Fixed an issue where VideoComponent static images were not fading out correctly in the gamelist view.

This commit is contained in:
Leon Styhre 2022-02-09 18:16:15 +01:00
parent 03f8e020c3
commit 027af497d5
2 changed files with 15 additions and 3 deletions

View file

@ -205,10 +205,17 @@ void GamelistView::update(int deltaTime)
}
for (auto& video : mVideoComponents) {
if (!mVideoPlaying)
video->onHide();
else if (mVideoPlaying && !video->isVideoPaused() && !mWindow->isScreensaverActive())
if (!mVideoPlaying) {
if (!video->getScrollHide())
video->onHide();
else if (!video->hasStaticImage())
video->onHide();
else if (video->getOpacity() == 0)
video->onHide();
}
else if (mVideoPlaying && !video->isVideoPaused() && !mWindow->isScreensaverActive()) {
video->onShow();
}
if (ViewController::getInstance()->getGameLaunchTriggered() && video->isAnimationPlaying(0))
video->finishAnimation(0);
@ -733,6 +740,10 @@ void GamelistView::updateInfoPanel()
if (image->getScrollHide())
comps.emplace_back(image.get());
}
for (auto& video : mVideoComponents) {
if (video->getScrollHide())
comps.emplace_back(video.get());
}
for (auto& badge : mBadgeComponents) {
if (badge->getScrollHide())
comps.emplace_back(badge.get());

View file

@ -49,6 +49,7 @@ public:
void setOpacity(unsigned char opacity) override { mOpacity = opacity; }
bool hasStaticVideo() { return !mConfig.staticVideoPath.empty(); }
bool hasStaticImage() { return mStaticImage.getTextureSize() != glm::ivec2 {0, 0}; }
void onShow() override;
void onHide() override;