After much checkpointing in the various mainmenu luascripts I isolated the problem and was able to isolate the segfault to a single line but it may now potentially glitch on display since I've omitted a line in the tabview's on_change by comm,enting it out as follows:
tab_singleplayer.lua:196
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
local function on_change(type, old_tab, new_tab)
local buttonbar = ui.find_by_name("game_button_bar")
print("tab singleplayer_onchange " .. type)
if ( buttonbar == nil ) then
singleplayer_refresh_gamebar()
buttonbar = ui.find_by_name("game_button_bar")
end
if (type == "ENTER") then
local game = current_game()
if game then
menudata.worldlist:set_filtercriteria(game.id)
core.set_topleft_text(game.name)
mm_texture.update("singleplayer",game)
end
buttonbar:show()
else
menudata.worldlist:set_filtercriteria(nil)
buttonbar:hide()
core.set_topleft_text("")
--The next line causing segfault
--mm_texture.update(new_tab,nil)
end
end
Not sure if this is a bug or not and I hope someone with a bit more knowledge of the GUI stuff can check this out.
GDB was almost useless in tracking this down.
PS: I noticed the two game mode selection icons at the lower left (minetest_game versus minimal_game) still segfault however thus I haven't totally got the UI working yet.
EDIT PSS: There seems to be more at issue. It segfaulted when I left the tab on Server and restarted (which defaulted to the server tab on restart) then tried to switch. It didn't seem to like that nil for on_change handler so I added a dummy for servertab... then I couldn't switch back to singleplayer_tab... commented out sinlgeplayer_tab's enter mm_texture.update and it was able to switch back to singleplayer_tab. Wonder if there's some sort of lingering uninitialized mm_texture condition? The tabs duplicate a lot of common code so it's tricky to pinpoint the exact issue.
EDIT 2: *** The code change above only fixes the segfaulting issue when singleplayer is the default tab on startup ***