diff --git a/source/libwiigui/gui_gamebrowser.cpp b/source/libwiigui/gui_gamebrowser.cpp index 533b7d47..81b54e0c 100644 --- a/source/libwiigui/gui_gamebrowser.cpp +++ b/source/libwiigui/gui_gamebrowser.cpp @@ -26,22 +26,14 @@ GuiGameBrowser::GuiGameBrowser(int w, int h, struct discHdr * l, int gameCnt, co { width = w; height = h; - if (gameCnt == 0) { - focus = 0; - dontsetfocus = 1; - } else { - gameList = l; - dontsetfocus = 0; - focus = 1; - } this->gameCnt = gameCnt; - - pagesize = (gameCnt > THEME.pagesize) ? THEME.pagesize : gameCnt; - scrollbaron = (gameCnt > THEME.pagesize) ? 1 : 0; + gameList = l; + pagesize = THEME.pagesize; + scrollbaron = (gameCnt > pagesize) ? 1 : 0; selectable = true; listOffset = (offset == 0) ? this->FindMenuItem(-1, 1) : offset; selectedItem = selected - offset; - // allow focus + focus = 1; // allow focus char imgPath[100]; trigA = new GuiTrigger; @@ -205,7 +197,6 @@ GuiGameBrowser::~GuiGameBrowser() void GuiGameBrowser::SetFocus(int f) { LOCK(this); - if(!dontsetfocus) focus = f; for(int i=0; iSetState(STATE_DISABLED); } - if(focus || !dontsetfocus) + if(focus) { if(i != selectedItem && game[i]->GetState() == STATE_SELECTED) game[i]->ResetState(); @@ -388,7 +379,7 @@ void GuiGameBrowser::Update(GuiTrigger * t) } // pad/joystick navigation - if(!focus || dontsetfocus) + if(!focus) return; // skip navigation if (scrollbaron == 1) { @@ -640,8 +631,7 @@ void GuiGameBrowser::Reload(struct discHdr * l, int count) LOCK(this); gameList = l; gameCnt = count; - scrollbaron = (gameCnt > THEME.pagesize) ? 1 : 0; - pagesize = (gameCnt > THEME.pagesize) ? THEME.pagesize : gameCnt; + scrollbaron = (gameCnt > pagesize) ? 1 : 0; selectedItem = 0; listOffset = 0; diff --git a/source/menu.cpp b/source/menu.cpp index e1b3a0b3..4b68b52c 100644 --- a/source/menu.cpp +++ b/source/menu.cpp @@ -2722,7 +2722,6 @@ static int MenuDiscList() char imgPath[100]; char buf[4]; __Menu_GetEntries(); - if (gameCnt==0){Settings.sort=all;__Menu_GetEntries();} f32 freespace, used, size = 0.0; u32 nolist; @@ -3170,7 +3169,7 @@ static int MenuDiscList() gameBrowser.Reload(gameList, gameCnt); sprintf(GamesCnt,"%s: %i",LANGUAGE.Games, gameCnt); gamecntTxt.SetText(GamesCnt); - selectedold=-1; + selectedold = 1; favoriteBtnImg.SetImage(dispFave ? &imgFavoriteOn : &imgFavoriteOff); favoriteBtn.ResetState(); }