aboutsummaryrefslogtreecommitdiff
path: root/advtrains_signals_ks
diff options
context:
space:
mode:
authororwell <orwell@bleipb.de>2024-05-23 20:25:35 +0200
committerorwell <orwell@bleipb.de>2024-05-23 20:25:35 +0200
commit9af6e32e644cfa53641e83d7550c0af2d31553fd (patch)
treeed7bab8989e35db5bed619e916d8e0ff5bd2b639 /advtrains_signals_ks
parent6fd845baec0f5aa8b7cdee1adf8d05061a643242 (diff)
downloadadvtrains-9af6e32e644cfa53641e83d7550c0af2d31553fd.tar.gz
advtrains-9af6e32e644cfa53641e83d7550c0af2d31553fd.tar.bz2
advtrains-9af6e32e644cfa53641e83d7550c0af2d31553fd.zip
Add proper UI aspect selection for static dialog
Diffstat (limited to 'advtrains_signals_ks')
-rwxr-xr-xadvtrains_signals_ks/init.lua12
1 files changed, 3 insertions, 9 deletions
diff --git a/advtrains_signals_ks/init.lua b/advtrains_signals_ks/init.lua
index abfb194..9cb0262 100755
--- a/advtrains_signals_ks/init.lua
+++ b/advtrains_signals_ks/init.lua
@@ -50,7 +50,7 @@ end
local applyaspectf_main = function(rot)
return function(pos, node, main_aspect, dst_aspect, dst_aspect_info)
- if not main_aspect then
+ if main_aspect.halt then
-- halt aspect, set red and don't do anything further
advtrains.ndb.swap_node(pos, {name="advtrains_signals_ks:hs_danger_"..rot, param2 = node.param2})
setzs3v(pos, nil, rot)
@@ -119,20 +119,14 @@ local mainaspects_main = {
description = "Proceed (speed 4)",
zs3 = "4",
},
- {
- name = "halt",
- description = "Halt",
- zs3 = "off",
- halt = true,
- },
}
--Rangiersignal
local applyaspectf_ra = function(rot)
-- we get here the full main_aspect table
return function(pos, node, main_aspect, dst_aspect, dst_aspect_info)
- if main_aspect then
- -- any main aspect is fine, there's only one anyway
+ if not main_aspect.halt then
+ -- any non-halt main aspect is fine, there's only one anyway
advtrains.ndb.swap_node(pos, {name="advtrains_signals_ks:ra_shuntd_"..rot, param2 = node.param2})
else
advtrains.ndb.swap_node(pos, {name="advtrains_signals_ks:ra_danger_"..rot, param2 = node.param2})