summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwebdesigner97 <Christian_D_97@gmx.de>2014-05-27 18:53:36 +0200
committerwebdesigner97 <Christian_D_97@gmx.de>2014-05-27 18:53:36 +0200
commit7480f644e291f651ff9fa04b77308f824e215b09 (patch)
treee70edf5bd18ef37804c7d0cdb523f34a4919dd16
parentb514e6b921c32da4ffca62aad75cb44b4b322061 (diff)
downloadroads-7480f644e291f651ff9fa04b77308f824e215b09.tar
roads-7480f644e291f651ff9fa04b77308f824e215b09.tar.gz
roads-7480f644e291f651ff9fa04b77308f824e215b09.tar.bz2
roads-7480f644e291f651ff9fa04b77308f824e215b09.tar.xz
roads-7480f644e291f651ff9fa04b77308f824e215b09.zip
make signs more flexible and easier to add new ones
-rw-r--r--roadsigns/init.lua2
-rw-r--r--roadsigns/workshop.lua17
2 files changed, 15 insertions, 4 deletions
diff --git a/roadsigns/init.lua b/roadsigns/init.lua
index 96646b3..73401fa 100644
--- a/roadsigns/init.lua
+++ b/roadsigns/init.lua
@@ -1,5 +1,7 @@
--[[
StreetsMod: Poles and signs
]]
+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/workshop.lua b/roadsigns/workshop.lua
index 815b9ff..b693222 100644
--- a/roadsigns/workshop.lua
+++ b/roadsigns/workshop.lua
@@ -45,6 +45,16 @@ local forms = {
--
}
}
+
+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 = 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"},
@@ -60,10 +70,9 @@ 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",streets.S("Sign workshop idle"))
meta:set_string("idle","y")