aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgpcf <gabriel@gpcf.eu>2023-05-14 19:48:30 +0200
committergpcf <gabriel@gpcf.eu>2023-05-14 19:48:30 +0200
commit9057c206104ddddcfb2239187c04db41d90387c8 (patch)
tree7d840701952009e6c6da490db9a9da493a2007f4
parentbbe3856e3547aea133001f746cb72d439e5ed01d (diff)
downloadadvtrains-9057c206104ddddcfb2239187c04db41d90387c8.tar.gz
advtrains-9057c206104ddddcfb2239187c04db41d90387c8.tar.bz2
advtrains-9057c206104ddddcfb2239187c04db41d90387c8.zip
Add low-level interface for departure boards
-rw-r--r--advtrains_luaautomation/environment.lua6
-rw-r--r--advtrains_luaautomation/mod.conf2
2 files changed, 7 insertions, 1 deletions
diff --git a/advtrains_luaautomation/environment.lua b/advtrains_luaautomation/environment.lua
index d85bedc..3499903 100644
--- a/advtrains_luaautomation/environment.lua
+++ b/advtrains_luaautomation/environment.lua
@@ -259,6 +259,12 @@ if advtrains.lines then
}
end
+if departureboards then
+ static_env.departureboard_set = function(pos, tb)
+ departureboards.contents[minetest.hash_node_position(pos)] = tb
+ end
+end
+
for _, name in pairs(safe_globals) do
static_env[name] = _G[name]
end
diff --git a/advtrains_luaautomation/mod.conf b/advtrains_luaautomation/mod.conf
index a737603..f135d8f 100644
--- a/advtrains_luaautomation/mod.conf
+++ b/advtrains_luaautomation/mod.conf
@@ -4,4 +4,4 @@ description=Lua control interface to Advanced Trains
author=orwell96
depends=advtrains
-optional_depends=advtrains_interlocking,advtrains_line_automation,mesecons_switch
+optional_depends=advtrains_interlocking,advtrains_line_automation,mesecons_switch,departureboards