From 61d45532cff608c0e944099c37d2a6fd41eccbd5 Mon Sep 17 00:00:00 2001 From: Aloshi Date: Sun, 1 Jun 2014 18:52:31 -0500 Subject: [PATCH] Only show 1 logo in carousel when there's 1 system. Don't animate SystemView or ViewController when destination == current position. Fade transition no longer gets triggered when pressing left/right with a single system. --- src/views/SystemView.cpp | 7 +++++++ src/views/ViewController.cpp | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/src/views/SystemView.cpp b/src/views/SystemView.cpp index 67e3caa30..0064ac382 100644 --- a/src/views/SystemView.cpp +++ b/src/views/SystemView.cpp @@ -153,6 +153,10 @@ void SystemView::onCursorChanged(const CursorState& state) if(abs(target - posMax - startPos) < dist) endPos = target - posMax; // loop around the start (max - 1 -> -1) + // no need to animate, we're not going anywhere (probably mEntries.size() == 1) + if(endPos == mCamOffset && endPos == mExtrasCamOffset) + return; + Animation* anim; if(Settings::getInstance()->getString("TransitionStyle") == "fade") { @@ -248,6 +252,9 @@ void SystemView::render(const Eigen::Affine3f& parentTrans) int logoCount = (int)(mSize.x() / logoSizeX) + 2; // how many logos we need to draw int center = (int)(mCamOffset); + if(mEntries.size() == 1) + logoCount = 1; + // draw background extras Eigen::Affine3f extrasTrans = trans; int extrasCenter = (int)mExtrasCamOffset; diff --git a/src/views/ViewController.cpp b/src/views/ViewController.cpp index 387119ec2..091f47657 100644 --- a/src/views/ViewController.cpp +++ b/src/views/ViewController.cpp @@ -89,6 +89,10 @@ void ViewController::playViewTransition() if(mCurrentView) target = mCurrentView->getPosition(); + // no need to animate, we're not going anywhere (probably goToNextGamelist() or goToPrevGamelist() when there's only 1 system) + if(target == -mCamera.translation()) + return; + if(Settings::getInstance()->getString("TransitionStyle") == "fade") { // fade