allow locked and all steel signs to hang from ceiling

This commit is contained in:
Vanessa Dannenberg 2019-09-15 01:26:05 -04:00
parent 78418de9c9
commit c765d3b316
3 changed files with 8 additions and 5 deletions

10
api.lua
View File

@ -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

View File

@ -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")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 B

After

Width:  |  Height:  |  Size: 173 B