*Fixed code dumps related to showing only favorites

*Fixed having no games installed and removed the old workaround
This commit is contained in:
DRayX7 2009-05-21 23:32:32 +00:00
parent 93aadca881
commit 306644b518
2 changed files with 9 additions and 20 deletions

View File

@ -26,22 +26,14 @@ GuiGameBrowser::GuiGameBrowser(int w, int h, struct discHdr * l, int gameCnt, co
{ {
width = w; width = w;
height = h; height = h;
if (gameCnt == 0) {
focus = 0;
dontsetfocus = 1;
} else {
gameList = l;
dontsetfocus = 0;
focus = 1;
}
this->gameCnt = gameCnt; this->gameCnt = gameCnt;
gameList = l;
pagesize = (gameCnt > THEME.pagesize) ? THEME.pagesize : gameCnt; pagesize = THEME.pagesize;
scrollbaron = (gameCnt > THEME.pagesize) ? 1 : 0; scrollbaron = (gameCnt > pagesize) ? 1 : 0;
selectable = true; selectable = true;
listOffset = (offset == 0) ? this->FindMenuItem(-1, 1) : offset; listOffset = (offset == 0) ? this->FindMenuItem(-1, 1) : offset;
selectedItem = selected - offset; selectedItem = selected - offset;
// allow focus focus = 1; // allow focus
char imgPath[100]; char imgPath[100];
trigA = new GuiTrigger; trigA = new GuiTrigger;
@ -205,7 +197,6 @@ GuiGameBrowser::~GuiGameBrowser()
void GuiGameBrowser::SetFocus(int f) void GuiGameBrowser::SetFocus(int f)
{ {
LOCK(this); LOCK(this);
if(!dontsetfocus)
focus = f; focus = f;
for(int i=0; i<pagesize; i++) for(int i=0; i<pagesize; i++)
@ -250,7 +241,7 @@ int GuiGameBrowser::GetClickedOption()
} }
int GuiGameBrowser::GetSelectedOption() int GuiGameBrowser::GetSelectedOption()
{ {
int found = -1; int found = -1;
for(int i=0; i<pagesize; i++) for(int i=0; i<pagesize; i++)
{ {
@ -371,7 +362,7 @@ void GuiGameBrowser::Update(GuiTrigger * t)
game[i]->SetState(STATE_DISABLED); game[i]->SetState(STATE_DISABLED);
} }
if(focus || !dontsetfocus) if(focus)
{ {
if(i != selectedItem && game[i]->GetState() == STATE_SELECTED) if(i != selectedItem && game[i]->GetState() == STATE_SELECTED)
game[i]->ResetState(); game[i]->ResetState();
@ -388,7 +379,7 @@ void GuiGameBrowser::Update(GuiTrigger * t)
} }
// pad/joystick navigation // pad/joystick navigation
if(!focus || dontsetfocus) if(!focus)
return; // skip navigation return; // skip navigation
if (scrollbaron == 1) { if (scrollbaron == 1) {
@ -640,8 +631,7 @@ void GuiGameBrowser::Reload(struct discHdr * l, int count)
LOCK(this); LOCK(this);
gameList = l; gameList = l;
gameCnt = count; gameCnt = count;
scrollbaron = (gameCnt > THEME.pagesize) ? 1 : 0; scrollbaron = (gameCnt > pagesize) ? 1 : 0;
pagesize = (gameCnt > THEME.pagesize) ? THEME.pagesize : gameCnt;
selectedItem = 0; selectedItem = 0;
listOffset = 0; listOffset = 0;

View File

@ -2722,7 +2722,6 @@ static int MenuDiscList()
char imgPath[100]; char imgPath[100];
char buf[4]; char buf[4];
__Menu_GetEntries(); __Menu_GetEntries();
if (gameCnt==0){Settings.sort=all;__Menu_GetEntries();}
f32 freespace, used, size = 0.0; f32 freespace, used, size = 0.0;
u32 nolist; u32 nolist;
@ -3170,7 +3169,7 @@ static int MenuDiscList()
gameBrowser.Reload(gameList, gameCnt); gameBrowser.Reload(gameList, gameCnt);
sprintf(GamesCnt,"%s: %i",LANGUAGE.Games, gameCnt); sprintf(GamesCnt,"%s: %i",LANGUAGE.Games, gameCnt);
gamecntTxt.SetText(GamesCnt); gamecntTxt.SetText(GamesCnt);
selectedold=-1; selectedold = 1;
favoriteBtnImg.SetImage(dispFave ? &imgFavoriteOn : &imgFavoriteOff); favoriteBtnImg.SetImage(dispFave ? &imgFavoriteOn : &imgFavoriteOff);
favoriteBtn.ResetState(); favoriteBtn.ResetState();
} }