aboutsummaryrefslogtreecommitdiff
path: root/advtrains/advtrains_luaautomation
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains/advtrains_luaautomation')
-rw-r--r--advtrains/advtrains_luaautomation/README.txt4
-rw-r--r--advtrains/advtrains_luaautomation/atc_rail.lua10
2 files changed, 14 insertions, 0 deletions
diff --git a/advtrains/advtrains_luaautomation/README.txt b/advtrains/advtrains_luaautomation/README.txt
index 1d29786..907b2fb 100644
--- a/advtrains/advtrains_luaautomation/README.txt
+++ b/advtrains/advtrains_luaautomation/README.txt
@@ -122,6 +122,10 @@ atc_id
Train ID of the train currently passing the controller. Nil if there's no train.
atc_speed
Speed of the train, or nil if there is no train.
+atc_set_text_outside(text)
+ Set text shown on the outside of the train. Pass nil to show no text.
+atc_set_text_inside(text)
+ Set text shown to train passengers. Pass nil to show no text.
# Operator panel
This simple node executes its actions when punched. It can be used to change a switch and update the corresponding signals or similar applications.
diff --git a/advtrains/advtrains_luaautomation/atc_rail.lua b/advtrains/advtrains_luaautomation/atc_rail.lua
index 78ef8f0..141f119 100644
--- a/advtrains/advtrains_luaautomation/atc_rail.lua
+++ b/advtrains/advtrains_luaautomation/atc_rail.lua
@@ -61,6 +61,16 @@ function r.fire_event(pos, evtdata)
atc_arrow = atc_arrow,
atc_id = train_id,
atc_speed = tvel,
+ atc_set_text_outside = function(text)
+ if not train_id then return false end
+ advtrains.trains[train_id].text_outside=text
+ return true
+ end,
+ atc_set_text_inside = function(text)
+ if not train_id then return false end
+ advtrains.trains[train_id].text_inside=text
+ return true
+ end,
}
atlatc.active.run_in_env(pos, evtdata, customfct)