Skip to content

Commit

Permalink
Update gamebar on tab enter (#8192)
Browse files Browse the repository at this point in the history
  • Loading branch information
p-ouellette authored and paramat committed Feb 18, 2019
1 parent 5751762 commit 0ad96cc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
5 changes: 4 additions & 1 deletion builtin/mainmenu/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ local function init_globals()
tv_main:set_fixed_size(false)

if menustyle ~= "simple" then
tv_main:set_tab(core.settings:get("maintab_LAST"))
local last_tab = core.settings:get("maintab_LAST")
if last_tab and tv_main.current_tab ~= last_tab then
tv_main:set_tab(last_tab)
end
end
ui.set_default("maintab")
tv_main:show()
Expand Down
16 changes: 7 additions & 9 deletions builtin/mainmenu/tab_local.lua
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,6 @@ end
local on_change
if enable_gamebar then
function on_change(type, old_tab, new_tab)
local buttonbar = ui.find_by_name("game_button_bar")

if ( buttonbar == nil ) then
singleplayer_refresh_gamebar()
buttonbar = ui.find_by_name("game_button_bar")
end

if (type == "ENTER") then
local game = current_game()

Expand All @@ -309,10 +302,15 @@ if enable_gamebar then
core.set_topleft_text(game.name)
mm_texture.update("singleplayer",game)
end
buttonbar:show()

singleplayer_refresh_gamebar()
ui.find_by_name("game_button_bar"):show()
else
menudata.worldlist:set_filtercriteria(nil)
buttonbar:hide()
local gamebar = ui.find_by_name("game_button_bar")
if gamebar then
gamebar:hide()
end
core.set_topleft_text("")
mm_texture.update(new_tab,nil)
end
Expand Down

0 comments on commit 0ad96cc

Please sign in to comment.