mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Fixed some fade transition issues in SystemView.
This commit is contained in:
parent
00b71c7b27
commit
6a2a3b1259
|
@ -35,6 +35,7 @@ SystemView::SystemView()
|
|||
, mNavigated {false}
|
||||
, mMaxFade {false}
|
||||
, mFadeTransitions {false}
|
||||
, mTransitionAnim {false}
|
||||
{
|
||||
setSize(Renderer::getScreenWidth(), Renderer::getScreenHeight());
|
||||
populate();
|
||||
|
@ -54,8 +55,10 @@ SystemView::~SystemView()
|
|||
|
||||
void SystemView::onShow()
|
||||
{
|
||||
if (mFadeTransitions)
|
||||
if (mFadeTransitions) {
|
||||
finishAnimation(0);
|
||||
mTransitionAnim = false;
|
||||
}
|
||||
}
|
||||
|
||||
void SystemView::onTransition()
|
||||
|
@ -65,6 +68,9 @@ void SystemView::onTransition()
|
|||
|
||||
for (auto& anim : mSystemElements[mPrimary->getCursor()].GIFAnimComponents)
|
||||
anim->setPauseAnimation(true);
|
||||
|
||||
if (mFadeTransitions)
|
||||
mTransitionAnim = true;
|
||||
}
|
||||
|
||||
void SystemView::goToSystem(SystemData* system, bool animate)
|
||||
|
@ -284,6 +290,9 @@ void SystemView::onCursorChanged(const CursorState& state)
|
|||
std::string transitionStyle {Settings::getInstance()->getString("TransitionStyle")};
|
||||
mFadeTransitions = transitionStyle == "fade";
|
||||
|
||||
if (startPos == endPos)
|
||||
return;
|
||||
|
||||
Animation* anim;
|
||||
|
||||
if (transitionStyle == "fade") {
|
||||
|
@ -1252,10 +1261,10 @@ void SystemView::renderElements(const glm::mat4& parentTrans, bool abovePrimary)
|
|||
element->getZIndex() < primaryZIndex)
|
||||
element->setDimming(1.0f - mFadeOpacity);
|
||||
if (mFadeTransitions && isAnimationPlaying(0))
|
||||
element->setOpacity(mMaxFade ? 1.0f - mFadeOpacity : 0.0f);
|
||||
element->setOpacity(1.0f - mFadeOpacity);
|
||||
else
|
||||
element->setOpacity(1.0f);
|
||||
if (mNavigated && mMaxFade)
|
||||
if (mFadeTransitions && mNavigated && mMaxFade)
|
||||
continue;
|
||||
element->render(elementTrans);
|
||||
}
|
||||
|
@ -1278,7 +1287,7 @@ void SystemView::renderElements(const glm::mat4& parentTrans, bool abovePrimary)
|
|||
if (mLegacyMode) {
|
||||
if (mFadeTransitions && !abovePrimary) {
|
||||
if (mFadeTransitions && isAnimationPlaying(0))
|
||||
mLegacySystemInfo->setOpacity(mMaxFade ? 1.0f - mFadeOpacity : 0.0f);
|
||||
mLegacySystemInfo->setOpacity(1.0f - mFadeOpacity);
|
||||
else
|
||||
mLegacySystemInfo->setOpacity(1.0f);
|
||||
}
|
||||
|
|
|
@ -49,12 +49,14 @@ public:
|
|||
bool isSystemAnimationPlaying(unsigned char slot) { return mPrimary->isAnimationPlaying(slot); }
|
||||
void finishSystemAnimation(unsigned char slot)
|
||||
{
|
||||
if (mFadeTransitions) {
|
||||
if (mFadeTransitions && mTransitionAnim) {
|
||||
mPrimary->finishAnimation(slot);
|
||||
mTransitionAnim = false;
|
||||
}
|
||||
else {
|
||||
finishAnimation(slot);
|
||||
mPrimary->finishAnimation(slot);
|
||||
mMaxFade = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,6 +146,7 @@ private:
|
|||
bool mNavigated;
|
||||
bool mMaxFade;
|
||||
bool mFadeTransitions;
|
||||
bool mTransitionAnim;
|
||||
};
|
||||
|
||||
#endif // ES_APP_VIEWS_SYSTEM_VIEW_H
|
||||
|
|
Loading…
Reference in a new issue