aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororwell <orwell@bleipb.de>2025-07-05 16:42:54 +0200
committerorwell <orwell@bleipb.de>2025-07-05 16:42:54 +0200
commit97e5554e34cfaa80716969eebee6577e4c4da000 (patch)
treee636785786d0aefc2e2a3ed751522cb48b7d85a1
parent041847319d4adb868f4329197f541d50aa02f89d (diff)
downloadadvtrains-97e5554e34cfaa80716969eebee6577e4c4da000.tar.gz
advtrains-97e5554e34cfaa80716969eebee6577e4c4da000.tar.bz2
advtrains-97e5554e34cfaa80716969eebee6577e4c4da000.zip
Implement the No Disable ARS flag on the stoprailtimetable
-rw-r--r--advtrains_line_automation/line_functions.lua4
-rw-r--r--advtrains_line_automation/stoprail.lua7
2 files changed, 8 insertions, 3 deletions
diff --git a/advtrains_line_automation/line_functions.lua b/advtrains_line_automation/line_functions.lua
index de5d133..3a369f7 100644
--- a/advtrains_line_automation/line_functions.lua
+++ b/advtrains_line_automation/line_functions.lua
@@ -623,7 +623,9 @@ function al.on_train_approach(pos, train_id, train, index, has_entered)
local stnname = stn and stn.name or S("Unknown Station")
train.text_inside = S("Next Stop:") .. "\n"..stnname
end
- advtrains.interlocking.ars_set_disable(train, true)
+ if not stdata.arskeepen then
+ advtrains.interlocking.ars_set_disable(train, true)
+ end
end
end
diff --git a/advtrains_line_automation/stoprail.lua b/advtrains_line_automation/stoprail.lua
index 21df5f5..e8de1dc 100644
--- a/advtrains_line_automation/stoprail.lua
+++ b/advtrains_line_automation/stoprail.lua
@@ -108,8 +108,8 @@ local function show_stoprailform(pos, player)
"checkbox[7,5.9;reverse;"..S("Reverse train")..";"..(stdata.reverse and "true" or "false").."]"..
"tooltip[reverse;"..S("Train will depart in the direction from where it arrived").."]"..
"checkbox[7,6.6;kick;"..S("Kick out passengers")..";"..(stdata.kick and "true" or "false").."]"..
- "checkbox[7,7.3;arsdis;"..S("Keep ARS enabled").."<NI>;false]"..
- "tooltip[arsdis;"..S("Do not disable ARS on approaching. Signals behind the stop rail already set ARS routes when the train arrives, not just before departure. (currently not implemented)").."]"..
+ "checkbox[7,7.3;arskeepen;"..S("Keep ARS enabled")..";"..(stdata.arskeepen and "true" or "false").."]"..
+ "tooltip[arskeepen;"..S("Do not disable ARS on approaching. Signals behind the stop rail already set ARS routes when the train arrives, not just before departure. (currently not implemented)").."]"..
--"textarea[0.5,7;6,1;arr_action;"..S("Arrival Actions")..";<not yet implemented>]"..
--"tooltip[arr_action;"..S("List of actions to perform on arrival (currently not implemented, later will allow actions such as setting line, RC and displays)").."]"..
-- departure
@@ -161,6 +161,9 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
if fields.keepopen then
tmp_checkboxes[pe].keepopen = (fields.keepopen == "true")
end
+ if fields.arskeepen then
+ tmp_checkboxes[pe].arskeepen = (fields.arskeepen == "true")
+ end
if fields.stn then
local new_index = tonumber(fields.stn)