Fix disabled signs.

This commit is contained in:
kaeza 2013-08-16 13:11:29 -03:00
parent b0cbea42e0
commit 53e9690679
3 changed files with 118 additions and 109 deletions

View File

@ -446,10 +446,8 @@ minetest.register_node("homedecor:fence_chainlink_corner", {
},
})
if not homedecor_disable_signs then
minetest.register_alias("homedecor:fence_wood_with_sign", "signs:sign_post")
homedecor_register_fence_with_sign("default:fence_wood", "signs:sign_post")
homedecor_register_fence_with_sign("homedecor:fence_brass", "homedecor:fence_brass_with_sign")
homedecor_register_fence_with_sign("homedecor:fence_wrought_iron", "homedecor:fence_wrought_iron_with_sign")
end

View File

@ -83,9 +83,7 @@ dofile(minetest.get_modpath("homedecor").."/slopes.lua")
dofile(minetest.get_modpath("homedecor").."/door_models.lua")
dofile(minetest.get_modpath("homedecor").."/doors_and_gates.lua")
if not homedecor_disable_signs then
dofile(minetest.get_modpath("homedecor").."/signs_lib.lua")
end
dofile(minetest.get_modpath("homedecor").."/fences.lua")

View File

@ -100,6 +100,7 @@ homedecor_update_sign = function(pos, fields)
text:setyaw(sign_info.yaw)
end
if not homedecor_disable_signs then
minetest.register_node(":default:sign_wall", {
description = "Sign",
inventory_image = "default_sign_wall.png",
@ -207,6 +208,7 @@ minetest.register_node(":default:sign_wall", {
homedecor_update_sign(pos)
end,
})
end
minetest.register_node(":signs:sign_yard", {
paramtype = "light",
@ -281,17 +283,28 @@ minetest.register_node(":signs:sign_post", {
},
})
local signs_text_on_activate
if not homedecor_disable_signs then
signs_text_on_activate = function(self)
local meta = minetest.get_meta(self.object:getpos())
local text = meta:get_string("text")
self.object:set_properties({textures={homedecor_generate_texture(homedecor_create_lines(text))}})
end
else
signs_text_on_activate = function(self)
self.object:remove()
end
end
minetest.register_entity(":signs:text", {
collisionbox = { 0, 0, 0, 0, 0, 0 },
visual = "upright_sprite",
textures = {},
on_activate = function(self)
local meta = minetest.get_meta(self.object:getpos())
local text = meta:get_string("text")
self.object:set_properties({textures={homedecor_generate_texture(homedecor_create_lines(text))}})
end
on_activate = signs_text_on_activate,
})
-- CONSTANTS