mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-27 00:25:38 +00:00
Transition style now also affects launch transition.
"Fade" only does a fade. "Slide" does the old move camera + fade effect.
This commit is contained in:
parent
a9514843b4
commit
b33a03fe83
|
@ -112,14 +112,32 @@ void ViewController::launch(FileData* game, Eigen::Vector3f center)
|
|||
center += mCurrentView->getPosition();
|
||||
stopAnimation(1); // make sure the fade in isn't still playing
|
||||
mLockInput = true;
|
||||
setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 1500), 0, [this, origCamera, center, game]
|
||||
|
||||
if(Settings::getInstance()->getString("TransitionStyle") == "fade")
|
||||
{
|
||||
game->getSystem()->launchGame(mWindow, game);
|
||||
mCamera = origCamera;
|
||||
mLockInput = false;
|
||||
setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 600), 0, nullptr, true);
|
||||
this->onFileChanged(game, FILE_METADATA_CHANGED);
|
||||
});
|
||||
// fade out, launch game, fade back in
|
||||
auto fadeFunc = [this](float t) {
|
||||
t -= 1;
|
||||
mFadeOpacity = lerp<float>(0.0f, 1.0f, t*t*t + 1);
|
||||
};
|
||||
setAnimation(new LambdaAnimation(fadeFunc, 1500), 0, [this, game, fadeFunc]
|
||||
{
|
||||
game->getSystem()->launchGame(mWindow, game);
|
||||
mLockInput = false;
|
||||
setAnimation(new LambdaAnimation(fadeFunc, 1500), 0, nullptr, true);
|
||||
this->onFileChanged(game, FILE_METADATA_CHANGED);
|
||||
});
|
||||
}else{
|
||||
// move camera to zoom in on center + fade out, launch game, come back in
|
||||
setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 1500), 0, [this, origCamera, center, game]
|
||||
{
|
||||
game->getSystem()->launchGame(mWindow, game);
|
||||
mCamera = origCamera;
|
||||
mLockInput = false;
|
||||
setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 600), 0, nullptr, true);
|
||||
this->onFileChanged(game, FILE_METADATA_CHANGED);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<IGameListView> ViewController::getGameListView(SystemData* system)
|
||||
|
|
Loading…
Reference in a new issue