]> git.lizzy.rs Git - signs_lib.git/commitdiff
default "allow_onpole" to disabled
authorVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>
Sat, 21 Sep 2019 19:56:45 +0000 (15:56 -0400)
committerVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>
Sat, 21 Sep 2019 19:56:45 +0000 (15:56 -0400)
for consistency with other similar flags

api.lua
standard_signs.lua

diff --git a/api.lua b/api.lua
index e3238626585da097b041818a49147522e0384c4c..0acc2c48a58395ec23208c411f241befbbb75cff 100644 (file)
--- a/api.lua
+++ b/api.lua
@@ -807,7 +807,7 @@ function signs_lib.after_place_node(pos, placer, itemstack, pointed_thing, locke
        local ppos = minetest.get_pointed_thing_position(pointed_thing)
        local pnode = minetest.get_node(ppos)
        local pdef = minetest.registered_items[pnode.name]
-       if (def.allow_onpole ~= false) and signs_lib.check_for_pole(pos, pointed_thing) then
+       if def.allow_onpole and signs_lib.check_for_pole(pos, pointed_thing) then
                local newparam2
                local lookdir = minetest.yaw_to_dir(placer:get_look_horizontal())
                if def.paramtype2 == "wallmounted" then
@@ -912,7 +912,7 @@ local function register_sign(name, rdef)
 
        local opdef = table.copy(def)
 
-       if rdef.allow_onpole ~= false or rdef.allow_onpole_horizontal then
+       if rdef.allow_onpole or rdef.allow_onpole_horizontal then
 
                local offset = 0.3125
                if opdef.uses_slim_pole_mount then
@@ -947,7 +947,7 @@ local function register_sign(name, rdef)
        -- setting one of item 3 or 4 to a texture and leaving the other "blank",
        -- reveals either the vertical or horizontal pole mount part of the model
 
-       if rdef.allow_onpole ~= false then
+       if rdef.allow_onpole then
                opdef.tiles[3] = "signs_lib_pole_mount.png"
                opdef.tiles[4] = "signs_lib_blank.png"
                minetest.register_node(":"..name.."_onpole", opdef)
@@ -1013,8 +1013,15 @@ signs_lib.register_sign("foo:my_cool_sign", {
 
 * 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,
+*For signs that can support being on a pole, include in the def:
+       allow_onpole = true,
+       (defaults to disabled)
+
+*For signs that can support being on a horizontal pole, include in the def:
+       allow_onpole_horizontal = true,
+       (defaults to disabled)
+
+* onpole/onpole_horizontal are independent; one may be allowed without the other
 
 * "standard" entity info implies the standard wood/steel sign model, in
   wallmounted mode.  For facedir signs using the standard model, use:
index 7d961e9e59eed5d28bf92bdafdd583f8a364eb28..dbfbb54a0e8b08586c65ece79b88b0820a0b9919 100644 (file)
@@ -10,6 +10,7 @@ signs_lib.register_sign("default:sign_wall_wood", {
        entity_info = "standard",
        allow_hanging = true,
        allow_widefont = true,
+       allow_onpole = true,
        allow_onpole_horizontal = true
 })
 
@@ -26,6 +27,7 @@ signs_lib.register_sign("default:sign_wall_steel", {
        entity_info = "standard",
        allow_hanging = true,
        allow_widefont = true,
+       allow_onpole = true,
        allow_onpole_horizontal = true
 })