summaryrefslogtreecommitdiff
path: root/streetsmod
diff options
context:
space:
mode:
Diffstat (limited to 'streetsmod')
-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
17 files changed, 62 insertions, 36 deletions
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