mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-18 07:05:39 +00:00
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:
parent
cf269641fc
commit
61d45532cf
|
@ -153,6 +153,10 @@ void SystemView::onCursorChanged(const CursorState& state)
|
||||||
if(abs(target - posMax - startPos) < dist)
|
if(abs(target - posMax - startPos) < dist)
|
||||||
endPos = target - posMax; // loop around the start (max - 1 -> -1)
|
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;
|
Animation* anim;
|
||||||
if(Settings::getInstance()->getString("TransitionStyle") == "fade")
|
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 logoCount = (int)(mSize.x() / logoSizeX) + 2; // how many logos we need to draw
|
||||||
int center = (int)(mCamOffset);
|
int center = (int)(mCamOffset);
|
||||||
|
|
||||||
|
if(mEntries.size() == 1)
|
||||||
|
logoCount = 1;
|
||||||
|
|
||||||
// draw background extras
|
// draw background extras
|
||||||
Eigen::Affine3f extrasTrans = trans;
|
Eigen::Affine3f extrasTrans = trans;
|
||||||
int extrasCenter = (int)mExtrasCamOffset;
|
int extrasCenter = (int)mExtrasCamOffset;
|
||||||
|
|
|
@ -89,6 +89,10 @@ void ViewController::playViewTransition()
|
||||||
if(mCurrentView)
|
if(mCurrentView)
|
||||||
target = mCurrentView->getPosition();
|
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")
|
if(Settings::getInstance()->getString("TransitionStyle") == "fade")
|
||||||
{
|
{
|
||||||
// fade
|
// fade
|
||||||
|
|
Loading…
Reference in a new issue