aboutsummaryrefslogtreecommitdiff
path: root/advtrains_luaautomation/environment.lua
diff options
context:
space:
mode:
author1F616EMO <root@1f616emo.xyz>2026-06-12 00:07:50 +0800
committerorwell <orwell@bleipb.de>2026-07-08 21:33:40 +0200
commite5c5ae1af136fc73b7c7c9b653c314235122957d (patch)
tree3705ea717b899353029f097d29fea7b7d8939ef6 /advtrains_luaautomation/environment.lua
parent1b3b4eb8a76cb059ff1f6bbaa7858f4c12d6b48a (diff)
Add get_active_route and list_routes to LuaATC
get_active_route returns the name of the route currently set on the signal. Useful for rendering signalling control panels. list_routes returns an array of valid route names. Useful for implementing remote controls of signals.
Diffstat (limited to 'advtrains_luaautomation/environment.lua')
-rw-r--r--advtrains_luaautomation/environment.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/advtrains_luaautomation/environment.lua b/advtrains_luaautomation/environment.lua
index 4d4ac47..93614ef 100644
--- a/advtrains_luaautomation/environment.lua
+++ b/advtrains_luaautomation/environment.lua
@@ -230,6 +230,18 @@ if advtrains.interlocking then
local pos, sigd, tcbs, routeid, route = gen_checks(signal, "", true)
return advtrains.interlocking.route.update_route(sigd, tcbs, nil, true)
end
+ static_env.get_active_route = function( static int gc_object(lua_State *L); static int l_get_area(lua_State *L); static int l_get_areas_for_pos(lua_State *L); static int l_get_areas_in_area(lua_State *L); static int l_insert_area(lua_State *L); static int l_reserve(lua_State *L); static int