From ccb354e8b6cf36a965e8b337621889fe52995229 Mon Sep 17 00:00:00 2001 From: emb <> Date: Wed, 4 Feb 2015 12:36:22 -0600 Subject: [PATCH] Fixed issue where animation from previous menu shows up for reloadable components. --- .../Graphics/Component/ScrollingList.cpp | 2 +- RetroFE/Source/Graphics/Page.cpp | 75 +++++++++---------- 2 files changed, 37 insertions(+), 40 deletions(-) diff --git a/RetroFE/Source/Graphics/Component/ScrollingList.cpp b/RetroFE/Source/Graphics/Component/ScrollingList.cpp index 9c4daaa..2e646b7 100644 --- a/RetroFE/Source/Graphics/Component/ScrollingList.cpp +++ b/RetroFE/Source/Graphics/Component/ScrollingList.cpp @@ -462,7 +462,7 @@ void ScrollingList::Update(float dt) CircularIncrement(spriteIndex, SpriteList); } - if(scrollStopped || NotifyAllRequested) + if(scrollStopped || (NotifyAllRequested && Focus)) { ComponentItemBinding *sprite = GetPendingCollectionItemSprite(); Item *item = NULL; diff --git a/RetroFE/Source/Graphics/Page.cpp b/RetroFE/Source/Graphics/Page.cpp index 046ce4f..7fec9b5 100644 --- a/RetroFE/Source/Graphics/Page.cpp +++ b/RetroFE/Source/Graphics/Page.cpp @@ -378,49 +378,46 @@ bool Page::PopCollection() { int menuExitIndex = -1; int menuEnterIndex = -1; + CollectionInfo *collection = NULL; + if(MenuDepth <= 1) { return false; } + if(Collections.size() <= 1) { return false; } + + Collections.pop_back(); + collection = Collections.back(); - if(MenuDepth > 1) + if(ActiveMenu) { - if(Collections.size() > 1) - { - Collections.pop_back(); - } - - if(ActiveMenu) - { - ActiveMenu->TriggerMenuExitEvent(); - } - - MenuDepth--; - menuExitIndex = MenuDepth; - menuEnterIndex = menuExitIndex - 1; - ActiveMenu = Menus[MenuDepth - 1]; - if(ActiveMenu) - { - ActiveMenu->TriggerMenuEnterEvent(); - } - - for(unsigned int i = 0; i < NUM_LAYERS; ++i) - { - for(std::vector::iterator it = LayerComponents[i].begin(); it != LayerComponents[i].end(); ++it) - { - if(menuEnterIndex >= 0) - { - (*it)->TriggerMenuEnterEvent(menuEnterIndex); - } - - if(menuExitIndex >= 0) - { - (*it)->TriggerMenuExitEvent(menuExitIndex); - } - } - } - - - return true; + ActiveMenu->TriggerMenuExitEvent(); } - return false; + MenuDepth--; + menuExitIndex = MenuDepth; + menuEnterIndex = menuExitIndex - 1; + ActiveMenu = Menus[MenuDepth - 1]; + if(ActiveMenu) + { + ActiveMenu->TriggerMenuEnterEvent(); + } + + for(unsigned int i = 0; i < NUM_LAYERS; ++i) + { + for(std::vector::iterator it = LayerComponents[i].begin(); it != LayerComponents[i].end(); ++it) + { + (*it)->SetCollectionName(collection->GetName()); + + if(menuEnterIndex >= 0) + { + (*it)->TriggerMenuEnterEvent(menuEnterIndex); + } + + if(menuExitIndex >= 0) + { + (*it)->TriggerMenuExitEvent(menuExitIndex); + } + } + } + + return true; }