diff options
Diffstat (limited to 'advtrains_signals_muc_ubahn/init.lua')
-rw-r--r--[-rwxr-xr-x] | advtrains_signals_muc_ubahn/init.lua | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/advtrains_signals_muc_ubahn/init.lua b/advtrains_signals_muc_ubahn/init.lua index 182a3dc..49642ef 100755..100644 --- a/advtrains_signals_muc_ubahn/init.lua +++ b/advtrains_signals_muc_ubahn/init.lua @@ -6,6 +6,9 @@ -- Hp4 and Hp5 are not implemented because they do not make sense. -- Also the speed signals are not yet added (they will be added later) +-- ask engine for translator instance, this will load the translation files +local S = core.get_translator("advtrains_signals_muc_ubahn") + local all_sigs = { hp0 = { asp = { main = 0 }, crea = true }, -- halt hp1 = { asp = { main = -1, proceed_as_main = true } }, -- free full speed @@ -16,9 +19,9 @@ local all_sigs = { } local mainaspects = { - { name = "hp1", description = "Hp1: Full speed" }, - { name = "hp2", description = "Hp2: Reduced Speed" }, - { name = "hp3", description = "Hp3: Shunt" }, + { name = "hp1", description = S("Hp1: Full speed") }, + { name = "hp2", description = S("Hp2: Reduced Speed") }, + { name = "hp3", description = S("Hp3: Shunt") }, } local dstaspects = { { name = "vr1", description = "Vr1: Expect Full speed" }, @@ -62,7 +65,7 @@ for r,f in pairs(all_sigs) do mesh = "advtrains_signals_muc_ubahn_wsig_"..loc..".obj", tiles = {"advtrains_signals_muc_ubahn_"..r..".png"}, drop = f.distant and "advtrains_signals_muc_ubahn:signal_wall_"..loc.."_vr0" or "advtrains_signals_muc_ubahn:signal_wall_"..loc.."_hp0", - description = f.distant and attrans("Munich U-Bahn Distant Signal ("..loc..")") or attrans("Munich U-Bahn Main Signal ("..loc..")"), + description = f.distant and S("Munich U-Bahn Distant Signal ("..loc..")") or S("Munich U-Bahn Main Signal ("..loc..")"), groups = { cracky=3, not_blocking_trains=1, @@ -86,3 +89,31 @@ for r,f in pairs(all_sigs) do }) end end + +-- Crafting +minetest.register_craft({ -- Main Signal Left as entry recipe + output = "advtrains_signals_muc_ubahn:signal_wall_l_hp0", + type = "shapeless", + recipe = {"advtrains:signal_wall_l_off", "advtrains_interlocking:tcb_node"}, +}) +minetest.register_craft({ -- Distant Signal Left as entry recipe + output = "advtrains_signals_muc_ubahn:signal_wall_l_vr0", + recipe = { + {"dye:orange","",""}, + {"dye:orange","advtrains_signals_muc_ubahn:signal_wall_l_hp0","dye:dark_green"}, + {"","","dye:dark_green"} + } +}) + +for this,nxt in pairs({l = "t", t = "r",r = "l"}) do --Circular crafting for wall-mount signals + minetest.register_craft({ -- Main Signal + output = "advtrains_signals_muc_ubahn:signal_wall_"..nxt.."_hp0", + type = "shapeless", + recipe = {"advtrains_signals_muc_ubahn:signal_wall_"..this.."_hp0"}, + }) + minetest.register_craft({ -- Distant Signal + output = "advtrains_signals_muc_ubahn:signal_wall_"..nxt.."_vr0", + type = "shapeless", + recipe = {"advtrains_signals_muc_ubahn:signal_wall_"..this.."_vr0"}, + }) +end |