summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asphalt/init.lua2
-rw-r--r--asphaltstairs/init.lua16
-rw-r--r--constructionarea/init.lua8
-rw-r--r--delineator/init.lua2
-rw-r--r--emergencyphone/init.lua4
-rw-r--r--labels/init.lua22
-rw-r--r--manholes/init.lua6
-rw-r--r--roadsigns/init.lua3
-rw-r--r--roadsigns/pole.lua70
-rw-r--r--roadsigns/signs.lua16
-rw-r--r--roadsigns/workshop.lua93
-rw-r--r--roadworks/init.lua24
-rw-r--r--steelsupport/init.lua2
-rw-r--r--streetlamps/init.lua10
-rw-r--r--streetsawards/depends.txt2
-rw-r--r--streetsawards/init.lua22
-rw-r--r--streetsconcrete/init.lua14
-rw-r--r--streetshotfix/depends.txt1
-rw-r--r--streetsmod/forms.lua4
-rw-r--r--streetsmod/forms/cmd_streets.smartfs1
-rw-r--r--streetsmod/init.lua69
m---------streetsmod/libs/smartfs0
-rw-r--r--streetsmod/locale/de.txt1
-rw-r--r--streetsmod/locale/template.txt.txt1
-rw-r--r--streetsmod/nodeboxes/trafficlight.nbe22
-rw-r--r--streetsmod/textures/streets_lampcontroller_top.pngbin583 -> 688 bytes
-rw-r--r--streetsmod/textures/streets_pole.pngbin2317 -> 496 bytes
-rw-r--r--streetsmod/textures/streets_tl_bg.pngbin3513 -> 750 bytes
-rw-r--r--streetsmod/textures/streets_tl_green.pngbin3290 -> 954 bytes
-rw-r--r--streetsmod/textures/streets_tl_off.pngbin3267 -> 884 bytes
-rw-r--r--streetsmod/textures/streets_tl_red.pngbin3295 -> 942 bytes
-rw-r--r--streetsmod/textures/streets_tl_redyellow.pngbin3318 -> 1025 bytes
-rw-r--r--streetsmod/textures/streets_tl_warn.pngbin3699 -> 3683 bytes
-rw-r--r--streetsmod/textures/streets_tl_yellow.pngbin3295 -> 1003 bytes
-rw-r--r--streetsmod/textures/streets_trafficlight_template.pngbin0 -> 320 bytes
-rw-r--r--streetspoles/depends.txt1
-rw-r--r--streetspoles/init.lua155
-rw-r--r--trafficlight/init.lua322
-rw-r--r--trafficlight/old2new.lua58
39 files changed, 600 insertions, 351 deletions
diff --git a/asphalt/init.lua b/asphalt/init.lua
index 76dc607..958cfd5 100644
--- a/asphalt/init.lua
+++ b/asphalt/init.lua
@@ -2,7 +2,7 @@
Streets Mod: All kinds of asphalt
]]
minetest.register_node(":streets:asphalt",{
- description = S(S("Asphalt")),
+ description = streets.S("Asphalt"),
tiles = {"streets_asphalt.png"},
groups = {cracky=3}
})
diff --git a/asphaltstairs/init.lua b/asphaltstairs/init.lua
index c035749..1ac3de8 100644
--- a/asphaltstairs/init.lua
+++ b/asphaltstairs/init.lua
@@ -10,7 +10,7 @@ if type(register_stair_slab_panel_micro) ~= "function" then return end
-- Asphalt solid line
-- Stair
minetest.register_node(":streets:asphalt_solid_line_stair",{
- description = S("Asphalt stair"),
+ description = streets.S("Asphalt stair"),
tiles = {"streets_asphalt.png^streets_asphalt_solid_line.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png^streets_asphalt_solid_line.png"},
groups = {cracky = 3},
paramtype = "light",
@@ -42,7 +42,7 @@ if type(register_stair_slab_panel_micro) ~= "function" then return end
})
-- Slab
minetest.register_node(":streets:asphalt_solid_line_slab",{
- description = S("Asphalt slab"),
+ description = streets.S("Asphalt slab"),
tiles = {"streets_asphalt.png^streets_asphalt_solid_line.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png^streets_asphalt_solid_line.png"},
groups = {cracky = 3},
paramtype = "light",
@@ -67,7 +67,7 @@ if type(register_stair_slab_panel_micro) ~= "function" then return end
-- Asphalt dashed line
-- Stair
minetest.register_node(":streets:asphalt_dashed_line_stair",{
- description = S("Asphalt stair"),
+ description = streets.S("Asphalt stair"),
tiles = {"streets_asphalt.png^streets_asphalt_dashed_line.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png^streets_asphalt_dashed_line.png"},
groups = {cracky = 3},
paramtype = "light",
@@ -99,7 +99,7 @@ if type(register_stair_slab_panel_micro) ~= "function" then return end
})
-- Slab
minetest.register_node(":streets:asphalt_dashed_line_slab",{
- description = S("Asphalt slab"),
+ description = streets.S("Asphalt slab"),
tiles = {"streets_asphalt.png^streets_asphalt_dashed_line.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png^streets_asphalt_dashed_line.png"},
groups = {cracky = 3},
paramtype = "light",
@@ -122,7 +122,7 @@ if type(register_stair_slab_panel_micro) ~= "function" then return end
})
-- Asphalt outer line
minetest.register_node(":streets:asphalt_side_stair_l",{
- description = S("Asphalt stair"),
+ description = streets.S("Asphalt stair"),
tiles = {"streets_asphalt.png^streets_asphalt_side.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png^streets_asphalt_side.png"},
groups = {cracky = 3},
paramtype = "light",
@@ -137,7 +137,7 @@ if type(register_stair_slab_panel_micro) ~= "function" then return end
}
})
minetest.register_node(":streets:asphalt_side_stair_r",{
- description = S(S("Asphalt stair")),
+ description = streets.S(streets.S("Asphalt stair")),
tiles = {"streets_asphalt.png^streets_asphalt_side_r.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png^streets_asphalt_side_r.png"},
groups = {cracky = 3},
paramtype = "light",
@@ -180,7 +180,7 @@ if type(register_stair_slab_panel_micro) ~= "function" then return end
})
---------------------------------------------------------------------
minetest.register_node(":streets:asphalt_side_slab_l",{
- description = S(S("Asphalt slab")),
+ description = streets.S(streets.S("Asphalt slab")),
tiles = {"streets_asphalt.png^streets_asphalt_side.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png^streets_asphalt_side.png"},
groups = {cracky = 3},
paramtype = "light",
@@ -194,7 +194,7 @@ if type(register_stair_slab_panel_micro) ~= "function" then return end
}
})
minetest.register_node(":streets:asphalt_side_slab_r",{
- description = S(S("Asphalt slab")),
+ description = streets.S(streets.S("Asphalt slab")),
tiles = {"streets_asphalt.png^streets_asphalt_side_r.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png^streets_asphalt_side_r.png"},
groups = {cracky = 3},
paramtype = "light",
diff --git a/constructionarea/init.lua b/constructionarea/init.lua
index b521f3e..9b1aefe 100644
--- a/constructionarea/init.lua
+++ b/constructionarea/init.lua
@@ -1,7 +1,7 @@
minetest.register_node(":streets:constructionfence_bottom",{
- description = S("Construction fence"),
+ description = streets.S("Construction fence"),
tiles = {"streets_fence_fromtop.png","streets_fence_fromtop.png","streets_fence_fromtop.png","streets_fence_fromtop.png","streets_fence_bottom.png","streets_fence_bottom.png"},
- groups = {cracky = 2,},
+ groups = {cracky = 2, disable_jump = 1},
paramtype = "light",
inventory_image = "streets_fence_inv.png",
wield_image = "streets_fence_inv.png",
@@ -35,9 +35,9 @@ minetest.register_node(":streets:constructionfence_bottom",{
})
minetest.register_node(":streets:constructionfence_top",{
- description = S("Construction fence"),
+ description = streets.S("Construction fence"),
tiles = {"streets_fence_fromtop.png","streets_fence_fromtop.png","streets_fence_fromtop.png","streets_fence_fromtop.png","streets_fence_top.png","streets_fence_top.png"},
- groups = {cracky = 2, not_in_creative_inventory = 1},
+ groups = {cracky = 2, not_in_creative_inventory = 1, disable_jump = 1},
paramtype = "light",
paramtype2 = "facedir",
drawtype = "nodebox",
diff --git a/delineator/init.lua b/delineator/init.lua
index 09158d2..cf78142 100644
--- a/delineator/init.lua
+++ b/delineator/init.lua
@@ -2,7 +2,7 @@
StreetsMod: Delineator
]]
minetest.register_node(":streets:delineator", {
- description = S("Delineator"),
+ description = streets.S("Delineator"),
tiles = {"streets_delineator_top.png","streets_delineator.png"},
drawtype = "nodebox",
paramtype = "light",
diff --git a/emergencyphone/init.lua b/emergencyphone/init.lua
index 4f4d1c7..8c25c65 100644
--- a/emergencyphone/init.lua
+++ b/emergencyphone/init.lua
@@ -2,7 +2,7 @@
StreetsMod: Emergency Phone
]]
minetest.register_node(":streets:emergencyphone",{
- description = S("Emergency Phone"),
+ description = streets.S("Emergency Phone"),
tiles = {"streets_sos_top.png","streets_sos_bottom.png","streets_sos_side.png","streets_sos_side.png","streets_sos_side.png","streets_sos_front.png"},
groups = {cracky = 3},
paramtype2 = "facedir",
@@ -10,7 +10,7 @@ minetest.register_node(":streets:emergencyphone",{
on_rightclick = function(pos,node,clicker)
if clicker:is_player() and clicker:get_hp() < 6 then
clicker:set_hp(6)
- minetest.log("action",clicker:get_player_name() .. " healed by emergency phone at pos (" .. pos.x .. "," .. pos.y .. "," .. pos.z .. ")")
+ minetest.log("action",clicker:get_player_name() .. " healed by emergency phone at pos " .. minetest.pos_to_string(pos) .. "")
end
end
})
diff --git a/labels/init.lua b/labels/init.lua
index e2a8606..c46a990 100644
--- a/labels/init.lua
+++ b/labels/init.lua
@@ -2,7 +2,7 @@
StreetsMod: All kinds of asphalt with labels
]]
minetest.register_node(":streets:asphalt_sideline",{
- description = S("Asphalt with sideline"),
+ description = streets.S("Asphalt with sideline"),
groups = {cracky=3},
tiles = {"streets_asphalt.png^streets_asphalt_side.png","streets_asphalt.png"},
paramtype2 = "facedir"
@@ -18,7 +18,7 @@ minetest.register_craft({
})
minetest.register_node(":streets:asphalt_solid_line",{
- description = S("Asphalt with solid line"),
+ description = streets.S("Asphalt with solid line"),
groups = {cracky=3},
tiles = {"streets_asphalt.png^streets_asphalt_solid_line.png","streets_asphalt.png"},
paramtype2 = "facedir"
@@ -34,7 +34,7 @@ minetest.register_craft({
})
minetest.register_node(":streets:asphalt_dashed_line",{
- description = S("Asphalt with dashed line"),
+ description = streets.S("Asphalt with dashed line"),
groups = {cracky=3},
tiles = {"streets_asphalt.png^streets_asphalt_dashed_line.png","streets_asphalt.png"},
paramtype2 = "facedir"
@@ -50,7 +50,7 @@ minetest.register_craft({
})
minetest.register_node(":streets:asphalt_outer_edge",{
- description = S("Asphalt with sideline (edge)"),
+ description = streets.S("Asphalt with sideline (edge)"),
groups = {cracky=3},
tiles = {"streets_asphalt.png^streets_asphalt_outer_edge.png","streets_asphalt.png"},
paramtype2 = "facedir"
@@ -66,7 +66,7 @@ minetest.register_craft({
})
minetest.register_node(":streets:asphalt_parking",{
- description = S("Asphalt with parking label"),
+ description = streets.S("Asphalt with parking label"),
groups = {cracky=3},
tiles = {"streets_asphalt.png^streets_parking.png","streets_asphalt.png"},
paramtype2 = "facedir"
@@ -82,7 +82,7 @@ minetest.register_craft({
})
minetest.register_node(":streets:asphalt_arrow_straight",{
- description = S("Asphalt with arrow"),
+ description = streets.S("Asphalt with arrow"),
groups = {cracky=3},
tiles = {"streets_asphalt.png^streets_arrow_straight.png","streets_asphalt.png"},
paramtype2 = "facedir"
@@ -98,7 +98,7 @@ minetest.register_craft({
})
minetest.register_node(":streets:asphalt_arrow_left",{
- description = S("Asphalt with arrow"),
+ description = streets.S("Asphalt with arrow"),
groups = {cracky=3},
tiles = {"streets_asphalt.png^streets_arrow_left.png","streets_asphalt.png"},
paramtype2 = "facedir"
@@ -114,7 +114,7 @@ minetest.register_craft({
})
minetest.register_node(":streets:asphalt_arrow_right",{
- description = S("Asphalt with arrow"),
+ description = streets.S("Asphalt with arrow"),
groups = {cracky=3},
tiles = {"streets_asphalt.png^streets_arrow_right.png","streets_asphalt.png"},
paramtype2 = "facedir"
@@ -130,7 +130,7 @@ minetest.register_craft({
})
minetest.register_node(":streets:asphalt_arrow_straight_left",{
- description = S("Asphalt with arrow"),
+ description = streets.S("Asphalt with arrow"),
groups = {cracky=3},
tiles = {"streets_asphalt.png^streets_arrow_straight_left.png","streets_asphalt.png"},
paramtype2 = "facedir"
@@ -146,7 +146,7 @@ minetest.register_craft({
})
minetest.register_node(":streets:asphalt_arrow_straight_right",{
- description = S("Asphalt with arrow"),
+ description = streets.S("Asphalt with arrow"),
groups = {cracky=3},
tiles = {"streets_asphalt.png^streets_arrow_straight_right.png","streets_asphalt.png"},
paramtype2 = "facedir"
@@ -162,7 +162,7 @@ minetest.register_craft({
})
minetest.register_node(":streets:asphalt_arrow_alldirs",{
- description = S("Asphalt with arrow"),
+ description = streets.S("Asphalt with arrow"),
groups = {cracky=3},
tiles = {"streets_asphalt.png^streets_arrow_alldirs.png","streets_asphalt.png"},
paramtype2 = "facedir"
diff --git a/manholes/init.lua b/manholes/init.lua
index bcd7d39..b9a2f40 100644
--- a/manholes/init.lua
+++ b/manholes/init.lua
@@ -2,13 +2,13 @@
StreetsMod: Manholes in asphalt
]]
minetest.register_node(":streets:manhole",{
- description = S("Simple manhole"),
+ description = streets.S("Simple manhole"),
tiles = {"streets_asphalt.png^streets_manhole.png","streets_asphalt.png"},
groups = {cracky=3}
})
minetest.register_node(":streets:manhole_adv_closed",{
- description = S("Advanced manhole"),
+ description = streets.S("Advanced manhole"),
tiles = {"streets_asphalt.png^streets_manhole_advanced.png","streets_asphalt.png"},
groups = {cracky=3},
drawtype = "nodebox",
@@ -36,7 +36,7 @@ minetest.register_node(":streets:manhole_adv_closed",{
end
})
minetest.register_node(":streets:manhole_adv_open",{
- description = S("Advanced manhole"),
+ description = streets.S("Advanced manhole"),
tiles = {"streets_asphalt.png^streets_manhole_advanced.png","streets_asphalt.png"},
groups = {cracky=3,not_in_creative_inventory=1},
drawtype = "nodebox",
diff --git a/roadsigns/init.lua b/roadsigns/init.lua
index 38e8692..73401fa 100644
--- a/roadsigns/init.lua
+++ b/roadsigns/init.lua
@@ -1,6 +1,7 @@
--[[
StreetsMod: Poles and signs
]]
-dofile(minetest.get_modpath(minetest.get_current_modname()) .. "/pole.lua")
+streets.workshop = {}
+
dofile(minetest.get_modpath(minetest.get_current_modname()) .. "/signs.lua")
dofile(minetest.get_modpath(minetest.get_current_modname()) .. "/workshop.lua") \ No newline at end of file
diff --git a/roadsigns/pole.lua b/roadsigns/pole.lua
deleted file mode 100644
index 417ecdf..0000000
--- a/roadsigns/pole.lua
+++ /dev/null
@@ -1,70 +0,0 @@
---[[
- StreetsMod: Poles and signs
-]]
-minetest.register_node(":streets:pole_bottom",{
- description = S("Pole"),
- tiles = {"streets_pole.png"},
- groups = {cracky=2},
- inventory_image = "streets_pole_inv.png",
- wield_image = "streets_pole_inv.png",
- paramtype = "light",
- paramtype2 = "facedir",
- drawtype = "nodebox",
- node_box = {
- type = "fixed",
- fixed = {
- {-0.1,-0.5,-0.5,0.1,0.5,-0.4},
- {-0.125,-0.5,-0.525,0.125,-0.3,-0.375}
- }
- },
- selection_box = {
- type = "fixed",
- fixed = {
- {-0.1,-0.5,-0.5,0.1,0.5,-0.4}
- }
- },
- after_place_node = function(pos,placer,itemstack)
- pos.y = pos.y +1
- if minetest.get_node(pos).name == "air" then
- minetest.add_node(pos,{name = "streets:pole_top", param2 = minetest.dir_to_facedir(placer:get_look_dir())})
- else
- minetest.chat_send_player(placer:get_player_name(),"Not enough free space! A pole has a height of 2 blocks!")
- pos.y = pos.y -1
- minetest.remove_node(pos)
- end
- end,
- after_dig_node = function(pos, oldnode, oldmetadata, digger)
- pos.y = pos.y +1
- if minetest.get_node(pos).name == "streets:pole_top" then
- minetest.remove_node(pos)
- end
- end
-})
-
-minetest.register_node(":streets:pole_top",{
- description = S("Y u no play minetest without cheating?"),
- tiles = {"streets_pole.png"},
- groups = {cracky=2,not_in_creative_inventory=1},
- paramtype = "light",
- paramtype2 = "facedir",
- drawtype = "nodebox",
- drop = "",
- can_dig = function()
- return false
- end,
- node_box = {
- type = "fixed",
- fixed = {
- {-0.1,-0.5,-0.5,0.1,0.5,-0.4}
- }
- }
-})
-
-minetest.register_craft({
- output = "streets:pole_bottom 3",
- recipe = {
- {"","default:steel_ingot",""},
- {"","default:steel_ingot",""},
- {"","default:steel_ingot",""}
- }
-}) \ No newline at end of file
diff --git a/roadsigns/signs.lua b/roadsigns/signs.lua
index 3b8beb4..03b4139 100644
--- a/roadsigns/signs.lua
+++ b/roadsigns/signs.lua
@@ -1,5 +1,5 @@
minetest.register_node(":streets:sign_blank",{
- description = S("Empty sign"),
+ description = streets.S("Empty sign"),
tiles = {"streets_sign_back.png"},
inventory_image = "streets_sign_back.png",
wield_image = "streets_sign_back.png",
@@ -27,11 +27,11 @@ minetest.register_node(":streets:sign_blank",{
after_place_node = function(pos)
local meta = minetest.get_meta(pos)
- meta:set_string("infotext", S("Empty Sign"))
+ meta:set_string("infotext", streets.S("Empty Sign"))
end
})
minetest.register_node(":streets:sign_lava",{
- description = S("Warning sign (lava)"),
+ description = streets.S("Warning sign (lava)"),
tiles = {"streets_sign_lava.png"},
inventory_image = "streets_sign_lava.png",
wield_image = "streets_sign_lava.png",
@@ -59,12 +59,12 @@ minetest.register_node(":streets:sign_lava",{
after_place_node = function(pos)
local meta = minetest.get_meta(pos)
- meta:set_string("infotext", S("Warning: Careful of lava"))
+ meta:set_string("infotext", streets.S("Warning: Careful of lava"))
end
})
minetest.register_node(":streets:sign_water",{
- description = S("Warning sign (water)"),
+ description = streets.S("Warning sign (water)"),
tiles = {"streets_sign_water.png"},
inventory_image = "streets_sign_water.png",
wield_image = "streets_sign_water.png",
@@ -92,12 +92,12 @@ minetest.register_node(":streets:sign_water",{
after_place_node = function(pos)
local meta = minetest.get_meta(pos)
- meta:set_string("infotext", S("Warning: Water nearby"))
+ meta:set_string("infotext", streets.S("Warning: Water nearby"))
end
})
minetest.register_node(":streets:sign_construction",{
- description = S("Warning sign (Construction area)"),
+ description = streets.S("Warning sign (Construction area)"),
tiles = {"streets_sign_construction.png"},
inventory_image = "streets_sign_construction.png",
wield_image = "streets_sign_construction.png",
@@ -125,6 +125,6 @@ minetest.register_node(":streets:sign_construction",{
after_place_node = function(pos)
local meta = minetest.get_meta(pos)
- meta:set_string("infotext", S("Warning: Construction area, possible deep excavations"))
+ meta:set_string("infotext", streets.S("Warning: Construction area, possible deep excavations"))
end
})
diff --git a/roadsigns/workshop.lua b/roadsigns/workshop.lua
index 08b94f2..b693222 100644
--- a/roadsigns/workshop.lua
+++ b/roadsigns/workshop.lua
@@ -4,39 +4,59 @@
local forms = {
inactive = {
"size[12,10]",
- "label[3.5,0;"..S("Sign workshop - Create signs for your roads!").."]",
- "label[0,0.5;"..S("Available signs:").."]",
+ "label[3.5,0;"..streets.S("Sign workshop - Create signs for your roads!").."]",
+ "label[0,0.5;"..streets.S("Available signs:").."]",
"list[context;streets:signworkshop_list;0,1;5,4]",
- "label[9,0.5;"..S("Needed stuff:").."]",
+ "label[9,0.5;"..streets.S("Needed stuff:").."]",
"list[context;streets:signworkshop_recipe;8,1;4,1]",
- "label[9,2;"..S("Put it here:").."]",
+ "label[9,2;"..streets.S("Put it here:").."]",
"list[context;streets:signworkshop_input;8,3;4,1]",
- "button[8,4;2,1;streets:signworkshop_send;"..S("Start!").."]",
- "label[5.8,0.5;"..S("Selected:").."]",
+ "button[8,4;2,1;streets:signworkshop_send;"..streets.S("Start!").."]",
+ "label[5.8,0.5;"..streets.S("Selected:").."]",
"list[context;streets:signworkshop_select;6,1;1,1]",
- "label[5.8,2.5;"..S("Output:").."]",
+ "label[5.8,2.5;"..streets.S("Output:").."]",
"list[context;streets:signworkshop_output;6,3;1,1]",
- "list[current_player;main;2,6;8,4]",
+ "list[current_player;main;2,6;8,1]",
+ "list[current_player;main;2,7.25;8,3;8]",
+ gui_bg,
+ gui_bg_img,
+ gui_slots,
+ default.get_hotbar_bg(2, 6)
},
active = {
"size[12,10]",
- "label[3.5,0;"..S("Sign workshop - Create signs for your roads!").."]",
- "label[0,0.5;"..S("Available signs:").."]",
+ "label[3.5,0;"..streets.S("Sign workshop - Create signs for your roads!").."]",
+ "label[0,0.5;"..streets.S("Available signs:").."]",
"list[context;streets:signworkshop_list;0,1;5,4]",
- "label[9,0.5;"..S("Needed stuff:").."]",
+ "label[9,0.5;"..streets.S("Needed stuff:").."]",
"list[context;streets:signworkshop_recipe;8,1;4,1]",
- "label[9,2;"..S("Put it here:").."]",
+ "label[9,2;"..streets.S("Put it here:").."]",
"list[context;streets:signworkshop_input;8,3;4,1]",
- "label[5.8,0.5;"..S("Selected:").."]",
+ "label[5.8,0.5;"..streets.S("Selected:").."]",
"list[context;streets:signworkshop_select;6,1;1,1]",
- "label[5.8,2.5;"..S("Output:").."]",
+ "label[5.8,2.5;"..streets.S("Output:").."]",
"list[context;streets:signworkshop_output;6,3;1,1]",
- "list[current_player;main;2,6;8,4]"
- --
+ "list[current_player;main;2,6;8,1]",
+ "list[current_player;main;2,7.25;8,3;8]",
+ gui_bg,
+ gui_bg_img,
+ gui_slots,
+ default.get_hotbar_bg(2, 6),
+ --
}
}
+
+streets.workshop.signs = {}
+minetest.after(0, function()
+ for k, v in pairs(minetest.registered_nodes) do
+ if v.streets and v.streets.signworkshop then
+ table.insert(streets.workshop.signs, k)
+ end
+ end
+end)
+
minetest.register_node(":streets:signworkshop",{
- description = S("Sign workshop"),
+ description = streets.S("Sign workshop"),
tiles = {"streets_signworkshop_top.png","streets_signworkshop_bottom.png","streets_signworkshop_side.png","streets_signworkshop_side.png","streets_signworkshop_side.png","streets_signworkshop_front.png"},
groups = {cracky = 1, level = 2},
paramtype2 = "facedir",
@@ -50,12 +70,11 @@ minetest.register_node(":streets:signworkshop",{
inv:set_size("streets:signworkshop_select",1*1)
inv:set_size("streets:signworkshop_output",1*1)
-- Fill
- inv:add_item("streets:signworkshop_list","streets:sign_blank")
- inv:add_item("streets:signworkshop_list","streets:sign_lava")
- inv:add_item("streets:signworkshop_list","streets:sign_water")
- inv:add_item("streets:signworkshop_list","streets:sign_construction")
+ for k, v in pairs(streets.workshop.signs) do
+ inv:add_item("streets:signworkshop_list", v)
+ end
-- Meta
- meta:set_string("infotext",S("Sign workshop idle"))
+ meta:set_string("infotext",streets.S("Sign workshop idle"))
meta:set_string("idle","y")
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
@@ -102,31 +121,23 @@ minetest.register_node(":streets:signworkshop",{
local def = minetest.registered_nodes[selection].streets.signworkshop
local need = inv:get_list("streets:signworkshop_recipe")
local has = inv:get_list("streets:signworkshop_input")
- need[1] = need[1]:to_table()
- need[2] = need[2]:to_table()
- need[3] = need[3]:to_table()
- need[4] = need[4]:to_table()
- has[1] = has[1]:to_table()
- has[2] = has[2]:to_table()
- has[3] = has[3]:to_table()
- has[4] = has[4]:to_table()
- if need[1] == nil then need[1] = { name = "" } end
- if need[2] == nil then need[2] = { name = "" } end
- if need[3] == nil then need[3] = { name = "" } end
- if need[4] == nil then need[4] = { name = "" } end
- if has[1] == nil then has[1] = { name = "" } end
- if has[2] == nil then has[2] = { name = "" } end
- if has[3] == nil then has[3] = { name = "" } end
- if has[4] == nil then has[4] = { name = "" } end
+ for k, v in pairs(need) do
+ need[k] = need[k]:to_table()
+ if need[k] == nil then need[k] = { name = "" } end
+ end
+ for k, v in pairs(has) do
+ has[k] = has[k]:to_table()
+ if has[k] == nil then has[k] = { name = "" } end
+ end
if need[1].name == has[1].name and need[2].name == has[2].name and need[3].name == has[3].name and need[4].name == has[4].name then
- meta:set_string("infotext",S("Sign workshop working"))
+ meta:set_string("infotext",streets.S("Sign workshop working"))
meta:set_string("idle","n")
- meta:set_string("formspec",table.concat(forms.active) .. "label[8,4;"..S("Please wait %s seconds..."):format(def.time).."]")
+ meta:set_string("formspec",table.concat(forms.active) .. "label[8,4;"..streets.S("Please wait %s seconds..."):format(def.time).."]")
-- Clear input
inv:set_list("streets:signworkshop_input",{"","","",""})
minetest.after(def.time,function()
-- Reset infotext and meta
- meta:set_string("infotext",S("Sign workshop idle"))
+ meta:set_string("infotext",streets.S("Sign workshop idle"))
meta:set_string("idle","y")
meta:set_string("formspec",table.concat(forms.inactive))
-- Fill output
diff --git a/roadworks/init.lua b/roadworks/init.lua
index dfad72e..43dfbbc 100644
--- a/roadworks/init.lua
+++ b/roadworks/init.lua
@@ -6,7 +6,7 @@
local box = {-0.5,-0.5,-0.5,0.5,-0.45,0.5}
minetest.register_node(":streets:rw_asphalt_solid",{
- description = S("Solid line (yellow)"),
+ description = streets.S("Solid line (yellow)"),
tiles = {"streets_rw_solid_line.png","streets_rw_solid_line_curve.png","streets_rw_solid_line_tjunction.png","streets_rw_solid_line_crossing.png"},
drawtype = "raillike",
paramtype = "light",
@@ -23,7 +23,7 @@ minetest.register_node(":streets:rw_asphalt_solid",{
})
minetest.register_node(":streets:rw_asphalt_dashed",{
- description = S("Dashed line (yellow)"),
+ description = streets.S("Dashed line (yellow)"),
tiles = {"streets_rw_dashed_line.png","streets_rw_dashed_line_curve.png","streets_rw_dashed_line_tjunction.png","streets_rw_dashed_line_crossing.png"},
drawtype = "raillike",
paramtype = "light",
@@ -40,7 +40,7 @@ minetest.register_node(":streets:rw_asphalt_dashed",{
})
minetest.register_node(":streets:rw_cross",{
- description = S("Cross (yellow)"),
+ description = streets.S("Cross (yellow)"),
tiles = {"streets_rw_cross.png"},
drawtype = "signlike",
paramtype = "light",
@@ -56,7 +56,7 @@ minetest.register_node(":streets:rw_cross",{
})
minetest.register_node(":streets:rw_outer_edge",{
- description = S("Outer edge (yellow)"),
+ description = streets.S("Outer edge (yellow)"),
tiles = {"streets_rw_outer_edge.png","streets_rw_transparent.png"},
drawtype = "nodebox",
paramtype = "light",
@@ -77,7 +77,7 @@ minetest.register_node(":streets:rw_outer_edge",{
})
minetest.register_node(":streets:rw_parking",{
- description = S("Parking (yellow)"),
+ description = streets.S("Parking (yellow)"),
tiles = {"streets_rw_parking.png","streets_rw_transparent.png"},
drawtype = "nodebox",
paramtype = "light",
@@ -98,7 +98,7 @@ minetest.register_node(":streets:rw_parking",{
})
minetest.register_node(":streets:rw_alldirs",{
- description = S("Arrow (yellow)"),
+ description = streets.S("Arrow (yellow)"),
tiles = {"streets_rw_arrow_alldirs.png","streets_rw_transparent.png"},
drawtype = "nodebox",
paramtype = "light",
@@ -119,7 +119,7 @@ minetest.register_node(":streets:rw_alldirs",{
})
minetest.register_node(":streets:rw_left",{
- description = S("Arrow (yellow)"),
+ description = streets.S("Arrow (yellow)"),
tiles = {"streets_rw_arrow_left.png","streets_rw_transparent.png"},
drawtype = "nodebox",
paramtype = "light",
@@ -140,7 +140,7 @@ minetest.register_node(":streets:rw_left",{
})
minetest.register_node(":streets:rw_right",{
- description = S("Arrow (yellow)"),
+ description = streets.S("Arrow (yellow)"),
tiles = {"streets_rw_arrow_right.png","streets_rw_transparent.png"},
drawtype = "nodebox",
paramtype = "light",
@@ -161,7 +161,7 @@ minetest.register_node(":streets:rw_right",{
})
minetest.register_node(":streets:rw_straight_right",{
- description = S("Arrow (yellow)"),
+ description = streets.S("Arrow (yellow)"),
tiles = {"streets_rw_arrow_straight_right.png","streets_rw_transparent.png"},
drawtype = "nodebox",
paramtype = "light",
@@ -182,7 +182,7 @@ minetest.register_node(":streets:rw_straight_right",{
})
minetest.register_node(":streets:rw_straight_left",{
- description = S("Arrow (yellow)"),
+ description = streets.S("Arrow (yellow)"),
tiles = {"streets_rw_arrow_straight_left.png","streets_rw_transparent.png"},
drawtype = "nodebox",
paramtype = "light",
@@ -203,7 +203,7 @@ minetest.register_node(":streets:rw_straight_left",{
})
minetest.register_node(":streets:rw_straight",{
- description = S("Arrow (yellow)"),
+ description = streets.S("Arrow (yellow)"),
tiles = {"streets_rw_arrow_straight.png","streets_rw_transparent.png"},
drawtype = "nodebox",
paramtype = "light",
@@ -224,7 +224,7 @@ minetest.register_node(":streets:rw_straight",{
})
minetest.register_node(":streets:rw_sideline",{
- description = S("Sideline (yellow)"),
+ description = streets.S("Sideline (yellow)"),
tiles = {"streets_rw_asphalt_side.png","streets_rw_transparent.png"},
drawtype = "nodebox",
paramtype = "light",
diff --git a/steelsupport/init.lua b/steelsupport/init.lua
index 6217600..56cc084 100644
--- a/steelsupport/init.lua
+++ b/steelsupport/init.lua
@@ -2,7 +2,7 @@
StreetsMod: Steel support for hanging signs on highways etc.
]]
minetest.register_node(":streets:steel_support",{
- description = S("Steel support"),
+ description = streets.S("Steel support"),
tiles = {"streets_support.png"},
groups = {cracky = 1},
drawtype = "glasslike_framed",
diff --git a/streetlamps/init.lua b/streetlamps/init.lua
index bb80136..c7097f9 100644
--- a/streetlamps/init.lua
+++ b/streetlamps/init.lua
@@ -2,7 +2,7 @@
StreetsMod: Streetlamps
]]
--[[minetest.register_node(":streets:streetlamp_basic_controller",{
- description = S("Trafficlight"),
+ description = streets.S("Trafficlight"),
tiles = {"streets_lampcontroller_top.png","streets_lampcontroller_bottom.png","streets_lampcontroller_sides.png"},
groups = {cracky = 1, not_in_creative_inventory = 1},
drawtype = "nodebox",
@@ -41,7 +41,7 @@
minetest.register_node(":streets:streetlamp_basic_bottom",{
drop = "",
- description = S("Street lamp"),
+ description = streets.S("Street lamp"),
tiles = {"streets_lamps_basic_bottom.png"},
inventory_image = "streets_lamps_basi_inv.png",
groups = {cracky = 1},
@@ -63,7 +63,7 @@ minetest.register_node(":streets:streetlamp_basic_bottom",{
})
minetest.register_node(":streets:streetlamp_basic_middle",{
drop = "",
- description = S("U cheater U"),
+ description = streets.S("U cheater U"),
groups = {cracky = 1, not_in_creative_inventory = 1},
tiles = {"streets_lamps_basic_middle.png"},
paramtype = "light",
@@ -78,7 +78,7 @@ minetest.register_node(":streets:streetlamp_basic_middle",{
})
--[[minetest.register_node(":streets:streetlamp_basic_top_off",{
drop = "",
- description = S("U cheater U"),
+ description = streets.S("U cheater U"),
groups = {cracky = 1, not_in_creative_inventory = 1},
paramtype = "light",
drawtype = "nodebox",
@@ -93,7 +93,7 @@ minetest.register_node(":streets:streetlamp_basic_middle",{
})]]
minetest.register_node(":streets:streetlamp_basic_top_on",{
drop = "streets:streetlamp_basic_bottom",
- description = S("U cheater U"),
+ description = streets.S("U cheater U"),
groups = {cracky = 1, not_in_creative_inventory = 1},
tiles = {"streets_lamps_basic_top_top.png","streets_lamps_basic_top_top.png","streets_lamps_basic_top.png","streets_lamps_basic_top.png","streets_lamps_basic_top.png","streets_lamps_basic_top.png"},
paramtype = "light",
diff --git a/streetsawards/depends.txt b/streetsawards/depends.txt
new file mode 100644
index 0000000..42d368b
--- /dev/null
+++ b/streetsawards/depends.txt
@@ -0,0 +1,2 @@
+streetsmod
+awards? \ No newline at end of file
diff --git a/streetsawards/init.lua b/streetsawards/init.lua
new file mode 100644
index 0000000..fedc768
--- /dev/null
+++ b/streetsawards/init.lua
@@ -0,0 +1,22 @@
+if streets.extendedBy.awards == true then
+ awards.register_achievement("award_countryroads",{
+ title = "Roadbuilder",
+ description = "You built some quite big roads!",
+ icon = "novicebuilder.png",
+ trigger = {
+ type = "place",
+ node = "streets:asphalt",
+ target = 175,
+ },
+ })
+ awards.register_achievement("award_underworld",{
+ title = "Start your sewers!",
+ description = "You placed your first manhole! Did you know that you can open it with a right-click?",
+ icon = "novicebuilder.png",
+ trigger = {
+ type = "place",
+ node = "streets:manhole_adv_closed",
+ target = 1,
+ },
+ })
+end \ No newline at end of file
diff --git a/streetsconcrete/init.lua b/streetsconcrete/init.lua
index f4d0205..cb29ee9 100644
--- a/streetsconcrete/init.lua
+++ b/streetsconcrete/init.lua
@@ -5,7 +5,7 @@ if streets.extendedBy.technic == true then
minetest.register_alias("streets:concrete","technic:concrete")
-- Use technic's concrete block for the seperating wall
minetest.register_node(":streets:concrete_wall",{
- description = S("Concrete wall"),
+ description = streets.S("Concrete wall"),
tiles = {"technic_concrete_block.png"},
groups = {cracky=2},
drawtype = "nodebox",
@@ -28,7 +28,7 @@ if streets.extendedBy.technic == true then
}
})
minetest.register_node(":streets:concrete_wall_flat",{
- description = S("Concrete wall"),
+ description = streets.S("Concrete wall"),
tiles = {"technic_concrete_block.png"},
groups = {cracky=2},
drawtype = "nodebox",
@@ -52,7 +52,7 @@ if streets.extendedBy.technic == true then
elseif streets.extendedBy.prefab then
minetest.register_alias("streets:concrete","prefab:concrete")
minetest.register_node(":streets:concrete_wall",{
- description = S("Concrete wall"),
+ description = streets.S("Concrete wall"),
tiles = {"prefab_concrete.png"},
groups = {cracky=2},
drawtype = "nodebox",
@@ -75,7 +75,7 @@ elseif streets.extendedBy.prefab then
}
})
minetest.register_node(":streets:concrete_wall_flat",{
- description = S("Concrete wall"),
+ description = streets.S("Concrete wall"),
tiles = {"prefab_concrete.png"},
groups = {cracky=2},
drawtype = "nodebox",
@@ -99,12 +99,12 @@ elseif streets.extendedBy.prefab then
else
-- Register concrete block with streets' texture and then the seperating wall
minetest.register_node(":streets:concrete",{
- description = S("Concrete"),
+ description = streets.S("Concrete"),
tiles = {"streets_concrete.png"},
groups = {cracky=2}
})
minetest.register_node(":streets:concrete_wall",{
- description = S("Concrete wall"),
+ description = streets.S("Concrete wall"),
tiles = {"streets_concrete.png"},
groups = {cracky=2},
drawtype = "nodebox",
@@ -127,7 +127,7 @@ else
}
})
minetest.register_node(":streets:concrete_wall_flat",{
- description = S("Concrete wall"),
+ description = streets.S("Concrete wall"),
tiles = {"streets_concrete.png"},
groups = {cracky=2},
drawtype = "nodebox",
diff --git a/streetshotfix/depends.txt b/streetshotfix/depends.txt
new file mode 100644
index 0000000..421a27d
--- /dev/null
+++ b/streetshotfix/depends.txt
@@ -0,0 +1 @@
+streetsmod \ No newline at end of file
diff --git a/streetsmod/forms.lua b/streetsmod/forms.lua
new file mode 100644
index 0000000..c636c85
--- /dev/null
+++ b/streetsmod/forms.lua
@@ -0,0 +1,4 @@
+-- Form for chatcommand /streets
+ streets.forms.chatcmd = smartfs.create("streets:chatcmd", function(state)
+ state:load(streets.modpath .. "/forms/cmd_streets.smartfs")
+ end) \ No newline at end of file
diff --git a/streetsmod/forms/cmd_streets.smartfs b/streetsmod/forms/cmd_streets.smartfs
new file mode 100644
index 0000000..3dbd29c
--- /dev/null
+++ b/streetsmod/forms/cmd_streets.smartfs
@@ -0,0 +1 @@
+return { ["ele"] = { ["streets:chatcmd_version"] = { ["type"] = "label", ["pos"] = { ["y"] = 1, ["x"] = 6.5 }, ["name"] = "streets:chatcmd_version", ["value"] = "Running version: 1.4.4dev" }, ["streets:chatcmd_guibg"] = { ["type"] = "code", ["name"] = "streets:chatcmd_guibg", ["code"] = "bgcolor[#080808BB;true]background[5,5;1,1;gui_formbg.png;true]" }, ["streets:chatcmd_modlist"] = { ["pos"] = { ["y"] = 1, ["x"] = 0 }, ["size"] = { ["h"] = 5, ["w"] = 6 }, ["type"] = "list", ["name"] = "streets:chatcmd_modlist", ["items"] = { "digilines installed: false", "mesecons installed: false", "moreblocks installed: false", "wool installed: true", "technic installed: false", "prefab installed: false", "awards installed: false" } } }, ["size"] = { ["h"] = 6, ["w"] = 10 } } \ No newline at end of file
diff --git a/streetsmod/init.lua b/streetsmod/init.lua
index 2fb517f..6e1a2fb 100644
--- a/streetsmod/init.lua
+++ b/streetsmod/init.lua
@@ -1,32 +1,54 @@
--[[
- StreetsMod 1.1 by webdesigner97:
+ StreetsMod 1.5 by webdesigner97:
License : CC-BY-SA 3.0 Unported (see license.txt)
Readme : see readme.txt
Forum : http://bit.ly/12cPMeo
Depends : default
]]
--- kaeza: intllib
+streets = {}
+
+-- Kaeza intllib
-- Boilerplate to support localized strings if intllib mod is installed.
- -- local S
- if (minetest.get_modpath("intllib")) then
- dofile(minetest.get_modpath("intllib").."/intllib.lua")
- S = intllib.Getter(minetest.get_current_modname())
+ if minetest.get_modpath("intllib") then
+ streets.S = intllib.Getter()
else
- S = function ( s ) return s end
+ streets.S = function(s) return s end
end
--- Create variables and tables
- print("Streets: " .. S("Creating variables and tables..."))
- streets = {}
- streets.version = "1.4.4dev"
- streets.modpath = minetest.get_modpath("streets")
+
+-- Create variable and tables
+ print("Streets: " .. streets.S("Creating variables and tables..."))
+ streets.version = "1.5"
+ streets.modpath = minetest.get_modpath("streetsmod")
streets.extendedBy = {}
streets.load = {
start = os.clock(),
fin = 0
}
+ streets.forms = {}
+
+
+
+-- Support for mimnetest_next's fancy inventories
+ if gui_bg and gui_bg_img and gui_slots and type(default.get_hotbar_bg) == "function" then
+ -- Everything fine :)
+ -- minetest_next rules! :P
+ else
+ gui_bg = ""
+ gui_bg_img = ""
+ gui_slots = ""
+ default.get_hotbar_bg = function() return "" end
+ end
+
+-- rubenwardy: smartfs
+ if not minetest.get_modpath("smartfs") then
+ dofile(streets.modpath .. "/libs/smartfs/smartfs.lua")
+ end
+
+-- Load forms
+ dofile(streets.modpath .. "/forms.lua")
-- Check for mods which change this mod's beahaviour
- print("Streets: " .. S("Checking installed mods..."))
+ print("Streets: " .. streets.S("Checking installed mods..."))
if minetest.get_modpath("wool") then
streets.extendedBy.wool = true
else
@@ -57,6 +79,11 @@
else
streets.extendedBy.prefab = false
end
+ if minetest.get_modpath("awards") then
+ streets.extendedBy.awards = true
+ else
+ streets.extendedBy.awards = false
+ end
-- Streets chatcommand
local function round(num, idp)
@@ -64,22 +91,12 @@
return math.floor(num * mult + 0.5) / mult
end
minetest.register_chatcommand("streets",{
- description = S("Check version of your installed StreetsMod and find information"),
+ description = streets.S("Check version of your installed StreetsMod and find information"),
func = function(name,param)
- minetest.show_formspec(name, "streets:streetsform", table.concat({
- "size[10,6]",
- "label[0,1;Wool installed: " .. tostring(streets.extendedBy.wool) .. "]",
- "label[0,1.5;Technic installed: " .. tostring(streets.extendedBy.technic) .. "]",
- "label[0,2;Moreblocks installed: " .. tostring(streets.extendedBy.moreblocks) .. "]",
- "label[0,2.5;Mesecons installed: " .. tostring(streets.extendedBy.mesecons) .. "]",
- "label[0,3;Digilines installed: " .. tostring(streets.extendedBy.digilines) .. "]",
- "label[0,3.5;Prefab installed: " .. tostring(streets.extendedBy.prefab) .. "]",
- "label[0,4.5;Running version: " .. streets.version .. "]",
- "label[0,5;Load time: " .. round(streets.load.fin - streets.load.start,4) .. "s]"
- }))
+ streets.forms.chatcmd:show(name);
end
})
-- Done
- print("Streets: " .. S("Setup completed, have fun with StreetsMod") .. " " .. streets.version .. "!")
+ print("Streets: " .. streets.S("Setup completed, have fun with StreetsMod") .. " " .. streets.version .. "!")
streets.load.fin = os.clock()
diff --git a/streetsmod/libs/smartfs b/streetsmod/libs/smartfs
-Subproject c700a1234606a8b5341611748d70b6578cabc36
+Subproject 701a615a7cdf2847947d942c7cf25f983b0581f
diff --git a/streetsmod/locale/de.txt b/streetsmod/locale/de.txt
index 7da8911..57694d3 100644
--- a/streetsmod/locale/de.txt
+++ b/streetsmod/locale/de.txt
@@ -47,6 +47,7 @@ Street lamp=Strassenlampe
Concrete wall=Betonwand
Concrete=Beton
Trafficlight=Ampel
+Running version=Version
Cheater=Schummler
Cheater!=Schummler!
Off=Aus
diff --git a/streetsmod/locale/template.txt.txt b/streetsmod/locale/template.txt.txt
index 7933d98..179cc7d 100644
--- a/streetsmod/locale/template.txt.txt
+++ b/streetsmod/locale/template.txt.txt
@@ -47,6 +47,7 @@ Street lamp=
Concrete wall=
Concrete=
Trafficlight=
+Running version=
Cheater=
Cheater!=
Off=
diff --git a/streetsmod/nodeboxes/trafficlight.nbe b/streetsmod/nodeboxes/trafficlight.nbe
index aa30fc6..189f333 100644
--- a/streetsmod/nodeboxes/trafficlight.nbe
+++ b/streetsmod/nodeboxes/trafficlight.nbe
@@ -5,13 +5,15 @@ NAME test
NODE node1
POSITION 0 0 0
NODEBOX nodebox1 -0.1875 -0.5 0.5 0.1875 0.5 0.75
-NODEBOX nodebox2 -0.0625 0.375 0.32 0.0625 0.429368 0.51
-NODEBOX nodebox3 -0.0625 0.0625 0.32 0.0625 0.125 0.51
-NODEBOX nodebox4 -0.0625 -0.25 0.32 0.0625 -0.1875 0.51
-NODEBOX nodebox5 0.0512648 0.32 0.32 0.113765 0.38 0.5
-NODEBOX nodebox6 -0.131446 0.32 0.32 -0.0689464 0.38 0.5
-NODEBOX nodebox7 0.0571587 0.001 0.32 0.119659 0.06 0.53
-NODEBOX nodebox8 -0.131446 0.001 0.32 -0.0689464 0.06 0.53
-NODEBOX nodebox9 0.0571587 -0.31 0.32 0.119659 -0.25 0.539972
-NODEBOX nodebox10 -0.125553 -0.31 0.32 -0.0630526 -0.25 0.60652
-END NODE \ No newline at end of file
+NODEBOX nodebox2 -0.0625 0.375 0.3125 0.0625 0.4375 0.5
+NODEBOX nodebox3 -0.0625 0.0625 0.3125 0.0625 0.125 0.5
+NODEBOX nodebox4 -0.0625 -0.25 0.3125 0.0625 -0.1875 0.5
+NODEBOX nodebox5 0.0625 0.3125 0.3125 0.125 0.38 0.5
+NODEBOX nodebox6 -0.125 0.3125 0.3125 -0.0625 0.375 0.5
+NODEBOX nodebox7 0.0625 0 0.3125 0.125 0.0625 0.5
+NODEBOX nodebox8 -0.125 0 0.3125 -0.0625 0.0625 0.5
+NODEBOX nodebox9 0.0625 -0.3125 0.3125 0.125 -0.25 0.5
+NODEBOX nodebox10 -0.125 -0.3125 0.3125 -0.0625 -0.25 0.5
+NODEBOX NodeBox11 -0.125 -0.125 0.85 0.125 0.125 0.75
+END NODE
+
diff --git a/streetsmod/textures/streets_lampcontroller_top.png b/streetsmod/textures/streets_lampcontroller_top.png
index cee87b3..00d2e4c 100644
--- a/streetsmod/textures/streets_lampcontroller_top.png
+++ b/streetsmod/textures/streets_lampcontroller_top.png
Binary files differ
diff --git a/streetsmod/textures/streets_pole.png b/streetsmod/textures/streets_pole.png
index 3fbed28..af4a378 100644
--- a/streetsmod/textures/streets_pole.png
+++ b/streetsmod/textures/streets_pole.png
Binary files differ
diff --git a/streetsmod/textures/streets_tl_bg.png b/streetsmod/textures/streets_tl_bg.png
index f0bba98..e4213db 100644
--- a/streetsmod/textures/streets_tl_bg.png
+++ b/streetsmod/textures/streets_tl_bg.png
Binary files differ
diff --git a/streetsmod/textures/streets_tl_green.png b/streetsmod/textures/streets_tl_green.png
index 014b118..7d7ba80 100644
--- a/streetsmod/textures/streets_tl_green.png
+++ b/streetsmod/textures/streets_tl_green.png
Binary files differ
diff --git a/streetsmod/textures/streets_tl_off.png b/streetsmod/textures/streets_tl_off.png
index 16621e7..a926d31 100644
--- a/streetsmod/textures/streets_tl_off.png
+++ b/streetsmod/textures/streets_tl_off.png
Binary files differ
diff --git a/streetsmod/textures/streets_tl_red.png b/streetsmod/textures/streets_tl_red.png
index 2481a86..4560199 100644
--- a/streetsmod/textures/streets_tl_red.png
+++ b/streetsmod/textures/streets_tl_red.png
Binary files differ
diff --git a/streetsmod/textures/streets_tl_redyellow.png b/streetsmod/textures/streets_tl_redyellow.png
index 0a85622..da443d9 100644
--- a/streetsmod/textures/streets_tl_redyellow.png
+++ b/streetsmod/textures/streets_tl_redyellow.png
Binary files differ
diff --git a/streetsmod/textures/streets_tl_warn.png b/streetsmod/textures/streets_tl_warn.png
index 8b4da58..349fa84 100644
--- a/streetsmod/textures/streets_tl_warn.png
+++ b/streetsmod/textures/streets_tl_warn.png
Binary files differ
diff --git a/streetsmod/textures/streets_tl_yellow.png b/streetsmod/textures/streets_tl_yellow.png
index 3666cae..42b4803 100644
--- a/streetsmod/textures/streets_tl_yellow.png
+++ b/streetsmod/textures/streets_tl_yellow.png
Binary files differ
diff --git a/streetsmod/textures/streets_trafficlight_template.png b/streetsmod/textures/streets_trafficlight_template.png
new file mode 100644
index 0000000..f987c9b
--- /dev/null
+++ b/streetsmod/textures/streets_trafficlight_template.png
Binary files differ
diff --git a/streetspoles/depends.txt b/streetspoles/depends.txt
new file mode 100644
index 0000000..421a27d
--- /dev/null
+++ b/streetspoles/depends.txt
@@ -0,0 +1 @@
+streetsmod \ No newline at end of file
diff --git a/streetspoles/init.lua b/streetspoles/init.lua
new file mode 100644
index 0000000..65b068d
--- /dev/null
+++ b/streetspoles/init.lua
@@ -0,0 +1,155 @@
+--[[
+ StreetsMod: Poles
+]]
+
+-- Simple pole
+minetest.register_node(":streets:pole_bottom",{
+ description = streets.S("Pole"),
+ tiles = {"streets_pole.png"},
+ groups = {cracky=2},
+ inventory_image = "streets_pole_inv.png",
+ wield_image = "streets_pole_inv.png",
+ paramtype = "light",
+ paramtype2 = "facedir",
+ drawtype = "nodebox",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.1,-0.5,-0.5,0.1,0.5,-0.4},
+ {-0.125,-0.5,-0.525,0.125,-0.3,-0.375}
+ }
+ },
+ selection_box = {
+ type = "fixed",
+ fixed = {
+ {-0.1,-0.5,-0.5,0.1,0.5,-0.4}
+ }
+ },
+ after_place_node = function(pos,placer,itemstack)
+ pos.y = pos.y +1
+ if minetest.get_node(pos).name == "air" then
+ minetest.add_node(pos,{name = "streets:pole_top", param2 = minetest.dir_to_facedir(placer:get_look_dir())})
+ else
+ minetest.chat_send_player(placer:get_player_name(),"Not enough free space! A pole has a height of 2 blocks!")
+ pos.y = pos.y -1
+ minetest.remove_node(pos)
+ end
+ end,
+ after_dig_node = function(pos, oldnode, oldmetadata, digger)
+ pos.y = pos.y +1
+ if minetest.get_node(pos).name == "streets:pole_top" then
+ minetest.remove_node(pos)
+ end
+ end
+})
+
+minetest.register_node(":streets:pole_top",{
+ description = streets.S("Y u no play minetest without cheating?"),
+ tiles = {"streets_pole.png"},
+ groups = {not_in_creative_inventory=1},
+ paramtype = "light",
+ paramtype2 = "facedir",
+ drawtype = "nodebox",
+ drop = "",
+ diggable = false,
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.1,-0.5,-0.5,0.1,0.5,-0.4}
+ }
+ }
+})
+
+minetest.register_craft({
+ output = "streets:pole_bottom 3",
+ recipe = {
+ {"","default:steel_ingot",""},
+ {"","default:steel_ingot",""},
+ {"","default:steel_ingot",""}
+ }
+})
+
+-- Big pole
+
+minetest.register_node(":streets:bigpole", {
+ description = "Pole",
+ paramtype = "light",
+ paramtype2 = "facedir",
+ drawtype = "nodebox",
+ tiles = {"streets_pole.png"},
+ sunlight_propagates = true,
+ groups = {cracky = 1, level = 2, bigpole = 1},
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15}
+ }
+ },
+ on_place = minetest.rotate_node,
+ digiline = {
+ wire = {
+ rules = {
+ {x= 0, y= 0, z=-1},
+ {x= 0, y= 0, z= 1},
+ {x= 1, y= 0, z= 0},
+ {x=-1, y= 0, z= 0},
+ {x= 0, y=-1, z= 0},
+ {x= 0, y= 1, z= 0},
+ {x= 0, y=-2, z= 0}
+ }
+ }
+ }
+})
+minetest.register_node(":streets:bigpole_edge", {
+ description = "Pole",
+ drop = "streets:bigpole",
+ paramtype = "light",
+ paramtype2 = "facedir",
+ drawtype = "nodebox",
+ tiles = {"streets_pole.png"},
+ sunlight_propagates = true,
+ groups = {cracky = 1, level = 2, bigpole = 1},
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.15,-0.5,-0.15,0.15,0.15,0.15},
+ {-0.15,-0.15,-0.15,0.15,0.15,-0.5}
+ }
+ },
+ digiline = {
+ wire = {
+ rules = {
+ {x= 0, y= 0, z=-1},
+ {x= 0, y= 0, z= 1},
+ {x= 1, y= 0, z= 0},
+ {x=-1, y= 0, z= 0},
+ {x= 0, y=-1, z= 0},
+ {x= 0, y= 1, z= 0},
+ }
+ }
+ }
+})
+minetest.register_craft({
+ output = "streets:bigpole 3",
+ recipe = {
+ {"","",""},
+ {"","default:steel_ingot",""},
+ {"","default:steel_ingot",""}
+ }
+})
+minetest.register_craft({
+ output = "streets:bigpole_edge 3",
+ recipe = {
+ {"","",""},
+ {"streets:bigpole","streets:bigpole",""},
+ {"streets:bigpole","",""}
+ }
+})
+minetest.register_craft({
+ output = "streets:bigpole_edge 3",
+ recipe = {
+ {"","",""},
+ {"streets:bigpole","streets:bigpole",""},
+ {"","streets:bigpole",""}
+ }
+}) \ No newline at end of file
diff --git a/trafficlight/init.lua b/trafficlight/init.lua
index eaa0a79..562068f 100644
--- a/trafficlight/init.lua
+++ b/trafficlight/init.lua
@@ -1,44 +1,96 @@
--[[
StreetsMod: inDev Trafficlights
]]
-minetest.register_node(":streets:trafficlight_bottom",{
- description = S("Cheater"),
- drop = "",
- groups = {not_in_creative_inventory = 1},
- paramtype = "light",
- paramtype2 = "facedir",
- drawtype = "nodebox",
- sunlight_propagates = true,
- tiles = {"streets_pole.png"},
- node_box = {
- type = "fixed",
- fixed = {
- {-0.15,-0.5,-0.15,0.15,0.25,0.15},
- {-0.1,0.25,-0.1,0.1,0.5,0.1}
- }
- },
-})
+dofile(streets.modpath .. "/../trafficlight/old2new.lua")
-minetest.register_node(":streets:trafficlight_middle",{
- description = S("Cheater!"),
- drop = "",
- groups = {cracky = 1, not_in_creative_inventory = 1},
- paramtype = "light",
- drawtype = "nodebox",
- sunlight_propagates = true,
- tiles = {"streets_pole.png"},
- node_box = {
- type = "fixed",
- fixed = {
- {-0.1,-0.5,-0.1,0.1,0.5,0.1},
- }
+streets.tlBox = {
+ --[[ Thank you, rubenwardy, for your awesome NodeboxEditor! Not perfect, but still great! ]]
+ {-0.1875,-0.5,0.5,0.1875,0.5,0.75}, --nodebox1
+ {-0.0625,0.375,0.3125,0.0625,0.4375,0.5}, --nodebox2
+ {-0.0625,0.0625,0.3125,0.0625,0.125,0.5}, --nodebox3
+ {-0.0625,-0.25,0.3125,0.0625,-0.1875,0.5}, --nodebox4
+ {0.0625,0.3125,0.3125,0.125,0.38,0.5}, --nodebox5
+ {-0.125,0.3125,0.3125,-0.0625,0.375,0.5}, --nodebox6
+ {0.0625,0,0.3125,0.125,0.0625,0.5}, --nodebox7
+ {-0.125,0,0.3125,-0.0625,0.0625,0.5}, --nodebox8
+ {0.0625,-0.3125,0.3125,0.125,-0.25,0.5}, --nodebox9
+ {-0.125,-0.3125,0.3125,-0.0625,-0.25,0.5}, --nodebox10
+ {-0.125, -0.125, 0.85, 0.125, 0.125, 0.75}, -- NodeBox11
+}
+
+streets.tlRythm = {
+ toRed = {
+ {name = "streets:trafficlight_top_yellow", pauseBefore = 0},
+ {name = "streets:trafficlight_top_red", pauseBefore = 3}
},
- pointable = false,
-})
+ toGreen = {
+ {name = "streets:trafficlight_top_redyellow", pauseBefore = 0},
+ {name = "streets:trafficlight_top_green", pauseBefore = 1.5}
+ },
+ toOff = {
+ {name = "streets:trafficlight_top_warn", pauseBefore = 0},
+ {name = "streets:trafficlight_top_off", pauseBefore = 5}
+ },
+ toWarn = {
+ {name = "streets:trafficlight_top_warn", pauseBefore = 0}
+ }
+}
-minetest.register_node(":streets:trafficlight_controller",{
- description = S("Trafficlight"),
- inventory_image = "streets_trafficlight_inv.png",
+streets.tlSwitch = function(def)
+ if not def.pos or not def.to or not streets.tlRythm[def.to] then
+ return
+ end
+ local meta = minetest.get_meta(def.pos)
+ -- Only switch if new state ~= current state
+ if "to" .. meta:get_string("state") == def.to then
+ return
+ end
+ -- Switch the trafficlight
+ for k, v in pairs(streets.tlRythm[def.to]) do
+ minetest.get_meta(def.pos):set_string("state", def.to:gsub("to", ""))
+ minetest.after(v.pauseBefore, function()
+ minetest.swap_node(def.pos, {name = v.name, param2 = minetest.get_node(def.pos).param2})
+ end)
+ end
+end
+
+streets.on_digiline_receive = function(pos, node, channel, msg)
+ local setchan = minetest.get_meta(pos):get_string("channel")
+ if setchan ~= channel then
+ return
+ end
+ -- Tl states
+ if msg == "OFF" then
+ streets.tlSwitch({
+ pos = pos,
+ to = "toOff"
+ })
+ elseif msg == "GREEN" then
+ streets.tlSwitch({
+ pos = pos,
+ to = "toGreen"
+ })
+ elseif msg == "RED" then
+ streets.tlSwitch({
+ pos = pos,
+ to = "toRed"
+ })
+ elseif msg == "WARN" then
+ streets.tlSwitch({
+ pos = pos,
+ to = "toWarn"
+ })
+ elseif msg == "GET" then
+ local state = minetest.get_meta(pos):get_string("state")
+ if not state or state == "" then
+ state = "UNDEFINED"
+ end
+ digiline:receptor_send(pos, digiline.rules.default, channel, state)
+ end
+end
+
+minetest.register_node(":streets:digiline_distributor",{
+ description = streets.S("Digiline distributor"),
tiles = {"streets_lampcontroller_top.png","streets_lampcontroller_bottom.png","streets_lampcontroller_sides.png"},
groups = {cracky = 1},
drawtype = "nodebox",
@@ -50,95 +102,55 @@ minetest.register_node(":streets:trafficlight_controller",{
{-0.05,0.5,-0.05,0.05,1.6,0.05}
}
},
- selection_box = {
- type = "fixed",
- fixed = {
- {-0.5,-0.5,-0.5,0.5,0.5,0.5},
- {-0.3,1.5,-0.3,0.3,4.5,0.3}
- }
- },
- on_receive_fields = function(pos, formname, fields, sender)
- minetest.get_meta(pos):set_string("channel", fields.channel)
- end,
- after_place_node = function(pos,placer,itemstack)
- minetest.set_node({x = pos.x, y = pos.y - 2, z = pos.z},{name = "streets:trafficlight_controller"})
- minetest.set_node({x = pos.x, y = pos.y + 0, z = pos.z},{name = "streets:trafficlight_bottom"})
- minetest.set_node({x = pos.x, y = pos.y + 1, z = pos.z},{name = "streets:trafficlight_middle"})
- minetest.set_node({x = pos.x, y = pos.y + 2, z = pos.z},{name = "streets:trafficlight_top_off",param2 = minetest.dir_to_facedir(placer:get_look_dir())})
- local meta = minetest.get_meta({x = pos.x, y = pos.y - 2, z = pos.z})
- meta:set_string("channel","")
- meta:set_string("infotext",S("Off"))
- meta:set_string("formspec","field[channel;"..S("Channel")..";${channel}]")
- end,
- after_dig_node = function(pos)
- minetest.remove_node({x = pos.x, y = pos.y + 2, z = pos.z})
- minetest.remove_node({x = pos.x, y = pos.y + 3, z = pos.z})
- minetest.remove_node({x = pos.x, y = pos.y + 4, z = pos.z})
- end,
digiline = {
- receptor = {},
- effector = {
- action = function(pos,node,channel,msg)
- local setchannel = minetest.get_meta(pos):get_string("channel")
- if channel == setchannel then
- -- Set a meta entry for the trafficlight's state
- local meta = minetest.get_meta(pos)
- local state = meta:get_string("infotext")
- if msg == "green" or msg == "red" or msg == "warn" or msg == "off" then
- meta:set_string("infotext",S(msg))
- local facedir = minetest.get_node({x = pos.x, y = pos.y + 4, z = pos.z}).param2
- -- Modify <pos> to the top node of the trafficlight
- pos.y = pos.y + 4
- --
- if msg == "red" and state ~= "red" then
- minetest.set_node(pos,{name = "streets:trafficlight_top_yellow",param2=facedir})
- minetest.after(3,function(param)
- minetest.set_node(pos,{name = "streets:trafficlight_top_red",param2=facedir})
- end)
- end
- --
- if msg == "green" and state ~= "green" then
- minetest.set_node(pos,{name = "streets:trafficlight_top_redyellow",param2=facedir})
- minetest.after(3,function(param)
- minetest.set_node(pos,{name = "streets:trafficlight_top_green",param2=facedir})
- end)
- end
- --
- if msg == "off" and state ~= "off" then
- minetest.set_node(pos,{name = "streets:trafficlight_top_off",param2=facedir})
- end
- --
- if msg == "warn" and state ~= "warn" then
- minetest.set_node(pos,{name = "streets:trafficlight_top_warn",param2=facedir})
- end
- end
- end
- end
+ wire = {
+ rules = {
+ {x= 0, y= 0, z=-1},
+ {x= 0, y= 0, z= 1},
+ {x= 1, y= 0, z= 0},
+ {x=-1, y= 0, z= 0},
+ {x= 0, y= 2, z=0}
+ }
}
}
})
minetest.register_node(":streets:trafficlight_top_off",{
- description = S("U cheater U"),
- drop = "",
- groups = {cracky = 1, not_in_creative_inventory = 1},
+ description = streets.S("Trafficlight"),
+ drawtype="nodebox",
paramtype = "light",
paramtype2 = "facedir",
+ groups = {cracky = 1, level = 2},
+ inventory_image = "streets_trafficlight_inv.png",
+ light_source = 11,
sunlight_propagates = true,
- drawtype = "nodebox",
- tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_off.png"},
node_box = {
type = "fixed",
- fixed = {
- {-0.25,-0.5,-0.25,0.25,0.5,0.25}
+ fixed = streets.tlBox
+ },
+ tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_off.png"},
+ digiline = {
+ receptor = {},
+ effector = {
+ action = function(pos, node, channel, msg)
+ streets.on_digiline_receive(pos, node, channel, msg)
+ end
}
},
- pointable = false,
+ on_construct = function(pos)
+ local meta = minetest.get_meta(pos)
+ meta:set_string("formspec", "field[channel;Channel;${channel}]")
+ end,
+ on_receive_fields = function(pos, formname, fields, sender)
+ if (fields.channel) then
+ minetest.get_meta(pos):set_string("channel", fields.channel)
+ minetest.get_meta(pos):set_string("state", "Off")
+ end
+ end,
})
minetest.register_node(":streets:trafficlight_top_red",{
- description = S("U cheater U"),
- drop = "",
+ drop = "streets:trafficlight_top_off",
groups = {cracky = 1, not_in_creative_inventory = 1},
paramtype = "light",
paramtype2 = "facedir",
@@ -147,17 +159,21 @@ minetest.register_node(":streets:trafficlight_top_red",{
tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_red.png"},
node_box = {
type = "fixed",
- fixed = {
- {-0.25,-0.5,-0.25,0.25,0.5,0.25}
- }
+ fixed = streets.tlBox
},
- pointable = false,
light_source = 6,
+ digiline = {
+ receptor = {},
+ effector = {
+ action = function(pos, node, channel, msg)
+ streets.on_digiline_receive(pos, node, channel, msg)
+ end
+ }
+ },
})
minetest.register_node(":streets:trafficlight_top_yellow",{
- description = S("U cheater U"),
- drop = "",
+ drop = "streets:trafficlight_top_off",
groups = {cracky = 1, not_in_creative_inventory = 1},
paramtype = "light",
paramtype2 = "facedir",
@@ -166,17 +182,21 @@ minetest.register_node(":streets:trafficlight_top_yellow",{
tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_yellow.png"},
node_box = {
type = "fixed",
- fixed = {
- {-0.25,-0.5,-0.25,0.25,0.5,0.25}
- }
+ fixed = streets.tlBox
},
- pointable = false,
light_source = 6,
+ digiline = {
+ receptor = {},
+ effector = {
+ action = function(pos, node, channel, msg)
+ streets.on_digiline_receive(pos, node, channel, msg)
+ end
+ }
+ },
})
minetest.register_node(":streets:trafficlight_top_redyellow",{
- description = S("U cheater U"),
- drop = "",
+ drop = "streets:trafficlight_top_off",
groups = {cracky = 1, not_in_creative_inventory = 1},
paramtype = "light",
paramtype2 = "facedir",
@@ -185,17 +205,21 @@ minetest.register_node(":streets:trafficlight_top_redyellow",{
tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_redyellow.png"},
node_box = {
type = "fixed",
- fixed = {
- {-0.25,-0.5,-0.25,0.25,0.5,0.25}
- }
+ fixed = streets.tlBox
},
- pointable = false,
light_source = 6,
+ digiline = {
+ receptor = {},
+ effector = {
+ action = function(pos, node, channel, msg)
+ streets.on_digiline_receive(pos, node, channel, msg)
+ end
+ }
+ },
})
minetest.register_node(":streets:trafficlight_top_green",{
- description = S("U cheater U"),
- drop = "",
+ drop = "streets:trafficlight_top_off",
groups = {cracky = 1, not_in_creative_inventory = 1},
paramtype = "light",
paramtype2 = "facedir",
@@ -204,17 +228,21 @@ minetest.register_node(":streets:trafficlight_top_green",{
tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_green.png"},
node_box = {
type = "fixed",
- fixed = {
- {-0.25,-0.5,-0.25,0.25,0.5,0.25}
- }
+ fixed = streets.tlBox
},
- pointable = false,
light_source = 6,
+ digiline = {
+ receptor = {},
+ effector = {
+ action = function(pos, node, channel, msg)
+ streets.on_digiline_receive(pos, node, channel, msg)
+ end
+ }
+ },
})
minetest.register_node(":streets:trafficlight_top_warn",{
- description = S("U cheater U"),
- drop = "",
+ drop = "streets:trafficlight_top_off",
groups = {cracky = 1, not_in_creative_inventory = 1},
paramtype = "light",
paramtype2 = "facedir",
@@ -226,19 +254,33 @@ minetest.register_node(":streets:trafficlight_top_warn",{
}},
node_box = {
type = "fixed",
- fixed = {
- {-0.25,-0.5,-0.25,0.25,0.5,0.25}
- }
+ fixed = streets.tlBox
},
- pointable = false,
light_source = 6,
+ digiline = {
+ receptor = {},
+ effector = {
+ action = function(pos, node, channel, msg)
+ streets.on_digiline_receive(pos, node, channel, msg)
+ end
+ }
+ },
})
minetest.register_craft({
- output = "streets:trafficlight_controller",
+ output = "streets:trafficlight_top_off",
recipe = {
- {"dye:red","",""},
- {"dye:yellow","",""},
- {"dye:green","",""}
+ {"default:steel_ingot", "dye:red", "default:steel_ingot"},
+ {"default:steel_ingot", "dye:yellow", "default:steel_ingot"},
+ {"default:steel_ingot", "dye:green", "default:steel_ingot"}
}
})
+
+minetest.register_craft({
+ output = "streets:digiline_distributor",
+ recipe = {
+ {"", "digilines:wire_std_00000000", ""},
+ {"digilines:wire_std_00000000", "mesecons_luacontroller:luacontroller0000", "digilines:wire_std_00000000"},
+ {"", "digilines:wire_std_00000000", ""}
+ }
+}) \ No newline at end of file
diff --git a/trafficlight/old2new.lua b/trafficlight/old2new.lua
new file mode 100644
index 0000000..51ba9f3
--- /dev/null
+++ b/trafficlight/old2new.lua
@@ -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
+}) \ No newline at end of file