aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking/route_ui.lua
diff options
context:
space:
mode:
authororwell <orwell@bleipb.de>2024-12-10 23:07:06 +0100
committerorwell <orwell@bleipb.de>2024-12-10 23:07:06 +0100
commit67ace4bde0edd0d40c63168758ac4b4878135946 (patch)
tree1b1d266024532334fe9db483b923e511c652d10a /advtrains_interlocking/route_ui.lua
parent361970cdaf734828397cf22fa1db6ffc885eba10 (diff)
downloadadvtrains-67ace4bde0edd0d40c63168758ac4b4878135946.tar.gz
advtrains-67ace4bde0edd0d40c63168758ac4b4878135946.tar.bz2
advtrains-67ace4bde0edd0d40c63168758ac4b4878135946.zip
Smartroute: Never replace already existing intact routes, change colorcoding, other fixes
Diffstat (limited to 'advtrains_interlocking/route_ui.lua')
-rw-r--r--advtrains_interlocking/route_ui.lua25
1 files changed, 12 insertions, 13 deletions
diff --git a/advtrains_interlocking/route_ui.lua b/advtrains_interlocking/route_ui.lua
index fa707d9..b75f9d7 100644
--- a/advtrains_interlocking/route_ui.lua
+++ b/advtrains_interlocking/route_ui.lua
@@ -43,7 +43,7 @@ function atil.show_route_edit_form(pname, sigd, routeid, sel_rpartidx)
-- we start at the tc designated by signal
local c_sigd = sigd
local i = 1
- local c_tcbs, c_ts_id, c_ts, c_rseg, c_lckp
+ local c_tcbs, c_ts_id, c_ts, c_rseg
while c_sigd and i<=#route do
c_tcbs = ildb.get_tcbs(c_sigd)
if not c_tcbs then
@@ -58,7 +58,6 @@ function atil.show_route_edit_form(pname, sigd, routeid, sel_rpartidx)
c_ts = ildb.get_ts(c_ts_id)
c_rseg = route[i]
- c_lckp = {}
local signame = "-"
if c_tcbs and c_tcbs.signal then signame = c_tcbs.signal_name or "o" end
@@ -145,9 +144,9 @@ function atil.show_route_edit_form(pname, sigd, routeid, sel_rpartidx)
form = form.."button[2.5,6;1,1;next;>>>]"
- if route.smartroute_generated or route.default_autoworking then
- form = form.."button[3.5,6;2,1;noautogen;Clr Autogen]"
- end
+ --if route.smartroute_generated or route.default_autoworking then
+ -- form = form.."button[3.5,6;2,1;noautogen;Clr Autogen]"
+ --end
form = form.."button[5.5,6;3,1;delete;Delete Route]"
form = form.."button[0.5,7;3,1;back;Back to signal]"
form = form.."button[3.5,7;2,1;clone;Clone Route]"
@@ -235,13 +234,13 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end
end
- if fields.noautogen then
- route.smartroute_generated = nil
- route.default_autoworking = nil
- -- reshow form for the button to disappear
- atil.show_route_edit_form(pname, sigd, routeid, sel_rpart and sel_rpart.idx)
- return
- end
+ --if fields.noautogen then
+ -- route.smartroute_generated = nil
+ -- route.default_autoworking = nil
+ -- -- reshow form for the button to disappear
+ -- atil.show_route_edit_form(pname, sigd, routeid, sel_rpart and sel_rpart.idx)
+ -- return
+ --end
if fields.delete then
-- if something set the route in the meantime, make sure this doesn't break.
@@ -298,7 +297,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end
end
- if field.quit then
+ if fields.quit then
-- cleanup
sel_rpartcache[pname] = nil
end