mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2026-01-10 00:01:28 +01:00
Allow onHighlight animations to be interrupted by key presses. This should remove the "lag" people have been experiencing when scrolling through the menu.
This commit is contained in:
parent
d3d4bdcd41
commit
c4c85fa9e8
@ -208,6 +208,18 @@ bool Page::isIdle()
|
||||
return idle;
|
||||
}
|
||||
|
||||
bool Page::isGraphicsIdle()
|
||||
{
|
||||
bool idle = true;
|
||||
|
||||
for(std::vector<Component *>::iterator it = LayerComponents.begin(); it != LayerComponents.end() && idle; ++it)
|
||||
{
|
||||
idle = (*it)->isIdle();
|
||||
}
|
||||
|
||||
return idle;
|
||||
}
|
||||
|
||||
|
||||
void Page::start()
|
||||
{
|
||||
|
||||
@ -74,6 +74,7 @@ public:
|
||||
void setScrollOffsetIndex(unsigned int i);
|
||||
unsigned int getScrollOffsetIndex();
|
||||
bool isIdle();
|
||||
bool isGraphicsIdle();
|
||||
bool isMenuIdle();
|
||||
void setStatusTextComponent(Text *t);
|
||||
void update(float dt);
|
||||
|
||||
@ -346,7 +346,11 @@ void RetroFE::run()
|
||||
break;
|
||||
|
||||
case RETROFE_HIGHLIGHT_EXIT:
|
||||
if (currentPage_->isIdle())
|
||||
if ( processUserInput(currentPage_) == RETROFE_HIGHLIGHT_REQUEST)
|
||||
{
|
||||
state = RETROFE_HIGHLIGHT_REQUEST;
|
||||
}
|
||||
else if (currentPage_->isGraphicsIdle())
|
||||
{
|
||||
currentPage_->onNewItemSelected();
|
||||
currentPage_->highlightEnter();
|
||||
@ -355,7 +359,11 @@ void RetroFE::run()
|
||||
break;
|
||||
|
||||
case RETROFE_HIGHLIGHT_ENTER:
|
||||
if (currentPage_->isIdle())
|
||||
if ( processUserInput(currentPage_) == RETROFE_HIGHLIGHT_REQUEST)
|
||||
{
|
||||
state = RETROFE_HIGHLIGHT_REQUEST;
|
||||
}
|
||||
else if (currentPage_->isGraphicsIdle())
|
||||
{
|
||||
state = RETROFE_IDLE;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user