pandorabox-io / pandorabox.io

Pandorabox infrastructure code
https://pandorabox.io
31 stars 4 forks source link

textline:lcd changes param2 after jump #591

Closed S-S-X closed 3 years ago

S-S-X commented 3 years ago

And it should not do that.

OgelGames commented 3 years ago

The jumpdrive compat for textline calls after_place_node: https://github.com/mt-mods/jumpdrive/blob/master/compat/textline.lua

-- refresh textline entities after the jump
minetest.override_item("textline:lcd", {
    on_movenode = function(from_pos, to_pos)
        minetest.after(1, function()
            textline_def.after_place_node(to_pos)
        end)
    end
})

Which sets the param2, depending on the node's param2: https://github.com/gbl08ma/textline/blob/master/init.lua#L103-L109

after_place_node = function (pos, placer, itemstack)
    local param2 = minetest.get_node(pos).param2
    if param2 == 0 or param2 == 1 then
        minetest.add_node(pos, {name = "textline:lcd", param2 = 3})
    end
    prepare_writing (pos)
end,
S-S-X commented 3 years ago

Which sets the param2, depending on the node's param2

Is there some real requirement / reason to actually do that?

edit. so it is prepare_writing(pos) that must be called and it is local...

BuckarooBanzay commented 3 years ago

Which sets the param2, depending on the node's param2

Is there some real requirement / reason to actually do that?

Looks like it has some issues with param2 being 0 or 1 :shrug:

Moving the text entity is more elegant anyway, thanks @S-S-X :+1:

S-S-X commented 3 years ago

Looks like it has some issues with param2 being 0 or 1

Yeah it does and wont add new entity if oriented that way, however if entity is already available it works just fine. I just wanted my quarry info HUD to work :smile:

I was actually also thinking about new display for textline mod, some textline:hud where node would not be panel like but instead more like 3 nodes wide thin bar.

S-S-X commented 3 years ago

https://github.com/pandorabox-io/pandorabox-mods/pull/1250