add electric signal and rotate signals for better placement

master
orwell96 2016-09-13 16:11:14 +02:00
parent 1e93892d8a
commit 173829fe59
12 changed files with 29 additions and 0 deletions

Binary file not shown.

Binary file not shown.

BIN
models/advtrains_signal.b3d Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 KiB

Binary file not shown.

View File

@ -15,6 +15,7 @@ for r,f in pairs({on="off", off="on"}) do
tiles = {"advtrains_retrosignal.png"},
description="Lampless Signal ("..r..")",
on_rightclick=switchfunc,
sunlight_propagates=true,
groups = {
choppy=3,
not_blocking_trains=1
@ -28,4 +29,32 @@ for r,f in pairs({on="off", off="on"}) do
minetest.swap_node(pos, {name = "advtrains:retrosignal_"..f, param2 = node.param2})
end,
})
minetest.register_node("advtrains:signal_"..r, {
drawtype = "mesh",
paramtype="light",
paramtype2="facedir",
walkable = false,
selection_box = {
type = "fixed",
fixed = {-1/4, -1/2, -1/4, 1/4, 2, 1/4},
},
mesh = "advtrains_signal.b3d",
tiles = {"advtrains_signal_"..r..".png"},
description="Signal ("..r..")",
on_rightclick=switchfunc,
groups = {
choppy=3,
not_blocking_trains=1
},
light_source = 1,
sunlight_propagates=true,
mesecons = {effector = {
["action_"..f] = function (pos, node)
minetest.swap_node(pos, {name = "advtrains:signal_"..f, param2 = node.param2})
end
}},
on_rightclick=function(pos, node, clicker)
minetest.swap_node(pos, {name = "advtrains:signal_"..f, param2 = node.param2})
end,
})
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB