]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
Display Minetest header when menu_last_game value isn't available anymore (#10751)
authorZughy <63455151+Zughy@users.noreply.github.com>
Mon, 28 Dec 2020 12:56:58 +0000 (12:56 +0000)
committerGitHub <noreply@github.com>
Mon, 28 Dec 2020 12:56:58 +0000 (13:56 +0100)
builtin/mainmenu/init.lua
builtin/mainmenu/tab_local.lua

index 2fc0ae64c0922c0a0a2b7c14ac8739fd80f69963..656d1d149a67afedd46dd2050e0b1c03813a4bd8 100644 (file)
@@ -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()
 
index 1aee246fc79f83a99592e985f09cae0023b91720..2eb4752bc449ab84ab0739d30a1ce35ac371bff5 100644 (file)
@@ -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")