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.
This commit is contained in:
Aloshi 2014-06-01 18:52:31 -05:00
parent cf269641fc
commit 61d45532cf
2 changed files with 11 additions and 0 deletions

View file

@ -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;

View file

@ -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