aboutsummaryrefslogtreecommitdiff
path: root/advtrains/trainhud.lua
diff options
context:
space:
mode:
authorywang <yw05@forksworld.de>2020-12-27 15:24:52 +0100
committerywang <yw05@forksworld.de>2020-12-27 15:24:52 +0100
commit846e688200dd9367df29b5407a783ec39ecc5669 (patch)
treeda3cb608dcfa8b4f2ba658e21af7423bb831ea7e /advtrains/trainhud.lua
parentb74fc92f81f8b80625fc0678d04dc14a24b51ab2 (diff)
downloadadvtrains-846e688200dd9367df29b5407a783ec39ecc5669.tar.gz
advtrains-846e688200dd9367df29b5407a783ec39ecc5669.tar.bz2
advtrains-846e688200dd9367df29b5407a783ec39ecc5669.zip
Add demo
Diffstat (limited to 'advtrains/trainhud.lua')
-rw-r--r--advtrains/trainhud.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/advtrains/trainhud.lua b/advtrains/trainhud.lua
index e2086d1..dc795e4 100644
--- a/advtrains/trainhud.lua
+++ b/advtrains/trainhud.lua
@@ -283,3 +283,24 @@ function advtrains.hud_train_format(train, flip)
return table.concat(st,"\n"), table.concat(ht,":")
end
+
+local _, texture = advtrains.hud_train_format { -- dummy train object to demonstrate the train hud
+ max_speed = 15, speed_restriction = 12, velocity = 12, tarvelocity = 15,
+ active_control = true, lever = 3, ctrl = {lzb = true}, is_shunt = true,
+ door_open = 1, lzb = {oncoming = {{spd = 6}}}
+}
+
+minetest.register_node("advtrains:hud_demo",{
+ description = "Train HUD demonstration",
+ tiles = {texture},
+ groups = {cracky = 3, not_in_creative_inventory = 1}
+})
+
+minetest.register_craft {
+ output = "advtrains:hud_demo",
+ recipe = {
+ {"default:paper", "default:paper", "default:paper"},
+ {"default:paper", "advtrains:trackworker", "default:paper"},
+ {"default:paper", "default:paper", "default:paper"},
+ }
+} \ No newline at end of file