Skip to content

Commit

Permalink
Fix sign formspec updates while used (#9)
Browse files Browse the repository at this point in the history
* Fix sign formspec updates while used
read https://gitea.your-land.de/your-land/bugtracker/issues/5553

* Better group name
  • Loading branch information
Niklp09 authored Dec 9, 2023
1 parent 03953f0 commit afe8f51
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions signs_api/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function signs_api.register_sign(mod, name, model)
fixed = {-model.width/2, -model.height/2, 0.5,
model.width/2, model.height/2, 0.5 - model.depth},
},
groups = {choppy=2, dig_immediate=2, not_blocking_trains=1, display_api=1},
groups = {choppy=2, dig_immediate=2, not_blocking_trains=1, display_api=1,signs_api_formspec_lbm=1},
sounds = default.node_sound_defaults(),
display_entities = {
["signs:display_text"] = {
Expand All @@ -180,9 +180,6 @@ function signs_api.register_sign(mod, name, model)

},
on_place = display_api.on_place,
on_rightclick = function(pos)
signs_api.set_formspec(pos)
end,
on_construct = function(pos)
local ndef = minetest.registered_nodes[minetest.get_node(pos).name]
local meta = minetest.get_meta(pos)
Expand Down Expand Up @@ -224,3 +221,14 @@ end

-- Text entity for all signs
display_api.register_display_entity("signs:display_text")

-- Update sign formspecs
minetest.register_lbm({
label = "Update signs_api formspecs",
name = "signs_api:update_formspecs",
run_at_every_load = false,
nodenames = {"group:signs_api_formspec_lbm"},
action = function(pos)
signs_api.set_formspec(pos)
end,
})

0 comments on commit afe8f51

Please sign in to comment.