Initial commit (version 0.1-test)
1
mods/roads/trafficlight/depends.txt
Normal file
@@ -0,0 +1 @@
|
||||
streetsmod
|
||||
1811
mods/roads/trafficlight/init.lua
Normal file
58
mods/roads/trafficlight/old2new.lua
Normal file
@@ -0,0 +1,58 @@
|
||||
--[[
|
||||
StreetsMod: Convert old trafficlights
|
||||
]]
|
||||
minetest.register_node(":streets:trafficlight_bottom", {
|
||||
diggable = false,
|
||||
pointable = false,
|
||||
drawtype = "airlike",
|
||||
description = "I'm an old node, please drop me",
|
||||
groups = {not_in_creative_inventory = 1}
|
||||
})
|
||||
minetest.register_abm({
|
||||
nodenames = {"streets:trafficlight_bottom"},
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node)
|
||||
minetest.log("action", "Converting trafficlight at position " .. minetest.pos_to_string(pos))
|
||||
-- Replace controller with distributor
|
||||
pos.y = pos.y - 2
|
||||
minetest.set_node(pos, {name = "streets:digiline_distributor"})
|
||||
-- Change bottom pole
|
||||
pos.y = pos.y + 2
|
||||
minetest.set_node(pos, {name = "streets:bigpole", param2 = 2})
|
||||
-- Change middle pole
|
||||
pos.y = pos.y + 1
|
||||
minetest.set_node(pos, {name = "streets:bigpole", param2 = 2})
|
||||
-- Change the top
|
||||
pos.y = pos.y + 1
|
||||
local fd = minetest.get_node(pos).param2
|
||||
local ch = minetest.get_meta(pos):get_string("channel")
|
||||
minetest.set_node(pos, {name = "streets:bigpole", param2 = 2})
|
||||
-- Place new top
|
||||
if fd == 1 then
|
||||
minetest.set_node({x = pos.x - 1, y = pos.y, z = pos.z}, {name = "streets:trafficlight_top_warn", param2 = fd})
|
||||
local meta = minetest.get_meta({x = pos.x - 1, y = pos.y, z = pos.z})
|
||||
meta:set_string("channel", ch)
|
||||
meta:set_string("state", "warn")
|
||||
meta:set_string("formspec", "field[channel;Channel;${channel}]")
|
||||
elseif fd == 2 then
|
||||
minetest.set_node({x = pos.x, y = pos.y, z = pos.z + 1}, {name = "streets:trafficlight_top_warn", param2 = fd})
|
||||
local meta = minetest.get_meta({x = pos.x, y = pos.y, z = pos.z + 1})
|
||||
meta:set_string("channel", ch)
|
||||
meta:set_string("state", "warn")
|
||||
meta:set_string("formspec", "field[channel;Channel;${channel}]")
|
||||
elseif fd == 3 then
|
||||
minetest.set_node({x = pos.x + 1, y = pos.y, z = pos.z}, {name = "streets:trafficlight_top_warn", param2 = fd})
|
||||
local meta = minetest.get_meta({x = pos.x + 1, y = pos.y, z = pos.z})
|
||||
meta:set_string("channel", ch)
|
||||
meta:set_string("state", "warn")
|
||||
meta:set_string("formspec", "field[channel;Channel;${channel}]")
|
||||
elseif fd == 0 then
|
||||
minetest.set_node({x = pos.x, y = pos.y, z = pos.z - 1}, {name = "streets:trafficlight_top_warn", param2 = fd})
|
||||
local meta = minetest.get_meta({x = pos.x, y = pos.y, z = pos.z - 1})
|
||||
meta:set_string("channel", ch)
|
||||
meta:set_string("state", "warn")
|
||||
meta:set_string("formspec", "field[channel;Channel;${channel}]")
|
||||
end
|
||||
end
|
||||
})
|
||||
BIN
mods/roads/trafficlight/textures/streets_b_flashred.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
mods/roads/trafficlight/textures/streets_b_red.png
Normal file
|
After Width: | Height: | Size: 847 B |
BIN
mods/roads/trafficlight/textures/streets_beacon_inv.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
mods/roads/trafficlight/textures/streets_hb_flashred.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
mods/roads/trafficlight/textures/streets_hb_flashyellow.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
mods/roads/trafficlight/textures/streets_hb_off.png
Normal file
|
After Width: | Height: | Size: 941 B |
BIN
mods/roads/trafficlight/textures/streets_hb_red.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
mods/roads/trafficlight/textures/streets_hb_yellow.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
mods/roads/trafficlight/textures/streets_hybrid_beacon_inv.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
mods/roads/trafficlight/textures/streets_pedlight_inv.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
mods/roads/trafficlight/textures/streets_pl_dontwalk.png
Normal file
|
After Width: | Height: | Size: 631 B |
BIN
mods/roads/trafficlight/textures/streets_pl_flashingdontwalk.png
Normal file
|
After Width: | Height: | Size: 798 B |
BIN
mods/roads/trafficlight/textures/streets_pl_flashingwalk.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
mods/roads/trafficlight/textures/streets_pl_number_0l.png
Normal file
|
After Width: | Height: | Size: 572 B |
BIN
mods/roads/trafficlight/textures/streets_pl_number_0r.png
Normal file
|
After Width: | Height: | Size: 615 B |
BIN
mods/roads/trafficlight/textures/streets_pl_number_1l.png
Normal file
|
After Width: | Height: | Size: 601 B |
BIN
mods/roads/trafficlight/textures/streets_pl_number_1r.png
Normal file
|
After Width: | Height: | Size: 602 B |
BIN
mods/roads/trafficlight/textures/streets_pl_number_2l.png
Normal file
|
After Width: | Height: | Size: 610 B |
BIN
mods/roads/trafficlight/textures/streets_pl_number_2r.png
Normal file
|
After Width: | Height: | Size: 610 B |
BIN
mods/roads/trafficlight/textures/streets_pl_number_3l.png
Normal file
|
After Width: | Height: | Size: 606 B |
BIN
mods/roads/trafficlight/textures/streets_pl_number_3r.png
Normal file
|
After Width: | Height: | Size: 610 B |
BIN
mods/roads/trafficlight/textures/streets_pl_number_4l.png
Normal file
|
After Width: | Height: | Size: 614 B |
BIN
mods/roads/trafficlight/textures/streets_pl_number_4r.png
Normal file
|
After Width: | Height: | Size: 620 B |
BIN
mods/roads/trafficlight/textures/streets_pl_number_5l.png
Normal file
|
After Width: | Height: | Size: 603 B |
BIN
mods/roads/trafficlight/textures/streets_pl_number_5r.png
Normal file
|
After Width: | Height: | Size: 621 B |
BIN
mods/roads/trafficlight/textures/streets_pl_number_6l.png
Normal file
|
After Width: | Height: | Size: 608 B |
BIN
mods/roads/trafficlight/textures/streets_pl_number_6r.png
Normal file
|
After Width: | Height: | Size: 618 B |
BIN
mods/roads/trafficlight/textures/streets_pl_number_7l.png
Normal file
|
After Width: | Height: | Size: 607 B |
BIN
mods/roads/trafficlight/textures/streets_pl_number_7r.png
Normal file
|
After Width: | Height: | Size: 620 B |
BIN
mods/roads/trafficlight/textures/streets_pl_number_8l.png
Normal file
|
After Width: | Height: | Size: 608 B |
BIN
mods/roads/trafficlight/textures/streets_pl_number_8r.png
Normal file
|
After Width: | Height: | Size: 611 B |
BIN
mods/roads/trafficlight/textures/streets_pl_number_9l.png
Normal file
|
After Width: | Height: | Size: 605 B |
BIN
mods/roads/trafficlight/textures/streets_pl_number_9r.png
Normal file
|
After Width: | Height: | Size: 613 B |
BIN
mods/roads/trafficlight/textures/streets_pl_number_template.png
Normal file
|
After Width: | Height: | Size: 669 B |
BIN
mods/roads/trafficlight/textures/streets_pl_off.png
Normal file
|
After Width: | Height: | Size: 571 B |
BIN
mods/roads/trafficlight/textures/streets_pl_walk.png
Normal file
|
After Width: | Height: | Size: 630 B |
BIN
mods/roads/trafficlight/textures/streets_rrfb_inv.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
mods/roads/trafficlight/textures/streets_rrfb_off.png
Normal file
|
After Width: | Height: | Size: 627 B |
BIN
mods/roads/trafficlight/textures/streets_rrfb_on.png
Normal file
|
After Width: | Height: | Size: 762 B |
BIN
mods/roads/trafficlight/textures/streets_tl_bg.png
Normal file
|
After Width: | Height: | Size: 750 B |
BIN
mods/roads/trafficlight/textures/streets_tl_flashgreen.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
mods/roads/trafficlight/textures/streets_tl_flashred.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
mods/roads/trafficlight/textures/streets_tl_flashred_alt.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
mods/roads/trafficlight/textures/streets_tl_green.png
Normal file
|
After Width: | Height: | Size: 954 B |
BIN
mods/roads/trafficlight/textures/streets_tl_left_flashgreen.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
mods/roads/trafficlight/textures/streets_tl_left_flashred.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
BIN
mods/roads/trafficlight/textures/streets_tl_left_green.png
Normal file
|
After Width: | Height: | Size: 977 B |
BIN
mods/roads/trafficlight/textures/streets_tl_left_off.png
Normal file
|
After Width: | Height: | Size: 908 B |
BIN
mods/roads/trafficlight/textures/streets_tl_left_red.png
Normal file
|
After Width: | Height: | Size: 937 B |
BIN
mods/roads/trafficlight/textures/streets_tl_left_redyellow.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
mods/roads/trafficlight/textures/streets_tl_left_warn.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
mods/roads/trafficlight/textures/streets_tl_left_warn_alt.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
mods/roads/trafficlight/textures/streets_tl_left_yellow.png
Normal file
|
After Width: | Height: | Size: 985 B |
BIN
mods/roads/trafficlight/textures/streets_tl_off.png
Normal file
|
After Width: | Height: | Size: 843 B |
BIN
mods/roads/trafficlight/textures/streets_tl_red.png
Normal file
|
After Width: | Height: | Size: 942 B |
BIN
mods/roads/trafficlight/textures/streets_tl_redyellow.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
mods/roads/trafficlight/textures/streets_tl_right_flashgreen.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
mods/roads/trafficlight/textures/streets_tl_right_flashred.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
BIN
mods/roads/trafficlight/textures/streets_tl_right_green.png
Normal file
|
After Width: | Height: | Size: 963 B |
BIN
mods/roads/trafficlight/textures/streets_tl_right_off.png
Normal file
|
After Width: | Height: | Size: 906 B |
BIN
mods/roads/trafficlight/textures/streets_tl_right_red.png
Normal file
|
After Width: | Height: | Size: 949 B |
BIN
mods/roads/trafficlight/textures/streets_tl_right_redyellow.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
mods/roads/trafficlight/textures/streets_tl_right_warn.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
mods/roads/trafficlight/textures/streets_tl_right_warn_alt.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
mods/roads/trafficlight/textures/streets_tl_right_yellow.png
Normal file
|
After Width: | Height: | Size: 978 B |
BIN
mods/roads/trafficlight/textures/streets_tl_straight_green.png
Normal file
|
After Width: | Height: | Size: 938 B |
BIN
mods/roads/trafficlight/textures/streets_tl_warn.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
mods/roads/trafficlight/textures/streets_tl_warn_alt.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
mods/roads/trafficlight/textures/streets_tl_yellow.png
Normal file
|
After Width: | Height: | Size: 1003 B |
BIN
mods/roads/trafficlight/textures/streets_tle_left_flashgreen.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
mods/roads/trafficlight/textures/streets_tle_left_green.png
Normal file
|
After Width: | Height: | Size: 950 B |
BIN
mods/roads/trafficlight/textures/streets_tle_left_yellow.png
Normal file
|
After Width: | Height: | Size: 953 B |
|
After Width: | Height: | Size: 2.9 KiB |
BIN
mods/roads/trafficlight/textures/streets_tle_right_green.png
Normal file
|
After Width: | Height: | Size: 930 B |
BIN
mods/roads/trafficlight/textures/streets_tle_right_yellow.png
Normal file
|
After Width: | Height: | Size: 980 B |
BIN
mods/roads/trafficlight/textures/streets_trafficlight_inv.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 320 B |