From c081129fe040d2dd62d36777ec5eeae315fd0928 Mon Sep 17 00:00:00 2001 From: orwell Date: Sun, 1 Dec 2024 23:51:41 +0100 Subject: Misc Fixes found during play --- advtrains_interlocking/tcb_ts_ui.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'advtrains_interlocking/tcb_ts_ui.lua') 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 -- cgit v1.2.3