GUI behavioral corrections

This commit is contained in:
dborth 2009-05-28 07:08:01 +00:00
parent 0998b084ea
commit dd90a80436
5 changed files with 23 additions and 8 deletions

View File

@ -161,7 +161,7 @@ void GuiButton::Update(GuiTrigger * t)
#ifdef HW_RVL #ifdef HW_RVL
// cursor // cursor
if(t->wpad.ir.valid) if(t->wpad.ir.valid && t->chan >= 0)
{ {
if(this->IsInside(t->wpad.ir.x, t->wpad.ir.y)) if(this->IsInside(t->wpad.ir.x, t->wpad.ir.y))
{ {

View File

@ -365,7 +365,13 @@ void GuiFileBrowser::Update(GuiTrigger * t)
gameList[selectedItem]->SetState(STATE_SELECTED, t->chan); gameList[selectedItem]->SetState(STATE_SELECTED, t->chan);
} }
int currChan = t->chan;
if(t->wpad.ir.valid && !gameList[i]->IsInside(t->wpad.ir.x, t->wpad.ir.y))
t->chan = -1;
gameList[i]->Update(t); gameList[i]->Update(t);
t->chan = currChan;
if(gameList[i]->GetState() == STATE_SELECTED) if(gameList[i]->GetState() == STATE_SELECTED)
{ {

View File

@ -270,12 +270,16 @@ void GuiOptionBrowser::Update(GuiTrigger * t)
optionBtn[selectedItem]->SetState(STATE_SELECTED, t->chan); optionBtn[selectedItem]->SetState(STATE_SELECTED, t->chan);
} }
int currChan = t->chan;
if(t->wpad.ir.valid && !optionBtn[i]->IsInside(t->wpad.ir.x, t->wpad.ir.y))
t->chan = -1;
optionBtn[i]->Update(t); optionBtn[i]->Update(t);
t->chan = currChan;
if(optionBtn[i]->GetState() == STATE_SELECTED) if(optionBtn[i]->GetState() == STATE_SELECTED)
{
selectedItem = i; selectedItem = i;
}
} }
// pad/joystick navigation // pad/joystick navigation

View File

@ -284,7 +284,6 @@ void GuiSaveBrowser::Update(GuiTrigger * t)
{ {
selectedItem += 2; selectedItem += 2;
} }
arrowDownBtn->ResetState();
} }
else if(t->Up() || arrowUpBtn->GetState() == STATE_CLICKED) else if(t->Up() || arrowUpBtn->GetState() == STATE_CLICKED)
{ {
@ -301,11 +300,16 @@ void GuiSaveBrowser::Update(GuiTrigger * t)
{ {
selectedItem -= 2; selectedItem -= 2;
} }
arrowUpBtn->ResetState();
} }
endNavigation: endNavigation:
if(arrowDownBtn->GetState() == STATE_CLICKED)
arrowDownBtn->ResetState();
if(arrowUpBtn->GetState() == STATE_CLICKED)
arrowUpBtn->ResetState();
for(i=0; i<SAVELISTSIZE; i++) for(i=0; i<SAVELISTSIZE; i++)
{ {
if(listOffset+i < 0 && action == 1) if(listOffset+i < 0 && action == 1)

View File

@ -1564,6 +1564,7 @@ static int MenuGameSaves(int action)
HaltGui(); HaltGui();
mainWindow->Append(&saveBrowser); mainWindow->Append(&saveBrowser);
mainWindow->ChangeFocus(&saveBrowser);
ResumeGui(); ResumeGui();
while(menu == MENU_NONE) while(menu == MENU_NONE)
@ -2658,7 +2659,7 @@ static int MenuSettingsVideo()
GuiText titleTxt("Game Settings - Video", 28, (GXColor){255, 255, 255, 255}); GuiText titleTxt("Game Settings - Video", 28, (GXColor){255, 255, 255, 255});
titleTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP); titleTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
titleTxt.SetPosition(50,50); titleTxt.SetPosition(50,50);
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM); GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM);
GuiSound btnSoundClick(button_click_pcm, button_click_pcm_size, SOUND_PCM); GuiSound btnSoundClick(button_click_pcm, button_click_pcm_size, SOUND_PCM);
@ -4252,7 +4253,7 @@ static int MenuPalette()
usleep(350000); // wait for effects to finish usleep(350000); // wait for effects to finish
} }
else if(backBtn.GetState() == STATE_CLICKED) else if(backBtn.GetState() == STATE_CLICKED)
{ {
menu = MENU_GAMESETTINGS_VIDEO; menu = MENU_GAMESETTINGS_VIDEO;
} }
} }
@ -4260,7 +4261,7 @@ static int MenuPalette()
if(menu == MENU_GAME) if(menu == MENU_GAME)
SavePrefs(NOTSILENT); SavePrefs(NOTSILENT);
gbSetPalette(CurrentPalette.palette); gbSetPalette(CurrentPalette.palette);
HaltGui(); HaltGui();
mainWindow->Remove(&w); mainWindow->Remove(&w);
return menu; return menu;