Compatibility with signs_lib

This commit is contained in:
Gabriel Pérez-Cerezo 2017-11-30 21:15:06 +01:00
parent 2e4d8f529c
commit d89b63e1b7
No known key found for this signature in database
GPG Key ID: 90422B01A46D0B3E
2 changed files with 5 additions and 5 deletions

@ -24,8 +24,8 @@ local F = function(...) return minetest.formspec_escape(S(...)) end
function signs.set_formspec(pos)
local meta = minetest.get_meta(pos)
local ndef = minetest.registered_nodes[minetest.get_node(pos).name]
if ndef and ndef.display_entities and ndef.display_entities["signs:text"] then
local maxlines = ndef.display_entities["signs:text"].maxlines
if ndef and ndef.display_entities and ndef.display_entities["signs:display_text"] then
local maxlines = ndef.display_entities["signs:display_text"].maxlines
local formspec
if maxlines == 1 then
@ -152,7 +152,7 @@ function signs.register_sign(mod, name, model)
groups = {choppy=2, dig_immediate=2},
sounds = default.node_sound_defaults(),
display_entities = {
["signs:text"] = {
["signs:display_text"] = {
on_display_update = font_lib.on_display_update,
depth = 0.499 - model.depth,
size = { x = model.width, y = model.height },
@ -187,7 +187,7 @@ function signs.register_sign(mod, name, model)
-- Entity fields override
for key, value in pairs(model.entity_fields) do
fields.display_entities["signs:text"][key] = value
fields.display_entities["signs:display_text"][key] = value
end
minetest.register_node(mod..":"..name, fields)

@ -66,7 +66,7 @@ local function on_receive_fields_poster(pos, formname, fields, player)
end
-- Text entity for all signs
display_lib.register_display_entity("signs:text")
display_lib.register_display_entity("signs:display_text")
-- Sign models and registration
local models = {