diff options
author | orwell96 <orwell@bleipb.de> | 2018-08-12 16:58:47 +0200 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2018-08-12 16:58:47 +0200 |
commit | a92ecbc26a14a193f103fe6a626eae000fe9b949 (patch) | |
tree | 7a88ed25c10d77eebf73d0f4d9f804b640070993 /advtrains_interlocking/tcb_ts_ui.lua | |
parent | 0ec89364c01eceb5c47f9cc3503d3561064b7fdb (diff) | |
download | advtrains-a92ecbc26a14a193f103fe6a626eae000fe9b949.tar.gz advtrains-a92ecbc26a14a193f103fe6a626eae000fe9b949.tar.bz2 advtrains-a92ecbc26a14a193f103fe6a626eae000fe9b949.zip |
Automatic working (re-set certain route on train pass)
Diffstat (limited to 'advtrains_interlocking/tcb_ts_ui.lua')
-rw-r--r-- | advtrains_interlocking/tcb_ts_ui.lua | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/advtrains_interlocking/tcb_ts_ui.lua b/advtrains_interlocking/tcb_ts_ui.lua index 0df3d3a..3b9a3ac 100644 --- a/advtrains_interlocking/tcb_ts_ui.lua +++ b/advtrains_interlocking/tcb_ts_ui.lua @@ -471,6 +471,12 @@ function advtrains.interlocking.show_signalling_form(sigd, pname, sel_rte) form = form.."label[0.5,4;"..tcbs.route_rsn.."]" end end + if not tcbs.route_auto then + form = form.."button[0.5,4.5; 5,1;auto;Enable Automatic Working]" + else + form = form.."label[0.5,4.5;Automatic Working is active.]" + form = form.."label[0.5,4.8;Route is re-set when a train passed.]" + end form = form.."button[0.5,6; 5,1;cancelroute;Cancel Route]" else @@ -526,7 +532,6 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) end if tcbs.routeset and fields.cancelroute then -- if route committed, cancel route ts info - ilrs.update_route(sigd, tcbs, nil, true) end if not tcbs.routeset then @@ -573,6 +578,10 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) end end + if fields.auto then + tcbs.route_auto = true + end + advtrains.interlocking.show_signalling_form(sigd, pname, sel_rte) return end |