mirror of
https://github.com/dborth/vbagx.git
synced 2024-12-28 03:31:49 +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 selectedItem;
|
||||||
int listOffset;
|
int listOffset;
|
||||||
int action;
|
int action;
|
||||||
|
bool saveBtnLastOver[SAVELISTSIZE];
|
||||||
|
|
||||||
SaveList * saves;
|
SaveList * saves;
|
||||||
GuiButton * saveBtn[SAVELISTSIZE];
|
GuiButton * saveBtn[SAVELISTSIZE];
|
||||||
|
@ -114,7 +114,10 @@ GuiSaveBrowser::GuiSaveBrowser(int w, int h, SaveList * s, int a)
|
|||||||
saveBtn[i]->SetVisible(false);
|
saveBtn[i]->SetVisible(false);
|
||||||
saveBtn[i]->SetSoundOver(btnSoundOver);
|
saveBtn[i]->SetSoundOver(btnSoundOver);
|
||||||
saveBtn[i]->SetSoundClick(btnSoundClick);
|
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)
|
if(!focus)
|
||||||
goto endNavigation; // skip navigation
|
goto endNavigation; // skip navigation
|
||||||
|
|
||||||
|
if(selectedItem < 0) selectedItem = 0;
|
||||||
|
|
||||||
if(t->Right())
|
if(t->Right())
|
||||||
{
|
{
|
||||||
if(selectedItem == SAVELISTSIZE-1)
|
if(selectedItem == SAVELISTSIZE-1)
|
||||||
@ -384,12 +389,11 @@ void GuiSaveBrowser::Update(GuiTrigger * t)
|
|||||||
else if(focus && i == selectedItem && saveBtn[i]->GetState() == STATE_DEFAULT)
|
else if(focus && i == selectedItem && saveBtn[i]->GetState() == STATE_DEFAULT)
|
||||||
saveBtn[selectedItem]->SetState(STATE_SELECTED, t->chan);
|
saveBtn[selectedItem]->SetState(STATE_SELECTED, t->chan);
|
||||||
|
|
||||||
if(t->wpad.ir.valid && !saveBtn[i]->IsInside(t->wpad.ir.x, t->wpad.ir.y)
|
if(t->wpad.ir.valid)
|
||||||
&& saveBtn[i]->GetState() == STATE_SELECTED)
|
|
||||||
{
|
{
|
||||||
saveBtn[i]->ResetState();
|
if(!saveBtnLastOver[i] && saveBtn[i]->IsInside(t->wpad.ir.x, t->wpad.ir.y))
|
||||||
if(selectedItem == i)
|
saveBtn[i]->ResetState();
|
||||||
selectedItem = -1;
|
saveBtnLastOver[i] = saveBtn[i]->IsInside(t->wpad.ir.x, t->wpad.ir.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
saveBtn[i]->Update(t);
|
saveBtn[i]->Update(t);
|
||||||
|
Loading…
Reference in New Issue
Block a user