mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Fixed an issue where gamelist scroll fade-in animations would continue to play after opening and closing a menu.
This commit is contained in:
parent
9e2c24ef79
commit
9867c3d595
|
@ -458,6 +458,7 @@ bool GamelistBase::input(InputConfig* config, Input input)
|
|||
ViewController::getInstance()->cancelViewTransitions();
|
||||
stopListScrolling();
|
||||
pauseViewVideos();
|
||||
stopScrollFadeIn();
|
||||
mWindow->pushGui(new GuiGamelistOptions(this->mRoot->getSystem()));
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -70,6 +70,7 @@ void GamelistView::legacyPopulateFields()
|
|||
mList.getPosition().y + mSize.y * 0.2125f);
|
||||
mImageComponents.back()->setMaxSize(mSize.x * (0.50f - 2.0f * padding), mSize.y * 0.4f);
|
||||
mImageComponents.back()->setDefaultZIndex(30.0f);
|
||||
mImageComponents.back()->setScrollFadeIn(true);
|
||||
addChild(mImageComponents.back().get());
|
||||
|
||||
if (mViewStyle == ViewController::VIDEO) {
|
||||
|
@ -81,6 +82,7 @@ void GamelistView::legacyPopulateFields()
|
|||
mList.getPosition().y + mSize.y * 0.2125f);
|
||||
mVideoComponents.back()->setSize(mSize.x * (0.5f - 2.0f * padding), mSize.y * 0.4f);
|
||||
mVideoComponents.back()->setDefaultZIndex(30.0f);
|
||||
mVideoComponents.back()->setScrollFadeIn(true);
|
||||
mVideoComponents.back()->setVisible(false);
|
||||
addChild(mVideoComponents.back().get());
|
||||
}
|
||||
|
|
|
@ -64,6 +64,18 @@ public:
|
|||
video->muteVideoPlayer();
|
||||
}
|
||||
|
||||
void stopScrollFadeIn() override
|
||||
{
|
||||
for (auto& image : mImageComponents) {
|
||||
if (image->getScrollFadeIn())
|
||||
image->finishAnimation(0);
|
||||
}
|
||||
for (auto& video : mVideoComponents) {
|
||||
if (video->getScrollFadeIn())
|
||||
video->finishAnimation(0);
|
||||
}
|
||||
}
|
||||
|
||||
const std::shared_ptr<ThemeData> getTheme() const { return mTheme; }
|
||||
void setTheme(const std::shared_ptr<ThemeData>& theme)
|
||||
{
|
||||
|
|
|
@ -831,6 +831,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();
|
||||
|
||||
// Finally, if the camera is currently moving, reset its position.
|
||||
cancelViewTransitions();
|
||||
|
|
|
@ -273,10 +273,10 @@ const bool GuiComponent::cancelAnimation(unsigned char slot)
|
|||
const bool GuiComponent::finishAnimation(unsigned char slot)
|
||||
{
|
||||
assert(slot < MAX_ANIMATIONS);
|
||||
AnimationController* anim = mAnimationMap[slot];
|
||||
AnimationController* anim {mAnimationMap[slot]};
|
||||
if (anim) {
|
||||
// Skip to animation's end.
|
||||
const bool done = anim->update(anim->getAnimation()->getDuration() - anim->getTime());
|
||||
const bool done {anim->update(anim->getAnimation()->getDuration() - anim->getTime())};
|
||||
if (done) {
|
||||
mAnimationMap[slot] = nullptr;
|
||||
delete anim; // Will also call finishedCallback.
|
||||
|
@ -291,9 +291,9 @@ const bool GuiComponent::finishAnimation(unsigned char slot)
|
|||
const bool GuiComponent::advanceAnimation(unsigned char slot, unsigned int time)
|
||||
{
|
||||
assert(slot < MAX_ANIMATIONS);
|
||||
AnimationController* anim = mAnimationMap[slot];
|
||||
AnimationController* anim {mAnimationMap[slot]};
|
||||
if (anim) {
|
||||
bool done = anim->update(time);
|
||||
bool done {anim->update(time)};
|
||||
if (done) {
|
||||
mAnimationMap[slot] = nullptr;
|
||||
delete anim; // Will also call finishedCallback.
|
||||
|
|
|
@ -189,6 +189,7 @@ public:
|
|||
void stopAllAnimations();
|
||||
void cancelAllAnimations();
|
||||
|
||||
virtual void stopScrollFadeIn() {}
|
||||
virtual bool isListScrolling() { return false; }
|
||||
virtual void stopListScrolling() {}
|
||||
virtual const float getOpacity() const { return mOpacity; }
|
||||
|
|
Loading…
Reference in a new issue