mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2026-01-26 17:54:46 +01:00
Added onGameEnter and onGameExit animation triggers.
This commit is contained in:
parent
3e6f67f0c8
commit
60356f0c48
@ -350,6 +350,24 @@ void ScrollingList::triggerMenuExitEvent( int menuIndex )
|
||||
}
|
||||
}
|
||||
|
||||
void ScrollingList::triggerGameEnterEvent( int menuIndex )
|
||||
{
|
||||
for(unsigned int i = 0; i < components_.size(); ++i)
|
||||
{
|
||||
Component *c = components_.at(i);
|
||||
if(c) c->triggerEvent( "gameEnter", menuIndex );
|
||||
}
|
||||
}
|
||||
|
||||
void ScrollingList::triggerGameExitEvent( int menuIndex )
|
||||
{
|
||||
for(unsigned int i = 0; i < components_.size(); ++i)
|
||||
{
|
||||
Component *c = components_.at(i);
|
||||
if(c) c->triggerEvent( "gameExit", menuIndex );
|
||||
}
|
||||
}
|
||||
|
||||
void ScrollingList::triggerHighlightEnterEvent( int menuIndex )
|
||||
{
|
||||
for(unsigned int i = 0; i < components_.size(); ++i)
|
||||
|
||||
@ -49,6 +49,8 @@ public:
|
||||
void triggerExitEvent();
|
||||
void triggerMenuEnterEvent(int menuIndex = -1);
|
||||
void triggerMenuExitEvent(int menuIndex = -1);
|
||||
void triggerGameEnterEvent(int menuIndex = -1);
|
||||
void triggerGameExitEvent(int menuIndex = -1);
|
||||
void triggerHighlightEnterEvent(int menuIndex = -1);
|
||||
void triggerHighlightExitEvent(int menuIndex = -1);
|
||||
|
||||
|
||||
@ -573,6 +573,44 @@ void Page::exitMenu()
|
||||
}
|
||||
|
||||
|
||||
void Page::enterGame()
|
||||
{
|
||||
|
||||
for(MenuVector_T::iterator it = menus_.begin(); it != menus_.end(); it++)
|
||||
{
|
||||
ScrollingList *menu = *it;
|
||||
menu->triggerEvent( "gameEnter", menuDepth_ - 1 );
|
||||
menu->triggerGameEnterEvent( menuDepth_ - 1 );
|
||||
}
|
||||
|
||||
for(std::vector<Component *>::iterator it = LayerComponents.begin(); it != LayerComponents.end(); ++it)
|
||||
{
|
||||
(*it)->triggerEvent( "gameEnter", menuDepth_ - 1 );
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void Page::exitGame()
|
||||
{
|
||||
|
||||
for(MenuVector_T::iterator it = menus_.begin(); it != menus_.end(); it++)
|
||||
{
|
||||
ScrollingList *menu = *it;
|
||||
menu->triggerEvent( "gameExit" );
|
||||
menu->triggerGameExitEvent( menuDepth_ - 1 );
|
||||
}
|
||||
|
||||
for(std::vector<Component *>::iterator it = LayerComponents.begin(); it != LayerComponents.end(); ++it)
|
||||
{
|
||||
(*it)->triggerEvent( "gameExit", menuDepth_ - 1 );
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
std::string Page::getPlaylistName()
|
||||
{
|
||||
return playlist_->first;
|
||||
|
||||
@ -49,6 +49,8 @@ public:
|
||||
bool popCollection();
|
||||
void enterMenu();
|
||||
void exitMenu();
|
||||
void enterGame();
|
||||
void exitGame();
|
||||
std::string getPlaylistName();
|
||||
void favPlaylist();
|
||||
void nextPlaylist();
|
||||
|
||||
@ -729,6 +729,8 @@ AnimationEvents *PageBuilder::createTweenInstance(xml_node<> *componentXml)
|
||||
buildTweenSet(tweens, componentXml, "onHighlightExit", "highlightExit");
|
||||
buildTweenSet(tweens, componentXml, "onMenuEnter", "menuEnter");
|
||||
buildTweenSet(tweens, componentXml, "onMenuExit", "menuExit");
|
||||
buildTweenSet(tweens, componentXml, "onGameEnter", "gameEnter");
|
||||
buildTweenSet(tweens, componentXml, "onGameExit", "gameExit");
|
||||
|
||||
return tweens;
|
||||
}
|
||||
|
||||
@ -537,12 +537,28 @@ void RetroFE::run()
|
||||
}
|
||||
break;
|
||||
|
||||
case RETROFE_LAUNCH_ENTER:
|
||||
currentPage_->enterGame();
|
||||
state = RETROFE_LAUNCH_REQUEST;
|
||||
break;
|
||||
|
||||
case RETROFE_LAUNCH_REQUEST:
|
||||
nextPageItem_ = currentPage_->getSelectedItem();
|
||||
launchEnter();
|
||||
l.run(nextPageItem_->collectionInfo->name, nextPageItem_);
|
||||
launchExit();
|
||||
state = RETROFE_IDLE;
|
||||
if(currentPage_->isIdle())
|
||||
{
|
||||
nextPageItem_ = currentPage_->getSelectedItem();
|
||||
launchEnter();
|
||||
l.run(nextPageItem_->collectionInfo->name, nextPageItem_);
|
||||
launchExit();
|
||||
currentPage_->exitGame();
|
||||
state = RETROFE_LAUNCH_EXIT;
|
||||
}
|
||||
break;
|
||||
|
||||
case RETROFE_LAUNCH_EXIT:
|
||||
if(currentPage_->isIdle())
|
||||
{
|
||||
state = RETROFE_IDLE;
|
||||
}
|
||||
break;
|
||||
|
||||
case RETROFE_BACK_REQUEST:
|
||||
@ -854,7 +870,7 @@ RetroFE::RETROFE_STATE RetroFE::processUserInput(Page *page)
|
||||
{
|
||||
if(nextPageItem_->leaf)
|
||||
{
|
||||
state = RETROFE_LAUNCH_REQUEST;
|
||||
state = RETROFE_LAUNCH_ENTER;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -70,7 +70,9 @@ private:
|
||||
RETROFE_NEXT_PAGE_MENU_EXIT,
|
||||
RETROFE_NEXT_PAGE_MENU_LOAD_ART,
|
||||
RETROFE_NEXT_PAGE_MENU_ENTER,
|
||||
RETROFE_LAUNCH_ENTER,
|
||||
RETROFE_LAUNCH_REQUEST,
|
||||
RETROFE_LAUNCH_EXIT,
|
||||
RETROFE_BACK_REQUEST,
|
||||
RETROFE_BACK_MENU_EXIT,
|
||||
RETROFE_BACK_MENU_LOAD_ART,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user