New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for sfinv #82
Conversation
For some reason the tabs are not always selecting properly for me, I sometimes need to click them twice to get them to highlight. I am uncertain if that has to do with this particular implementation or if this is a problem with sfinv. I am testing with a freshly pulled and rebuilt engine and game, only minutes old. |
I can't reproduce this :/ Maybe add print statements to |
I can reproduce when not in creative mode |
|
Did you mean survival? It is actually the opposite for me, it seems to be working okay in creative. |
I edited that post immediately afterwards, I meant it "not in creative mode"
|
This is a strange one, even if I reduce the mod to only registering a sfinv page with no other mods installed, it still does the same thing. I can only guess that it has something to do with the name @rubenwardy any ideas? |
I have finally narrowed it down to soft dependency on the fire mod, at least removing that appears to fix it for some weird reason. Since sfinv has nothing to do with fire (and vice-versa) I suspect there lies a much deeper problem somewhere. Edit: As I suspected, in a simple test mod it works fine with fire soft-dependency. I guess it must have something to do with mod load order, either way it looks like sfinv is not currently usable with this mod. |
Maybe it's due to your mod also doing register_on_player_submit_fields()? I don't see how this would be affected by mod load order, as it'll always run after sfinv (which I believe cancels it) |
Like I said, I even went as far as to delete the entirety of init.lua and only register the sfinv page, nothing else and all other mods in the MP disabled. Only removing the fire mod soft-dep makes it work. Very strange... |
@rubenwardy Here is a simple test mod that reproduces this reliably for me, could you try it and confirm this is the same for you. |
Is anyone else willing to test this and confirm that this is a game/engine bug so I can file an issue? If you do not wish to download the zip, the code is very simple though I am guessing that adding the fire dependency to any mod that also uses sfinv will cause the same problem. depends.txt
init.lua sfinv.register_page("invtest:test", {
title = "test",
get = function(self, player, context)
return sfinv.make_formspec(player, context,
"label[0,0;Test]", true)
end
}) Note: You must turn off creative mode in order to reproduce this issue. |
Yeah, seems to be a MTG issue. Quite busy at the moment so unsure as to when I'll be able to work on it. It's worth filing an issue |
I think I found part of the issue, and it lies entirely with sfinv. My fork at https://github.com/ForbiddenJ/minetest-3d_armor attempts to add a page sfinv. I also have your invtest mod installed on my installation running Minetest 0.4.15. I added a simple print function to sfinv and also changed a function in sfinv so that it spits out a bit of debug info.
When I click the armor tab this comes out:
The tab gui can only highlight what it displays in context.nav_titles, which has a length of 3, however current_idx is trying to reference tab number 7, which is outside of this length. Therefore the GUI bounces back to highlighting tab 1. It should use number 3. With fire mod removed and armor tab clicked again, this is what I get.
This explains why removing fire seemingly fixes the problem. Update: |
@ForbiddenJ Thank you for the explanation, it sure had me beat. |
All seems good now with sfiinv so I will merge now since is fixes a number of other issues, thank you all for your help with this. |
No description provided.