diff --git a/src/views/ViewController.cpp b/src/views/ViewController.cpp index e4daa665d..ca4f56340 100644 --- a/src/views/ViewController.cpp +++ b/src/views/ViewController.cpp @@ -10,7 +10,7 @@ #include "../animations/LambdaAnimation.h" ViewController::ViewController(Window* window) - : GuiComponent(window), mCurrentView(nullptr), mCamera(Eigen::Affine3f::Identity()), mFadeOpacity(1) + : GuiComponent(window), mCurrentView(nullptr), mCamera(Eigen::Affine3f::Identity()), mFadeOpacity(1), mLockInput(false) { // slot 1 so the fade carries over setAnimation(new LambdaAnimation([&] (float t) { mFadeOpacity = lerp(1.0f, 0.0f, t); }, 900), nullptr, false, 1); @@ -105,10 +105,12 @@ 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), [this, origCamera, center, game] { game->getSystem()->launchGame(mWindow, game); mCamera = origCamera; + mLockInput = false; setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 600), nullptr, true); }); } @@ -171,6 +173,9 @@ std::shared_ptr ViewController::getSystemListView() bool ViewController::input(InputConfig* config, Input input) { + if(mLockInput) + return true; + if(mCurrentView) return mCurrentView->input(config, input); diff --git a/src/views/ViewController.h b/src/views/ViewController.h index c9ec81ab3..bb3472cb9 100644 --- a/src/views/ViewController.h +++ b/src/views/ViewController.h @@ -64,6 +64,7 @@ private: Eigen::Affine3f mCamera; float mFadeOpacity; + bool mLockInput; State mState; };