diff --git a/basic_signs/init.lua b/basic_signs/init.lua index 4bb474cf..083f75f2 100644 --- a/basic_signs/init.lua +++ b/basic_signs/init.lua @@ -9,20 +9,6 @@ dofile(basic_signs.path .. "/crafting.lua") local S, NS = dofile(basic_signs.path .. "/intllib.lua") basic_signs.gettext = S -local cbox - --- array : color, translated color, default text color -local sign_colors = { - {"green", S("green"), "f"}, - {"yellow", S("yellow"), "0"}, - {"red", S("red"), "f"}, - {"white_red", S("white_red"), "4"}, - {"white_black", S("white_black"), "0"}, - {"orange", S("orange"), "0"}, - {"blue", S("blue"), "f"}, - {"brown", S("brown"), "f"}, -} - function basic_signs.determine_sign_type(pos, placer, itemstack, pointed_thing) local playername = placer:get_player_name() local pt_name = minetest.get_node(pointed_thing.under).name @@ -57,137 +43,66 @@ function basic_signs.determine_sign_type(pos, placer, itemstack, pointed_thing) return itemstack end -for _, onpole in ipairs({"", "_onpole"}) do +minetest.override_item("default:sign_wall_wood", { + after_place_node = basic_signs.determine_sign_type +}) - local nci = nil - local pole_mount_tex = nil +signs_lib.register_sign("basic_signs:sign_wall_locked", { + description = S("Locked Sign"), + tiles = { + "basic_signs_sign_wall_locked.png", + "signs_lib_sign_wall_steel_edges.png", + }, + inventory_image = "basic_signs_sign_wall_locked_inv.png", + locked = true, + entity_info = "standard", +}) - if onpole == "_onpole" then - nci = 1 - pole_mount_tex = "signs_lib_pole_mount.png" -- the metal straps on back, if needed - end +minetest.register_alias("locked_sign:sign_wall_locked", "basic_signs:sign_wall_locked") - local wood_groups = table.copy(signs_lib.standard_wood_groups) - wood_groups.not_in_creative_inventory = nci - local steel_groups = table.copy(signs_lib.standard_steel_groups) - steel_groups.not_in_creative_inventory = nci +-- array : color, translated color, default text color - cbox = signs_lib.make_selection_boxes(35, 25, onpole) +local sign_colors = { + {"green", S("green"), "f"}, + {"yellow", S("yellow"), "0"}, + {"red", S("red"), "f"}, + {"white_red", S("white_red"), "4"}, + {"white_black", S("white_black"), "0"}, + {"orange", S("orange"), "0"}, + {"blue", S("blue"), "f"}, + {"brown", S("brown"), "f"}, +} - minetest.override_item("default:sign_wall_wood"..onpole, { - after_place_node = basic_signs.determine_sign_type - }) +local cbox = signs_lib.make_selection_boxes(35, 25, true, 0, 0, 0, true) - minetest.register_node("basic_signs:sign_wall_locked"..onpole, { - description = S("Locked Sign"), - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, +for i, color in ipairs(sign_colors) do + signs_lib.register_sign("basic_signs:sign_wall_steel_"..color[1], { + description = S("Sign (@1, steel)", color[2]), + paramtype2 = "facedir", selection_box = cbox, - mesh = "signs_lib_standard_wall_sign"..onpole..".obj", + mesh = "signs_lib_standard_wall_sign_facedir.obj", tiles = { - "basic_signs_sign_wall_locked.png", + "basic_signs_steel_"..color[1]..".png", "signs_lib_sign_wall_steel_edges.png", - pole_mount_tex }, - inventory_image = "basic_signs_sign_wall_locked_inv.png", - wield_image = "basic_signs_sign_wall_locked_inv.png", - groups = wood_groups, - default_color = "0", - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - after_place_node = function(pos, placer, itemstack, pointed_thing) - signs_lib.after_place_node(pos, placer, itemstack, pointed_thing, true) - end, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - can_dig = signs_lib.can_modify, - on_rotate = signs_lib.wallmounted_rotate, - number_of_lines = signs_lib.standard_lines, - horiz_scaling = signs_lib.standard_hscale, - vert_scaling = signs_lib.standard_vscale, - line_spacing = signs_lib.standard_lspace, - font_size = signs_lib.standard_fsize, - x_offset = signs_lib.standard_xoffs, - y_offset = signs_lib.standard_yoffs, - chars_per_line = signs_lib.standard_cpl, + inventory_image = "basic_signs_steel_"..color[1].."_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, + default_color = color[3], entity_info = { - mesh = "signs_lib_standard_wall_sign_entity"..onpole..".obj", - yaw = signs_lib.wallmounted_yaw + mesh = "signs_lib_standard_wall_sign_entity.obj", + yaw = signs_lib.standard_yaw }, - drop = "basic_signs:sign_wall_locked" }) - table.insert(signs_lib.lbm_restore_nodes, "basic_signs:sign_wall_locked"..onpole) - table.insert(signs_lib.lbm_restore_nodes, "locked_sign:sign_wall_locked"..onpole) - minetest.register_alias("locked_sign:sign_wall_locked", "basic_signs:sign_wall_locked") - - cbox = signs_lib.make_selection_boxes(35, 25, onpole, 0, 0, 0, true) - - for i, color in ipairs(sign_colors) do - minetest.register_node("basic_signs:sign_wall_steel_"..color[1]..onpole, { - description = S("Sign (@1, steel)", color[2]), - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "facedir", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "signs_lib_standard_wall_sign_facedir"..onpole..".obj", - tiles = { - "basic_signs_steel_"..color[1]..".png", - "signs_lib_sign_wall_steel_edges.png", - pole_mount_tex - }, - inventory_image = "basic_signs_steel_"..color[1].."_inv.png", - wield_image = "basic_signs_steel_"..color[1].."_inv.png", - groups = steel_groups, - default_color = color[3], - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - after_place_node = signs_lib.after_place_node, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - on_rotate = signs_lib.facedir_rotate, - number_of_lines = signs_lib.standard_lines, - horiz_scaling = signs_lib.standard_hscale, - vert_scaling = signs_lib.standard_vscale, - line_spacing = signs_lib.standard_lspace, - font_size = signs_lib.standard_fsize, - x_offset = signs_lib.standard_xoffs, - y_offset = signs_lib.standard_yoffs, - chars_per_line = signs_lib.standard_cpl, - entity_info = { - mesh = "signs_lib_standard_wall_sign_entity"..onpole..".obj", - yaw = signs_lib.standard_yaw - }, - drop = "basic_signs:sign_wall_steel_"..color[1] - }) - table.insert(signs_lib.lbm_restore_nodes, "basic_signs:sign_wall_steel_"..color[1]..onpole) - table.insert(signs_lib.lbm_restore_nodes, "signs:sign_wall_"..color[1]..onpole) - - minetest.register_alias("signs:sign_wall_"..color[1], "basic_signs:sign_wall_steel_"..color[1]) - - end + table.insert(signs_lib.lbm_restore_nodes, "signs:sign_wall_"..color[1]) + minetest.register_alias("signs:sign_wall_"..color[1], "basic_signs:sign_wall_steel_"..color[1]) end -cbox = signs_lib.make_selection_boxes(35, 34.5, false, 0, -1.25, -19.69, true) - -local nci_wood_groups = table.copy(signs_lib.standard_wood_groups) -nci_wood_groups.not_in_creative_inventory = 1 - -minetest.register_node("basic_signs:yard_sign", { +signs_lib.register_sign("basic_signs:yard_sign", { description = "Wooden yard sign", - paramtype = "light", - sunlight_propagates = true, paramtype2 = "facedir", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, + selection_box = signs_lib.make_selection_boxes(35, 34.5, false, 0, -1.25, -19.69, true), mesh = "basic_signs_yard_sign.obj", tiles = { "signs_lib_sign_wall_wooden.png", @@ -195,44 +110,18 @@ minetest.register_node("basic_signs:yard_sign", { "default_wood.png" }, inventory_image = "default_sign_wood.png", - wield_image = "default_sign_wood.png", - groups = nci_wood_groups, - default_color = "0", - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - after_place_node = signs_lib.after_place_node, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - on_rotate = signs_lib.facedir_rotate, - number_of_lines = signs_lib.standard_lines, - horiz_scaling = signs_lib.standard_hscale, - vert_scaling = signs_lib.standard_vscale, - line_spacing = signs_lib.standard_lspace, - font_size = signs_lib.standard_fsize, - x_offset = signs_lib.standard_xoffs, - y_offset = signs_lib.standard_yoffs, - chars_per_line = signs_lib.standard_cpl, entity_info = { mesh = "basic_signs_yard_sign_entity.obj", yaw = signs_lib.standard_yaw }, - drop = "default:sign_wall_wood" + drop = "default:sign_wall_wood", + allow_onpole = false }) -table.insert(signs_lib.lbm_restore_nodes, "basic_signs:yard_sign") -table.insert(signs_lib.lbm_restore_nodes, "signs:sign_yard") -minetest.register_alias("signs:sign_yard", "basic_signs:yard_sign") -cbox = signs_lib.make_selection_boxes(35, 32, false, 0, 3, -18.5, true) - -minetest.register_node("basic_signs:hanging_sign", { +signs_lib.register_sign("basic_signs:hanging_sign", { description = "Wooden sign, hanging", - paramtype = "light", - sunlight_propagates = true, paramtype2 = "facedir", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, + selection_box = signs_lib.make_selection_boxes(35, 32, false, 0, 3, -18.5, true), mesh = "basic_signs_hanging_sign.obj", tiles = { "signs_lib_sign_wall_wooden.png", @@ -240,36 +129,16 @@ minetest.register_node("basic_signs:hanging_sign", { "basic_signs_ceiling_hangers.png" }, inventory_image = "default_sign_wood.png", - wield_image = "default_sign_wood.png", - groups = nci_wood_groups, - default_color = "0", - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - after_place_node = signs_lib.after_place_node, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - on_rotate = signs_lib.facedir_rotate, - number_of_lines = signs_lib.standard_lines, - horiz_scaling = signs_lib.standard_hscale, - vert_scaling = signs_lib.standard_vscale, - line_spacing = signs_lib.standard_lspace, - font_size = signs_lib.standard_fsize, - x_offset = signs_lib.standard_xoffs, - y_offset = signs_lib.standard_yoffs, - chars_per_line = signs_lib.standard_cpl, entity_info = { mesh = "basic_signs_hanging_sign_entity.obj", yaw = signs_lib.standard_yaw }, - drop = "default:sign_wall_wood" + drop = "default:sign_wall_wood", + allow_onpole = false }) -table.insert(signs_lib.lbm_restore_nodes, "basic_signs:hanging_sign") + +table.insert(signs_lib.lbm_restore_nodes, "signs:sign_yard") table.insert(signs_lib.lbm_restore_nodes, "signs:sign_hanging") +minetest.register_alias("signs:sign_yard", "basic_signs:yard_sign") minetest.register_alias("signs:sign_hanging", "basic_signs:hanging_sign") --- insert the old wood sign-on-fencepost into signs_lib's conversion LBM - -table.insert(signs_lib.old_fenceposts_with_signs, "signs:sign_post") -signs_lib.old_fenceposts["signs:sign_post"] = "default:fence_wood" -signs_lib.old_fenceposts_replacement_signs["signs:sign_post"] = "default:sign_wall_wood_onpole" diff --git a/basic_signs/models/basic_signs_hanging_sign_entity.obj b/basic_signs/models/basic_signs_hanging_sign_entity.obj index af87e96a..34fa86b4 100644 --- a/basic_signs/models/basic_signs_hanging_sign_entity.obj +++ b/basic_signs/models/basic_signs_hanging_sign_entity.obj @@ -1,10 +1,10 @@ # Blender v2.79 (sub 0) OBJ File: 'basic_signs wooden hanging sign.blend' # www.blender.org o Plane -v 0.406250 -0.281250 -0.039062 -v -0.406250 -0.281250 -0.039062 -v 0.406250 0.281250 -0.039063 -v -0.406250 0.281250 -0.039063 +v 0.406250 -0.281250 -0.042969 +v -0.406250 -0.281250 -0.042969 +v 0.406250 0.281250 -0.042969 +v -0.406250 0.281250 -0.042969 vt 0.000000 0.000000 vt 1.000000 0.000000 vt 1.000000 1.000000 diff --git a/basic_signs/models/basic_signs_yard_sign_entity.obj b/basic_signs/models/basic_signs_yard_sign_entity.obj index 0ec6f73c..fde001b9 100644 --- a/basic_signs/models/basic_signs_yard_sign_entity.obj +++ b/basic_signs/models/basic_signs_yard_sign_entity.obj @@ -1,10 +1,10 @@ # Blender v2.79 (sub 0) OBJ File: 'basic_signs wooden yard sign.blend' # www.blender.org o Plane -v 0.406250 -0.218750 -0.070312 -v -0.406250 -0.218750 -0.070312 -v 0.406250 0.343750 -0.070313 -v -0.406250 0.343750 -0.070313 +v 0.406250 -0.218750 -0.074219 +v -0.406250 -0.218750 -0.074219 +v 0.406250 0.343750 -0.074219 +v -0.406250 0.343750 -0.074219 vt 0.000000 0.000000 vt 1.000000 0.000000 vt 1.000000 1.000000 diff --git a/digistuff/README b/digistuff/README index 617705a0..79f68c76 100644 --- a/digistuff/README +++ b/digistuff/README @@ -10,7 +10,8 @@ Textures WITH "adwaita" in the file name - These are icons by the GNOME Project, Depends: Required: digilines (base only) and mesecons (base only) -Only needed for craft recipes: default, mesecons_luacontroller, basic_materials +Optional: mesecons_noteblock (for digilines noteblock), mesecons_mvps (for digilines piston), mesecons_luacontroller (for I/O expander) +Only needed for craft recipes: default, basic_materials How to use digilines buttons: @@ -66,3 +67,7 @@ Send a number representing a time in seconds, from 0.5 to 3600. When the time ex How to use the junction box: These are just plain digilines conductors (like digimese) but can skip over one node to another junction box or certain other nodes. As in, [digiline][junction box][dirt][junction box][digiline] will work to transmit signals "through" the dirt. + +How to use the I/O expander: +After setting a channel, send a table (same format as a Luacontroller's "port" table) to set the output states. +A table in this same format will be sent back whenever an input changes or you manually poll it by sending a "GET" message. diff --git a/digistuff/init.lua b/digistuff/init.lua index 4f336b41..4df2e65e 100644 --- a/digistuff/init.lua +++ b/digistuff/init.lua @@ -14,6 +14,9 @@ local components = { "piston", "timer", } + +if minetest.get_modpath("mesecons_luacontroller") then table.insert(components,"ioexpander") end + for _,name in ipairs(components) do dofile(string.format("%s%s%s.lua",minetest.get_modpath(minetest.get_current_modname()),DIR_DELIM,name)) end diff --git a/digistuff/ioexpander.lua b/digistuff/ioexpander.lua new file mode 100644 index 00000000..7e257720 --- /dev/null +++ b/digistuff/ioexpander.lua @@ -0,0 +1,176 @@ +local explode_port_states = function(state) + local port = {} + port.a = state%2 == 1 + port.b = state%4 >= 2 + port.c = state%8 >= 4 + port.d = state%16 >= 8 + return port +end + +local implode_port_states = function(port) + local state = 0 + if port.a then state = state + 1 end + if port.b then state = state + 2 end + if port.c then state = state + 4 end + if port.d then state = state + 8 end + return state +end + +local gettiles = function(state) + tiles = { + "digistuff_ioexp_top.png", + "jeija_microcontroller_bottom.png", + "jeija_microcontroller_sides.png", + "jeija_microcontroller_sides.png", + "jeija_microcontroller_sides.png", + "jeija_microcontroller_sides.png" + } + local port = explode_port_states(state) + for p,v in pairs(port) do + if v then + tiles[1] = tiles[1].."^jeija_luacontroller_LED_"..string.upper(p)..".png" + end + end + return tiles +end + +local ioexp_get_on_rules = function(state) + local port = explode_port_states(state) + local rules = {} + if port.a then table.insert(rules,vector.new(-1,0,0)) end + if port.b then table.insert(rules,vector.new(0,0,1)) end + if port.c then table.insert(rules,vector.new(1,0,0)) end + if port.d then table.insert(rules,vector.new(0,0,-1)) end + return rules +end + +local ioexp_get_off_rules = function(state) + local port = explode_port_states(state) + local rules = {} + if not port.a then table.insert(rules,vector.new(-1,0,0)) end + if not port.b then table.insert(rules,vector.new(0,0,1)) end + if not port.c then table.insert(rules,vector.new(1,0,0)) end + if not port.d then table.insert(rules,vector.new(0,0,-1)) end + return rules +end + +local ioexp_digiline_send = function(pos) + local meta = minetest.get_meta(pos) + local channel = meta:get_string("channel") + local port = { + a = meta:get_int("aon") == 1, + b = meta:get_int("bon") == 1, + c = meta:get_int("con") == 1, + d = meta:get_int("don") == 1, + } + local outstate = explode_port_states(meta:get_int("outstate")) + for k,v in pairs(outstate) do port[k] = port[k] or v end + digiline:receptor_send(pos,digiline.rules.default,channel,port) +end + +local ioexp_handle_digilines = function(pos,node,channel,msg) + local meta = minetest.get_meta(pos) + if channel ~= meta:get_string("channel") then return end + if msg == "GET" then + ioexp_digiline_send(pos) + return + end + if type(msg) ~= "table" then return end + local state = implode_port_states(msg) + node.name = "digistuff:ioexpander_"..state + meta:set_int("outstate",state) + minetest.swap_node(pos,node) + for _,i in ipairs(ioexp_get_on_rules(state)) do + mesecon.receptor_on(pos,{i}) + end + for _,i in ipairs(ioexp_get_off_rules(state)) do + mesecon.receptor_off(pos,{i}) + end +end + +local ioexp_rule_to_port = function(rule) + if rule.x < 0 then return "a" + elseif rule.z > 0 then return "b" + elseif rule.x > 0 then return "c" + elseif rule.z < 0 then return "d" end +end + +local ioexp_handle_mesecons = function(pos,_,rule,state) + local meta = minetest.get_meta(pos) + local port = ioexp_rule_to_port(rule) + if not port then return end + local meta = minetest.get_meta(pos) + meta:set_int(port.."on",state == "on" and 1 or 0) + ioexp_digiline_send(pos) +end + +for i=0,15,1 do + local offstate = i == 0 + minetest.register_node("digistuff:ioexpander_"..i, { + description = offstate and "Digilines I/O Expander" or string.format("Digilines I/O Expander (on state %X - you hacker you!)",i), + groups = offstate and {cracky = 3,} or {cracky = 3,not_in_creative_inventory = 1,}, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec","field[channel;Channel;${channel}") + meta:set_int("aon",0) + meta:set_int("bon",0) + meta:set_int("con",0) + meta:set_int("don",0) + meta:set_int("outstate",i) + end, + tiles = gettiles(i), + inventory_image = "digistuff_ioexp_top.png", + drawtype = "nodebox", + drop = "digistuff:ioexpander_0", + selection_box = { + --From luacontroller + type = "fixed", + fixed = { -8/16, -8/16, -8/16, 8/16, -5/16, 8/16 }, + }, + node_box = { + --From Luacontroller + type = "fixed", + fixed = { + {-8/16, -8/16, -8/16, 8/16, -7/16, 8/16}, -- Bottom slab + {-5/16, -7/16, -5/16, 5/16, -6/16, 5/16}, -- Circuit board + {-3/16, -6/16, -3/16, 3/16, -5/16, 3/16}, -- IC + } + }, + paramtype = "light", + sunlight_propagates = true, + on_receive_fields = function(pos, formname, fields, sender) + local name = sender:get_player_name() + if minetest.is_protected(pos,name) and not minetest.check_player_privs(name,{protection_bypass=true}) then + minetest.record_protection_violation(pos,name) + return + end + local meta = minetest.get_meta(pos) + if fields.channel then meta:set_string("channel",fields.channel) end + end, + mesecons = { + effector = { + rules = ioexp_get_off_rules(i), + action_change = ioexp_handle_mesecons, + }, + receptor = { + state = mesecon.state.on, + rules = ioexp_get_on_rules(i), + }, + }, + digiline = { + receptor = {}, + effector = { + action = ioexp_handle_digilines, + }, + }, + }) +end + +minetest.register_craft({ + output = "digistuff:ioexpander_0", + recipe = { + {"","mesecons:wire_00000000_off","",}, + {"digilines:wire_std_00000000","basic_materials:silicon","mesecons:wire_00000000_off",}, + {"","mesecons:wire_00000000_off","",}, + } +}) diff --git a/digistuff/textures/digistuff_ioexp_top.png b/digistuff/textures/digistuff_ioexp_top.png new file mode 100644 index 00000000..0b8ee3e5 Binary files /dev/null and b/digistuff/textures/digistuff_ioexp_top.png differ diff --git a/signs_lib/api.lua b/signs_lib/api.lua index 9b481cc4..c88f5760 100644 --- a/signs_lib/api.lua +++ b/signs_lib/api.lua @@ -15,11 +15,19 @@ signs_lib.standard_vscale = 1 signs_lib.standard_lspace = 1 signs_lib.standard_fsize = 15 signs_lib.standard_xoffs = 4 -signs_lib.standard_yoffs = 2 +signs_lib.standard_yoffs = 0 signs_lib.standard_cpl = 35 -signs_lib.standard_wood_groups = {sign = 1, choppy = 2, flammable = 2, oddly_breakable_by_hand = 3} -signs_lib.standard_steel_groups = {sign = 1, cracky = 2, oddly_breakable_by_hand = 3} +signs_lib.standard_wood_groups = table.copy(minetest.registered_items["default:sign_wall_wood"].groups) +signs_lib.standard_wood_groups.sign = 1 +signs_lib.standard_wood_groups.attached_node = nil + +signs_lib.standard_steel_groups = table.copy(minetest.registered_items["default:sign_wall_steel"].groups) +signs_lib.standard_steel_groups.sign = 1 +signs_lib.standard_steel_groups.attached_node = nil + +signs_lib.standard_wood_sign_sounds = table.copy(minetest.registered_items["default:sign_wall_wood"].sounds) +signs_lib.standard_steel_sign_sounds = table.copy(minetest.registered_items["default:sign_wall_steel"].sounds) signs_lib.standard_yaw = { 0, @@ -561,7 +569,7 @@ minetest.register_entity("signs_lib:text", { -- make selection boxes -- sizex/sizey specified in inches because that's what MUTCD uses. -function signs_lib.make_selection_boxes(sizex, sizey, onpole, xoffs, yoffs, zoffs, fdir) +function signs_lib.make_selection_boxes(sizex, sizey, foo, xoffs, yoffs, zoffs, is_facedir) local tx = (sizex * 0.0254 ) / 2 local ty = (sizey * 0.0254 ) / 2 @@ -569,34 +577,18 @@ function signs_lib.make_selection_boxes(sizex, sizey, onpole, xoffs, yoffs, zoff local yo = yoffs and yoffs * 0.0254 or 0 local zo = zoffs and zoffs * 0.0254 or 0 - if onpole == "_onpole" then - if not fdir then - return { - type = "wallmounted", - wall_side = { -0.5 - 0.3125 + zo, -ty + yo, -tx + xo, -0.4375 - 0.3125 + zo, ty + yo , tx + xo }, - wall_top = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }, - wall_bottom = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }, - } - else - return { - type = "fixed", - fixed = { -tx + xo, -ty + yo, 0.5 + 0.3125 + zo, tx + xo, ty + yo, 0.4375 + 0.3125 + zo } - } - end + if not is_facedir then + return { + type = "wallmounted", + wall_side = { -0.5 + zo, -ty + yo, -tx + xo, -0.4375 + zo, ty + yo, tx + xo }, + wall_top = { -tx - xo, 0.5 + zo, -ty + yo, tx - xo, 0.4375 + zo, ty + yo}, + wall_bottom = { -tx - xo, -0.5 + zo, -ty + yo, tx - xo, -0.4375 + zo, ty + yo } + } else - if not fdir then - return { - type = "wallmounted", - wall_side = { -0.5 + zo, -ty + yo, -tx + xo, -0.4375 + zo, ty + yo, tx + xo }, - wall_top = { -tx - xo, 0.5 + zo, -ty + yo, tx - xo, 0.4375 + zo, ty + yo}, - wall_bottom = { -tx - xo, -0.5 + zo, -ty + yo, tx - xo, -0.4375 + zo, ty + yo } - } - else - return { - type = "fixed", - fixed = { -tx + xo, -ty + yo, 0.5 + zo, tx + xo, ty + yo, 0.4375 + zo} - } - end + return { + type = "fixed", + fixed = { -tx + xo, -ty + yo, 0.5 + zo, tx + xo, ty + yo, 0.4375 + zo} + } end end @@ -605,9 +597,6 @@ function signs_lib.check_for_pole(pos, pointed_thing) local pnode = minetest.get_node(ppos) local pdef = minetest.registered_items[pnode.name] - print(dump(pos)) - print(dump(ppos)) - if (signs_lib.allowed_poles[pnode.name] or (pdef and pdef.drawtype == "fencelike") or string.find(pnode.name, "default:fence_") @@ -618,18 +607,19 @@ function signs_lib.check_for_pole(pos, pointed_thing) ) and (pos.x ~= ppos.x or pos.z ~= ppos.z) then - print("signs_lib.check_for_pole returned true") return true end end function signs_lib.after_place_node(pos, placer, itemstack, pointed_thing, locked) + local playername = placer:get_player_name() + local def = minetest.registered_items[itemstack:get_name()] + local ppos = minetest.get_pointed_thing_position(pointed_thing) local pnode = minetest.get_node(ppos) local pdef = minetest.registered_items[pnode.name] - local playername = placer:get_player_name() - if signs_lib.check_for_pole(pos, pointed_thing) then + if (def.allow_onpole ~= false) and signs_lib.check_for_pole(pos, pointed_thing) then local node = minetest.get_node(pos) minetest.swap_node(pos, {name = itemstack:get_name().."_onpole", param2 = node.param2}) end @@ -644,6 +634,154 @@ function signs_lib.register_fence_with_sign() minetest.log("warning", "[signs_lib] ".."Attempt to call no longer used function signs_lib.register_fence_with_sign()") end +--[[ +The main sign registration function +=================================== + +Example minimal recommended def for writable signs: + +signs_lib.register_sign("foo:my_cool_sign", { + description = "Wooden cool sign", + inventory_image = "signs_lib_sign_cool_inv.png", + tiles = { + "signs_lib_sign_cool.png", + "signs_lib_sign_cool_edges.png" + }, + number_of_lines = 2, + horiz_scaling = 0.8, + vert_scaling = 1, + line_spacing = 9, + font_size = 31, + x_offset = 7, + y_offset = 4, + chars_per_line = 40, + entity_info = "standard" +}) + +* default def assumes a wallmounted sign with on-pole being allowed. + +*For signs that can't support onpole, include in the def: + allow_onpole = false, + +* "standard" entity info implies the standard wood/steel sign model, in + wallmounted mode. For facedir signs using the standard model, use: + + entity_info = { + mesh = "signs_lib_standard_wall_sign_entity.obj", + yaw = signs_lib.standard_yaw + }, + +]]-- + +function signs_lib.register_sign(name, rdef) + + local def = table.copy(rdef) + + if rdef.entity_info == "standard" then + def.entity_info = { + mesh = "signs_lib_standard_wall_sign_entity.obj", + yaw = signs_lib.wallmounted_yaw + } + elseif rdef.entity_info then + def.entity_info = rdef.entity_info + end + + if rdef.entity_info then + def.on_rightclick = rdef.on_rightclick or signs_lib.construct_sign + def.on_construct = rdef.on_construct or signs_lib.construct_sign + def.on_destruct = rdef.on_destruct or signs_lib.destruct_sign + def.on_receive_fields = rdef.on_receive_fields or signs_lib.receive_fields + def.on_punch = rdef.on_punch or signs_lib.update_sign + def.number_of_lines = rdef.number_of_lines or signs_lib.standard_lines + def.horiz_scaling = rdef.horiz_scaling or signs_lib.standard_hscale + def.vert_scaling = rdef.vert_scaling or signs_lib.standard_vscale + def.line_spacing = rdef.line_spacing or signs_lib.standard_lspace + def.font_size = rdef.font_size or signs_lib.standard_fsize + def.x_offset = rdef.x_offset or signs_lib.standard_xoffs + def.y_offset = rdef.y_offset or signs_lib.standard_yoffs + def.chars_per_line = rdef.chars_per_line or signs_lib.standard_cpl + def.default_color = rdef.default_color or "0" + if rdef.locked and not rdef.after_place_node then + def.after_place_node = function(pos, placer, itemstack, pointed_thing) + signs_lib.after_place_node(pos, placer, itemstack, pointed_thing, true) + end + else + def.after_place_node = rdef.after_place_node or signs_lib.after_place_node + end + end + + def.paramtype = rdef.paramtype or "light" + def.paramtype2 = rdef.paramtype2 or "wallmounted" + def.drawtype = rdef.drawtype or "mesh" + def.mesh = rdef.mesh or "signs_lib_standard_wall_sign.obj" + def.wield_image = rdef.wield_image or def.inventory_image + def.drop = rdef.drop or name + def.sounds = rdef.sounds or signs_lib.standard_wood_sign_sounds + def.on_rotate = rdef.on_rotate or signs_lib.wallmounted_rotate + + if rdef.on_rotate then + def.on_rotate = rdef.on_rotate + elseif rdef.drawtype == "wallmounted" then + def.on_rotate = signs_lib.wallmounted_rotate + else + def.on_rotate = signs_lib.facedir_rotate + end + + if rdef.groups then + def.groups = rdef.groups + else + def.groups = signs_lib.standard_wood_groups + end + + local cbox = signs_lib.make_selection_boxes(35, 25, allow_onpole) + + def.selection_box = rdef.selection_box or cbox + def.node_box = table.copy(rdef.node_box or rdef.selection_box or cbox) + + if def.sunlight_propagates ~= false then + def.sunlight_propagates = true + end + + minetest.register_node(":"..name, def) + table.insert(signs_lib.lbm_restore_nodes, name) + + if rdef.allow_onpole ~= false then + + local opdef = table.copy(def) + + local offset = 0.3125 + if opdef.uses_slim_pole_mount then + offset = 0.35 + end + + if opdef.paramtype2 == "wallmounted" then + opdef.node_box.wall_side[1] = def.node_box.wall_side[1] - offset + opdef.node_box.wall_side[4] = def.node_box.wall_side[4] - offset + + opdef.selection_box.wall_side[1] = def.selection_box.wall_side[1] - offset + opdef.selection_box.wall_side[4] = def.selection_box.wall_side[4] - offset + else + opdef.node_box.fixed[3] = def.node_box.fixed[3] + offset + opdef.node_box.fixed[6] = def.node_box.fixed[6] + offset + + opdef.selection_box.fixed[3] = def.selection_box.fixed[3] + offset + opdef.selection_box.fixed[6] = def.selection_box.fixed[6] + offset + end + + opdef.groups.not_in_creative_inventory = 1 + opdef.tiles[3] = "signs_lib_pole_mount.png" + opdef.mesh = string.gsub(opdef.mesh, ".obj$", "_onpole.obj") + opdef.on_rotate = nil + + + if opdef.entity_info then + opdef.entity_info.mesh = string.gsub(opdef.entity_info.mesh, ".obj$", "_onpole.obj") + end + minetest.register_node(":"..name.."_onpole", opdef) + table.insert(signs_lib.lbm_restore_nodes, name.."_onpole") + end +end + -- restore signs' text after /clearobjects and the like, the next time -- a block is reloaded by the server. diff --git a/signs_lib/models/basic_signs wooden sign.blend b/signs_lib/models/basic_signs wooden sign.blend new file mode 100644 index 00000000..35015122 Binary files /dev/null and b/signs_lib/models/basic_signs wooden sign.blend differ diff --git a/signs_lib/models/signs_lib_standard_wall_sign_entity.obj b/signs_lib/models/signs_lib_standard_wall_sign_entity.obj index 70056177..54ae3b2e 100644 --- a/signs_lib/models/signs_lib_standard_wall_sign_entity.obj +++ b/signs_lib/models/signs_lib_standard_wall_sign_entity.obj @@ -1,10 +1,10 @@ # Blender v2.79 (sub 0) OBJ File: 'basic_signs wooden sign.blend' # www.blender.org o text_entity_Plane -v 0.406250 -0.281250 0.429688 -v -0.406250 -0.281250 0.429688 -v 0.406250 0.281250 0.429688 -v -0.406250 0.281250 0.429688 +v 0.406250 -0.281250 0.425781 +v -0.406250 -0.281250 0.425781 +v 0.406250 0.281250 0.425781 +v -0.406250 0.281250 0.425781 vt 0.000000 0.000000 vt 1.000000 0.000000 vt 1.000000 1.000000 diff --git a/signs_lib/models/signs_lib_standard_wall_sign_entity_onpole.obj b/signs_lib/models/signs_lib_standard_wall_sign_entity_onpole.obj index abc340d8..5b630c37 100644 --- a/signs_lib/models/signs_lib_standard_wall_sign_entity_onpole.obj +++ b/signs_lib/models/signs_lib_standard_wall_sign_entity_onpole.obj @@ -1,10 +1,10 @@ # Blender v2.79 (sub 0) OBJ File: 'basic_signs wooden sign.blend' # www.blender.org o text_entity.001_Plane -v 0.406250 -0.281250 0.742188 -v -0.406250 -0.281250 0.742188 -v 0.406250 0.281250 0.742188 -v -0.406250 0.281250 0.742188 +v 0.406250 -0.281250 0.738281 +v -0.406250 -0.281250 0.738281 +v 0.406250 0.281250 0.738281 +v -0.406250 0.281250 0.738281 vt 0.000000 0.000000 vt 1.000000 0.000000 vt 1.000000 1.000000 diff --git a/signs_lib/models/street_signs OM3.blend b/signs_lib/models/street_signs OM3.blend new file mode 100644 index 00000000..7039be8e Binary files /dev/null and b/signs_lib/models/street_signs OM3.blend differ diff --git a/signs_lib/standard_signs.lua b/signs_lib/standard_signs.lua index 1fdc4360..ee36d3d9 100644 --- a/signs_lib/standard_signs.lua +++ b/signs_lib/standard_signs.lua @@ -1,105 +1,30 @@ -- Definitions for standard minetest_game wooden and steel wall signs -for _, onpole in ipairs({"", "_onpole"}) do +signs_lib.register_sign("default:sign_wall_wood", { + description = "Wooden wall sign", + inventory_image = "signs_lib_sign_wall_wooden_inv.png", + tiles = { + "signs_lib_sign_wall_wooden.png", + "signs_lib_sign_wall_wooden_edges.png", + }, + entity_info = "standard" +}) - local nci = nil - local on_rotate = signs_lib.wallmounted_rotate - local pole_mount_tex = nil +signs_lib.register_sign("default:sign_wall_steel", { + description = "Steel wall sign", + inventory_image = "signs_lib_sign_wall_steel_inv.png", + tiles = { + "signs_lib_sign_wall_steel.png", + "signs_lib_sign_wall_steel_edges.png", + }, + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, + locked = true, + entity_info = "standard" +}) - if onpole == "_onpole" then - nci = 1 - on_rotate = nil - pole_mount_tex = "signs_lib_pole_mount.png" -- the metal straps on back, if needed - end +-- insert the old wood sign-on-fencepost into signs_lib's conversion LBM - local wood_groups = table.copy(signs_lib.standard_wood_groups) - wood_groups.not_in_creative_inventory = nci - local steel_groups = table.copy(signs_lib.standard_steel_groups) - steel_groups.not_in_creative_inventory = nci - - cbox = signs_lib.make_selection_boxes(35, 25, onpole) - - minetest.register_node(":default:sign_wall_wood"..onpole, { - description = "Wooden wall sign", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "signs_lib_standard_wall_sign"..onpole..".obj", - tiles = { - "signs_lib_sign_wall_wooden.png", - "signs_lib_sign_wall_wooden_edges.png", - pole_mount_tex - }, - inventory_image = "signs_lib_sign_wall_wooden_inv.png", - wield_image = "signs_lib_sign_wall_wooden_inv.png", - groups = wood_groups, - default_color = "0", - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - on_rotate = signs_lib.wallmounted_rotate, - number_of_lines = signs_lib.standard_lines, - horiz_scaling = signs_lib.standard_hscale, - vert_scaling = signs_lib.standard_vscale, - line_spacing = signs_lib.standard_lspace, - font_size = signs_lib.standard_fsize, - x_offset = signs_lib.standard_xoffs, - y_offset = signs_lib.standard_yoffs, - chars_per_line = signs_lib.standard_cpl, - entity_info = { - mesh = "signs_lib_standard_wall_sign_entity"..onpole..".obj", - yaw = signs_lib.wallmounted_yaw - }, - drop = "default:sign_wall_wood" - }) - table.insert(signs_lib.lbm_restore_nodes, "default:sign_wall_wood"..onpole) - - minetest.register_node(":default:sign_wall_steel"..onpole, { - description = "Steel wall sign", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "signs_lib_standard_wall_sign"..onpole..".obj", - tiles = { - "signs_lib_sign_wall_steel.png", - "signs_lib_sign_wall_steel_edges.png", - pole_mount_tex - }, - inventory_image = "signs_lib_sign_wall_steel_inv.png", - wield_image = "signs_lib_sign_wall_steel_inv.png", - groups = wood_groups, - default_color = "0", - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - after_place_node = function(pos, placer, itemstack, pointed_thing) - signs_lib.after_place_node(pos, placer, itemstack, pointed_thing, true) - end, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - can_dig = signs_lib.can_modify, - on_rotate = signs_lib.wallmounted_rotate, - number_of_lines = signs_lib.standard_lines, - horiz_scaling = signs_lib.standard_hscale, - vert_scaling = signs_lib.standard_vscale, - line_spacing = signs_lib.standard_lspace, - font_size = signs_lib.standard_fsize, - x_offset = signs_lib.standard_xoffs, - y_offset = signs_lib.standard_yoffs, - chars_per_line = signs_lib.standard_cpl, - entity_info = { - mesh = "signs_lib_standard_wall_sign_entity"..onpole..".obj", - yaw = signs_lib.wallmounted_yaw - }, - drop = "default:sign_wall_steel" - }) - table.insert(signs_lib.lbm_restore_nodes, "default:sign_wall_steel"..onpole) -end +table.insert(signs_lib.old_fenceposts_with_signs, "signs:sign_post") +signs_lib.old_fenceposts["signs:sign_post"] = "default:fence_wood" +signs_lib.old_fenceposts_replacement_signs["signs:sign_post"] = "default:sign_wall_wood_onpole" diff --git a/street_signs/models/street_signs_object_marker_type_3_onpole.obj b/street_signs/models/street_signs_object_marker_type_3_onpole.obj new file mode 100644 index 00000000..6065f482 --- /dev/null +++ b/street_signs/models/street_signs_object_marker_type_3_onpole.obj @@ -0,0 +1,480 @@ +# Blender v2.79 (sub 0) OBJ File: 'street signs OM3.blend' +# www.blender.org +o Cube_Cube_front-back +v -0.152400 -0.793750 0.407200 +v -0.149953 -0.793750 0.422651 +v -0.142851 -0.793750 0.436589 +v -0.131789 -0.793750 0.447651 +v -0.117851 -0.793750 0.454753 +v -0.102400 -0.793750 0.457200 +v 0.102400 -0.793750 0.457200 +v 0.117851 -0.793750 0.454753 +v 0.131789 -0.793750 0.447651 +v 0.142851 -0.793750 0.436589 +v 0.149953 -0.793750 0.422651 +v 0.152400 -0.793750 0.407200 +v 0.152400 -0.793750 -0.407200 +v 0.149953 -0.793750 -0.422651 +v 0.142851 -0.793750 -0.436589 +v 0.131789 -0.793750 -0.447651 +v 0.117851 -0.793750 -0.454753 +v 0.102400 -0.793750 -0.457200 +v -0.102400 -0.793750 -0.457200 +v -0.117851 -0.793750 -0.454753 +v -0.131789 -0.793750 -0.447651 +v -0.142851 -0.793750 -0.436589 +v -0.149953 -0.793750 -0.422651 +v -0.152400 -0.793750 -0.407200 +v 0.152400 -0.843750 0.407200 +v 0.149953 -0.843750 0.422651 +v 0.142851 -0.843750 0.436589 +v 0.131789 -0.843750 0.447651 +v 0.117851 -0.843750 0.454753 +v 0.102400 -0.843750 0.457200 +v -0.102400 -0.843750 0.457200 +v -0.117851 -0.843750 0.454753 +v -0.131789 -0.843750 0.447651 +v -0.142851 -0.843750 0.436589 +v -0.149953 -0.843750 0.422651 +v -0.152400 -0.843750 0.407200 +v -0.152400 -0.843750 -0.407200 +v -0.149953 -0.843750 -0.422651 +v -0.142851 -0.843750 -0.436589 +v -0.131789 -0.843750 -0.447651 +v -0.117851 -0.843750 -0.454753 +v -0.102400 -0.843750 -0.457200 +v 0.102400 -0.843750 -0.457200 +v 0.117851 -0.843750 -0.454753 +v 0.131789 -0.843750 -0.447651 +v 0.142851 -0.843750 -0.436589 +v 0.149953 -0.843750 -0.422651 +v 0.152400 -0.843750 -0.407200 +v 0.102400 -0.843750 0.457200 +v 0.102400 -0.793750 0.457200 +v -0.102400 -0.793750 0.457200 +v -0.102400 -0.843750 0.457200 +v -0.152400 -0.843750 -0.407200 +v -0.152400 -0.843750 0.407200 +v -0.152400 -0.793750 0.407200 +v -0.152400 -0.793750 -0.407200 +v -0.102400 -0.843750 -0.457200 +v -0.102400 -0.793750 -0.457200 +v 0.102400 -0.793750 -0.457200 +v 0.102400 -0.843750 -0.457200 +v 0.117851 -0.793750 -0.454753 +v 0.117851 -0.843750 -0.454753 +v 0.131789 -0.793750 -0.447651 +v 0.131789 -0.843750 -0.447651 +v 0.142851 -0.793750 -0.436589 +v 0.142851 -0.843750 -0.436589 +v 0.149953 -0.793750 -0.422651 +v 0.149953 -0.843750 -0.422651 +v 0.152400 -0.793750 -0.407200 +v 0.152400 -0.843750 -0.407200 +v 0.117851 -0.843750 0.454753 +v 0.117851 -0.793750 0.454753 +v 0.131789 -0.843750 0.447651 +v 0.131789 -0.793750 0.447651 +v 0.142851 -0.843750 0.436589 +v 0.142851 -0.793750 0.436589 +v 0.149953 -0.843750 0.422651 +v 0.149953 -0.793750 0.422651 +v 0.152400 -0.843750 0.407200 +v 0.152400 -0.793750 0.407200 +v -0.117851 -0.793750 0.454753 +v -0.117851 -0.843750 0.454753 +v -0.131789 -0.793750 0.447651 +v -0.131789 -0.843750 0.447651 +v -0.142851 -0.793750 0.436589 +v -0.142851 -0.843750 0.436589 +v -0.149953 -0.793750 0.422651 +v -0.149953 -0.843750 0.422651 +v -0.117851 -0.843750 -0.454753 +v -0.117851 -0.793750 -0.454753 +v -0.131789 -0.843750 -0.447651 +v -0.131789 -0.793750 -0.447651 +v -0.142851 -0.843750 -0.436589 +v -0.142851 -0.793750 -0.436589 +v -0.149953 -0.843750 -0.422651 +v -0.149953 -0.793750 -0.422651 +v 0.119048 -0.843750 0.156250 +v 0.119048 -0.875000 0.156250 +v 0.119048 -0.843750 0.125000 +v 0.119048 -0.875000 0.125000 +v -0.119048 -0.843750 0.125000 +v -0.119048 -0.843750 0.156250 +v -0.119048 -0.875000 0.156250 +v -0.119048 -0.875000 0.125000 +v 0.119048 -1.117188 0.156250 +v 0.119048 -0.843750 0.156250 +v 0.119048 -1.117188 0.125000 +v 0.119048 -0.843750 0.125000 +v 0.156250 -1.117188 0.156250 +v 0.156250 -0.843750 0.156250 +v 0.156250 -1.117188 0.125000 +v 0.156250 -0.843750 0.125000 +v -0.156250 -1.117188 0.156250 +v -0.156250 -0.843750 0.156250 +v -0.156250 -1.117188 0.125000 +v -0.156250 -0.843750 0.125000 +v -0.119047 -1.117188 0.156250 +v -0.119047 -0.843750 0.156250 +v -0.119047 -1.117188 0.125000 +v -0.119047 -0.843750 0.125000 +v 0.156250 -1.156250 0.156250 +v -0.156250 -1.156250 0.156250 +v 0.156250 -1.156250 0.125000 +v -0.156250 -1.156250 0.125000 +v 0.156250 -1.117188 0.156250 +v -0.156250 -1.117188 0.156250 +v 0.156250 -1.117188 0.125000 +v -0.156250 -1.117188 0.125000 +v -0.156250 -0.843750 0.125000 +v 0.156250 -0.843750 0.125000 +v -0.156250 -0.843750 0.156250 +v 0.156250 -0.843750 0.156250 +v 0.119048 -0.843750 -0.125000 +v 0.119048 -0.875000 -0.125000 +v 0.119048 -0.843750 -0.156250 +v 0.119048 -0.875000 -0.156250 +v -0.119048 -0.843750 -0.156250 +v -0.119048 -0.843750 -0.125000 +v -0.119048 -0.875000 -0.125000 +v -0.119048 -0.875000 -0.156250 +v 0.119048 -1.117188 -0.125000 +v 0.119048 -0.843750 -0.125000 +v 0.119048 -1.117188 -0.156250 +v 0.119048 -0.843750 -0.156250 +v 0.156250 -1.117188 -0.125000 +v 0.156250 -0.843750 -0.125000 +v 0.156250 -1.117188 -0.156250 +v 0.156250 -0.843750 -0.156250 +v -0.156250 -1.117188 -0.125000 +v -0.156250 -0.843750 -0.125000 +v -0.156250 -1.117188 -0.156250 +v -0.156250 -0.843750 -0.156250 +v -0.119048 -1.117188 -0.125000 +v -0.119048 -0.843750 -0.125000 +v -0.119048 -1.117188 -0.156250 +v -0.119048 -0.843750 -0.156250 +v 0.156250 -1.156250 -0.125000 +v -0.156250 -1.156250 -0.125000 +v 0.156250 -1.156250 -0.156250 +v -0.156250 -1.156250 -0.156250 +v 0.156250 -1.117188 -0.125000 +v -0.156250 -1.117188 -0.125000 +v 0.156250 -1.117188 -0.156250 +v -0.156250 -1.117188 -0.156250 +v -0.156250 -0.843750 -0.156250 +v 0.156250 -0.843750 -0.156250 +v -0.156250 -0.843750 -0.125000 +v 0.156250 -0.843750 -0.125000 +vt 0.500000 0.945319 +vt 0.495986 0.962217 +vt 0.484335 0.977460 +vt 0.466190 0.989557 +vt 0.443325 0.997324 +vt 0.417979 1.000000 +vt 0.082021 1.000000 +vt 0.056675 0.997324 +vt 0.033810 0.989557 +vt 0.015665 0.977460 +vt 0.004014 0.962217 +vt 0.000000 0.945319 +vt 0.000000 0.054681 +vt 0.004014 0.037783 +vt 0.015665 0.022540 +vt 0.033810 0.010443 +vt 0.056675 0.002676 +vt 0.082021 0.000000 +vt 0.417979 0.000000 +vt 0.443325 0.002676 +vt 0.466190 0.010443 +vt 0.484335 0.022540 +vt 0.495986 0.037783 +vt 0.500000 0.054681 +vt 0.500000 0.945319 +vt 0.504014 0.962217 +vt 0.515665 0.977460 +vt 0.533810 0.989557 +vt 0.556675 0.997324 +vt 0.582021 1.000000 +vt 0.917979 1.000000 +vt 0.943325 0.997324 +vt 0.966190 0.989557 +vt 0.984335 0.977460 +vt 0.995986 0.962217 +vt 1.000000 0.945319 +vt 1.000000 0.054681 +vt 0.995986 0.037783 +vt 0.984335 0.022540 +vt 0.966190 0.010443 +vt 0.943325 0.002676 +vt 0.917979 0.000000 +vt 0.582021 0.000000 +vt 0.556675 0.002676 +vt 0.533810 0.010443 +vt 0.515665 0.022540 +vt 0.504014 0.037783 +vt 0.500000 0.054681 +vt 0.164042 0.000000 +vt 0.164042 0.999996 +vt 0.835958 0.999996 +vt 0.835958 0.000000 +vt 0.054681 0.000000 +vt 0.945319 0.000000 +vt 0.945319 1.000000 +vt 0.054681 1.000000 +vt 0.835958 0.000003 +vt 0.835958 1.000000 +vt 0.164042 1.000000 +vt 0.164042 0.000003 +vt 0.113350 1.000000 +vt 0.113350 0.000003 +vt 0.067621 1.000000 +vt 0.067621 0.000003 +vt 0.022540 1.000000 +vt 0.022540 0.000000 +vt 0.037783 1.000000 +vt 0.037783 0.000000 +vt 0.054681 1.000000 +vt 0.054681 0.000000 +vt 0.113350 0.000000 +vt 0.113350 0.999996 +vt 0.067621 0.000000 +vt 0.067621 0.999996 +vt 0.000000 0.000000 +vt 0.000000 0.999996 +vt 0.977460 1.000000 +vt 0.977460 0.000000 +vt 0.962217 0.000000 +vt 0.962217 1.000000 +vt 0.945319 0.000000 +vt 0.945319 1.000000 +vt 0.886650 0.999996 +vt 0.886650 0.000000 +vt 0.932379 0.999996 +vt 0.932379 0.000000 +vt 0.977460 1.000000 +vt 0.977460 0.000000 +vt 0.962217 1.000000 +vt 0.962217 0.000000 +vt 0.886650 0.000003 +vt 0.886650 1.000000 +vt 0.932379 0.000003 +vt 0.932379 1.000000 +vt 1.000000 0.000003 +vt 1.000000 1.000000 +vt 0.022540 1.000000 +vt 0.022540 0.000000 +vt 0.037783 0.000000 +vt 0.037783 1.000000 +vt 0.781250 0.664062 +vt 0.781250 0.992188 +vt 0.921875 0.992188 +vt 0.921875 0.664062 +vt 0.703125 0.093750 +vt 0.156250 0.093750 +vt 0.156250 0.031250 +vt 0.703125 0.031250 +vt 0.703125 0.578125 +vt 0.156250 0.578125 +vt 0.156250 0.507812 +vt 0.703125 0.507812 +vt 0.312500 0.640625 +vt 0.312500 0.992188 +vt 0.453125 0.992188 +vt 0.453125 0.640625 +vt 0.234375 0.640625 +vt 0.234375 0.992188 +vt 0.312500 0.992188 +vt 0.312500 0.640625 +vt 0.234375 0.640625 +vt 0.234375 0.992188 +vt 0.093750 0.992188 +vt 0.093750 0.640625 +vt 0.015625 0.992188 +vt 0.015625 0.640625 +vt 0.312500 0.640625 +vt 0.312500 0.992188 +vt 0.453125 0.992188 +vt 0.453125 0.640625 +vt 0.234375 0.640625 +vt 0.234375 0.992188 +vt 0.312500 0.992188 +vt 0.312500 0.640625 +vt 0.234375 0.640625 +vt 0.234375 0.992188 +vt 0.093750 0.992188 +vt 0.093750 0.640625 +vt 0.015625 0.992188 +vt 0.015625 0.640625 +vt 0.781250 0.664062 +vt 0.781250 0.992188 +vt 0.921875 0.992188 +vt 0.921875 0.664062 +vt 0.484375 0.664062 +vt 0.484375 0.992188 +vt 0.562500 0.992188 +vt 0.562500 0.664062 +vt 0.703125 0.992188 +vt 0.703125 0.664062 +vt 0.234375 0.593750 +vt 0.234375 0.640625 +vt 0.093750 0.640625 +vt 0.093750 0.593750 +vt 0.453125 0.640625 +vt 0.453125 0.593750 +vt 0.312500 0.593750 +vt 0.312500 0.640625 +vt 0.781250 0.664062 +vt 0.781250 0.992188 +vt 0.921875 0.992188 +vt 0.921875 0.664062 +vt 0.703125 0.093750 +vt 0.156250 0.093750 +vt 0.156250 0.031250 +vt 0.703125 0.031250 +vt 0.703125 0.578125 +vt 0.156250 0.578125 +vt 0.156250 0.507812 +vt 0.703125 0.507812 +vt 0.312500 0.640625 +vt 0.312500 0.992188 +vt 0.453125 0.992188 +vt 0.453125 0.640625 +vt 0.234375 0.640625 +vt 0.234375 0.992188 +vt 0.312500 0.992188 +vt 0.312500 0.640625 +vt 0.234375 0.640625 +vt 0.234375 0.992188 +vt 0.093750 0.992188 +vt 0.093750 0.640625 +vt 0.015625 0.992188 +vt 0.015625 0.640625 +vt 0.312500 0.640625 +vt 0.312500 0.992188 +vt 0.453125 0.992188 +vt 0.453125 0.640625 +vt 0.234375 0.640625 +vt 0.234375 0.992188 +vt 0.312500 0.992188 +vt 0.312500 0.640625 +vt 0.234375 0.640625 +vt 0.234375 0.992188 +vt 0.093750 0.992188 +vt 0.093750 0.640625 +vt 0.015625 0.992188 +vt 0.015625 0.640625 +vt 0.781250 0.664062 +vt 0.781250 0.992188 +vt 0.921875 0.992188 +vt 0.921875 0.664062 +vt 0.484375 0.664062 +vt 0.484375 0.992188 +vt 0.562500 0.992188 +vt 0.562500 0.664062 +vt 0.703125 0.992188 +vt 0.703125 0.664062 +vt 0.234375 0.593750 +vt 0.234375 0.640625 +vt 0.093750 0.640625 +vt 0.093750 0.593750 +vt 0.453125 0.640625 +vt 0.453125 0.593750 +vt 0.312500 0.593750 +vt 0.312500 0.640625 +vn 0.0000 1.0000 0.0000 +vn 0.0000 -1.0000 -0.0000 +vn 0.0000 0.0000 1.0000 +vn -1.0000 0.0000 0.0000 +vn -0.0000 0.0000 -1.0000 +vn 0.1564 0.0000 -0.9877 +vn 0.4540 0.0000 -0.8910 +vn 0.7071 0.0000 -0.7071 +vn 0.8910 0.0000 -0.4540 +vn 0.9877 0.0000 -0.1564 +vn 0.1564 0.0000 0.9877 +vn 0.4540 0.0000 0.8910 +vn 0.7071 0.0000 0.7071 +vn 0.8910 0.0000 0.4540 +vn 0.9877 0.0000 0.1564 +vn -0.1564 0.0000 0.9877 +vn -0.4540 0.0000 0.8910 +vn -0.7071 0.0000 0.7071 +vn -0.8910 0.0000 0.4540 +vn -0.9877 0.0000 0.1564 +vn -0.1564 0.0000 -0.9877 +vn -0.4540 0.0000 -0.8910 +vn -0.7071 0.0000 -0.7071 +vn -0.8910 0.0000 -0.4540 +vn -0.9877 0.0000 -0.1564 +vn 1.0000 0.0000 -0.0000 +g Cube_Cube_front-back_Cube_Cube_front-back_front-back +s 1 +f 1/1/1 2/2/1 3/3/1 4/4/1 5/5/1 6/6/1 7/7/1 8/8/1 9/9/1 10/10/1 11/11/1 12/12/1 13/13/1 14/14/1 15/15/1 16/16/1 17/17/1 18/18/1 19/19/1 20/20/1 21/21/1 22/22/1 23/23/1 24/24/1 +f 25/25/2 26/26/2 27/27/2 28/28/2 29/29/2 30/30/2 31/31/2 32/32/2 33/33/2 34/34/2 35/35/2 36/36/2 37/37/2 38/38/2 39/39/2 40/40/2 41/41/2 42/42/2 43/43/2 44/44/2 45/45/2 46/46/2 47/47/2 48/48/2 +g Cube_Cube_front-back_Cube_Cube_front-back_edges +f 49/49/3 50/50/3 51/51/3 52/52/3 +f 53/53/4 54/54/4 55/55/4 56/56/4 +f 57/57/5 58/58/5 59/59/5 60/60/5 +f 60/60/6 59/59/6 61/61/6 62/62/6 +f 62/62/7 61/61/7 63/63/7 64/64/7 +f 64/64/8 63/63/8 65/65/8 66/66/8 +f 66/66/9 65/65/9 67/67/9 68/68/9 +f 68/68/10 67/67/10 69/69/10 70/70/10 +f 50/50/11 49/49/11 71/71/11 72/72/11 +f 72/72/12 71/71/12 73/73/12 74/74/12 +f 74/74/13 73/73/13 75/75/13 76/76/13 +f 76/77/14 75/78/14 77/79/14 78/80/14 +f 78/80/15 77/79/15 79/81/15 80/82/15 +f 52/52/16 51/51/16 81/83/16 82/84/16 +f 82/84/17 81/83/17 83/85/17 84/86/17 +f 84/86/18 83/85/18 85/87/18 86/88/18 +f 86/88/19 85/87/19 87/89/19 88/90/19 +f 88/90/20 87/89/20 55/55/20 54/54/20 +f 58/58/21 57/57/21 89/91/21 90/92/21 +f 90/92/22 89/91/22 91/93/22 92/94/22 +f 92/94/23 91/93/23 93/95/23 94/96/23 +f 94/97/24 93/98/24 95/99/24 96/100/24 +f 96/100/25 95/99/25 53/53/25 56/56/25 +f 79/81/26 70/70/26 69/69/26 80/82/26 +g Cube_Cube_front-back_Cube_Cube_front-back_pole_mount +s off +f 132/101/2 131/102/2 129/103/2 130/104/2 +f 100/105/5 104/106/5 101/107/5 99/108/5 +f 97/109/3 102/110/3 103/111/3 98/112/3 +f 98/112/2 103/111/2 104/106/2 100/105/2 +f 105/113/4 106/114/4 108/115/4 107/116/4 +f 107/117/5 108/118/5 112/119/5 111/120/5 +f 111/121/26 112/122/26 110/123/26 109/124/26 +f 109/124/3 110/123/3 106/125/3 105/126/3 +f 113/127/4 114/128/4 116/129/4 115/130/4 +f 115/131/5 116/132/5 120/133/5 119/134/5 +f 119/135/26 120/136/26 118/137/26 117/138/26 +f 117/138/3 118/137/3 114/139/3 113/140/3 +f 121/141/2 122/142/2 124/143/2 123/144/2 +f 123/145/5 124/146/5 128/147/5 127/148/5 +f 127/148/1 128/147/1 126/149/1 125/150/1 +f 125/150/3 126/149/3 122/142/3 121/141/3 +f 123/151/26 127/152/26 125/153/26 121/154/26 +f 128/155/4 124/156/4 122/157/4 126/158/4 +f 168/159/2 167/160/2 165/161/2 166/162/2 +f 136/163/5 140/164/5 137/165/5 135/166/5 +f 133/167/3 138/168/3 139/169/3 134/170/3 +f 134/170/2 139/169/2 140/164/2 136/163/2 +f 141/171/4 142/172/4 144/173/4 143/174/4 +f 143/175/5 144/176/5 148/177/5 147/178/5 +f 147/179/26 148/180/26 146/181/26 145/182/26 +f 145/182/3 146/181/3 142/183/3 141/184/3 +f 149/185/4 150/186/4 152/187/4 151/188/4 +f 151/189/5 152/190/5 156/191/5 155/192/5 +f 155/193/26 156/194/26 154/195/26 153/196/26 +f 153/196/3 154/195/3 150/197/3 149/198/3 +f 157/199/2 158/200/2 160/201/2 159/202/2 +f 159/203/5 160/204/5 164/205/5 163/206/5 +f 163/206/1 164/205/1 162/207/1 161/208/1 +f 161/208/3 162/207/3 158/200/3 157/199/3 +f 159/209/26 163/210/26 161/211/26 157/212/26 +f 164/213/4 160/214/4 158/215/4 162/216/4 diff --git a/street_signs/signs_class_d.lua b/street_signs/signs_class_d.lua index 4002e75c..0857e4bc 100644 --- a/street_signs/signs_class_d.lua +++ b/street_signs/signs_class_d.lua @@ -1,7 +1,6 @@ -- Class D signs - local S = signs_lib.gettext -local cbox +local groups = table.copy(signs_lib.standard_steel_groups) local cbox = { type = "fixed", @@ -14,24 +13,15 @@ local cbox = { } } -minetest.register_node("street_signs:sign_basic", { +signs_lib.register_sign("street_signs:sign_basic", { description = "D3-1a: Generic intersection street name sign", - paramtype = "light", - sunlight_propagates = true, paramtype2 = "facedir", - drawtype = "mesh", - node_box = cbox, selection_box = cbox, mesh = "street_signs_basic.obj", tiles = { "street_signs_basic.png" }, - groups = {sign = 1, choppy=2, dig_immediate=2}, + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, default_color = "f", - on_construct = signs_lib.construct_sign, - on_rightclick = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - on_rotate = signs_lib.facedir_rotate, number_of_lines = 2, horiz_scaling = 0.8, vert_scaling = 1, @@ -43,7 +33,8 @@ minetest.register_node("street_signs:sign_basic", { entity_info = { mesh = "street_signs_basic_entity.obj", yaw = signs_lib.standard_yaw - } + }, + allow_onpole = false }) cbox = { @@ -54,28 +45,18 @@ cbox = { { -1/32, 1/16, -1/32, 1/32, 2/16, 1/32 }, { -8/16, -4/16, -1/32, 8/16, 1/16, 1/32 }, { -1/16, -8/16, -1/16, 1/16, -4/16, 1/16 }, - } } -minetest.register_node("street_signs:sign_basic_top_only", { +signs_lib.register_sign("street_signs:sign_basic_top_only", { description = "D3-1a: Generic intersection street name sign (top only)", - paramtype = "light", - sunlight_propagates = true, paramtype2 = "facedir", - drawtype = "mesh", - node_box = cbox, selection_box = cbox, mesh = "street_signs_basic_top_only.obj", tiles = { "street_signs_basic.png" }, - groups = {sign = 1, choppy=2, dig_immediate=2}, + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, default_color = "f", - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - on_rotate = signs_lib.facedir_rotate, number_of_lines = 2, horiz_scaling = 0.8, vert_scaling = 1, @@ -87,156 +68,80 @@ minetest.register_node("street_signs:sign_basic_top_only", { entity_info = { mesh = "street_signs_basic_top_only_entity.obj", yaw = signs_lib.standard_yaw - } + }, + allow_onpole = false }) -table.insert(signs_lib.lbm_restore_nodes, "street_signs:sign_basic") -table.insert(signs_lib.lbm_restore_nodes, "street_signs:sign_basic_top_only") +cbox = signs_lib.make_selection_boxes(24, 24) -for _, onpole in ipairs({"", "_onpole"}) do +signs_lib.register_sign("street_signs:sign_service_hospital", { + description = "D9-2: General service: hospital", + selection_box = cbox, + mesh = "street_signs_generic_sign_24x24.obj", + tiles = { "street_signs_service_hospital.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_service_hospital_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - local nci = nil - local on_rotate = signs_lib.wallmounted_rotate - local pole_mount_tex = nil +signs_lib.register_sign("street_signs:sign_service_handicapped", { + description = "D9-6: General service: handicapped", + selection_box = cbox, + mesh = "street_signs_generic_sign_24x24.obj", + tiles = { "street_signs_service_handicapped.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_service_handicapped_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - if onpole == "_onpole" then - nci = 1 - on_rotate = nil - pole_mount_tex = "signs_lib_pole_mount.png" - end +signs_lib.register_sign("street_signs:sign_service_fuel", { + description = "D9-7: General service: fuel/gas", + selection_box = cbox, + mesh = "street_signs_generic_sign_24x24.obj", + tiles = { "street_signs_service_fuel.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_service_fuel_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - cbox = signs_lib.make_selection_boxes(24, 24, onpole) +signs_lib.register_sign("street_signs:sign_service_food", { + description = "D9-8: General service: food", + selection_box = cbox, + mesh = "street_signs_generic_sign_24x24.obj", + tiles = { "street_signs_service_food.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_service_food_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_service_hospital"..onpole, { - description = "D9-2: General service: hospital", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_24x24"..onpole..".obj", - tiles = { "street_signs_service_hospital.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_service_hospital_inv.png", - wield_image = "street_signs_service_hospital_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_service_hospital" - }) - - minetest.register_node("street_signs:sign_service_handicapped"..onpole, { - description = "D9-6: General service: handicapped", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_24x24"..onpole..".obj", - tiles = { "street_signs_service_handicapped.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_service_handicapped_inv.png", - wield_image = "street_signs_service_handicapped_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_service_handicapped" - }) - - minetest.register_node("street_signs:sign_service_fuel"..onpole, { - description = "D9-7: General service: fuel/gas", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_24x24"..onpole..".obj", - tiles = { "street_signs_service_fuel.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_service_fuel_inv.png", - wield_image = "street_signs_service_fuel_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_service_fuel" - }) - - minetest.register_node("street_signs:sign_service_food"..onpole, { - description = "D9-8: General service: food", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_24x24"..onpole..".obj", - tiles = { "street_signs_service_food.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_service_food_inv.png", - wield_image = "street_signs_service_food_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_service_food" - }) - - minetest.register_node("street_signs:sign_service_lodging"..onpole, { - description = "D9-9: General service: lodging", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_24x24"..onpole..".obj", - tiles = { "street_signs_service_lodging.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_service_lodging_inv.png", - wield_image = "street_signs_service_lodging_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_service_lodging" - }) - - minetest.register_node("street_signs:sign_service_ev_charging"..onpole, { - description = "D9-11b: General service: EV charging", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_24x24"..onpole..".obj", - tiles = { "street_signs_service_ev_charging.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_service_ev_charging_inv.png", - wield_image = "street_signs_service_ev_charging_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_service_ev_charging" - }) -end +signs_lib.register_sign("street_signs:sign_service_lodging", { + description = "D9-9: General service: lodging", + selection_box = cbox, + mesh = "street_signs_generic_sign_24x24.obj", + tiles = { "street_signs_service_lodging.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_service_lodging_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) +signs_lib.register_sign("street_signs:sign_service_ev_charging", { + description = "D9-11b: General service: EV charging", + selection_box = cbox, + mesh = "street_signs_generic_sign_24x24.obj", + tiles = { "street_signs_service_ev_charging.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_service_ev_charging_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) diff --git a/street_signs/signs_class_m.lua b/street_signs/signs_class_m.lua index b1256d4d..e4c5f6af 100644 --- a/street_signs/signs_class_m.lua +++ b/street_signs/signs_class_m.lua @@ -1,146 +1,82 @@ -- Class-M signs - local S = signs_lib.gettext -local cbox +local cbox = signs_lib.make_selection_boxes(36, 36) -for _, onpole in ipairs({"", "_onpole"}) do +signs_lib.register_sign("street_signs:sign_us_route", { + description = "M1-4: Generic \"US Route\" sign", + selection_box = cbox, + mesh = "street_signs_generic_sign_36x36.obj", + tiles = { + "street_signs_us_route.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_us_route_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, + number_of_lines = 1, + horiz_scaling = 3.5, + vert_scaling = 1.4, + line_spacing = 6, + font_size = 31, + x_offset = 8, + y_offset = 11, + chars_per_line = 3, + entity_info = { + mesh = "street_signs_generic_sign_36x36_entity.obj", + yaw = signs_lib.wallmounted_yaw + }, +}) - local nci = nil - local on_rotate = signs_lib.wallmounted_rotate - local pole_mount_tex = nil +signs_lib.register_sign("street_signs:sign_us_interstate", { + description = "M1-1: Generic US Interstate sign", + selection_box = cbox, + mesh = "street_signs_interstate_shield.obj", + tiles = { + "street_signs_us_interstate.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_us_interstate_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, + default_color = "f", + number_of_lines = 1, + horiz_scaling = 4.3, + vert_scaling = 1.4, + line_spacing = 6, + font_size = 31, + x_offset = 8, + y_offset = 14, + chars_per_line = 3, + entity_info = { + mesh = "street_signs_interstate_shield_entity.obj", + yaw = signs_lib.wallmounted_yaw + }, +}) - if onpole == "_onpole" then - nci = 1 - on_rotate = nil - pole_mount_tex = "signs_lib_pole_mount.png" - end +cbox = signs_lib.make_selection_boxes(48, 18) - cbox = signs_lib.make_selection_boxes(36, 36, onpole) +signs_lib.register_sign("street_signs:sign_detour_right_m4_10", { + description = "M4-10: Detour sign (to right)", + selection_box = cbox, + mesh = "street_signs_generic_sign_48x18.obj", + tiles = { + "street_signs_detour_right_m4_10.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_detour_right_m4_10_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_us_route"..onpole, { - description = "M1-4: Generic \"US Route\" sign", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_36x36"..onpole..".obj", - tiles = { "street_signs_us_route.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_us_route_inv.png", - wield_image = "street_signs_us_route_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - after_place_node = signs_lib.after_place_node, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - on_rotate = signs_lib.wallmounted_rotate, - number_of_lines = 1, - horiz_scaling = 3.5, - vert_scaling = 1.4, - line_spacing = 6, - font_size = 31, - x_offset = 8, - y_offset = 11, - chars_per_line = 3, - entity_info = { - mesh = "street_signs_generic_sign_36x36_entity"..onpole..".obj", - yaw = signs_lib.wallmounted_yaw - }, - drop = "street_signs:sign_us_route" - }) - - minetest.register_node("street_signs:sign_us_interstate"..onpole, { - description = "M1-1: Generic US Interstate sign", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_interstate_shield"..onpole..".obj", - tiles = { "street_signs_us_interstate.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_us_interstate_inv.png", - wield_image = "street_signs_us_interstate_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "f", - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - after_place_node = signs_lib.after_place_node, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - on_rotate = signs_lib.wallmounted_rotate, - number_of_lines = 1, - horiz_scaling = 4.3, - vert_scaling = 1.4, - line_spacing = 6, - font_size = 31, - x_offset = 8, - y_offset = 14, - chars_per_line = 3, - entity_info = { - mesh = "street_signs_interstate_shield_entity"..onpole..".obj", - yaw = signs_lib.wallmounted_yaw - }, - drop = "street_signs:sign_us_interstate" - }) - - cbox = signs_lib.make_selection_boxes(48, 18, onpole) - - minetest.register_node("street_signs:sign_detour_right_m4_10"..onpole, { - description = "M4-10: Detour sign (to right)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_48x18"..onpole..".obj", - tiles = { "street_signs_detour_right_m4_10.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_detour_right_m4_10_inv.png", - wield_image = "street_signs_detour_right_m4_10_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_detour_right_m4_10" - }) - - minetest.register_node("street_signs:sign_detour_left_m4_10"..onpole, { - description = "M4-10: Detour sign (to left)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_48x18"..onpole..".obj", - tiles = { "street_signs_detour_left_m4_10.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_detour_left_m4_10_inv.png", - wield_image = "street_signs_detour_left_m4_10_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_detour_left_m4_10" - }) - - table.insert(signs_lib.lbm_restore_nodes, "street_signs:sign_us_route"..onpole) - table.insert(signs_lib.lbm_restore_nodes, "street_signs:sign_us_interstate"..onpole) -end +signs_lib.register_sign("street_signs:sign_detour_left_m4_10", { + description = "M4-10: Detour sign (to left)", + selection_box = cbox, + mesh = "street_signs_generic_sign_48x18.obj", + tiles = { + "street_signs_detour_left_m4_10.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_detour_left_m4_10_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) diff --git a/street_signs/signs_class_om.lua b/street_signs/signs_class_om.lua index 0d458916..5858e674 100644 --- a/street_signs/signs_class_om.lua +++ b/street_signs/signs_class_om.lua @@ -1,25 +1,20 @@ -- Class-OM signs local S = signs_lib.gettext -local cbox +local cbox = signs_lib.make_selection_boxes(12, 36, nil) for _, d in ipairs({"l", "c", "r"}) do - - cbox = signs_lib.make_selection_boxes(12, 36, nil) - - minetest.register_node("street_signs:sign_object_marker_type3_"..d, { + signs_lib.register_sign("street_signs:sign_object_marker_type3_"..d, { description = "OM3-"..string.upper(d)..": Type 3 object marker", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, selection_box = cbox, mesh = "street_signs_object_marker_type_3.obj", - tiles = { "street_signs_object_marker_type3_"..d..".png", + tiles = { + "street_signs_object_marker_type3_"..d..".png", "street_signs_sign_edge.png" }, inventory_image = "street_signs_object_marker_type3_"..d.."_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2}, + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, + uses_slim_pole_mount = true, }) end diff --git a/street_signs/signs_class_r.lua b/street_signs/signs_class_r.lua index 344c9251..d43ea236 100644 --- a/street_signs/signs_class_r.lua +++ b/street_signs/signs_class_r.lua @@ -1,1095 +1,691 @@ -- Class-R signs local S = signs_lib.gettext -local cbox - -for _, onpole in ipairs({"", "_onpole"}) do - - local nci = nil - local on_rotate = signs_lib.wallmounted_rotate - local pole_mount_tex = nil - - if onpole == "_onpole" then - nci = 1 - on_rotate = nil - pole_mount_tex = "signs_lib_pole_mount.png" - end - - cbox = signs_lib.make_selection_boxes(36, 36, onpole) - - minetest.register_node("street_signs:sign_stop"..onpole, { - description = "R1-1: Stop sign", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_stop"..onpole..".obj", - tiles = { "street_signs_stop.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_stop_inv.png", - wield_image = "street_signs_stop_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_stop" - }) - - cbox = signs_lib.make_selection_boxes(36, 43.1, onpole, 0, -3.55, 0) - - minetest.register_node("street_signs:sign_stop_all_way"..onpole, { - description = "R1-1 + R1-3P: Stop sign with \"all way\" plaque", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_stop_all_way"..onpole..".obj", - tiles = { "street_signs_stop.png", - "street_signs_sign_edge.png", - "street_signs_stop_all_way_plaque.png", - pole_mount_tex - }, - inventory_image = "street_signs_stop_all_way_inv.png", - wield_image = "street_signs_stop_all_way_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_stop_all_way" - }) - - cbox = signs_lib.make_selection_boxes(48, 48, onpole) - - minetest.register_node("street_signs:sign_yield"..onpole, { - description = "R1-2: Yield sign", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_yield"..onpole..".obj", - tiles = { "street_signs_yield.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_yield_inv.png", - wield_image = "street_signs_yield_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_yield" - }) - - cbox = signs_lib.make_selection_boxes(30, 36, onpole) - - minetest.register_node("street_signs:sign_speed_limit"..onpole, { - description = "R2-1: Generic speed limit sign", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_30x36"..onpole..".obj", - tiles = { "street_signs_speed_limit.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_speed_limit_inv.png", - wield_image = "street_signs_speed_limit_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - after_place_node = signs_lib.after_place_node, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - on_rotate = signs_lib.wallmounted_rotate, - number_of_lines = 1, - horiz_scaling = 2.65, - vert_scaling = 2.3, - line_spacing = 1, - font_size = 31, - x_offset = 8, - y_offset = 37, - chars_per_line = 4, - entity_info = { - mesh = "street_signs_generic_sign_30x36_entity"..onpole..".obj", - yaw = signs_lib.wallmounted_yaw - }, - drop = "street_signs:sign_speed_limit" - }) - - cbox = signs_lib.make_selection_boxes(36, 36, onpole) - - minetest.register_node("street_signs:sign_no_right_turn"..onpole, { - description = "R3-1: No right turn", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_36x36"..onpole..".obj", - tiles = { - "street_signs_no_right_turn.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_no_right_turn_inv.png", - wield_image = "street_signs_no_right_turn_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_no_right_turn" - }) - - minetest.register_node("street_signs:sign_no_left_turn"..onpole, { - description = "R3-2: No left turn", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_36x36"..onpole..".obj", - tiles = { - "street_signs_no_left_turn.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_no_left_turn_inv.png", - wield_image = "street_signs_no_left_turn_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_no_left_turn" - }) - - minetest.register_node("street_signs:sign_no_u_turn"..onpole, { - description = "R3-4: No U-turn", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_36x36"..onpole..".obj", - tiles = { - "street_signs_no_u_turn.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_no_u_turn_inv.png", - wield_image = "street_signs_no_u_turn_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_no_u_turn" - }) - - minetest.register_node("street_signs:sign_u_turn_here"..onpole, { - description = "U-turn here", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_36x36"..onpole..".obj", - tiles = { - "street_signs_u_turn_here.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_u_turn_here_inv.png", - wield_image = "street_signs_u_turn_here_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_u_turn_here" - }) - - cbox = signs_lib.make_selection_boxes(30, 36, onpole) - - minetest.register_node("street_signs:sign_left_turn_only"..onpole, { - description = "R3-5: Left turn only", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_30x36"..onpole..".obj", - tiles = { - "street_signs_left_turn_only.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_left_turn_only_inv.png", - wield_image = "street_signs_left_turn_only_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_left_turn_only" - }) - - minetest.register_node("street_signs:sign_right_turn_only"..onpole, { - description = "R3-5: Right turn only", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_30x36"..onpole..".obj", - tiles = { - "street_signs_right_turn_only.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_right_turn_only_inv.png", - wield_image = "street_signs_right_turn_only_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_right_turn_only" - }) - - minetest.register_node("street_signs:sign_straight_through_only"..onpole, { - description = "R3-5a: Straight through only", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_30x36"..onpole..".obj", - tiles = { - "street_signs_straight_through_only.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_straight_through_only_inv.png", - wield_image = "street_signs_straight_through_only_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_straight_through_only" - }) - - minetest.register_node("street_signs:sign_left_turn_or_straight"..onpole, { - description = "R3-6: Left turn or straight through", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_30x36"..onpole..".obj", - tiles = { - "street_signs_left_turn_or_straight.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_left_turn_or_straight_inv.png", - wield_image = "street_signs_left_turn_or_straight_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_left_turn_or_straight" - }) - - minetest.register_node("street_signs:sign_right_turn_or_straight"..onpole, { - description = "R3-6: Right turn or straight through", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_30x36"..onpole..".obj", - tiles = { - "street_signs_right_turn_or_straight.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_right_turn_or_straight_inv.png", - wield_image = "street_signs_right_turn_or_straight_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_right_turn_or_straight" - }) - - - cbox = signs_lib.make_selection_boxes(36, 36, onpole) - - minetest.register_node("street_signs:sign_left_lane_must_turn_left"..onpole, { - description = "R3-7: Left lane must turn left", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_36x36"..onpole..".obj", - tiles = { - "street_signs_left_lane_must_turn_left.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_left_lane_must_turn_left_inv.png", - wield_image = "street_signs_left_lane_must_turn_left_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_left_lane_must_turn_left" - }) - - minetest.register_node("street_signs:sign_right_lane_must_turn_right"..onpole, { - description = "R3-7: Right lane must turn right", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_36x36"..onpole..".obj", - tiles = { - "street_signs_right_lane_must_turn_right.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_right_lane_must_turn_right_inv.png", - wield_image = "street_signs_right_lane_must_turn_right_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_right_lane_must_turn_right" - }) - - minetest.register_node("street_signs:sign_no_straight_through"..onpole, { - description = "R3-27: No straight through", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_36x36"..onpole..".obj", - tiles = { - "street_signs_no_straight_through.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_no_straight_through_inv.png", - wield_image = "street_signs_no_straight_through_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_no_straight_through" - }) - - cbox = signs_lib.make_selection_boxes(36, 48, onpole) - - minetest.register_node("street_signs:sign_keep_right"..onpole, { - description = "R4-7: Keep right sign", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_36x48"..onpole..".obj", - tiles = { "street_signs_keep_right.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_keep_right_inv.png", - wield_image = "street_signs_keep_right_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_keep_right" - }) - - minetest.register_node("street_signs:sign_keep_left"..onpole, { - description = "R4-8: Keep left sign", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_36x48"..onpole..".obj", - tiles = { "street_signs_keep_left.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_keep_left_inv.png", - wield_image = "street_signs_keep_left_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_keep_left" - }) - - cbox = signs_lib.make_selection_boxes(36, 36, onpole) - - minetest.register_node("street_signs:sign_do_not_enter"..onpole, { - description = "R5-1: Do not enter sign", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_36x36"..onpole..".obj", - tiles = { - "street_signs_do_not_enter.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_do_not_enter_inv.png", - wield_image = "street_signs_do_not_enter_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_do_not_enter" - }) - - cbox = signs_lib.make_selection_boxes(42, 30, onpole) - - minetest.register_node("street_signs:sign_wrong_way"..onpole, { - description = "R5-1a: Wrong way sign", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_42x30"..onpole..".obj", - tiles = { "street_signs_wrong_way.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_wrong_way_inv.png", - wield_image = "street_signs_wrong_way_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_wrong_way" - }) - - cbox = signs_lib.make_selection_boxes(54, 18, onpole) - - minetest.register_node("street_signs:sign_one_way_left"..onpole, { - description = "R6-1: One way (left)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_54x18"..onpole..".obj", - tiles = { "street_signs_one_way_left.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_one_way_left_inv.png", - wield_image = "street_signs_one_way_left_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_one_way_left" - }) - - minetest.register_node("street_signs:sign_one_way_right"..onpole, { - description = "R6-1: One way (right)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_54x18"..onpole..".obj", - tiles = { "street_signs_one_way_right.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_one_way_right_inv.png", - wield_image = "street_signs_one_way_right_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_one_way_right" - }) - - cbox = signs_lib.make_selection_boxes(30, 24, onpole) - - minetest.register_node("street_signs:sign_divided_highway_with_cross_road"..onpole, { - description = "R6-3: divided highway with cross road", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_30x24"..onpole..".obj", - tiles = { "street_signs_divided_highway_with_cross_road.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_divided_highway_with_cross_road_inv.png", - wield_image = "street_signs_divided_highway_with_cross_road_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_divided_highway_with_cross_road" - }) - - cbox = signs_lib.make_selection_boxes(60, 24, onpole) - - minetest.register_node("street_signs:sign_roundabout_directional"..onpole, { - description = "R6-4b: Roundabout direction (4 chevrons)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_60x24"..onpole..".obj", - tiles = { "street_signs_roundabout_directional.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_roundabout_directional_inv.png", - wield_image = "street_signs_roundabout_directional.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_roundabout_directional" - }) - - minetest.register_node("street_signs:sign_roundabout_directional_left"..onpole, { - description = "R6-4b: Roundabout direction (4 chevrons, pointing left)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_60x24"..onpole..".obj", - tiles = { "street_signs_roundabout_directional_left.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_roundabout_directional_left_inv.png", - wield_image = "street_signs_roundabout_directional_left.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_roundabout_directional_left" - }) - - cbox = signs_lib.make_selection_boxes(30, 30, onpole) - - minetest.register_node("street_signs:sign_roundabout_counter_clockwise"..onpole, { - description = "R6-5P: Roundabout plaque (to the left/counter-clockwise)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_30x30"..onpole..".obj", - tiles = { "street_signs_roundabout_counter_clockwise.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_roundabout_counter_clockwise_inv.png", - wield_image = "street_signs_roundabout_counter_clockwise.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_roundabout_counter_clockwise" - }) - - minetest.register_node("street_signs:sign_roundabout_clockwise"..onpole, { - description = "R6-5P: Roundabout plaque (to the right/clockwise)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_30x30"..onpole..".obj", - tiles = { "street_signs_roundabout_clockwise.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_roundabout_clockwise_inv.png", - wield_image = "street_signs_roundabout_clockwise.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_roundabout_clockwise" - }) - - cbox = signs_lib.make_selection_boxes(24, 30, onpole) - - minetest.register_node("street_signs:sign_do_not_stop_on_tracks"..onpole, { - description = "R8-8: Do not stop on tracks", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_24x30"..onpole..".obj", - tiles = { "street_signs_do_not_stop_on_tracks.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_do_not_stop_on_tracks_inv.png", - wield_image = "street_signs_do_not_stop_on_tracks.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_do_not_stop_on_tracks" - }) - - cbox = signs_lib.make_selection_boxes(9, 15, onpole, 0, 0, -1.25) - - minetest.register_node("street_signs:sign_ped_push_button_to_cross_r10_3a"..onpole, { - description = "R10-3a: Pedestrians, push button to cross (pointing left)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_9x15"..onpole..".obj", - tiles = { "street_signs_ped_push_button_to_cross_r10_3a.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_ped_push_button_to_cross_r10_3a_inv.png", - wield_image = "street_signs_ped_push_button_to_cross_r10_3a_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_ped_push_button_to_cross_r10_3a" - }) - - minetest.register_node("street_signs:sign_ped_push_button_to_cross_r10_3a_right"..onpole, { - description = "R10-3a: Pedestrians, push button to cross (pointing right)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_9x15"..onpole..".obj", - tiles = { "street_signs_ped_push_button_to_cross_r10_3a_right.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_ped_push_button_to_cross_r10_3a_right_inv.png", - wield_image = "street_signs_ped_push_button_to_cross_r10_3a_right_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_ped_push_button_to_cross_r10_3a_right" - }) - - minetest.register_node("street_signs:sign_ped_push_button_to_cross_r10_3a_both_ways"..onpole, { - description = "R10-3a: Pedestrians, push button to cross (pointing both ways)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_9x15"..onpole..".obj", - tiles = { "street_signs_ped_push_button_to_cross_r10_3a_both_ways.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_ped_push_button_to_cross_r10_3a_both_ways_inv.png", - wield_image = "street_signs_ped_push_button_to_cross_r10_3a_both_ways_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_ped_push_button_to_cross_r10_3a_both_ways" - }) - - minetest.register_node("street_signs:sign_ped_push_button_to_cross_r10_3e"..onpole, { - description = "R10-3e: Pedestrians, push button to cross (pointing right)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_9x15"..onpole..".obj", - tiles = { "street_signs_ped_push_button_to_cross_r10_3e.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_ped_push_button_to_cross_r10_3e_inv.png", - wield_image = "street_signs_ped_push_button_to_cross_r10_3e_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_ped_push_button_to_cross_r10_3e" - }) - - minetest.register_node("street_signs:sign_ped_push_button_to_cross_r10_3e_left"..onpole, { - description = "R10-3e: Pedestrians, push button to cross (pointing left)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_9x15"..onpole..".obj", - tiles = { "street_signs_ped_push_button_to_cross_r10_3e_left.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_ped_push_button_to_cross_r10_3e_left_inv.png", - wield_image = "street_signs_ped_push_button_to_cross_r10_3e_left_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_ped_push_button_to_cross_r10_3e_left" - }) - - minetest.register_node("street_signs:sign_ped_push_button_to_cross_r10_3i"..onpole, { - description = "R10-3i: Pedestrians, push button to cross (pointing right, with street name)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_9x15"..onpole..".obj", - tiles = { "street_signs_ped_push_button_to_cross_r10_3i.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_ped_push_button_to_cross_r10_3i_inv.png", - wield_image = "street_signs_ped_push_button_to_cross_r10_3i_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - after_place_node = signs_lib.after_place_node, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - on_rotate = signs_lib.wallmounted_rotate, - number_of_lines = 1, - horiz_scaling = 3, - vert_scaling = 12, - line_spacing = 1, - font_size = 31, - x_offset = 15, - y_offset = 333, - chars_per_line = 25, - entity_info = { - mesh = "street_signs_generic_sign_9x15_entity"..onpole..".obj", - yaw = signs_lib.wallmounted_yaw - }, - drop = "street_signs:sign_ped_push_button_to_cross_r10_3i" - }) - - minetest.register_node("street_signs:sign_ped_push_button_to_cross_r10_3i_left"..onpole, { - description = "R10-3i: Pedestrians, push button to cross (pointing left, with street name)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_9x15"..onpole..".obj", - tiles = { "street_signs_ped_push_button_to_cross_r10_3i_left.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_ped_push_button_to_cross_r10_3i_left_inv.png", - wield_image = "street_signs_ped_push_button_to_cross_r10_3i_left_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - after_place_node = signs_lib.after_place_node, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - on_rotate = signs_lib.wallmounted_rotate, - number_of_lines = 1, - horiz_scaling = 3, - vert_scaling = 12, - line_spacing = 1, - font_size = 31, - x_offset = 15, - y_offset = 333, - chars_per_line = 25, - entity_info = { - mesh = "street_signs_generic_sign_9x15_entity"..onpole..".obj", - yaw = signs_lib.wallmounted_yaw - }, - drop = "street_signs:sign_ped_push_button_to_cross_r10_3i_left" - }) - - cbox = signs_lib.make_selection_boxes(30, 36, onpole) - - minetest.register_node("street_signs:sign_left_on_green_arrow_only"..onpole, { - description = "R10-5: Left on green arrow only sign", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_30x36"..onpole..".obj", - tiles = { "street_signs_left_on_green_arrow_only.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_left_on_green_arrow_only_inv.png", - wield_image = "street_signs_left_on_green_arrow_only_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_left_on_green_arrow_only" - }) - - cbox = signs_lib.make_selection_boxes(24, 36, onpole) - - minetest.register_node("street_signs:sign_stop_here_on_red"..onpole, { - description = "R10-6: Stop here on red sign", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_24x36"..onpole..".obj", - tiles = { "street_signs_stop_here_on_red.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_stop_here_on_red_inv.png", - wield_image = "street_signs_stop_here_on_red_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_stop_here_on_red" - }) - - cbox = signs_lib.make_selection_boxes(36, 42, onpole) - - minetest.register_node("street_signs:sign_use_lane_with_green_arrow"..onpole, { - description = "R10-8: Use lane with green arrow", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_36x42"..onpole..".obj", - tiles = { "street_signs_use_lane_with_green_arrow.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_use_lane_with_green_arrow_inv.png", - wield_image = "street_signs_use_lane_with_green_arrow_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:use_lane_with_green_arrow" - }) - - cbox = signs_lib.make_selection_boxes(36, 48, onpole) - - minetest.register_node("street_signs:sign_no_turn_on_red_light"..onpole, { - description = "R10-11: No turn on red light", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_36x48"..onpole..".obj", - tiles = { "street_signs_no_turn_on_red_light.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_no_turn_on_red_light_inv.png", - wield_image = "street_signs_no_turn_on_red_light_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:no_turn_on_red_light" - }) - - cbox = signs_lib.make_selection_boxes(30, 36, onpole) - - minetest.register_node("street_signs:sign_left_turn_yield_on_green_light"..onpole, { - description = "R10-12: Left turn yield on green light", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_30x36"..onpole..".obj", - tiles = { "street_signs_left_turn_yield_on_green_light.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_left_turn_yield_on_green_light_inv.png", - wield_image = "street_signs_left_turn_yield_on_green_light_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_left_turn_yield_on_green_light" - }) - - cbox = signs_lib.make_selection_boxes(24, 30, onpole) - - minetest.register_node("street_signs:sign_crosswalk_stop_on_red_light"..onpole, { - description = "R10-23: Crosswalk: stop on red light", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_24x30"..onpole..".obj", - tiles = { "street_signs_crosswalk_stop_on_red_light.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_crosswalk_stop_on_red_light_inv.png", - wield_image = "street_signs_crosswalk_stop_on_red_light_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_crosswalk_stop_on_red_light" - }) - - cbox = signs_lib.make_selection_boxes(9, 12, onpole, 0, 0, -1.25) - - minetest.register_node("street_signs:sign_ped_push_button_to_turn_on_warning_lights"..onpole, { - description = "R10-25: Pedestrians, push button to turn on warning lights", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_9x12"..onpole..".obj", - tiles = { "street_signs_ped_push_button_to_turn_on_warning_lights.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_ped_push_button_to_turn_on_warning_lights_inv.png", - wield_image = "street_signs_ped_push_button_to_turn_on_warning_lights_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_ped_push_button_to_turn_on_warning_lights" - }) - - cbox = signs_lib.make_selection_boxes(41, 41, onpole) - - minetest.register_node("street_signs:sign_rr_grade_crossbuck"..onpole, { - description = "R15-1: Railroad grade crossing (crossbuck)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_rr_grade_crossbuck"..onpole..".obj", - tiles = { "street_signs_rr_grade_crossbuck.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_rr_grade_crossbuck_inv.png", - wield_image = "street_signs_rr_grade_crossbuck_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_rr_grade_crossbuck" - }) - - cbox = signs_lib.make_selection_boxes(24, 12, onpole, 0, 12, 0) - - minetest.register_node("street_signs:sign_rr_exempt_r15_3p"..onpole, { - description = "R15-3P: Railroad \"EXEMPT\" sign (white)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_24x12_top"..onpole..".obj", - tiles = { "street_signs_rr_exempt_r15_3p.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_rr_exempt_r15_3p_inv.png", - wield_image = "street_signs_rr_exempt_r15_3p_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_rr_exempt_r15_3p" - }) - - - table.insert(signs_lib.lbm_restore_nodes, "street_signs:sign_ped_push_button_to_cross_r10_3i"..onpole) - table.insert(signs_lib.lbm_restore_nodes, "street_signs:sign_ped_push_button_to_cross_r10_3i_left"..onpole) - table.insert(signs_lib.lbm_restore_nodes, "street_signs:sign_speed_limit"..onpole) -end +local cbox = signs_lib.make_selection_boxes(36, 36) + + +signs_lib.register_sign("street_signs:sign_stop", { + description = "R1-1: Stop sign", + selection_box = cbox, + mesh = "street_signs_stop.obj", + tiles = { + "street_signs_stop.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_stop_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +cbox = signs_lib.make_selection_boxes(36, 43.1, nil, 0, -3.55, 0) + +signs_lib.register_sign("street_signs:sign_stop_all_way", { + description = "R1-1 + R1-3P: Stop sign with \"all way\" plaque", + selection_box = cbox, + mesh = "street_signs_stop_all_way.obj", + tiles = { + "street_signs_stop.png", + "street_signs_sign_edge.png", + "street_signs_stop_all_way_plaque.png", + }, + inventory_image = "street_signs_stop_all_way_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +cbox = signs_lib.make_selection_boxes(48, 48) + +signs_lib.register_sign("street_signs:sign_yield", { + description = "R1-2: Yield sign", + selection_box = cbox, + mesh = "street_signs_yield.obj", + tiles = { + "street_signs_yield.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_yield_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +cbox = signs_lib.make_selection_boxes(30, 36) + +signs_lib.register_sign("street_signs:sign_speed_limit", { + description = "R2-1: Generic speed limit sign", + selection_box = cbox, + mesh = "street_signs_generic_sign_30x36.obj", + tiles = { + "street_signs_speed_limit.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_speed_limit_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, + number_of_lines = 1, + horiz_scaling = 2.65, + vert_scaling = 2.3, + line_spacing = 1, + font_size = 31, + x_offset = 8, + y_offset = 37, + chars_per_line = 4, + entity_info = { + mesh = "street_signs_generic_sign_30x36_entity.obj", + yaw = signs_lib.wallmounted_yaw + }, +}) + +cbox = signs_lib.make_selection_boxes(36, 36) + +signs_lib.register_sign("street_signs:sign_no_right_turn", { + description = "R3-1: No right turn", + selection_box = cbox, + mesh = "street_signs_generic_sign_36x36.obj", + tiles = { + "street_signs_no_right_turn.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_no_right_turn_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +signs_lib.register_sign("street_signs:sign_no_left_turn", { + description = "R3-2: No left turn", + selection_box = cbox, + mesh = "street_signs_generic_sign_36x36.obj", + tiles = { + "street_signs_no_left_turn.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_no_left_turn_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +signs_lib.register_sign("street_signs:sign_no_u_turn", { + description = "R3-4: No U-turn", + selection_box = cbox, + mesh = "street_signs_generic_sign_36x36.obj", + tiles = { + "street_signs_no_u_turn.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_no_u_turn_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +signs_lib.register_sign("street_signs:sign_u_turn_here", { + description = "U-turn here", + selection_box = cbox, + mesh = "street_signs_generic_sign_36x36.obj", + tiles = { + "street_signs_u_turn_here.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_u_turn_here_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +cbox = signs_lib.make_selection_boxes(30, 36) + +signs_lib.register_sign("street_signs:sign_left_turn_only", { + description = "R3-5: Left turn only", + selection_box = cbox, + mesh = "street_signs_generic_sign_30x36.obj", + tiles = { + "street_signs_left_turn_only.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_left_turn_only_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +signs_lib.register_sign("street_signs:sign_right_turn_only", { + description = "R3-5: Right turn only", + selection_box = cbox, + mesh = "street_signs_generic_sign_30x36.obj", + tiles = { + "street_signs_right_turn_only.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_right_turn_only_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +signs_lib.register_sign("street_signs:sign_straight_through_only", { + description = "R3-5a: Straight through only", + selection_box = cbox, + mesh = "street_signs_generic_sign_30x36.obj", + tiles = { + "street_signs_straight_through_only.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_straight_through_only_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +signs_lib.register_sign("street_signs:sign_left_turn_or_straight", { + description = "R3-6: Left turn or straight through", + selection_box = cbox, + mesh = "street_signs_generic_sign_30x36.obj", + tiles = { + "street_signs_left_turn_or_straight.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_left_turn_or_straight_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +signs_lib.register_sign("street_signs:sign_right_turn_or_straight", { + description = "R3-6: Right turn or straight through", + selection_box = cbox, + mesh = "street_signs_generic_sign_30x36.obj", + tiles = { + "street_signs_right_turn_or_straight.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_right_turn_or_straight_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +cbox = signs_lib.make_selection_boxes(36, 36) + +signs_lib.register_sign("street_signs:sign_left_lane_must_turn_left", { + description = "R3-7: Left lane must turn left", + selection_box = cbox, + mesh = "street_signs_generic_sign_36x36.obj", + tiles = { + "street_signs_left_lane_must_turn_left.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_left_lane_must_turn_left_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +signs_lib.register_sign("street_signs:sign_right_lane_must_turn_right", { + description = "R3-7: Right lane must turn right", + selection_box = cbox, + mesh = "street_signs_generic_sign_36x36.obj", + tiles = { + "street_signs_right_lane_must_turn_right.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_right_lane_must_turn_right_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +signs_lib.register_sign("street_signs:sign_no_straight_through", { + description = "R3-27: No straight through", + selection_box = cbox, + mesh = "street_signs_generic_sign_36x36.obj", + tiles = { + "street_signs_no_straight_through.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_no_straight_through_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +cbox = signs_lib.make_selection_boxes(36, 48) + +signs_lib.register_sign("street_signs:sign_keep_right", { + description = "R4-7: Keep right sign", + selection_box = cbox, + mesh = "street_signs_generic_sign_36x48.obj", + tiles = { + "street_signs_keep_right.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_keep_right_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +signs_lib.register_sign("street_signs:sign_keep_left", { + description = "R4-8: Keep left sign", + selection_box = cbox, + mesh = "street_signs_generic_sign_36x48.obj", + tiles = { + "street_signs_keep_left.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_keep_left_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +cbox = signs_lib.make_selection_boxes(36, 36) + +signs_lib.register_sign("street_signs:sign_do_not_enter", { + description = "R5-1: Do not enter sign", + selection_box = cbox, + mesh = "street_signs_generic_sign_36x36.obj", + tiles = { + "street_signs_do_not_enter.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_do_not_enter_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +cbox = signs_lib.make_selection_boxes(42, 30) + +signs_lib.register_sign("street_signs:sign_wrong_way", { + description = "R5-1a: Wrong way sign", + selection_box = cbox, + mesh = "street_signs_generic_sign_42x30.obj", + tiles = { + "street_signs_wrong_way.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_wrong_way_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +cbox = signs_lib.make_selection_boxes(54, 18) + +signs_lib.register_sign("street_signs:sign_one_way_left", { + description = "R6-1: One way (left)", + selection_box = cbox, + mesh = "street_signs_generic_sign_54x18.obj", + tiles = { + "street_signs_one_way_left.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_one_way_left_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +signs_lib.register_sign("street_signs:sign_one_way_right", { + description = "R6-1: One way (right)", + selection_box = cbox, + mesh = "street_signs_generic_sign_54x18.obj", + tiles = { + "street_signs_one_way_right.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_one_way_right_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +cbox = signs_lib.make_selection_boxes(30, 24) + +signs_lib.register_sign("street_signs:sign_divided_highway_with_cross_road", { + description = "R6-3: divided highway with cross road", + selection_box = cbox, + mesh = "street_signs_generic_sign_30x24.obj", + tiles = { + "street_signs_divided_highway_with_cross_road.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_divided_highway_with_cross_road_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +cbox = signs_lib.make_selection_boxes(60, 24) + +signs_lib.register_sign("street_signs:sign_roundabout_directional", { + description = "R6-4b: Roundabout direction (4 chevrons)", + selection_box = cbox, + mesh = "street_signs_generic_sign_60x24.obj", + tiles = { + "street_signs_roundabout_directional.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_roundabout_directional_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +signs_lib.register_sign("street_signs:sign_roundabout_directional_left", { + description = "R6-4b: Roundabout direction (4 chevrons, pointing left)", + selection_box = cbox, + mesh = "street_signs_generic_sign_60x24.obj", + tiles = { + "street_signs_roundabout_directional_left.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_roundabout_directional_left_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +cbox = signs_lib.make_selection_boxes(30, 30) + +signs_lib.register_sign("street_signs:sign_roundabout_counter_clockwise", { + description = "R6-5P: Roundabout plaque (to the left/counter-clockwise)", + selection_box = cbox, + mesh = "street_signs_generic_sign_30x30.obj", + tiles = { + "street_signs_roundabout_counter_clockwise.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_roundabout_counter_clockwise_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +signs_lib.register_sign("street_signs:sign_roundabout_clockwise", { + description = "R6-5P: Roundabout plaque (to the right/clockwise)", + selection_box = cbox, + mesh = "street_signs_generic_sign_30x30.obj", + tiles = { + "street_signs_roundabout_clockwise.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_roundabout_clockwise_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +cbox = signs_lib.make_selection_boxes(24, 30) + +signs_lib.register_sign("street_signs:sign_do_not_stop_on_tracks", { + description = "R8-8: Do not stop on tracks", + selection_box = cbox, + mesh = "street_signs_generic_sign_24x30.obj", + tiles = { + "street_signs_do_not_stop_on_tracks.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_do_not_stop_on_tracks_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +cbox = signs_lib.make_selection_boxes(9, 15, nil, 0, 0, -1.25) + +signs_lib.register_sign("street_signs:sign_ped_push_button_to_cross_r10_3a", { + description = "R10-3a: Pedestrians, push button to cross (pointing left)", + selection_box = cbox, + mesh = "street_signs_generic_sign_9x15.obj", + tiles = { + "street_signs_ped_push_button_to_cross_r10_3a.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_ped_push_button_to_cross_r10_3a_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, + uses_slim_pole_mount = true, +}) + +signs_lib.register_sign("street_signs:sign_ped_push_button_to_cross_r10_3a_right", { + description = "R10-3a: Pedestrians, push button to cross (pointing right)", + selection_box = cbox, + mesh = "street_signs_generic_sign_9x15.obj", + tiles = { + "street_signs_ped_push_button_to_cross_r10_3a_right.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_ped_push_button_to_cross_r10_3a_right_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, + uses_slim_pole_mount = true, +}) + +signs_lib.register_sign("street_signs:sign_ped_push_button_to_cross_r10_3a_both_ways", { + description = "R10-3a: Pedestrians, push button to cross (pointing both ways)", + selection_box = cbox, + mesh = "street_signs_generic_sign_9x15.obj", + tiles = { + "street_signs_ped_push_button_to_cross_r10_3a_both_ways.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_ped_push_button_to_cross_r10_3a_both_ways_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, + uses_slim_pole_mount = true, +}) + +signs_lib.register_sign("street_signs:sign_ped_push_button_to_cross_r10_3e", { + description = "R10-3e: Pedestrians, push button to cross (pointing right)", + selection_box = cbox, + mesh = "street_signs_generic_sign_9x15.obj", + tiles = { + "street_signs_ped_push_button_to_cross_r10_3e.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_ped_push_button_to_cross_r10_3e_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, + uses_slim_pole_mount = true, +}) + +signs_lib.register_sign("street_signs:sign_ped_push_button_to_cross_r10_3e_left", { + description = "R10-3e: Pedestrians, push button to cross (pointing left)", + selection_box = cbox, + mesh = "street_signs_generic_sign_9x15.obj", + tiles = { + "street_signs_ped_push_button_to_cross_r10_3e_left.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_ped_push_button_to_cross_r10_3e_left_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, + uses_slim_pole_mount = true, +}) + +signs_lib.register_sign("street_signs:sign_ped_push_button_to_cross_r10_3i", { + description = "R10-3i: Pedestrians, push button to cross (pointing right, with street name)", + selection_box = cbox, + mesh = "street_signs_generic_sign_9x15.obj", + tiles = { + "street_signs_ped_push_button_to_cross_r10_3i.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_ped_push_button_to_cross_r10_3i_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, + number_of_lines = 1, + horiz_scaling = 3, + vert_scaling = 12, + line_spacing = 1, + font_size = 31, + x_offset = 15, + y_offset = 333, + chars_per_line = 25, + entity_info = { + mesh = "street_signs_generic_sign_9x15_entity.obj", + yaw = signs_lib.wallmounted_yaw + }, + uses_slim_pole_mount = true, +}) + +signs_lib.register_sign("street_signs:sign_ped_push_button_to_cross_r10_3i_left", { + description = "R10-3i: Pedestrians, push button to cross (pointing left, with street name)", + selection_box = cbox, + mesh = "street_signs_generic_sign_9x15.obj", + tiles = { + "street_signs_ped_push_button_to_cross_r10_3i_left.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_ped_push_button_to_cross_r10_3i_left_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, + number_of_lines = 1, + horiz_scaling = 3, + vert_scaling = 12, + line_spacing = 1, + font_size = 31, + x_offset = 15, + y_offset = 333, + chars_per_line = 25, + entity_info = { + mesh = "street_signs_generic_sign_9x15_entity.obj", + yaw = signs_lib.wallmounted_yaw + }, + uses_slim_pole_mount = true, +}) + + +cbox = signs_lib.make_selection_boxes(30, 36) + +signs_lib.register_sign("street_signs:sign_left_on_green_arrow_only", { + description = "R10-5: Left on green arrow only sign", + selection_box = cbox, + mesh = "street_signs_generic_sign_30x36.obj", + tiles = { + "street_signs_left_on_green_arrow_only.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_left_on_green_arrow_only_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +cbox = signs_lib.make_selection_boxes(24, 36) + +signs_lib.register_sign("street_signs:sign_stop_here_on_red", { + description = "R10-6: Stop here on red sign", + selection_box = cbox, + mesh = "street_signs_generic_sign_24x36.obj", + tiles = { + "street_signs_stop_here_on_red.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_stop_here_on_red_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +cbox = signs_lib.make_selection_boxes(36, 42) + +signs_lib.register_sign("street_signs:sign_use_lane_with_green_arrow", { + description = "R10-8: Use lane with green arrow", + selection_box = cbox, + mesh = "street_signs_generic_sign_36x42.obj", + tiles = { + "street_signs_use_lane_with_green_arrow.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_use_lane_with_green_arrow_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +cbox = signs_lib.make_selection_boxes(36, 48) + +signs_lib.register_sign("street_signs:sign_no_turn_on_red_light", { + description = "R10-11: No turn on red light", + selection_box = cbox, + mesh = "street_signs_generic_sign_36x48.obj", + tiles = { + "street_signs_no_turn_on_red_light.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_no_turn_on_red_light_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +cbox = signs_lib.make_selection_boxes(30, 36) + +signs_lib.register_sign("street_signs:sign_left_turn_yield_on_green_light", { + description = "R10-12: Left turn yield on green light", + selection_box = cbox, + mesh = "street_signs_generic_sign_30x36.obj", + tiles = { + "street_signs_left_turn_yield_on_green_light.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_left_turn_yield_on_green_light_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +cbox = signs_lib.make_selection_boxes(24, 30) + +signs_lib.register_sign("street_signs:sign_crosswalk_stop_on_red_light", { + description = "R10-23: Crosswalk: stop on red light", + selection_box = cbox, + mesh = "street_signs_generic_sign_24x30.obj", + tiles = { + "street_signs_crosswalk_stop_on_red_light.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_crosswalk_stop_on_red_light_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +cbox = signs_lib.make_selection_boxes(9, 12, nil, 0, 0, -1.25) + +signs_lib.register_sign("street_signs:sign_ped_push_button_to_turn_on_warning_lights", { + description = "R10-25: Pedestrians, push button to turn on warning lights", + selection_box = cbox, + mesh = "street_signs_generic_sign_9x12.obj", + tiles = { + "street_signs_ped_push_button_to_turn_on_warning_lights.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_ped_push_button_to_turn_on_warning_lights_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, + uses_slim_pole_mount = true, +}) + +cbox = signs_lib.make_selection_boxes(41, 41) + +signs_lib.register_sign("street_signs:sign_rr_grade_crossbuck", { + description = "R15-1: Railroad grade crossing (crossbuck)", + selection_box = cbox, + mesh = "street_signs_rr_grade_crossbuck.obj", + tiles = { + "street_signs_rr_grade_crossbuck.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_rr_grade_crossbuck_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) + +cbox = signs_lib.make_selection_boxes(24, 12, nil, 0, 12, 0) + +signs_lib.register_sign("street_signs:sign_rr_exempt_r15_3p", { + description = "R15-3P: Railroad \"EXEMPT\" sign (white)", + selection_box = cbox, + mesh = "street_signs_generic_sign_24x12_top.obj", + tiles = { + "street_signs_rr_exempt_r15_3p.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_rr_exempt_r15_3p_inv.png", + groups = groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) cbox = { type = "fixed", fixed = { -0.1875, -0.5, -0.25, 0.1875, 0.6125, 0.25 } } -minetest.register_node("street_signs:sign_stop_for_ped", { +signs_lib.register_sign("street_signs:sign_stop_for_ped", { description = "R1-6a: Stop for pedestrian in crosswalk sign", - paramtype = "light", - sunlight_propagates = true, paramtype2 = "facedir", - drawtype = "mesh", - node_box = cbox, selection_box = cbox, mesh = "street_signs_stop_for_ped.obj", - tiles = { "street_signs_stop_for_ped.png" }, + tiles = { + "street_signs_stop_for_ped.png", + "street_signs_sign_edge.png" + }, inventory_image = "street_signs_stop_for_ped_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2}, + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, + allow_onpole = false }) diff --git a/street_signs/signs_class_w.lua b/street_signs/signs_class_w.lua index 7487a959..e4227244 100644 --- a/street_signs/signs_class_w.lua +++ b/street_signs/signs_class_w.lua @@ -1,1084 +1,640 @@ -- Class-W signs - local S = signs_lib.gettext -local cbox +local cbox = signs_lib.make_selection_boxes(36, 36, onpole) -for _, onpole in ipairs({"", "_onpole"}) do +signs_lib.register_sign("street_signs:sign_road_turns_sharp_left", { + description = "W1-1: Road turns, sharp left ahead", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_road_turns_sharp_left.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_road_turns_sharp_left_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - local nci = nil - local on_rotate = signs_lib.wallmounted_rotate - local pole_mount_tex = nil +signs_lib.register_sign("street_signs:sign_road_turns_sharp_right", { + description = "W1-1: Road turns, sharp right ahead", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_road_turns_sharp_right.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_road_turns_sharp_right_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - if onpole == "_onpole" then - nci = 1 - on_rotate = nil - pole_mount_tex = "signs_lib_pole_mount.png" - end +signs_lib.register_sign("street_signs:sign_road_turns_left", { + description = "W1-2: Road turns left ahead", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_road_turns_left.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_road_turns_left_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - cbox = signs_lib.make_selection_boxes(36, 36, onpole) +signs_lib.register_sign("street_signs:sign_road_turns_right", { + description = "W1-2: Road turns right ahead", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_road_turns_right.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_road_turns_right_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_road_turns_sharp_left"..onpole, { - description = "W1-1: Road turns, sharp left ahead", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_road_turns_sharp_left.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_road_turns_sharp_left_inv.png", - wield_image = "street_signs_road_turns_sharp_left_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_road_turns_sharp_left" - }) +signs_lib.register_sign("street_signs:sign_road_turns_dog_leg_left", { + description = "W1-3: Road turns, sharp dog-leg to the left ahead", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_road_turns_dog_leg_left.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_road_turns_dog_leg_left_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_road_turns_sharp_right"..onpole, { - description = "W1-1: Road turns, sharp right ahead", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_road_turns_sharp_right.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_road_turns_sharp_right_inv.png", - wield_image = "street_signs_road_turns_sharp_right_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_road_turns_sharp_right" - }) +signs_lib.register_sign("street_signs:sign_road_turns_dog_leg_right", { + description = "W1-3: Road turns, sharp dog-leg to the right ahead", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_road_turns_dog_leg_right.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_road_turns_dog_leg_right_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_road_turns_left"..onpole, { - description = "W1-2: Road turns left ahead", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_road_turns_left.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_road_turns_left_inv.png", - wield_image = "street_signs_road_turns_left_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_road_turns_left" - }) +signs_lib.register_sign("street_signs:sign_road_turns_dog_leg_curve_left", { + description = "W1-4: Road turns, dog-leg curve to the left ahead", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_road_turns_dog_leg_curve_left.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_road_turns_dog_leg_curve_left_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_road_turns_right"..onpole, { - description = "W1-2: Road turns right ahead", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_road_turns_right.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_road_turns_right_inv.png", - wield_image = "street_signs_road_turns_right_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_road_turns_right" - }) +signs_lib.register_sign("street_signs:sign_road_turns_dog_leg_curve_right", { + description = "W1-4: Road turns, dog-leg curve to the right ahead", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_road_turns_dog_leg_curve_right.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_road_turns_dog_leg_curve_right_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_road_turns_dog_leg_left"..onpole, { - description = "W1-3: Road turns, sharp dog-leg to the left ahead", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_road_turns_dog_leg_left.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_road_turns_dog_leg_left_inv.png", - wield_image = "street_signs_road_turns_dog_leg_left_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_road_turns_dog_leg_left" - }) +signs_lib.register_sign("street_signs:sign_road_winding", { + description = "W1-5: Winding road ahead", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_road_winding.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_road_winding_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_road_turns_dog_leg_right"..onpole, { - description = "W1-3: Road turns, sharp dog-leg to the right ahead", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_road_turns_dog_leg_right.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_road_turns_dog_leg_right_inv.png", - wield_image = "street_signs_road_turns_dog_leg_right_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_road_turns_dog_leg_right" - }) +signs_lib.register_sign("street_signs:sign_road_turns_hairpin_left", { + description = "W1-11: Road turns, hairpin curve to the left ahead", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_road_turns_hairpin_left.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_road_turns_hairpin_left_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_road_turns_dog_leg_curve_left"..onpole, { - description = "W1-4: Road turns, dog-leg curve to the left ahead", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_road_turns_dog_leg_curve_left.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_road_turns_dog_leg_curve_left_inv.png", - wield_image = "street_signs_road_turns_dog_leg_curve_left_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_road_turns_dog_leg_curve_left" - }) +signs_lib.register_sign("street_signs:sign_road_turns_hairpin_right", { + description = "W1-11: Road turns, hairpin curve to the right ahead", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_road_turns_hairpin_right.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_road_turns_hairpin_right_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_road_turns_dog_leg_curve_right"..onpole, { - description = "W1-4: Road turns, dog-leg curve to the right ahead", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_road_turns_dog_leg_curve_right.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_road_turns_dog_leg_curve_right_inv.png", - wield_image = "street_signs_road_turns_dog_leg_curve_right_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_road_turns_dog_leg_curve_right" - }) +signs_lib.register_sign("street_signs:sign_road_turns_270_left", { + description = "W1-15: Road turns, 270 degree loop to the left ahead", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_road_turns_270_left.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_road_turns_270_left_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_road_winding"..onpole, { - description = "W1-5: Winding road ahead", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_road_winding.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_road_winding_inv.png", - wield_image = "street_signs_road_winding_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_road_winding" - }) +signs_lib.register_sign("street_signs:sign_road_turns_270_right", { + description = "W1-15: Road turns, 270 degree loop to the right ahead", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_road_turns_270_right.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_road_turns_270_right_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) +cbox = signs_lib.make_selection_boxes(48, 24, onpole) - minetest.register_node("street_signs:sign_road_turns_hairpin_left"..onpole, { - description = "W1-11: Road turns, hairpin curve to the left ahead", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_road_turns_hairpin_left.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_road_turns_hairpin_left_inv.png", - wield_image = "street_signs_road_turns_hairpin_left_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_road_turns_hairpin_left" - }) +signs_lib.register_sign("street_signs:sign_large_arrow_left", { + description = "W1-6: Large arrow pointing left", + selection_box = cbox, + mesh = "street_signs_generic_sign_48x24.obj", + tiles = { + "street_signs_large_arrow_left.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_large_arrow_left_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_road_turns_hairpin_right"..onpole, { - description = "W1-11: Road turns, hairpin curve to the right ahead", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_road_turns_hairpin_right.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_road_turns_hairpin_right_inv.png", - wield_image = "street_signs_road_turns_hairpin_right_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_road_turns_hairpin_right" - }) +signs_lib.register_sign("street_signs:sign_large_arrow_right", { + description = "W1-6: Large arrow pointing right", + selection_box = cbox, + mesh = "street_signs_generic_sign_48x24.obj", + tiles = { + "street_signs_large_arrow_right.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_large_arrow_right_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_road_turns_270_left"..onpole, { - description = "W1-15: Road turns, 270 degree loop to the left ahead", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_road_turns_270_left.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_road_turns_270_left_inv.png", - wield_image = "street_signs_road_turns_270_left_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_road_turns_270_left" - }) +signs_lib.register_sign("street_signs:sign_two_direction_large_arrow", { + description = "W1-7: Two direction large arrow", + selection_box = cbox, + mesh = "street_signs_generic_sign_48x24.obj", + tiles = { + "street_signs_two_direction_large_arrow.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_two_direction_large_arrow_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) +cbox = signs_lib.make_selection_boxes(36, 36, onpole) - minetest.register_node("street_signs:sign_road_turns_270_right"..onpole, { - description = "W1-15: Road turns, 270 degree loop to the right ahead", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_road_turns_270_right.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_road_turns_270_right_inv.png", - wield_image = "street_signs_road_turns_270_right_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_road_turns_270_right" - }) +signs_lib.register_sign("street_signs:sign_cross_road_ahead", { + description = "W2-1: Cross-road ahead", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_cross_road_ahead.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_cross_road_ahead_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - cbox = signs_lib.make_selection_boxes(48, 24, onpole) +signs_lib.register_sign("street_signs:sign_side_road_right_ahead", { + description = "W2-2: Side road ahead (right)", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_side_road_right_ahead.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_side_road_right_ahead_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_large_arrow_left"..onpole, { - description = "W1-6: Large arrow pointing left", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_48x24"..onpole..".obj", - tiles = { "street_signs_large_arrow_left.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_large_arrow_left_inv.png", - wield_image = "street_signs_large_arrow_left_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_large_arrow_left" - }) +signs_lib.register_sign("street_signs:sign_side_road_left_ahead", { + description = "W2-2: Side road ahead (left)", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_side_road_left_ahead.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_side_road_left_ahead_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_large_arrow_right"..onpole, { - description = "W1-6: Large arrow pointing right", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_48x24"..onpole..".obj", - tiles = { "street_signs_large_arrow_right.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_large_arrow_right_inv.png", - wield_image = "street_signs_large_arrow_right_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_large_arrow_right" - }) +signs_lib.register_sign("street_signs:sign_t_junction_ahead", { + description = "W2-4: \"T\" junction ahead", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_t_junction_ahead.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_t_junction_ahead_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_two_direction_large_arrow"..onpole, { - description = "W1-7: Two direction large arrow", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_48x24"..onpole..".obj", - tiles = { "street_signs_two_direction_large_arrow.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_two_direction_large_arrow_inv.png", - wield_image = "street_signs_two_direction_large_arrow_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_two_direction_large_arrow" - }) +signs_lib.register_sign("street_signs:sign_circular_intersection_ahead", { + description = "W2-6: Roundabout/traffic circle ahead", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_circular_intersection_ahead.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_circular_intersection_ahead_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - cbox = signs_lib.make_selection_boxes(36, 36, onpole) +signs_lib.register_sign("street_signs:sign_offset_side_road_left_ahead", { + description = "W2-7L: Offset side-roads ahead (left first)", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_offset_side_road_left_ahead.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_offset_side_road_left_ahead_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_cross_road_ahead"..onpole, { - description = "W2-1: Cross-road ahead", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_cross_road_ahead.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_cross_road_ahead_inv.png", - wield_image = "street_signs_cross_road_ahead_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_cross_road_ahead" - }) +signs_lib.register_sign("street_signs:sign_offset_side_road_right_ahead", { + description = "W2-7R: Offset side-roads ahead (right first)", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_offset_side_road_right_ahead.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_offset_side_road_right_ahead_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_side_road_right_ahead"..onpole, { - description = "W2-2: Side road ahead (right)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_side_road_right_ahead.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_side_road_right_ahead_inv.png", - wield_image = "street_signs_side_road_right_ahead_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_side_road_right_ahead" - }) +signs_lib.register_sign("street_signs:sign_stop_ahead", { + description = "W3-1: Stop sign ahead", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_stop_ahead.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_stop_ahead_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_side_road_left_ahead"..onpole, { - description = "W2-2: Side road ahead (left)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_side_road_left_ahead.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_side_road_left_ahead_inv.png", - wield_image = "street_signs_side_road_left_ahead_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_side_road_left_ahead" - }) +signs_lib.register_sign("street_signs:sign_yield_ahead", { + description = "W3-2: Yield sign ahead", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_yield_ahead.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_yield_ahead_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_t_junction_ahead"..onpole, { - description = "W2-4: \"T\" junction ahead", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_t_junction_ahead.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_t_junction_ahead_inv.png", - wield_image = "street_signs_t_junction_ahead_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_t_junction_ahead" - }) +signs_lib.register_sign("street_signs:sign_signal_ahead", { + description = "W3-3: Traffic signal ahead", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_signal_ahead.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_signal_ahead_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_circular_intersection_ahead"..onpole, { - description = "W2-6: Roundabout/traffic circle ahead", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_circular_intersection_ahead.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_circular_intersection_ahead_inv.png", - wield_image = "street_signs_circular_intersection_ahead_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_circular_intersection_ahead" - }) +signs_lib.register_sign("street_signs:sign_merging_traffic", { + description = "W4-1: Traffic merging from right sign", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_merging_traffic.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_merging_traffic_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_offset_side_road_left_ahead"..onpole, { - description = "W2-7L: Offset side-roads ahead (left first)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_offset_side_road_left_ahead.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_offset_side_road_left_ahead_inv.png", - wield_image = "street_signs_offset_side_road_left_ahead_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_offset_side_road_left_ahead" - }) +signs_lib.register_sign("street_signs:sign_left_lane_ends", { + description = "W4-2: Left lane ends sign", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_left_lane_ends.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_left_lane_ends_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_offset_side_road_right_ahead"..onpole, { - description = "W2-7R: Offset side-roads ahead (right first)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_offset_side_road_right_ahead.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_offset_side_road_right_ahead_inv.png", - wield_image = "street_signs_offset_side_road_right_ahead_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_offset_side_road_right_ahead" - }) +signs_lib.register_sign("street_signs:sign_right_lane_ends", { + description = "W4-2: Right lane ends sign", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_right_lane_ends.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_right_lane_ends_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_stop_ahead"..onpole, { - description = "W3-1: Stop sign ahead", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_stop_ahead.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_stop_ahead_inv.png", - wield_image = "street_signs_stop_ahead_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_stop_ahead" - }) +signs_lib.register_sign("street_signs:sign_divided_highway_begins", { + description = "W6-1: Divided highway begins sign", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_divided_highway_begins.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_divided_highway_begins_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_yield_ahead"..onpole, { - description = "W3-2: Yield sign ahead", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_yield_ahead.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_yield_ahead_inv.png", - wield_image = "street_signs_yield_ahead_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_yield_ahead" - }) +signs_lib.register_sign("street_signs:sign_divided_highway_ends", { + description = "W6-2: Divided highway ends sign", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_divided_highway_ends.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_divided_highway_ends_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_signal_ahead"..onpole, { - description = "W3-3: Traffic signal ahead", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_signal_ahead.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_signal_ahead_inv.png", - wield_image = "street_signs_signal_ahead_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_signal_ahead" - }) +signs_lib.register_sign("street_signs:sign_two_way_traffic", { + description = "W6-3: Two-way traffic sign", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_two_way_traffic.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_two_way_traffic_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_merging_traffic"..onpole, { - description = "W4-1: Traffic merging from right sign", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_merging_traffic.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_merging_traffic_inv.png", - wield_image = "street_signs_merging_traffic_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_merging_traffic" - }) +signs_lib.register_sign("street_signs:sign_hill_with_grade_ahead", { + description = "W7-1a: Hill with grade ahead", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_hill_with_grade_ahead.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_hill_with_grade_ahead_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, + number_of_lines = 1, + horiz_scaling = 1.9, + vert_scaling = 4.6, + line_spacing = 1, + font_size = 31, + x_offset = 8, + y_offset = 93, + chars_per_line = 15, + entity_info = { + mesh = "street_signs_warning_36x36_entity.obj", + yaw = signs_lib.wallmounted_yaw + }, +}) +cbox = signs_lib.make_selection_boxes(24, 18, onpole, 0, 9.75, 0) - minetest.register_node("street_signs:sign_left_lane_ends"..onpole, { - description = "W4-2: Left lane ends sign", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_left_lane_ends.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_left_lane_ends_inv.png", - wield_image = "street_signs_left_lane_ends_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_left_lane_ends" - }) +signs_lib.register_sign("street_signs:sign_distance_2_lines", { + description = "W7-3aP: Blank distance sign (like \"Next X Miles\", 2 lines, yellow)", + selection_box = cbox, + mesh = "street_signs_generic_sign_24x18_top.obj", + tiles = { + "street_signs_distance_2_lines.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_distance_2_lines_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, + number_of_lines = 2, + horiz_scaling = 1.8, + vert_scaling = 1.25, + line_spacing = 1, + font_size = 31, + x_offset = 12, + y_offset = 12, + chars_per_line = 20, + entity_info = { + mesh = "street_signs_generic_sign_24x18_top_entity.obj", + yaw = signs_lib.wallmounted_yaw + }, +}) - minetest.register_node("street_signs:sign_right_lane_ends"..onpole, { - description = "W4-2: Right lane ends sign", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_right_lane_ends.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_right_lane_ends_inv.png", - wield_image = "street_signs_right_lane_ends_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_right_lane_ends" - }) +signs_lib.register_sign("street_signs:sign_distance_2_lines_orange", { + description = "W7-3aP: Blank distance sign (like \"Next X Miles\", 2 lines, orange)", + selection_box = cbox, + mesh = "street_signs_generic_sign_24x18_top.obj", + tiles = { + "street_signs_distance_2_lines_orange.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_distance_2_lines_orange_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, + number_of_lines = 2, + horiz_scaling = 1.8, + vert_scaling = 1.25, + line_spacing = 1, + font_size = 31, + x_offset = 12, + y_offset = 12, + chars_per_line = 20, + entity_info = { + mesh = "street_signs_generic_sign_24x18_top_entity.obj", + yaw = signs_lib.wallmounted_yaw + }, +}) +cbox = signs_lib.make_selection_boxes(30, 30, onpole) - minetest.register_node("street_signs:sign_divided_highway_begins"..onpole, { - description = "W6-1: Divided highway begins sign", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_divided_highway_begins.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_divided_highway_begins_inv.png", - wield_image = "street_signs_divided_highway_begins_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_divided_highway_begins" - }) +signs_lib.register_sign("street_signs:sign_rr_grade_crossing_advance", { + description = "W10-1: Railroad grade crossing advance warning", + selection_box = cbox, + mesh = "street_signs_generic_sign_30dia.obj", + tiles = { + "street_signs_rr_grade_crossing_advance.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_rr_grade_crossing_advance_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) +cbox = signs_lib.make_selection_boxes(24, 12, onpole, 0, 12, 0) - minetest.register_node("street_signs:sign_divided_highway_ends"..onpole, { - description = "W6-2: Divided highway ends sign", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_divided_highway_ends.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_divided_highway_ends_inv.png", - wield_image = "street_signs_divided_highway_ends_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_divided_highway_ends" - }) +signs_lib.register_sign("street_signs:sign_rr_exempt_w10_1ap", { + description = "W10-1aP: Railroad \"EXEMPT\" sign (yellow)", + selection_box = cbox, + mesh = "street_signs_generic_sign_24x12_top.obj", + tiles = { + "street_signs_rr_exempt_w10_1ap.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_rr_exempt_w10_1ap_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) +cbox = signs_lib.make_selection_boxes(36, 36, onpole) - minetest.register_node("street_signs:sign_two_way_traffic"..onpole, { - description = "W6-3: Two-way traffic sign", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_two_way_traffic.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_two_way_traffic_inv.png", - wield_image = "street_signs_two_way_traffic_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_two_way_traffic" - }) +signs_lib.register_sign("street_signs:sign_pedestrian_crossing", { + description = "W11-2: Pedestrian crossing sign", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_pedestrian_crossing.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_pedestrian_crossing_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, +}) - minetest.register_node("street_signs:sign_hill_with_grade_ahead"..onpole, { - description = "W7-1a: Hill with grade ahead", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_hill_with_grade_ahead.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_hill_with_grade_ahead_inv.png", - wield_image = "street_signs_hill_with_grade_ahead_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - after_place_node = signs_lib.after_place_node, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - on_rotate = signs_lib.wallmounted_rotate, - number_of_lines = 1, - horiz_scaling = 1.9, - vert_scaling = 4.6, - line_spacing = 1, - font_size = 31, - x_offset = 8, - y_offset = 93, - chars_per_line = 15, - entity_info = { - mesh = "street_signs_warning_36x36_entity"..onpole..".obj", - yaw = signs_lib.wallmounted_yaw - }, - drop = "street_signs:sign_hill_with_grade_ahead" - }) +signs_lib.register_sign("street_signs:sign_low_clearance", { + description = "W12-2: Low clearance", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_low_clearance.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_low_clearance_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, + number_of_lines = 1, + horiz_scaling = 1.3, + vert_scaling = 3, + line_spacing = 1, + font_size = 31, + x_offset = 8, + y_offset = 36, + chars_per_line = 15, + entity_info = { + mesh = "street_signs_warning_36x36_entity.obj", + yaw = signs_lib.wallmounted_yaw + }, +}) +cbox = signs_lib.make_selection_boxes(18, 18, onpole, 0, 10, 0) - cbox = signs_lib.make_selection_boxes(24, 18, onpole, 0, 9.75, 0) +signs_lib.register_sign("street_signs:sign_advisory_speed_mph", { + description = "W13-1P: Advisory speed (MPH)", + selection_box = cbox, + mesh = "street_signs_generic_sign_18x18_top.obj", + tiles = { + "street_signs_advisory_speed_mph.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_advisory_speed_mph_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, + number_of_lines = 1, + horiz_scaling = 1.25, + vert_scaling = 1.5, + line_spacing = 1, + font_size = 31, + x_offset = 8, + y_offset = 5, + chars_per_line = 8, + entity_info = { + mesh = "street_signs_generic_sign_18x18_top_entity.obj", + yaw = signs_lib.wallmounted_yaw + }, +}) - minetest.register_node("street_signs:sign_distance_2_lines"..onpole, { - description = "W7-3aP: Blank distance sign (like \"Next X Miles\", 2 lines, yellow)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_24x18_top"..onpole..".obj", - tiles = { "street_signs_distance_2_lines.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_distance_2_lines_inv.png", - wield_image = "street_signs_distance_2_lines_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - after_place_node = signs_lib.after_place_node, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - on_rotate = signs_lib.wallmounted_rotate, - number_of_lines = 2, - horiz_scaling = 1.8, - vert_scaling = 1.25, - line_spacing = 1, - font_size = 31, - x_offset = 12, - y_offset = 12, - chars_per_line = 20, - entity_info = { - mesh = "street_signs_generic_sign_24x18_top_entity"..onpole..".obj", - yaw = signs_lib.wallmounted_yaw - }, - drop = "street_signs:sign_distance_2_lines" - }) +signs_lib.register_sign("street_signs:sign_advisory_speed_kmh", { + description = "W13-1P: Advisory speed (km/h)", + selection_box = cbox, + mesh = "street_signs_generic_sign_18x18_top.obj", + tiles = { + "street_signs_advisory_speed_kmh.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_advisory_speed_kmh_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, + number_of_lines = 1, + horiz_scaling = 1.25, + vert_scaling = 1.5, + line_spacing = 1, + font_size = 31, + x_offset = 8, + y_offset = 5, + chars_per_line = 8, + entity_info = { + mesh = "street_signs_generic_sign_18x18_top_entity.obj", + yaw = signs_lib.wallmounted_yaw + }, +}) - minetest.register_node("street_signs:sign_distance_2_lines_orange"..onpole, { - description = "W7-3aP: Blank distance sign (like \"Next X Miles\", 2 lines, orange)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_24x18_top"..onpole..".obj", - tiles = { "street_signs_distance_2_lines_orange.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_distance_2_lines_orange_inv.png", - wield_image = "street_signs_distance_2_lines_orange_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - after_place_node = signs_lib.after_place_node, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - on_rotate = signs_lib.wallmounted_rotate, - number_of_lines = 2, - horiz_scaling = 1.8, - vert_scaling = 1.25, - line_spacing = 1, - font_size = 31, - x_offset = 12, - y_offset = 12, - chars_per_line = 20, - entity_info = { - mesh = "street_signs_generic_sign_24x18_top_entity"..onpole..".obj", - yaw = signs_lib.wallmounted_yaw - }, - drop = "street_signs:sign_distance_2_lines_orange" - }) - - - cbox = signs_lib.make_selection_boxes(30, 30, onpole) - - minetest.register_node("street_signs:sign_rr_grade_crossing_advance"..onpole, { - description = "W10-1: Railroad grade crossing advance warning", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_30dia"..onpole..".obj", - tiles = { "street_signs_rr_grade_crossing_advance.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_rr_grade_crossing_advance_inv.png", - wield_image = "street_signs_rr_grade_crossing_advance_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_rr_grade_crossing_advance" - }) - - cbox = signs_lib.make_selection_boxes(24, 12, onpole, 0, 12, 0) - - minetest.register_node("street_signs:sign_rr_exempt_w10_1ap"..onpole, { - description = "W10-1aP: Railroad \"EXEMPT\" sign (yellow)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_24x12_top"..onpole..".obj", - tiles = { "street_signs_rr_exempt_w10_1ap.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_rr_exempt_w10_1ap_inv.png", - wield_image = "street_signs_rr_exempt_w10_1ap_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_rr_exempt_w10_1ap" - }) - - cbox = signs_lib.make_selection_boxes(36, 36, onpole) - - minetest.register_node("street_signs:sign_pedestrian_crossing"..onpole, { - description = "W11-2: Pedestrian crossing sign", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_pedestrian_crossing.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_pedestrian_crossing_inv.png", - wield_image = "street_signs_pedestrian_crossing_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - after_place_node = signs_lib.after_place_node, - on_rotate = signs_lib.wallmounted_rotate, - drop = "street_signs:sign_pedestrian_crossing" - }) - - minetest.register_node("street_signs:sign_low_clearance"..onpole, { - description = "W12-2: Low clearance", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_low_clearance.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_low_clearance_inv.png", - wield_image = "street_signs_low_clearance_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - after_place_node = signs_lib.after_place_node, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - on_rotate = signs_lib.wallmounted_rotate, - number_of_lines = 1, - horiz_scaling = 1.3, - vert_scaling = 3, - line_spacing = 1, - font_size = 31, - x_offset = 8, - y_offset = 36, - chars_per_line = 15, - entity_info = { - mesh = "street_signs_warning_36x36_entity"..onpole..".obj", - yaw = signs_lib.wallmounted_yaw - }, - drop = "street_signs:sign_low_clearance" - }) - - cbox = signs_lib.make_selection_boxes(18, 18, onpole, 0, 10, 0) - - minetest.register_node("street_signs:sign_advisory_speed_mph"..onpole, { - description = "W13-1P: Advisory speed (MPH)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_18x18_top"..onpole..".obj", - tiles = { "street_signs_advisory_speed_mph.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_advisory_speed_mph_inv.png", - wield_image = "street_signs_advisory_speed_mph_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - after_place_node = signs_lib.after_place_node, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - on_rotate = signs_lib.wallmounted_rotate, - number_of_lines = 1, - horiz_scaling = 1.25, - vert_scaling = 1.5, - line_spacing = 1, - font_size = 31, - x_offset = 8, - y_offset = 5, - chars_per_line = 8, - entity_info = { - mesh = "street_signs_generic_sign_18x18_top_entity"..onpole..".obj", - yaw = signs_lib.wallmounted_yaw - }, - drop = "street_signs:sign_advisory_speed_mph" - }) - - minetest.register_node("street_signs:sign_advisory_speed_kmh"..onpole, { - description = "W13-1P: Advisory speed (km/h)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_18x18_top"..onpole..".obj", - tiles = { "street_signs_advisory_speed_kmh.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_advisory_speed_kmh_inv.png", - wield_image = "street_signs_advisory_speed_kmh_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - after_place_node = signs_lib.after_place_node, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - on_rotate = signs_lib.wallmounted_rotate, - number_of_lines = 1, - horiz_scaling = 1.25, - vert_scaling = 1.5, - line_spacing = 1, - font_size = 31, - x_offset = 8, - y_offset = 5, - chars_per_line = 8, - entity_info = { - mesh = "street_signs_generic_sign_18x18_top_entity"..onpole..".obj", - yaw = signs_lib.wallmounted_yaw - }, - drop = "street_signs:sign_advisory_speed_kmh" - }) - - minetest.register_node("street_signs:sign_advisory_speed_ms"..onpole, { - description = "W13-1P: Advisory speed (m/s)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_generic_sign_18x18_top"..onpole..".obj", - tiles = { "street_signs_advisory_speed_ms.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_advisory_speed_ms_inv.png", - wield_image = "street_signs_advisory_speed_ms_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - after_place_node = signs_lib.after_place_node, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - on_rotate = signs_lib.wallmounted_rotate, - number_of_lines = 1, - horiz_scaling = 1.25, - vert_scaling = 1.5, - line_spacing = 1, - font_size = 31, - x_offset = 8, - y_offset = 5, - chars_per_line = 8, - entity_info = { - mesh = "street_signs_generic_sign_18x18_top_entity"..onpole..".obj", - yaw = signs_lib.wallmounted_yaw - }, - drop = "street_signs:sign_advisory_speed_ms" - }) - - table.insert(signs_lib.lbm_restore_nodes, "street_signs:sign_hill_with_grade_ahead"..onpole) - table.insert(signs_lib.lbm_restore_nodes, "street_signs:sign_low_clearance"..onpole) - table.insert(signs_lib.lbm_restore_nodes, "street_signs:sign_distance_2_lines"..onpole) - table.insert(signs_lib.lbm_restore_nodes, "street_signs:sign_advisory_speed_mph"..onpole) - table.insert(signs_lib.lbm_restore_nodes, "street_signs:sign_advisory_speed_kmh"..onpole) - table.insert(signs_lib.lbm_restore_nodes, "street_signs:sign_advisory_speed_ms"..onpole) -end +signs_lib.register_sign("street_signs:sign_advisory_speed_ms", { + description = "W13-1P: Advisory speed (m/s)", + selection_box = cbox, + mesh = "street_signs_generic_sign_18x18_top.obj", + tiles = { + "street_signs_advisory_speed_ms.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_advisory_speed_ms_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, + number_of_lines = 1, + horiz_scaling = 1.25, + vert_scaling = 1.5, + line_spacing = 1, + font_size = 31, + x_offset = 8, + y_offset = 5, + chars_per_line = 8, + entity_info = { + mesh = "street_signs_generic_sign_18x18_top_entity.obj", + yaw = signs_lib.wallmounted_yaw + }, +}) diff --git a/street_signs/signs_misc_generic.lua b/street_signs/signs_misc_generic.lua index 0e4ffe1b..5efe87a0 100644 --- a/street_signs/signs_misc_generic.lua +++ b/street_signs/signs_misc_generic.lua @@ -1,182 +1,110 @@ -- Misc./Generic signs - local S = signs_lib.gettext -local cbox +local cbox = signs_lib.make_selection_boxes(36, 36) -for _, onpole in ipairs({"", "_onpole"}) do +signs_lib.register_sign("street_signs:sign_warning_3_line", { + description = "W3-4: Generic US diamond \"warning\" sign (3-line, yellow)", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_warning.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_warning_3_line_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, + number_of_lines = 3, + horiz_scaling = 1.75, + vert_scaling = 1.75, + line_spacing = 1, + font_size = 15, + x_offset = 6, + y_offset = 19, + chars_per_line = 15, + entity_info = { + mesh = "street_signs_warning_36x36_entity.obj", + yaw = signs_lib.wallmounted_yaw + }, + drop = "street_signs:sign_warning_3_line" +}) - local nci = nil - local pole_mount_tex = nil +signs_lib.register_sign("street_signs:sign_warning_4_line", { + description = "W23-2: Generic US diamond \"warning\" sign (4-line, yellow)", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_warning.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_warning_4_line_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, + number_of_lines = 4, + horiz_scaling = 1.75, + vert_scaling = 1.75, + line_spacing = 1, + font_size = 15, + x_offset = 6, + y_offset = 25, + chars_per_line = 15, + entity_info = { + mesh = "street_signs_warning_36x36_entity.obj", + yaw = signs_lib.wallmounted_yaw + }, + drop = "street_signs:sign_warning_4_line" +}) - if onpole == "_onpole" then - nci = 1 - pole_mount_tex = "signs_lib_pole_mount.png" - end - - cbox = signs_lib.make_selection_boxes(36, 36, onpole) - - minetest.register_node("street_signs:sign_warning_3_line"..onpole, { - description = "W3-4: Generic US diamond \"warning\" sign (3-line, yellow)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_warning.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_warning_3_line_inv.png", - wield_image = "street_signs_warning_3_line_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - after_place_node = signs_lib.after_place_node, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - on_rotate = signs_lib.wallmounted_rotate, - number_of_lines = 3, - horiz_scaling = 1.75, - vert_scaling = 1.75, - line_spacing = 1, - font_size = 15, - x_offset = 6, - y_offset = 19, - chars_per_line = 15, - entity_info = { - mesh = "street_signs_warning_36x36_entity"..onpole..".obj", - yaw = signs_lib.wallmounted_yaw - }, - drop = "street_signs:sign_warning_3_line" - }) - - minetest.register_node("street_signs:sign_warning_4_line"..onpole, { - description = "W23-2: Generic US diamond \"warning\" sign (4-line, yellow)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_warning.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_warning_4_line_inv.png", - wield_image = "street_signs_warning_4_line_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - after_place_node = signs_lib.after_place_node, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - on_rotate = signs_lib.wallmounted_rotate, - number_of_lines = 4, - horiz_scaling = 1.75, - vert_scaling = 1.75, - line_spacing = 1, - font_size = 15, - x_offset = 6, - y_offset = 25, - chars_per_line = 15, - entity_info = { - mesh = "street_signs_warning_36x36_entity"..onpole..".obj", - yaw = signs_lib.wallmounted_yaw - }, - drop = "street_signs:sign_warning_4_line" - }) - - minetest.register_node("street_signs:sign_warning_orange_3_line"..onpole, { - description = "W3-4: Generic US diamond \"warning\" sign (3-line, orange)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_warning_orange.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_warning_orange_3_line_inv.png", - wield_image = "street_signs_warning_orange_3_line_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - after_place_node = signs_lib.after_place_node, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - on_rotate = signs_lib.wallmounted_rotate, - number_of_lines = 3, - horiz_scaling = 1.75, - vert_scaling = 1.75, - line_spacing = 1, - font_size = 15, - x_offset = 6, - y_offset = 19, - chars_per_line = 15, - entity_info = { - mesh = "street_signs_warning_36x36_entity"..onpole..".obj", - yaw = signs_lib.wallmounted_yaw - }, - drop = "street_signs:sign_warning_orange_3_line" - }) - - minetest.register_node("street_signs:sign_warning_orange_4_line"..onpole, { - description = "W23-2: Generic US diamond \"warning\" sign (4-line, orange)", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, - selection_box = cbox, - mesh = "street_signs_warning_36x36"..onpole..".obj", - tiles = { "street_signs_warning_orange.png", - "street_signs_sign_edge.png", - pole_mount_tex - }, - inventory_image = "street_signs_warning_orange_4_line_inv.png", - wield_image = "street_signs_warning_orange_4_line_inv.png", - groups = {sign = 1, choppy=2, dig_immediate=2, not_in_creative_inventory = nci}, - default_color = "0", - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - after_place_node = signs_lib.after_place_node, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - on_rotate = signs_lib.wallmounted_rotate, - number_of_lines = 4, - horiz_scaling = 1.75, - vert_scaling = 1.75, - line_spacing = 1, - font_size = 15, - x_offset = 6, - y_offset = 25, - chars_per_line = 15, - entity_info = { - mesh = "street_signs_warning_36x36_entity"..onpole..".obj", - yaw = signs_lib.wallmounted_yaw - }, - drop = "street_signs:sign_warning_orange_4_line" - }) - - table.insert(signs_lib.lbm_restore_nodes, "street_signs:sign_warning_3_line"..onpole) - table.insert(signs_lib.lbm_restore_nodes, "street_signs:sign_warning_4_line"..onpole) - table.insert(signs_lib.lbm_restore_nodes, "street_signs:sign_warning_orange_3_line"..onpole) - table.insert(signs_lib.lbm_restore_nodes, "street_signs:sign_warning_orange_4_line"..onpole) -end +signs_lib.register_sign("street_signs:sign_warning_orange_3_line", { + description = "W3-4: Generic US diamond \"warning\" sign (3-line, orange)", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_warning_orange.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_warning_orange_3_line_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, + number_of_lines = 3, + horiz_scaling = 1.75, + vert_scaling = 1.75, + line_spacing = 1, + font_size = 15, + x_offset = 6, + y_offset = 19, + chars_per_line = 15, + entity_info = { + mesh = "street_signs_warning_36x36_entity.obj", + yaw = signs_lib.wallmounted_yaw + }, + drop = "street_signs:sign_warning_orange_3_line" +}) +signs_lib.register_sign("street_signs:sign_warning_orange_4_line", { + description = "W23-2: Generic US diamond \"warning\" sign (4-line, orange)", + selection_box = cbox, + mesh = "street_signs_warning_36x36.obj", + tiles = { + "street_signs_warning_orange.png", + "street_signs_sign_edge.png", + }, + inventory_image = "street_signs_warning_orange_4_line_inv.png", + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, + number_of_lines = 4, + horiz_scaling = 1.75, + vert_scaling = 1.75, + line_spacing = 1, + font_size = 15, + x_offset = 6, + y_offset = 25, + chars_per_line = 15, + entity_info = { + mesh = "street_signs_warning_36x36_entity.obj", + yaw = signs_lib.wallmounted_yaw + }, + drop = "street_signs:sign_warning_orange_4_line" +}) for _, s in ipairs(street_signs.big_sign_sizes) do local size = s[1] local nlines = s[2] @@ -191,21 +119,13 @@ for _, s in ipairs(street_signs.big_sign_sizes) do wall_top = { -s[8][3], -s[8][1], s[8][2], -s[8][6], -s[8][4], s[8][5] }, wall_bottom = { s[8][3], s[8][1], s[8][2], s[8][6], s[8][4], s[8][5] } } - for _, c in ipairs(street_signs.big_sign_colors) do - local color = c[1] local defc = c[2] - - minetest.register_node("street_signs:sign_highway_"..size.."_"..color, { + + signs_lib.register_sign("street_signs:sign_highway_"..size.."_"..color, { description = "Generic highway sign ("..nlines.."-line, "..size..", "..color..")", inventory_image = "street_signs_generic_highway_"..size.."_"..color.."_inv.png", - wield_image = "street_signs_generic_highway_"..size.."_"..color.."_inv.png", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, selection_box = cbox, mesh = "street_signs_generic_highway_"..size..".obj", tiles = { @@ -214,13 +134,8 @@ for _, s in ipairs(street_signs.big_sign_sizes) do "street_signs_generic_highway_edges.png" }, default_color = defc, - groups = {sign = 1, choppy=2, dig_immediate=2}, - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - on_rotate = signs_lib.wallmounted_rotate, + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, number_of_lines = nlines, chars_per_line = nchars, horiz_scaling = hscale, @@ -232,18 +147,13 @@ for _, s in ipairs(street_signs.big_sign_sizes) do entity_info = { mesh = "street_signs_generic_highway_"..size.."_entity.obj", yaw = signs_lib.wallmounted_yaw - } + }, + allow_onpole = false }) - - minetest.register_node("street_signs:sign_highway_widefont_"..size.."_"..color, { + + signs_lib.register_sign("street_signs:sign_highway_widefont_"..size.."_"..color, { description = "Generic highway sign (Wide font, "..nlines.."-line, "..size..", "..color..")", inventory_image = "street_signs_generic_highway_"..size.."_"..color.."_inv.png", - wield_image = "street_signs_generic_highway_"..size.."_"..color.."_inv.png", - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "wallmounted", - drawtype = "mesh", - node_box = cbox, selection_box = cbox, mesh = "street_signs_generic_highway_"..size..".obj", tiles = { @@ -252,13 +162,8 @@ for _, s in ipairs(street_signs.big_sign_sizes) do "street_signs_generic_highway_edges.png" }, default_color = defc, - groups = {sign = 1, choppy=2, dig_immediate=2}, - on_rightclick = signs_lib.construct_sign, - on_construct = signs_lib.construct_sign, - on_destruct = signs_lib.destruct_sign, - on_receive_fields = signs_lib.receive_fields, - on_punch = signs_lib.update_sign, - on_rotate = signs_lib.wallmounted_rotate, + groups = signs_lib.standard_steel_groups, + sounds = signs_lib.standard_steel_sign_sounds, number_of_lines = nlines, chars_per_line = math.ceil(nchars/1.4), horiz_scaling = hscale/1.4, @@ -270,12 +175,8 @@ for _, s in ipairs(street_signs.big_sign_sizes) do entity_info = { mesh = "street_signs_generic_highway_"..size.."_entity.obj", yaw = signs_lib.wallmounted_yaw - } + }, + allow_onpole = false }) - - table.insert(signs_lib.lbm_restore_nodes, "street_signs:sign_highway_"..size.."_"..color) - table.insert(signs_lib.lbm_restore_nodes, "street_signs:sign_highway_widefont_"..size.."_"..color) - end end -