aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking/tcb_ts_ui.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-11-19 23:53:42 +0100
committerorwell96 <orwell@bleipb.de>2018-11-19 23:53:42 +0100
commite2a844f5bfb1b8e88951ddb66ed9d0ae0d40256b (patch)
tree8ca21bca1cdb4a8603f7cf967532580ed4b17e73 /advtrains_interlocking/tcb_ts_ui.lua
parent5874a6d3f4e8668ac790d7882b5fe85fd20125a0 (diff)
downloadadvtrains-e2a844f5bfb1b8e88951ddb66ed9d0ae0d40256b.tar.gz
advtrains-e2a844f5bfb1b8e88951ddb66ed9d0ae0d40256b.tar.bz2
advtrains-e2a844f5bfb1b8e88951ddb66ed9d0ae0d40256b.zip
Permit basic signal aspect setting
(basically only usable with Ks signals, because they're the only signals supporting slow move and/or shunt move
Diffstat (limited to 'advtrains_interlocking/tcb_ts_ui.lua')
-rw-r--r--advtrains_interlocking/tcb_ts_ui.lua15
1 files changed, 14 insertions, 1 deletions
diff --git a/advtrains_interlocking/tcb_ts_ui.lua b/advtrains_interlocking/tcb_ts_ui.lua
index 203e0b1..c149a44 100644
--- a/advtrains_interlocking/tcb_ts_ui.lua
+++ b/advtrains_interlocking/tcb_ts_ui.lua
@@ -577,7 +577,8 @@ function advtrains.interlocking.show_signalling_form(sigd, pname, sel_rte)
form = form.."button[0.5,7;2,1;dsproute;Show]"
if hasprivs then
form = form.."button[2.5,7;1,1;delroute;Delete]"
- form = form.."button[3.5,7;2,1;editroute;Edit]"
+ form = form.."button[3.5,7;1,1;editroute;Rename]"
+ form = form.."button[4.5,7;1,1;asproute;Aspect]"
end
end
if hasprivs then
@@ -660,6 +661,18 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
minetest.show_formspec(pname, formname.."_renroute_"..sel_rte, "field[name;Enter new route name;"..rte.name.."]")
return
end
+ if fields.asproute and hasprivs then
+ local rte = tcbs.routes[sel_rte]
+ local suppasp = advtrains.interlocking.signal_get_supported_aspects(tcbs.signal)
+
+ local callback = function(pname, asp)
+ rte.aspect = asp
+ advtrains.interlocking.show_signalling_form(sigd, pname, sel_rte)
+ end
+
+ advtrains.interlocking.show_signal_aspect_selector(pname, suppasp, rte.name, callback, rte.aspect)
+ return
+ end
if fields.delroute and hasprivs then
table.remove(tcbs.routes, sel_rte)
sel_rte = nil