mirror of
https://github.com/dborth/vbagx.git
synced 2024-12-27 11:11:50 +01:00
fix savebrowser bugs
This commit is contained in:
parent
279333fd01
commit
d9c9fc15a7
@ -843,6 +843,7 @@ class GuiSaveBrowser : public GuiElement
|
||||
int selectedItem;
|
||||
int listOffset;
|
||||
int action;
|
||||
bool saveBtnLastOver[SAVELISTSIZE];
|
||||
|
||||
SaveList * saves;
|
||||
GuiButton * saveBtn[SAVELISTSIZE];
|
||||
|
@ -114,7 +114,10 @@ GuiSaveBrowser::GuiSaveBrowser(int w, int h, SaveList * s, int a)
|
||||
saveBtn[i]->SetVisible(false);
|
||||
saveBtn[i]->SetSoundOver(btnSoundOver);
|
||||
saveBtn[i]->SetSoundClick(btnSoundClick);
|
||||
saveBtnLastOver[i] = false;
|
||||
}
|
||||
saveBtn[0]->SetState(STATE_SELECTED, -1);
|
||||
saveBtn[0]->SetVisible(true);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -229,6 +232,8 @@ void GuiSaveBrowser::Update(GuiTrigger * t)
|
||||
if(!focus)
|
||||
goto endNavigation; // skip navigation
|
||||
|
||||
if(selectedItem < 0) selectedItem = 0;
|
||||
|
||||
if(t->Right())
|
||||
{
|
||||
if(selectedItem == SAVELISTSIZE-1)
|
||||
@ -384,12 +389,11 @@ void GuiSaveBrowser::Update(GuiTrigger * t)
|
||||
else if(focus && i == selectedItem && saveBtn[i]->GetState() == STATE_DEFAULT)
|
||||
saveBtn[selectedItem]->SetState(STATE_SELECTED, t->chan);
|
||||
|
||||
if(t->wpad.ir.valid && !saveBtn[i]->IsInside(t->wpad.ir.x, t->wpad.ir.y)
|
||||
&& saveBtn[i]->GetState() == STATE_SELECTED)
|
||||
if(t->wpad.ir.valid)
|
||||
{
|
||||
saveBtn[i]->ResetState();
|
||||
if(selectedItem == i)
|
||||
selectedItem = -1;
|
||||
if(!saveBtnLastOver[i] && saveBtn[i]->IsInside(t->wpad.ir.x, t->wpad.ir.y))
|
||||
saveBtn[i]->ResetState();
|
||||
saveBtnLastOver[i] = saveBtn[i]->IsInside(t->wpad.ir.x, t->wpad.ir.y);
|
||||
}
|
||||
|
||||
saveBtn[i]->Update(t);
|
||||
|
Loading…
Reference in New Issue
Block a user