Expand sequencer wrench menu
This commit is contained in:
parent
8fcd4ef70b
commit
228b2d39cc
@ -45,9 +45,18 @@ local WRENCH_MENU = {
|
|||||||
name = "cycletime",
|
name = "cycletime",
|
||||||
label = S("Cycle time"),
|
label = S("Cycle time"),
|
||||||
tooltip = S("Timer cycle time (default: 100 ms)"),
|
tooltip = S("Timer cycle time (default: 100 ms)"),
|
||||||
default = "1",
|
default = "100ms",
|
||||||
values = {0.1, 0.2, 0.5, 1.0, 2.0}
|
values = {0.1, 0.2, 0.5, 1.0, 2.0}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type = "dropdown",
|
||||||
|
choices = "no,yes",
|
||||||
|
name = "ignore_off",
|
||||||
|
label = S("Ignore OFF command"),
|
||||||
|
tooltip = S("If 'yes' a received OFF command won't stop the sequencer"),
|
||||||
|
default = "no",
|
||||||
|
values = {0, 1}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
local function cycle_time(pos)
|
local function cycle_time(pos)
|
||||||
@ -171,6 +180,7 @@ local function formspec(nvm, meta)
|
|||||||
|
|
||||||
return "size[10,8]" ..
|
return "size[10,8]" ..
|
||||||
style ..
|
style ..
|
||||||
|
techage.wrench_image(9.3, -0.25) ..
|
||||||
"tabheader[0,0;tab;edit,help;1;;true]" ..
|
"tabheader[0,0;tab;edit,help;1;;true]" ..
|
||||||
"label[0.1,-0.2;" .. S("Commands") .. ":]" ..
|
"label[0.1,-0.2;" .. S("Commands") .. ":]" ..
|
||||||
textarea ..
|
textarea ..
|
||||||
@ -207,6 +217,7 @@ local function node_timer(pos, elapsed)
|
|||||||
mem.idx = mem.idx or mem.code.start_idx
|
mem.idx = mem.idx or mem.code.start_idx
|
||||||
local code = mem.code.tCode[mem.idx]
|
local code = mem.code.tCode[mem.idx]
|
||||||
if code and code.cmnd then
|
if code and code.cmnd then
|
||||||
|
print("Sequencer", code.cmnd)
|
||||||
local src = M(pos):get_string("node_number")
|
local src = M(pos):get_string("node_number")
|
||||||
techage.counting_start(M(pos):get_string("owner"))
|
techage.counting_start(M(pos):get_string("owner"))
|
||||||
techage.send_single(src, code.number, code.cmnd, code.payload)
|
techage.send_single(src, code.number, code.cmnd, code.payload)
|
||||||
@ -325,7 +336,7 @@ techage.register_node({"techage:ta4_sequencer"}, {
|
|||||||
mem.idx = tonumber(payload or 1) or 1
|
mem.idx = tonumber(payload or 1) or 1
|
||||||
restart_timer(pos, 1)
|
restart_timer(pos, 1)
|
||||||
logic.infotext(M(pos), S("TA4 Sequencer"), S("running"))
|
logic.infotext(M(pos), S("TA4 Sequencer"), S("running"))
|
||||||
elseif topic == "stop" or topic == "off" then
|
elseif topic == "stop" or (topic == "off" and M(pos):get_int("ignore_off") == 0) then
|
||||||
nvm.running = false
|
nvm.running = false
|
||||||
minetest.get_node_timer(pos):stop()
|
minetest.get_node_timer(pos):stop()
|
||||||
logic.infotext(M(pos), S("TA4 Sequencer"), S("stopped"))
|
logic.infotext(M(pos), S("TA4 Sequencer"), S("stopped"))
|
||||||
|
Loading…
Reference in New Issue
Block a user