mirror of
https://github.com/pyrollo/display_modpack.git
synced 2024-11-24 07:13:44 +01:00
Compatibility with signs_lib
This commit is contained in:
parent
2e4d8f529c
commit
d89b63e1b7
@ -24,8 +24,8 @@ local F = function(...) return minetest.formspec_escape(S(...)) end
|
|||||||
function signs.set_formspec(pos)
|
function signs.set_formspec(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local ndef = minetest.registered_nodes[minetest.get_node(pos).name]
|
local ndef = minetest.registered_nodes[minetest.get_node(pos).name]
|
||||||
if ndef and ndef.display_entities and ndef.display_entities["signs:text"] then
|
if ndef and ndef.display_entities and ndef.display_entities["signs:display_text"] then
|
||||||
local maxlines = ndef.display_entities["signs:text"].maxlines
|
local maxlines = ndef.display_entities["signs:display_text"].maxlines
|
||||||
local formspec
|
local formspec
|
||||||
|
|
||||||
if maxlines == 1 then
|
if maxlines == 1 then
|
||||||
@ -152,7 +152,7 @@ function signs.register_sign(mod, name, model)
|
|||||||
groups = {choppy=2, dig_immediate=2},
|
groups = {choppy=2, dig_immediate=2},
|
||||||
sounds = default.node_sound_defaults(),
|
sounds = default.node_sound_defaults(),
|
||||||
display_entities = {
|
display_entities = {
|
||||||
["signs:text"] = {
|
["signs:display_text"] = {
|
||||||
on_display_update = font_lib.on_display_update,
|
on_display_update = font_lib.on_display_update,
|
||||||
depth = 0.499 - model.depth,
|
depth = 0.499 - model.depth,
|
||||||
size = { x = model.width, y = model.height },
|
size = { x = model.width, y = model.height },
|
||||||
@ -187,7 +187,7 @@ function signs.register_sign(mod, name, model)
|
|||||||
|
|
||||||
-- Entity fields override
|
-- Entity fields override
|
||||||
for key, value in pairs(model.entity_fields) do
|
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
|
end
|
||||||
|
|
||||||
minetest.register_node(mod..":"..name, fields)
|
minetest.register_node(mod..":"..name, fields)
|
||||||
|
@ -66,7 +66,7 @@ local function on_receive_fields_poster(pos, formname, fields, player)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Text entity for all signs
|
-- Text entity for all signs
|
||||||
display_lib.register_display_entity("signs:text")
|
display_lib.register_display_entity("signs:display_text")
|
||||||
|
|
||||||
-- Sign models and registration
|
-- Sign models and registration
|
||||||
local models = {
|
local models = {
|
||||||
|
Loading…
Reference in New Issue
Block a user