mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-12-23 10:21:55 +01:00
Fixed a codedump caused by not having any games and playing around in the gamewall.
This commit is contained in:
parent
2874d9672c
commit
6d082b7c66
@ -37,6 +37,7 @@ int mover=0, mover2=0;
|
||||
u8 goback=0;
|
||||
int goLeft = 0, goRight=0;
|
||||
char debugbuffer[100];
|
||||
int c;
|
||||
|
||||
/**
|
||||
* Constructor for the GuiGamegrid class.
|
||||
@ -47,6 +48,7 @@ GuiGameGrid::GuiGameGrid(int w, int h, struct discHdr * l, int count, const char
|
||||
height = h;
|
||||
gameCnt = (count < SAFETY) ? count : SAFETY;
|
||||
gameList = l;
|
||||
c=count;
|
||||
listOffset = (offset == 0) ? this->FindMenuItem(-1, 1) : offset;
|
||||
selectable = true;
|
||||
selectedItem = selected - offset;
|
||||
@ -137,7 +139,7 @@ GuiGameGrid::GuiGameGrid(int w, int h, struct discHdr * l, int count, const char
|
||||
btnRowDown->SetTrigger(trig1);
|
||||
|
||||
|
||||
|
||||
//if (count>0){
|
||||
|
||||
gameIndex = new int[pagesize];
|
||||
game = new GuiButton * [pagesize];
|
||||
@ -365,7 +367,7 @@ GuiGameGrid::GuiGameGrid(int w, int h, struct discHdr * l, int count, const char
|
||||
else
|
||||
WindowPrompt("Oops","Your Wii must be in 16:9 mode to see the gamewall.",0, LANGUAGE.ok, 0,0);
|
||||
|
||||
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
@ -501,7 +503,9 @@ void GuiGameGrid::Draw()
|
||||
LOCK(this);
|
||||
if(!this->IsVisible())
|
||||
return;
|
||||
|
||||
|
||||
if(c>0){
|
||||
|
||||
int next = listOffset;
|
||||
|
||||
for(int i=0; i<pagesize; i++) {
|
||||
@ -519,8 +523,10 @@ void GuiGameGrid::Draw()
|
||||
btnRowUp->Draw();
|
||||
btnRowDown->Draw();
|
||||
//debugTxt->Draw();
|
||||
|
||||
|
||||
this->UpdateEffects();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -792,7 +798,7 @@ void GuiGameGrid::Update(GuiTrigger * t)
|
||||
|
||||
|
||||
// navigation
|
||||
if(!focus || gameCnt < pagesize || (game[bob[0]]->GetEffect() && game[bob[pagesize-1]]->GetEffect()))
|
||||
if(!focus || gameCnt < pagesize || (c==0)||(game[bob[0]]->GetEffect() && game[bob[pagesize-1]]->GetEffect()))
|
||||
return; // skip navigation
|
||||
|
||||
if (t->Left() || btnLeft->GetState() == STATE_CLICKED) {
|
||||
@ -1289,14 +1295,14 @@ void GuiGameGrid::Update(GuiTrigger * t)
|
||||
}
|
||||
}
|
||||
|
||||
if (btnRowUp->GetState() == STATE_CLICKED) {
|
||||
if ((btnRowUp->GetState() == STATE_CLICKED)&&(c>0)) {
|
||||
if ((rows==1)&&(gameCnt>=16))this->ChangeRows(2);
|
||||
else if ((rows==2)&&(gameCnt>=42))this->ChangeRows(3);
|
||||
btnRowUp->ResetState();
|
||||
return;
|
||||
}
|
||||
|
||||
if (btnRowDown->GetState() == STATE_CLICKED) {
|
||||
if ((btnRowDown->GetState() == STATE_CLICKED)&&(c>0)) {
|
||||
if (rows==3)this->ChangeRows(2);
|
||||
else if (rows==2)this->ChangeRows(1);
|
||||
btnRowDown->ResetState();
|
||||
|
Loading…
Reference in New Issue
Block a user