Gamelist fade animations are now cancelled on certain navigation actions.

This commit is contained in:
Leon Styhre 2022-09-09 17:52:20 +02:00
parent 9e9fa58cd0
commit 2a4d9d334d
4 changed files with 35 additions and 12 deletions

View file

@ -72,6 +72,7 @@ bool GamelistBase::input(InputConfig* config, Input input)
pauseViewVideos();
ViewController::getInstance()->cancelViewTransitions();
stopListScrolling();
stopGamelistFadeAnimations();
launch(cursor);
}
else {
@ -93,6 +94,7 @@ bool GamelistBase::input(InputConfig* config, Input input)
pauseViewVideos();
ViewController::getInstance()->cancelViewTransitions();
stopListScrolling();
stopGamelistFadeAnimations();
launch(child);
return true;
}
@ -142,6 +144,7 @@ bool GamelistBase::input(InputConfig* config, Input input)
mCursorStack.top()->getParent());
setCursor(mCursorStack.top());
stopListScrolling();
stopGamelistFadeAnimations();
if (mCursorStack.size() > 0)
mCursorStack.pop();
if (mRoot->getSystem()->getThemeFolder() == "custom-collections")
@ -152,6 +155,7 @@ bool GamelistBase::input(InputConfig* config, Input input)
muteViewVideos();
onFocusLost();
stopListScrolling();
stopGamelistFadeAnimations();
SystemData* systemToView = getCursor()->getSystem();
if (systemToView->isCustomCollection() &&
systemToView->getRootFolder()->getParent())
@ -184,6 +188,7 @@ bool GamelistBase::input(InputConfig* config, Input input)
}
else if (mRoot->getSystem()->isGameSystem()) {
stopListScrolling();
stopGamelistFadeAnimations();
ViewController::getInstance()->cancelViewTransitions();
NavigationSounds::getInstance().playThemeNavigationSound(SCROLLSOUND);
mWindow->startMediaViewer(getCursor());
@ -196,6 +201,7 @@ bool GamelistBase::input(InputConfig* config, Input input)
muteViewVideos();
onFocusLost();
stopListScrolling();
stopGamelistFadeAnimations();
ViewController::getInstance()->goToNextGamelist();
return true;
}
@ -206,6 +212,7 @@ bool GamelistBase::input(InputConfig* config, Input input)
muteViewVideos();
onFocusLost();
stopListScrolling();
stopGamelistFadeAnimations();
ViewController::getInstance()->goToPrevGamelist();
return true;
}
@ -476,7 +483,7 @@ bool GamelistBase::input(InputConfig* config, Input input)
ViewController::getInstance()->cancelViewTransitions();
stopListScrolling();
pauseViewVideos();
stopScrollFadeIn();
stopGamelistFadeAnimations();
mWindow->pushGui(new GuiGamelistOptions(this->mRoot->getSystem()));
return true;
}

View file

@ -69,16 +69,32 @@ public:
video->muteVideoPlayer();
}
void stopScrollFadeIn() override
void stopGamelistFadeAnimations() override
{
for (auto& image : mImageComponents) {
if (image->getScrollFadeIn())
image->finishAnimation(0);
}
for (auto& video : mVideoComponents) {
if (video->getScrollFadeIn())
video->finishAnimation(0);
}
for (auto& comp : mTextComponents)
comp->finishAnimation(0);
for (auto& comp : mDateTimeComponents)
comp->finishAnimation(0);
for (auto& comp : mImageComponents)
comp->finishAnimation(0);
for (auto& comp : mStaticVideoComponents)
comp->finishAnimation(0);
for (auto& comp : mVideoComponents)
comp->finishAnimation(0);
for (auto& comp : mLottieAnimComponents)
comp->finishAnimation(0);
for (auto& comp : mGIFAnimComponents)
comp->finishAnimation(0);
for (auto& comp : mBadgeComponents)
comp->finishAnimation(0);
for (auto& comp : mRatingComponents)
comp->finishAnimation(0);
for (auto& comp : mContainerComponents)
comp->finishAnimation(0);
for (auto& comp : mContainerTextComponents)
comp->finishAnimation(0);
for (auto& comp : mGamelistInfoComponents)
comp->finishAnimation(0);
}
const std::shared_ptr<ThemeData> getTheme() const { return mTheme; }

View file

@ -855,7 +855,7 @@ bool ViewController::input(InputConfig* config, Input input)
mCurrentView->stopListScrolling();
// Pause all videos as they would otherwise continue to play beneath the menu.
mCurrentView->pauseViewVideos();
mCurrentView->stopScrollFadeIn();
mCurrentView->stopGamelistFadeAnimations();
// Finally, if the camera is currently moving, reset its position.
cancelViewTransitions();

View file

@ -210,7 +210,7 @@ public:
void stopAllAnimations();
void cancelAllAnimations();
virtual void stopScrollFadeIn() {}
virtual void stopGamelistFadeAnimations() {}
virtual bool isListScrolling() { return false; }
virtual void stopListScrolling() {}
virtual const float getOpacity() const { return mOpacity; }