summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--streetsawards/depends.txt2
-rw-r--r--streetsawards/init.lua22
-rw-r--r--streetshotfix/depends.txt1
-rw-r--r--streetsmod/init.lua19
m---------streetsmod/libs/smartfs0
-rw-r--r--streetsmod/nodeboxes/trafficlight.nbe18
-rw-r--r--streetsmod/textures/streets_trafficlight_template.pngbin0 -> 470 bytes
-rw-r--r--trafficlight/init.lua139
8 files changed, 65 insertions, 136 deletions
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/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/init.lua b/streetsmod/init.lua
index 2fb517f..86b7e19 100644
--- a/streetsmod/init.lua
+++ b/streetsmod/init.lua
@@ -14,6 +14,10 @@
else
S = function ( s ) return s end
end
+
+-- rubenwardy: smartfs
+ dofile(minetest.get_modpath("streetsmod").."/libs/smartfs/smartfs.lua")
+
-- Create variables and tables
print("Streets: " .. S("Creating variables and tables..."))
streets = {}
@@ -24,6 +28,7 @@
start = os.clock(),
fin = 0
}
+ streets.forms = {}
-- Check for mods which change this mod's beahaviour
print("Streets: " .. S("Checking installed mods..."))
@@ -57,12 +62,21 @@
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)
local mult = 10^(idp or 0)
return math.floor(num * mult + 0.5) / mult
end
+ streets.forms.chatcmd = smartfs.create("streets:chatcmd", function(state)
+ state:size(10,6)
+
+ end)
minetest.register_chatcommand("streets",{
description = S("Check version of your installed StreetsMod and find information"),
func = function(name,param)
@@ -74,8 +88,9 @@
"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]"
+ "label[0,4;Awards installed: " .. tostring(streets.extendedBy.awards) .. "]",
+ "label[0,5;Running version: " .. streets.version .. "]",
+ "label[0,5.5;Load time: " .. round(streets.load.fin - streets.load.start,4) .. "s]"
}))
end
})
diff --git a/streetsmod/libs/smartfs b/streetsmod/libs/smartfs
-Subproject c700a1234606a8b5341611748d70b6578cabc36
+Subproject 847ab09feafc1288a026e00ec0d563fe21ae91f
diff --git a/streetsmod/nodeboxes/trafficlight.nbe b/streetsmod/nodeboxes/trafficlight.nbe
index aa30fc6..7842206 100644
--- a/streetsmod/nodeboxes/trafficlight.nbe
+++ b/streetsmod/nodeboxes/trafficlight.nbe
@@ -5,13 +5,13 @@ 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
+NODEBOX nodebox2 -0.05 0.375 0.32 0.05 0.429368 0.51
+NODEBOX nodebox3 -0.05 0.0625 0.32 0.05 0.125 0.51
+NODEBOX nodebox4 -0.05 -0.25 0.32 0.05 -0.1875 0.51
+NODEBOX nodebox5 0.05 0.32 0.32 0.1 0.38 0.5
+NODEBOX nodebox6 -0.1 0.32 0.32 -0.05 0.38 0.5
+NODEBOX nodebox7 0.05 0.001 0.32 0.1 0.06 0.5
+NODEBOX nodebox8 -0.1 0.001 0.32 -0.05 0.06 0.5
+NODEBOX nodebox9 0.05 -0.31 0.32 0.1 -0.25 0.5
+NODEBOX nodebox10 -0.1 -0.31 0.32 -0.05 -0.25 0.5
END NODE \ No newline at end of file
diff --git a/streetsmod/textures/streets_trafficlight_template.png b/streetsmod/textures/streets_trafficlight_template.png
new file mode 100644
index 0000000..72b6b02
--- /dev/null
+++ b/streetsmod/textures/streets_trafficlight_template.png
Binary files differ
diff --git a/trafficlight/init.lua b/trafficlight/init.lua
index 4704743..8547718 100644
--- a/trafficlight/init.lua
+++ b/trafficlight/init.lua
@@ -1,139 +1,28 @@
--[[
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}
- }
- },
-})
-
-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},
- }
- },
- pointable = false,
-})
-
-minetest.register_node(":streets:trafficlight_controller",{
- description = S("Trafficlight"),
- inventory_image = "streets_trafficlight_inv.png",
- tiles = {"streets_lampcontroller_top.png","streets_lampcontroller_bottom.png","streets_lampcontroller_sides.png"},
- groups = {cracky = 1},
- drawtype = "nodebox",
- paramtype = "light",
- node_box = {
- type = "fixed",
- fixed = {
- {-0.5,-0.5,-0.5,0.5,0.5,0.5},
- {-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","Off")
- meta:set_string("formspec","field[channel;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",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
- }
- }
-})
-
minetest.register_node(":streets:trafficlight_top_off",{
- description = S("U cheater U"),
- drop = "",
- groups = {cracky = 1, not_in_creative_inventory = 1},
+ description = S("Trafficlight"),
+ drawtype="nodebox",
paramtype = "light",
paramtype2 = "facedir",
- 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"},
+ groups = {cracky = 1},
node_box = {
type = "fixed",
fixed = {
- {-0.25,-0.5,-0.25,0.25,0.5,0.25}
+ {-0.1875,-0.5,0.5,0.1875,0.5,0.75}, --nodebox1
+ {-0.05,0.375,0.32,0.05,0.429368,0.51}, --nodebox2
+ {-0.05,0.0625,0.32,0.05,0.125,0.51}, --nodebox3
+ {-0.05,-0.25,0.32,0.05,-0.1875,0.51}, --nodebox4
+ {0.05,0.32,0.32,0.1,0.38,0.5}, --nodebox5
+ {-0.1,0.32,0.32,-0.05,0.38,0.5}, --nodebox6
+ {0.05,0.001,0.32,0.1,0.06,0.5}, --nodebox7
+ {-0.1,0.001,0.32,-0.05,0.06,0.5}, --nodebox8
+ {0.05,-0.31,0.32,0.1,-0.25,0.5}, --nodebox9
+ {-0.1,-0.31,0.32,-0.05,-0.25,0.5}, --nodebox10
}
},
- pointable = false,
+ tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_trafficlight_template.png"},
})
minetest.register_node(":streets:trafficlight_top_red",{