*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;
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; i<pagesize; i++)
@ -250,7 +241,7 @@ int GuiGameBrowser::GetClickedOption()
}
int GuiGameBrowser::GetSelectedOption()
{
{
int found = -1;
for(int i=0; i<pagesize; i++)
{
@ -371,7 +362,7 @@ void GuiGameBrowser::Update(GuiTrigger * t)
game[i]->SetState(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;

View File

@ -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();
}