Allow menus of level n to finish the onMenuEnter animation at level n-1. This allows themes to e.g. fade out a collection menu during the onMenuEnter animation sequence of the Main collection.

This commit is contained in:
Pieter Hulshoff 2016-08-31 08:55:37 +02:00
parent 51d63e1b10
commit f5c7808c80
4 changed files with 10 additions and 4 deletions

View File

@ -648,14 +648,17 @@ void Page::update(float dt)
if(*it) (*it)->update(dt);
}
// many nodes still have handles on the collection info. We need to delete
// them once everything is done using them
}
void Page::cleanup()
{
std::list<MenuInfo_S>::iterator del = deleteCollections_.begin();
while(del != deleteCollections_.end())
{
MenuInfo_S &info = *del;
if(info.queueDelete && info.menu && info.menu->isIdle())
if(info.queueDelete && info.menu)
{
std::list<MenuInfo_S>::iterator next = del;
++next;
@ -675,6 +678,7 @@ void Page::update(float dt)
}
}
void Page::draw()
{
for(unsigned int i = 0; i < NUM_LAYERS; ++i)

View File

@ -78,6 +78,7 @@ public:
bool isMenuIdle();
void setStatusTextComponent(Text *t);
void update(float dt);
void cleanup();
void draw();
void freeGraphicsMemory();
void allocateGraphicsMemory();

View File

@ -510,6 +510,7 @@ void RetroFE::run()
case RETROFE_BACK_MENU_ENTER:
if(currentPage_->isIdle())
{
currentPage_->cleanup();
state = RETROFE_IDLE;
}
break;

View File

@ -20,7 +20,7 @@
std::string retrofe_version_major = "0";
std::string retrofe_version_minor = "7";
std::string retrofe_version_build = "7";
std::string retrofe_version_build = "8";
std::string Version::getString()