mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 16:13:46 +01:00
Fix startup after removing last game (#13015)
This commit is contained in:
parent
291c42ed57
commit
b85831e389
@ -86,9 +86,12 @@ local function init_globals()
|
|||||||
menudata.worldlist:add_sort_mechanism("alphabetic", sort_worlds_alphabetic)
|
menudata.worldlist:add_sort_mechanism("alphabetic", sort_worlds_alphabetic)
|
||||||
menudata.worldlist:set_sortmode("alphabetic")
|
menudata.worldlist:set_sortmode("alphabetic")
|
||||||
|
|
||||||
if not core.settings:get("menu_last_game") then
|
local gameid = core.settings:get("menu_last_game")
|
||||||
local default_game = core.settings:get("default_game") or "minetest"
|
local game = gameid and pkgmgr.find_by_gameid(gameid)
|
||||||
core.settings:set("menu_last_game", default_game)
|
if not game then
|
||||||
|
gameid = core.settings:get("default_game") or "minetest"
|
||||||
|
game = pkgmgr.find_by_gameid(gameid)
|
||||||
|
core.settings:set("menu_last_game", gameid)
|
||||||
end
|
end
|
||||||
|
|
||||||
mm_game_theme.init()
|
mm_game_theme.init()
|
||||||
@ -115,11 +118,8 @@ local function init_globals()
|
|||||||
|
|
||||||
-- In case the folder of the last selected game has been deleted,
|
-- In case the folder of the last selected game has been deleted,
|
||||||
-- display "Minetest" as a header
|
-- display "Minetest" as a header
|
||||||
if tv_main.current_tab == "local" then
|
if tv_main.current_tab == "local" and not game then
|
||||||
local game = pkgmgr.find_by_gameid(core.settings:get("menu_last_game"))
|
mm_game_theme.reset()
|
||||||
if game == nil then
|
|
||||||
mm_game_theme.reset()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
ui.set_default("maintab")
|
ui.set_default("maintab")
|
||||||
|
Loading…
Reference in New Issue
Block a user