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

View file

@ -69,16 +69,32 @@ public:
video->muteVideoPlayer(); video->muteVideoPlayer();
} }
void stopScrollFadeIn() override void stopGamelistFadeAnimations() override
{ {
for (auto& image : mImageComponents) { for (auto& comp : mTextComponents)
if (image->getScrollFadeIn()) comp->finishAnimation(0);
image->finishAnimation(0); for (auto& comp : mDateTimeComponents)
} comp->finishAnimation(0);
for (auto& video : mVideoComponents) { for (auto& comp : mImageComponents)
if (video->getScrollFadeIn()) comp->finishAnimation(0);
video->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; } const std::shared_ptr<ThemeData> getTheme() const { return mTheme; }

View file

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

View file

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