mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2026-02-04 22:15:50 +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;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Page::IsIdle()
|
bool Page::IsMenuIdle()
|
||||||
{
|
{
|
||||||
bool idle = true;
|
bool idle = true;
|
||||||
|
|
||||||
@ -176,7 +176,13 @@ bool Page::IsIdle()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return idle;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Page::IsIdle()
|
||||||
|
{
|
||||||
|
bool idle = IsMenuIdle();
|
||||||
|
|
||||||
for(unsigned int i = 0; i < NUM_LAYERS && idle; ++i)
|
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)
|
for(std::vector<Component *>::iterator it = LayerComponents[i].begin(); it != LayerComponents[i].end() && idle; ++it)
|
||||||
|
|||||||
@ -61,9 +61,9 @@ public:
|
|||||||
bool IsHorizontalScroll();
|
bool IsHorizontalScroll();
|
||||||
unsigned int GetMenuDepth();
|
unsigned int GetMenuDepth();
|
||||||
Item *GetSelectedItem();
|
Item *GetSelectedItem();
|
||||||
Item *GetPendingSelectedItem();
|
|
||||||
void RemoveSelectedItem();
|
void RemoveSelectedItem();
|
||||||
bool IsIdle();
|
bool IsIdle();
|
||||||
|
bool IsMenuIdle();
|
||||||
bool IsHidden();
|
bool IsHidden();
|
||||||
void SetStatusTextComponent(Text *t);
|
void SetStatusTextComponent(Text *t);
|
||||||
void Update(float dt);
|
void Update(float dt);
|
||||||
|
|||||||
@ -429,7 +429,7 @@ RetroFE::RETROFE_STATE RetroFE::ProcessUserInput(Page *page)
|
|||||||
{
|
{
|
||||||
//todo: add admin mode support
|
//todo: add admin mode support
|
||||||
}
|
}
|
||||||
if (keys[Input.GetScancode(UserInput::KeyCodeSelect)])
|
if (keys[Input.GetScancode(UserInput::KeyCodeSelect)] && page->IsMenuIdle())
|
||||||
{
|
{
|
||||||
NextPageItem = page->GetSelectedItem();
|
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)
|
if(Back(exit) || exit)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user