mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2026-01-27 02:05:06 +01:00
Fix bug when pressing back when scrolling (can cause crash or select the wrong item)
This commit is contained in:
parent
2def9989ee
commit
4a240eef19
@ -162,7 +162,7 @@ bool Page::AddComponent(Component *c)
|
||||
return retVal;
|
||||
}
|
||||
|
||||
bool Page::IsIdle()
|
||||
bool Page::IsMenuIdle()
|
||||
{
|
||||
bool idle = true;
|
||||
|
||||
@ -176,7 +176,13 @@ bool Page::IsIdle()
|
||||
break;
|
||||
}
|
||||
}
|
||||
return idle;
|
||||
}
|
||||
|
||||
bool Page::IsIdle()
|
||||
{
|
||||
bool idle = IsMenuIdle();
|
||||
|
||||
for(unsigned int i = 0; i < NUM_LAYERS && idle; ++i)
|
||||
{
|
||||
for(std::vector<Component *>::iterator it = LayerComponents[i].begin(); it != LayerComponents[i].end() && idle; ++it)
|
||||
|
||||
@ -61,9 +61,9 @@ public:
|
||||
bool IsHorizontalScroll();
|
||||
unsigned int GetMenuDepth();
|
||||
Item *GetSelectedItem();
|
||||
Item *GetPendingSelectedItem();
|
||||
void RemoveSelectedItem();
|
||||
bool IsIdle();
|
||||
bool IsMenuIdle();
|
||||
bool IsHidden();
|
||||
void SetStatusTextComponent(Text *t);
|
||||
void Update(float dt);
|
||||
|
||||
@ -429,7 +429,7 @@ RetroFE::RETROFE_STATE RetroFE::ProcessUserInput(Page *page)
|
||||
{
|
||||
//todo: add admin mode support
|
||||
}
|
||||
if (keys[Input.GetScancode(UserInput::KeyCodeSelect)])
|
||||
if (keys[Input.GetScancode(UserInput::KeyCodeSelect)] && page->IsMenuIdle())
|
||||
{
|
||||
NextPageItem = page->GetSelectedItem();
|
||||
|
||||
@ -453,7 +453,7 @@ RetroFE::RETROFE_STATE RetroFE::ProcessUserInput(Page *page)
|
||||
}
|
||||
}
|
||||
|
||||
if (keys[Input.GetScancode(UserInput::KeyCodeBack)])
|
||||
if (keys[Input.GetScancode(UserInput::KeyCodeBack)] && page->IsMenuIdle())
|
||||
{
|
||||
if(Back(exit) || exit)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user