diff --git a/signs_lib/init.lua b/signs_lib/init.lua index f573848..920845a 100644 --- a/signs_lib/init.lua +++ b/signs_lib/init.lua @@ -14,7 +14,24 @@ signs_lib = {} signs_lib.modpath = minetest.get_modpath("signs_lib") -signs_lib.wall_sign_model = { +signs_lib.regular_wall_sign_model = { + nodebox = { + type = "wallmounted", + wall_side = { -0.5, -0.25, -0.4375, -0.4375, 0.375, 0.4375 }, + wall_bottom = { -0.4375, -0.5, -0.25, 0.4375, -0.4375, 0.375 }, + wall_top = { -0.4375, 0.4375, -0.375, 0.4375, 0.5, 0.25 } + }, + textpos = { + nil, + nil, + {delta = {x = 0.43, y = 0.07, z = 0 }, yaw = math.pi / -2}, + {delta = {x = -0.43, y = 0.07, z = 0 }, yaw = math.pi / 2}, + {delta = {x = 0, y = 0.07, z = 0.43 }, yaw = 0}, + {delta = {x = 0, y = 0.07, z = -0.43 }, yaw = math.pi}, + } +} + +signs_lib.metal_wall_sign_model = { nodebox = { type = "fixed", fixed = {-0.4375, -0.25, 0.4375, 0.4375, 0.375, 0.5} @@ -536,7 +553,11 @@ signs_lib.update_sign = function(pos, fields, owner) elseif signnode.name == "signs:sign_hanging" then sign_info = signs_lib.hanging_sign_model.textpos[minetest.get_node(pos).param2 + 1] elseif string.find(signnode.name, "sign_wall") then - sign_info = signs_lib.wall_sign_model.textpos[minetest.get_node(pos).param2 + 1] + if signnode.name == "default:sign_wall" then + sign_info = signs_lib.regular_wall_sign_model.textpos[minetest.get_node(pos).param2 + 1] + else + sign_info = signs_lib.metal_wall_sign_model.textpos[minetest.get_node(pos).param2 + 1] + end else -- ...it must be a sign on a fence post. sign_info = signs_lib.sign_post_model.textpos[minetest.get_node(pos).param2 + 1] end @@ -607,8 +628,11 @@ function signs_lib.determine_sign_type(itemstack, placer, pointed_thing, locked) minetest.add_node(above, {name = "signs:sign_hanging", param2 = fdir}) elseif wdir == 1 and signname == "default:sign_wall" then minetest.add_node(above, {name = "signs:sign_yard", param2 = fdir}) - else -- it must be a wooden or metal wall sign. + elseif signname ~= "default:sign_wall" then -- it must be a metal wall sign. minetest.add_node(above, {name = signname, param2 = fdir}) + else -- it must be a default or locked wooden wall sign + minetest.add_node(above, {name = signname, param2 = wdir }) -- note it's wallmounted here! + print(dump(wdir)) if locked then local meta = minetest.get_meta(above) local owner = placer:get_player_name() @@ -649,12 +673,12 @@ minetest.register_node(":default:sign_wall", { inventory_image = "default_sign_wall.png", wield_image = "default_sign_wall.png", node_placement_prediction = "", - paramtype = "light", sunlight_propagates = true, - paramtype2 = "facedir", + paramtype = "light", + paramtype2 = "wallmounted", drawtype = "nodebox", - node_box = signs_lib.wall_sign_model.nodebox, - tiles = {"signs_top.png", "signs_bottom.png", "signs_side.png", "signs_side.png", "signs_back.png", "signs_front.png"}, + node_box = signs_lib.regular_wall_sign_model.nodebox, + tiles = {"signs_wall_sign.png"}, groups = sign_groups, on_place = function(itemstack, placer, pointed_thing) @@ -770,19 +794,12 @@ minetest.register_node(":locked_sign:sign_wall_locked", { inventory_image = "signs_locked_inv.png", wield_image = "signs_locked_inv.png", node_placement_prediction = "", - paramtype = "light", sunlight_propagates = true, - paramtype2 = "facedir", + paramtype = "light", + paramtype2 = "wallmounted", drawtype = "nodebox", - node_box = signs_lib.wall_sign_model.nodebox, - tiles = { - "signs_top_locked.png", - "signs_bottom_locked.png", - "signs_side_locked.png", - "signs_side.png", - "signs_back.png", - "signs_front_locked.png" - }, + node_box = signs_lib.regular_wall_sign_model.nodebox, + tiles = { "signs_wall_sign_locked.png" }, groups = sign_groups, on_place = function(itemstack, placer, pointed_thing) return signs_lib.determine_sign_type(itemstack, placer, pointed_thing, true) @@ -829,7 +846,7 @@ for _, color in ipairs(sign_colors) do sunlight_propagates = true, paramtype2 = "facedir", drawtype = "nodebox", - node_box = signs_lib.wall_sign_model.nodebox, + node_box = signs_lib.metal_wall_sign_model.nodebox, tiles = { "signs_metal_tb.png", "signs_metal_tb.png", diff --git a/signs_lib/textures/signs_bottom_locked.png b/signs_lib/textures/signs_bottom_locked.png deleted file mode 100644 index f90a9d8..0000000 Binary files a/signs_lib/textures/signs_bottom_locked.png and /dev/null differ diff --git a/signs_lib/textures/signs_front_locked.png b/signs_lib/textures/signs_front_locked.png deleted file mode 100644 index c638e5c..0000000 Binary files a/signs_lib/textures/signs_front_locked.png and /dev/null differ diff --git a/signs_lib/textures/signs_locked_inv.png b/signs_lib/textures/signs_locked_inv.png index 3c0554a..b87a355 100644 Binary files a/signs_lib/textures/signs_locked_inv.png and b/signs_lib/textures/signs_locked_inv.png differ diff --git a/signs_lib/textures/signs_side_locked.png b/signs_lib/textures/signs_side_locked.png deleted file mode 100644 index 8025a83..0000000 Binary files a/signs_lib/textures/signs_side_locked.png and /dev/null differ diff --git a/signs_lib/textures/signs_top_locked.png b/signs_lib/textures/signs_top_locked.png deleted file mode 100644 index c96c550..0000000 Binary files a/signs_lib/textures/signs_top_locked.png and /dev/null differ diff --git a/signs_lib/textures/signs_wall_sign.png b/signs_lib/textures/signs_wall_sign.png new file mode 100644 index 0000000..284fb8b Binary files /dev/null and b/signs_lib/textures/signs_wall_sign.png differ diff --git a/signs_lib/textures/signs_wall_sign_locked.png b/signs_lib/textures/signs_wall_sign_locked.png new file mode 100644 index 0000000..2dd61b4 Binary files /dev/null and b/signs_lib/textures/signs_wall_sign_locked.png differ