Fixed issue where animation from previous menu shows up for reloadable components.

This commit is contained in:
emb 2015-02-04 12:36:22 -06:00
parent 8df517437c
commit ccb354e8b6
2 changed files with 37 additions and 40 deletions

View File

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

View File

@ -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<Component *>::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<Component *>::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;
}