mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-16 20: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();
|
ViewController::getInstance()->cancelViewTransitions();
|
||||||
stopListScrolling();
|
stopListScrolling();
|
||||||
pauseViewVideos();
|
pauseViewVideos();
|
||||||
|
stopScrollFadeIn();
|
||||||
mWindow->pushGui(new GuiGamelistOptions(this->mRoot->getSystem()));
|
mWindow->pushGui(new GuiGamelistOptions(this->mRoot->getSystem()));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,6 +70,7 @@ void GamelistView::legacyPopulateFields()
|
||||||
mList.getPosition().y + mSize.y * 0.2125f);
|
mList.getPosition().y + mSize.y * 0.2125f);
|
||||||
mImageComponents.back()->setMaxSize(mSize.x * (0.50f - 2.0f * padding), mSize.y * 0.4f);
|
mImageComponents.back()->setMaxSize(mSize.x * (0.50f - 2.0f * padding), mSize.y * 0.4f);
|
||||||
mImageComponents.back()->setDefaultZIndex(30.0f);
|
mImageComponents.back()->setDefaultZIndex(30.0f);
|
||||||
|
mImageComponents.back()->setScrollFadeIn(true);
|
||||||
addChild(mImageComponents.back().get());
|
addChild(mImageComponents.back().get());
|
||||||
|
|
||||||
if (mViewStyle == ViewController::VIDEO) {
|
if (mViewStyle == ViewController::VIDEO) {
|
||||||
|
@ -81,6 +82,7 @@ void GamelistView::legacyPopulateFields()
|
||||||
mList.getPosition().y + mSize.y * 0.2125f);
|
mList.getPosition().y + mSize.y * 0.2125f);
|
||||||
mVideoComponents.back()->setSize(mSize.x * (0.5f - 2.0f * padding), mSize.y * 0.4f);
|
mVideoComponents.back()->setSize(mSize.x * (0.5f - 2.0f * padding), mSize.y * 0.4f);
|
||||||
mVideoComponents.back()->setDefaultZIndex(30.0f);
|
mVideoComponents.back()->setDefaultZIndex(30.0f);
|
||||||
|
mVideoComponents.back()->setScrollFadeIn(true);
|
||||||
mVideoComponents.back()->setVisible(false);
|
mVideoComponents.back()->setVisible(false);
|
||||||
addChild(mVideoComponents.back().get());
|
addChild(mVideoComponents.back().get());
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,6 +64,18 @@ public:
|
||||||
video->muteVideoPlayer();
|
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; }
|
const std::shared_ptr<ThemeData> getTheme() const { return mTheme; }
|
||||||
void setTheme(const std::shared_ptr<ThemeData>& theme)
|
void setTheme(const std::shared_ptr<ThemeData>& theme)
|
||||||
{
|
{
|
||||||
|
|
|
@ -831,6 +831,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();
|
||||||
|
|
||||||
// Finally, if the camera is currently moving, reset its position.
|
// Finally, if the camera is currently moving, reset its position.
|
||||||
cancelViewTransitions();
|
cancelViewTransitions();
|
||||||
|
|
|
@ -273,10 +273,10 @@ const bool GuiComponent::cancelAnimation(unsigned char slot)
|
||||||
const bool GuiComponent::finishAnimation(unsigned char slot)
|
const bool GuiComponent::finishAnimation(unsigned char slot)
|
||||||
{
|
{
|
||||||
assert(slot < MAX_ANIMATIONS);
|
assert(slot < MAX_ANIMATIONS);
|
||||||
AnimationController* anim = mAnimationMap[slot];
|
AnimationController* anim {mAnimationMap[slot]};
|
||||||
if (anim) {
|
if (anim) {
|
||||||
// Skip to animation's end.
|
// 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) {
|
if (done) {
|
||||||
mAnimationMap[slot] = nullptr;
|
mAnimationMap[slot] = nullptr;
|
||||||
delete anim; // Will also call finishedCallback.
|
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)
|
const bool GuiComponent::advanceAnimation(unsigned char slot, unsigned int time)
|
||||||
{
|
{
|
||||||
assert(slot < MAX_ANIMATIONS);
|
assert(slot < MAX_ANIMATIONS);
|
||||||
AnimationController* anim = mAnimationMap[slot];
|
AnimationController* anim {mAnimationMap[slot]};
|
||||||
if (anim) {
|
if (anim) {
|
||||||
bool done = anim->update(time);
|
bool done {anim->update(time)};
|
||||||
if (done) {
|
if (done) {
|
||||||
mAnimationMap[slot] = nullptr;
|
mAnimationMap[slot] = nullptr;
|
||||||
delete anim; // Will also call finishedCallback.
|
delete anim; // Will also call finishedCallback.
|
||||||
|
|
|
@ -189,6 +189,7 @@ public:
|
||||||
void stopAllAnimations();
|
void stopAllAnimations();
|
||||||
void cancelAllAnimations();
|
void cancelAllAnimations();
|
||||||
|
|
||||||
|
virtual void stopScrollFadeIn() {}
|
||||||
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; }
|
||||||
|
|
Loading…
Reference in a new issue