diff options
author | orwell <orwell@bleipb.de> | 2024-04-08 21:52:32 +0200 |
---|---|---|
committer | orwell <orwell@bleipb.de> | 2024-04-08 21:52:32 +0200 |
commit | 852da6bcaeeb8c39ce73639ef64f10ebc5b127b0 (patch) | |
tree | ebd944b0b8a763b63f128e7a7bf81882a4e8c29f /advtrains_interlocking/tcb_ts_ui.lua | |
parent | 9fa43cb7bfc25ba71d16c8210f0074797a7bca1a (diff) | |
parent | 1f74697e85d456e97e201cdd9edef91a2df4fc14 (diff) | |
download | advtrains-852da6bcaeeb8c39ce73639ef64f10ebc5b127b0.tar.gz advtrains-852da6bcaeeb8c39ce73639ef64f10ebc5b127b0.tar.bz2 advtrains-852da6bcaeeb8c39ce73639ef64f10ebc5b127b0.zip |
Merge branch 'new-ks-orwell' into route_prog_rework
Diffstat (limited to 'advtrains_interlocking/tcb_ts_ui.lua')
-rwxr-xr-x | advtrains_interlocking/tcb_ts_ui.lua | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/advtrains_interlocking/tcb_ts_ui.lua b/advtrains_interlocking/tcb_ts_ui.lua index 9e7fcd4..bfec648 100755 --- a/advtrains_interlocking/tcb_ts_ui.lua +++ b/advtrains_interlocking/tcb_ts_ui.lua @@ -15,6 +15,7 @@ local lntrans = { "A", "B" } local function sigd_to_string(sigd) return minetest.pos_to_string(sigd.p).." / "..lntrans[sigd.s] end +advtrains.interlocking.sigd_to_string = sigd_to_string minetest.register_node("advtrains_interlocking:tcb_node", { drawtype = "mesh", @@ -580,7 +581,7 @@ function advtrains.interlocking.show_signalling_form(sigd, pname, sel_rte, calle if not tcbs.signal then return end if not tcbs.routes then tcbs.routes = {} end - local form = "size[7,10]label[0.5,0.5;Signal at "..minetest.pos_to_string(sigd.p).."]" + local form = "size[7,10.25]label[0.5,0.5;Signal at "..minetest.pos_to_string(sigd.p).."]" form = form.."field[0.8,1.5;5.2,1;name;Signal name;"..minetest.formspec_escape(tcbs.signal_name or "").."]" form = form.."button[5.5,1.2;1,1;setname;Set]" @@ -640,12 +641,8 @@ function advtrains.interlocking.show_signalling_form(sigd, pname, sel_rte, calle if hasprivs then form = form.."button[0.5,8;2.5,1;newroute;New Route]" form = form.."button[ 3,8;2.5,1;unassign;Unassign Signal]" - form = form.."button[ 3,9;2.5,1;influp;Influence Point]" - end - if tcbs.ars_disabled then - form = form.."button[0.5,9;2.5,1;arsenable;Enable ARS]" - else - form = form.."button[0.5,9;2.5,1;arsdisable;Disable ARS]" + form = form..string.format("checkbox[0.5,8.75;ars;Automatic routesetting;%s]", not tcbs.ars_disabled) + form = form..string.format("checkbox[0.5,9.25;dst;Distant signalling;%s]", not tcbs.nodst) end elseif sigd_equal(tcbs.route_origin, sigd) then -- something has gone wrong: tcbs.routeset should have been set... @@ -768,16 +765,13 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) minetest.chat_send_player(pname, "Please cancel route first!") end end - if fields.influp and hasprivs then - advtrains.interlocking.show_ip_form(tcbs.signal, pname) - return - end - if tcbs.ars_disabled and fields.arsenable then - tcbs.ars_disabled = nil + if fields.ars then + tcbs.ars_disabled = not minetest.is_yes(fields.ars) end - if not tcbs.ars_disabled and fields.arsdisable then - tcbs.ars_disabled = true + + if fields.dst then + tcbs.nodst = not minetest.is_yes(fields.dst) end if fields.auto then |