From c765d3b31674d0e8bb08037cff837fd1c12af618 Mon Sep 17 00:00:00 2001 From: Vanessa Dannenberg Date: Sun, 15 Sep 2019 01:26:05 -0400 Subject: [PATCH] allow locked and all steel signs to hang from ceiling --- api.lua | 10 ++++++---- standard_signs.lua | 3 ++- textures/signs_lib_hangers.png | Bin 155 -> 173 bytes 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/api.lua b/api.lua index e23f741..7b34cdf 100644 --- a/api.lua +++ b/api.lua @@ -798,16 +798,18 @@ function signs_lib.register_sign(name, rdef) local hdef = table.copy(def) hdef.paramtype2 = "facedir" - hdef.selection_box = rdef.selection_box or signs_lib.make_selection_boxes(35, 32, false, 0, 3, -18.5, true) - hdef.node_box = rdef.node_box or rdef.selection_box or hdef.selection_box + local hcbox = signs_lib.make_selection_boxes(35, 32, false, 0, 3, -18.5, true) + + hdef.selection_box = rdef.hanging_selection_box or hcbox + hdef.node_box = rdef.hanging_node_box or rdef.hanging_selection_box or hcbox hdef.groups.not_in_creative_inventory = 1 hdef.tiles[3] = "signs_lib_hangers.png" - hdef.mesh = string.gsub(hdef.mesh, ".obj$", "_hanging.obj") + hdef.mesh = string.gsub(string.gsub(hdef.mesh, "_facedir.obj", ".obj"), ".obj$", "_hanging.obj") hdef.on_rotate = nil if hdef.entity_info then - hdef.entity_info.mesh = string.gsub(hdef.entity_info.mesh, ".obj$", "_hanging.obj") + hdef.entity_info.mesh = string.gsub(string.gsub(hdef.entity_info.mesh, "_facedir.obj", ".obj"), ".obj$", "_hanging.obj") hdef.entity_info.yaw = signs_lib.standard_yaw end diff --git a/standard_signs.lua b/standard_signs.lua index 5ecc9f4..dca41b4 100644 --- a/standard_signs.lua +++ b/standard_signs.lua @@ -21,7 +21,8 @@ signs_lib.register_sign("default:sign_wall_steel", { groups = signs_lib.standard_steel_groups, sounds = signs_lib.standard_steel_sign_sounds, locked = true, - entity_info = "standard" + entity_info = "standard", + allow_hanging = true, }) minetest.register_alias("signs:sign_hanging", "default:sign_wall_wood_hanging") diff --git a/textures/signs_lib_hangers.png b/textures/signs_lib_hangers.png index 04d74a9359e059cf15e6bb7b47ac581dd5688e51..3099c54980f2c6b95e3fa0ec5dcecffcb5901add 100644 GIT binary patch delta 145 zcmV;C0B--A0j&X$B!6^CL_t(o!|jtX4#Xe~1jnbeyp0d|d3=Buk}6V!PLWLtQtZ?) zn3dPKQEMGM(0exmWIPtV9DO|NIpzbU6aZRl2H@_41)`oGoB12-Jni+1EU!H7K33z; zc)pjwJn?E0QP1`zR14GswLmS{-U1joq015yANkvXXu0mjf?n^yA delta 126 zcmV-^0D=Fl0hM&XyztFyU4#&ZEDw5LLmBGFO`<^Rt5 zqA@OV&W(Xus}V5MvFPRK@Y&AZA4n+yP)acXcW*3+b~ZkCyVm}-=PzbG>bQGbUH=;$ g5fKp)5t08o0DQJ6q|GSMGXMYp07*qoM6N<$g4hr^q5uE@