aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking/tcb_ts_ui.lua
diff options
context:
space:
mode:
authororwell <orwell@bleipb.de>2024-12-01 23:51:41 +0100
committerorwell <orwell@bleipb.de>2024-12-01 23:51:41 +0100
commitc081129fe040d2dd62d36777ec5eeae315fd0928 (patch)
tree5f2ea14aec4ab5d3829027ac2b824349eed9b14f /advtrains_interlocking/tcb_ts_ui.lua
parent2bfc24ef27ea4098a93cc025b513afe1b8c4ee1f (diff)
downloadadvtrains-c081129fe040d2dd62d36777ec5eeae315fd0928.tar.gz
advtrains-c081129fe040d2dd62d36777ec5eeae315fd0928.tar.bz2
advtrains-c081129fe040d2dd62d36777ec5eeae315fd0928.zip
Misc Fixes found during play
Diffstat (limited to 'advtrains_interlocking/tcb_ts_ui.lua')
-rwxr-xr-xadvtrains_interlocking/tcb_ts_ui.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/advtrains_interlocking/tcb_ts_ui.lua b/advtrains_interlocking/tcb_ts_ui.lua
index 54ffe9b..87e56ca 100755
--- a/advtrains_interlocking/tcb_ts_ui.lua
+++ b/advtrains_interlocking/tcb_ts_ui.lua
@@ -768,6 +768,7 @@ function advtrains.interlocking.show_signalling_form(sigd, pname, sel_rte, calle
form = form.."button[0.5,6; 5,1;setroute;Set Route]"
form = form.."button[0.5,7;2,1;dsproute;Show]"
if hasprivs then
+ form = form.."button[2.5,7;1,1;setarsdefault;Set Def.]"
form = form.."button[3.5,7;2,1;editroute;Edit]"
if sel_rte > 1 then
form = form .. "button[5.5,4;0.5,0.3;moveup;↑]"
@@ -984,6 +985,16 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
advtrains.interlocking.show_route_edit_form(pname, sigd, sel_rte)
return
end
+ if fields.setarsdefault and hasprivs then
+ for rid, route in ipairs(tcbs.routes) do
+ local isdefault = rid == sel_rte
+ if route.ars then
+ route.ars.default = isdefault
+ elseif isdefault then
+ route.ars = {default = true}
+ end
+ end
+ end
end
end