diff options
Diffstat (limited to 'advtrains_signals_ks/init.lua')
-rw-r--r-- | advtrains_signals_ks/init.lua | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/advtrains_signals_ks/init.lua b/advtrains_signals_ks/init.lua index ac26399..34fb6d3 100644 --- a/advtrains_signals_ks/init.lua +++ b/advtrains_signals_ks/init.lua @@ -82,6 +82,7 @@ local suppasp_ra = { advtrains.trackplacer.register_tracktype("advtrains_signals_ks:hs") advtrains.trackplacer.register_tracktype("advtrains_signals_ks:ra") +advtrains.trackplacer.register_tracktype("advtrains_signals_ks:sign") advtrains.trackplacer.register_tracktype("advtrains_signals_ks:mast") for _, rtab in ipairs({ @@ -181,6 +182,55 @@ for _, rtab in ipairs({ advtrains.trackplacer.add_worked("advtrains_signals_ks:ra", typ, "_"..rot, prts.n) end + --Schilder: + for typ, prts in pairs({ + -- Speed restrictions: + ["8"] = {asp = { main = {free = true, speed = 8}, shunt = {free = true} }, n = "12", ici=true}, + ["12"] = {asp = { main = {free = true, speed = 12}, shunt = {free = true} }, n = "16"}, + ["16"] = {asp = { main = {free = true, speed = 16}, shunt = {free = true} }, n = "e"}, + -- Speed restriction lifted + ["e"] = {asp = { main = {free = true, speed = -1}, shunt = {free = true} }, n = "hfs"}, + -- Halt for shunt moves: + ["hfs"] = {asp = { main = {free = true}, shunt = {free = false} }, n = "8"}, + }) do + minetest.register_node("advtrains_signals_ks:sign_"..typ.."_"..rot, { + description = "Signal Sign", + drawtype = "mesh", + mesh = "advtrains_signals_ks_sign_smr"..rot..".obj", + tiles = {"advtrains_signals_ks_signpost.png", "advtrains_signals_ks_sign_"..typ..".png"}, + + paramtype="light", + sunlight_propagates=true, + light_source = 4, + + paramtype2 = "facedir", + selection_box = { + type = "fixed", + fixed = {rtab.sbox, {-1/4, -1/2, -1/4, 1/4, -7/16, 1/4}} + }, + groups = { + cracky = 2, + advtrains_signal = 2, + not_blocking_trains = 1, + save_in_at_nodedb = 1, + not_in_creative_inventory = (rtab.ici and prts.ici) and 0 or 1, + }, + drop = "advtrains_signals_ks:sign_e_0", + inventory_image = "advtrains_signals_ks_sign_8.png", + sounds = default.node_sound_stone_defaults(), + advtrains = { + -- This is a static signal! No set_aspect + get_aspect = function(pos, node) + return prts.asp + end, + }, + on_rightclick = advtrains.interlocking.signal_rc_handler, + can_dig = advtrains.interlocking.signal_can_dig, + }) + -- rotatable by trackworker + advtrains.trackplacer.add_worked("advtrains_signals_ks:sign", typ, "_"..rot, prts.n) + end + minetest.register_node("advtrains_signals_ks:mast_mast_"..rot, { description = "Ks Mast", drawtype = "mesh", |