From ead64398f99a1aeb556d45ac6617bc8d4df2bebe Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 24 Jun 2014 16:23:26 +0100 Subject: Update init.lua added a sign register. simply adding signs and also less code overall --- roadsigns/init.lua | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/roadsigns/init.lua b/roadsigns/init.lua index 73401fa..ccb58ea 100644 --- a/roadsigns/init.lua +++ b/roadsigns/init.lua @@ -3,5 +3,40 @@ ]] streets.workshop = {} +streets.workshop.register_sign = function(nodename, desc, img, rrecipe, rtime) + + minetest.register_node(nodename,{ + description = desc, + tiles = img, + inventory_image = img, + wield_image = img, + groups = {snappy = 1,attached_node = 1}, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", desc) + end, + drawtype = "nodebox", + node_box = { + type = "wallmounted", + fixed = { + {-0.4,-0.5,-0.4,0.4,-0.4,0.4} + } + }, + paramtype = "light", + paramtype2 = "wallmounted", + walkable = false, + sunlight_propagates = true, + selection_box = { + type = "wallmounted" + }, + streets = { + signworkshop = { + recipe = rrecipe, + time = rtime + } + } + }) +end + 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 +dofile(minetest.get_modpath(minetest.get_current_modname()) .. "/workshop.lua") -- cgit v1.2.3 From 76ad13c0978a811af1f79b1769f08a56ca4c8511 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 24 Jun 2014 16:36:44 +0100 Subject: Update signs.lua Updated page to conform with the new sign register --- roadsigns/signs.lua | 136 +++------------------------------------------------- 1 file changed, 7 insertions(+), 129 deletions(-) diff --git a/roadsigns/signs.lua b/roadsigns/signs.lua index 03b4139..58adbed 100644 --- a/roadsigns/signs.lua +++ b/roadsigns/signs.lua @@ -1,130 +1,8 @@ -minetest.register_node(":streets:sign_blank",{ - description = streets.S("Empty sign"), - tiles = {"streets_sign_back.png"}, - inventory_image = "streets_sign_back.png", - wield_image = "streets_sign_back.png", - groups = {snappy = 1,attached_node = 1}, - drawtype = "nodebox", - node_box = { - type = "wallmounted", - fixed = { - {-0.4,-0.5,-0.4,0.4,-0.4,0.4} - } - }, - paramtype = "light", - paramtype2 = "wallmounted", - walkable = false, - sunlight_propagates = true, - selection_box = { - type = "wallmounted" - }, - streets = { - signworkshop = { - recipe = {"default:steel_ingot","","",""}, - time = 3 - } - }, - after_place_node = function(pos) - local meta = minetest.get_meta(pos) - - meta:set_string("infotext", streets.S("Empty Sign")) - end -}) -minetest.register_node(":streets: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", - groups = {snappy = 1,attached_node = 1}, - drawtype = "nodebox", - node_box = { - type = "wallmounted", - fixed = { - {-0.4,-0.5,-0.4,0.4,-0.4,0.4} - } - }, - paramtype = "light", - paramtype2 = "wallmounted", - walkable = false, - sunlight_propagates = true, - selection_box = { - type = "wallmounted" - }, - streets = { - signworkshop = { - recipe = {"streets:sign_blank","bucket:bucket_lava","",""}, - time = 5 - } - }, - after_place_node = function(pos) - local meta = minetest.get_meta(pos) - - meta:set_string("infotext", streets.S("Warning: Careful of lava")) - end -}) - -minetest.register_node(":streets: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", - groups = {snappy = 1,attached_node = 1}, - drawtype = "nodebox", - node_box = { - type = "wallmounted", - fixed = { - {-0.4,-0.5,-0.4,0.4,-0.4,0.4} - } - }, - paramtype = "light", - paramtype2 = "wallmounted", - walkable = false, - sunlight_propagates = true, - selection_box = { - type = "wallmounted" - }, - streets = { - signworkshop = { - recipe = {"streets:sign_blank","bucket:bucket_water","",""}, - time = 5 - } - }, - after_place_node = function(pos) - local meta = minetest.get_meta(pos) - - meta:set_string("infotext", streets.S("Warning: Water nearby")) - end -}) +-- example: streets.workshop.register_sign(nodename, desc, img, recipe, time) +streets.workshop.register_sign(":streets:sign_blank", treets.S("Empty sign"), "streets_sign_back.png", {"default:steel_ingot","","",""}, 3) -minetest.register_node(":streets:sign_construction",{ - description = streets.S("Warning sign (Construction area)"), - tiles = {"streets_sign_construction.png"}, - inventory_image = "streets_sign_construction.png", - wield_image = "streets_sign_construction.png", - groups = {snappy = 1,attached_node = 1}, - drawtype = "nodebox", - node_box = { - type = "wallmounted", - fixed = { - {-0.4,-0.5,-0.4,0.4,-0.4,0.4} - } - }, - paramtype = "light", - paramtype2 = "wallmounted", - walkable = false, - sunlight_propagates = true, - selection_box = { - type = "wallmounted" - }, - streets = { - signworkshop = { - recipe = {"streets:sign_blank","default:dirt","",""}, - time = 5 - } - }, - after_place_node = function(pos) - local meta = minetest.get_meta(pos) - - meta:set_string("infotext", streets.S("Warning: Construction area, possible deep excavations")) - end -}) +streets.workshop.register_sign(":streets:sign_lava", streets.S("Warning sign (lava)"), "streets_sign_lava.png", {"streets:sign_blank","bucket:bucket_lava","",""}, 5) + +streets.workshop.register_sign(":streets:sign_water", streets.S("Warning sign (water)"), "streets_sign_water.png", {"streets:sign_blank","bucket:bucket_water","",""}, 5) + +streets.workshop.register_sign(":streets:sign_construction", streets.S("Warning sign (Construction area)"), "streets_sign_construction.png", {"streets:sign_blank","default:dirt","",""}, 5) -- cgit v1.2.3 From 5c24ba52ba4448094cf1b51494eb994f1cbc6567 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 24 Jun 2014 17:47:32 +0100 Subject: Added some new signs Added new signs with textures and also replaced asphalt texture with a much cleaner softer texture --- roadsigns/signs.lua | 9 +++++++++ streetsmod/textures/Thumbs.db | Bin 0 -> 291840 bytes streetsmod/textures/streets_asphalt.png | Bin 8955 -> 5993 bytes streetsmod/textures/streets_sign_grasswalk.png | Bin 0 -> 21692 bytes streetsmod/textures/streets_sign_mine.png | Bin 0 -> 2412 bytes streetsmod/textures/streets_sign_shop.png | Bin 0 -> 2664 bytes streetsmod/textures/streets_sign_workshop.png | Bin 0 -> 2320 bytes 7 files changed, 9 insertions(+) create mode 100644 streetsmod/textures/Thumbs.db create mode 100644 streetsmod/textures/streets_sign_grasswalk.png create mode 100644 streetsmod/textures/streets_sign_mine.png create mode 100644 streetsmod/textures/streets_sign_shop.png create mode 100644 streetsmod/textures/streets_sign_workshop.png diff --git a/roadsigns/signs.lua b/roadsigns/signs.lua index 58adbed..d5d8ee1 100644 --- a/roadsigns/signs.lua +++ b/roadsigns/signs.lua @@ -6,3 +6,12 @@ streets.workshop.register_sign(":streets:sign_lava", streets.S("Warning sign (la streets.workshop.register_sign(":streets:sign_water", streets.S("Warning sign (water)"), "streets_sign_water.png", {"streets:sign_blank","bucket:bucket_water","",""}, 5) streets.workshop.register_sign(":streets:sign_construction", streets.S("Warning sign (Construction area)"), "streets_sign_construction.png", {"streets:sign_blank","default:dirt","",""}, 5) + + +streets.workshop.register_sign(":streets:sign_mine", streets.S("Notice sign (Public Mine Ahead)"), "streets_sign_mine.png", {"streets:sign_blank","default:dirt","",""}, 5) + +streets.workshop.register_sign(":streets:sign_shop", streets.S("Notice sign (Shop/Mall Ahead)"), "streets_sign_construction.png", {"streets:sign_blank","default:dirt","",""}, 5) + +streets.workshop.register_sign(":streets:sign_workshop", streets.S("Notice sign (Public Workshop Ahead)"), "streets_sign_workshop.png", {"streets:sign_blank","default:dirt","",""}, 5) + +streets.workshop.register_sign(":streets:sign_grasswalk", streets.S("Warning sign (No walking on the grass)"), "streets_sign_grasswalk.png", {"streets:sign_blank","default:dirt","",""}, 5) diff --git a/streetsmod/textures/Thumbs.db b/streetsmod/textures/Thumbs.db new file mode 100644 index 0000000..e4d9f4f Binary files /dev/null and b/streetsmod/textures/Thumbs.db differ diff --git a/streetsmod/textures/streets_asphalt.png b/streetsmod/textures/streets_asphalt.png index 9210759..1841635 100644 Binary files a/streetsmod/textures/streets_asphalt.png and b/streetsmod/textures/streets_asphalt.png differ diff --git a/streetsmod/textures/streets_sign_grasswalk.png b/streetsmod/textures/streets_sign_grasswalk.png new file mode 100644 index 0000000..1a72dff Binary files /dev/null and b/streetsmod/textures/streets_sign_grasswalk.png differ diff --git a/streetsmod/textures/streets_sign_mine.png b/streetsmod/textures/streets_sign_mine.png new file mode 100644 index 0000000..92aaf97 Binary files /dev/null and b/streetsmod/textures/streets_sign_mine.png differ diff --git a/streetsmod/textures/streets_sign_shop.png b/streetsmod/textures/streets_sign_shop.png new file mode 100644 index 0000000..b30ea8e Binary files /dev/null and b/streetsmod/textures/streets_sign_shop.png differ diff --git a/streetsmod/textures/streets_sign_workshop.png b/streetsmod/textures/streets_sign_workshop.png new file mode 100644 index 0000000..3c399bc Binary files /dev/null and b/streetsmod/textures/streets_sign_workshop.png differ -- cgit v1.2.3