From 846e688200dd9367df29b5407a783ec39ecc5669 Mon Sep 17 00:00:00 2001 From: ywang Date: Sun, 27 Dec 2020 15:24:52 +0100 Subject: Add demo --- advtrains/trainhud.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'advtrains') 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 -- cgit v1.2.3