Skip to content

Commit

Permalink
Display Minetest header when menu_last_game value isn't available any…
Browse files Browse the repository at this point in the history
…more (#10751)
  • Loading branch information
Zughy committed Dec 28, 2020
1 parent 8f72d4b commit 55dba1b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions builtin/mainmenu/init.lua
Expand Up @@ -106,6 +106,16 @@ local function init_globals()
if last_tab and tv_main.current_tab ~= last_tab then
tv_main:set_tab(last_tab)
end

-- In case the folder of the last selected game has been deleted,
-- display "Minetest" as a header
if tv_main.current_tab == "local" then
local game = pkgmgr.find_by_gameid(core.settings:get("menu_last_game"))
if game == nil then
mm_texture.reset()
end
end

ui.set_default("maintab")
tv_main:show()

Expand Down
1 change: 1 addition & 0 deletions builtin/mainmenu/tab_local.lua
Expand Up @@ -18,6 +18,7 @@

local enable_gamebar = PLATFORM ~= "Android"
local current_game, singleplayer_refresh_gamebar

if enable_gamebar then
function current_game()
local last_game_id = core.settings:get("menu_last_game")
Expand Down

0 comments on commit 55dba1b

Please sign in to comment.