Skip to content

Commit 55dba1b

Browse files
authoredDec 28, 2020
Display Minetest header when menu_last_game value isn't available anymore (#10751)
1 parent 8f72d4b commit 55dba1b

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
 

‎builtin/mainmenu/init.lua

+10
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,16 @@ local function init_globals()
106106
if last_tab and tv_main.current_tab ~= last_tab then
107107
tv_main:set_tab(last_tab)
108108
end
109+
110+
-- In case the folder of the last selected game has been deleted,
111+
-- display "Minetest" as a header
112+
if tv_main.current_tab == "local" then
113+
local game = pkgmgr.find_by_gameid(core.settings:get("menu_last_game"))
114+
if game == nil then
115+
mm_texture.reset()
116+
end
117+
end
118+
109119
ui.set_default("maintab")
110120
tv_main:show()
111121

‎builtin/mainmenu/tab_local.lua

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
local enable_gamebar = PLATFORM ~= "Android"
2020
local current_game, singleplayer_refresh_gamebar
21+
2122
if enable_gamebar then
2223
function current_game()
2324
local last_game_id = core.settings:get("menu_last_game")

0 commit comments

Comments
 (0)
Please sign in to comment.