mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2025-12-12 17:58:53 +01:00
Added onPlaylistEnter/Exit animations REPLACING the onHighlightEnter/Exit
animations that used to be triggered. Layouts should be updated accordingly!
This commit is contained in:
parent
1680c8467d
commit
57c465cef3
@ -434,6 +434,24 @@ void ScrollingList::triggerHighlightExitEvent( int menuIndex )
|
||||
}
|
||||
}
|
||||
|
||||
void ScrollingList::triggerPlaylistEnterEvent( int menuIndex )
|
||||
{
|
||||
for ( unsigned int i = 0; i < components_.size( ); ++i )
|
||||
{
|
||||
Component *c = components_.at( i );
|
||||
if ( c ) c->triggerEvent( "playlistEnter", menuIndex );
|
||||
}
|
||||
}
|
||||
|
||||
void ScrollingList::triggerPlaylistExitEvent( int menuIndex )
|
||||
{
|
||||
for ( unsigned int i = 0; i < components_.size( ); ++i )
|
||||
{
|
||||
Component *c = components_.at( i );
|
||||
if ( c ) c->triggerEvent( "playlistExit", menuIndex );
|
||||
}
|
||||
}
|
||||
|
||||
void ScrollingList::update( float dt )
|
||||
{
|
||||
|
||||
|
||||
@ -53,6 +53,8 @@ public:
|
||||
void triggerGameExitEvent( int menuIndex = -1 );
|
||||
void triggerHighlightEnterEvent( int menuIndex = -1 );
|
||||
void triggerHighlightExitEvent( int menuIndex = -1 );
|
||||
void triggerPlaylistEnterEvent( int menuIndex = -1 );
|
||||
void triggerPlaylistExitEvent( int menuIndex = -1 );
|
||||
|
||||
bool allocateTexture( unsigned int index, Item *i );
|
||||
void deallocateTexture( unsigned int index );
|
||||
|
||||
@ -483,6 +483,68 @@ void Page::highlightExit()
|
||||
}
|
||||
|
||||
|
||||
void Page::playlistEnter()
|
||||
{
|
||||
Item *item = selectedItem_;
|
||||
|
||||
if(!item) return;
|
||||
for(MenuVector_T::iterator it = menus_.begin(); it != menus_.end(); it++)
|
||||
{
|
||||
for(std::vector<ScrollingList *>::iterator it2 = menus_[std::distance(menus_.begin(), it)].begin(); it2 != menus_[std::distance(menus_.begin(), it)].end(); it2++)
|
||||
{
|
||||
ScrollingList *menu = *it2;
|
||||
if(menuDepth_-1 == static_cast<unsigned int>(distance(menus_.begin(), it)))
|
||||
{
|
||||
// Also trigger animations for index i for active menu
|
||||
menu->triggerEvent( "playlistEnter", MENU_INDEX_HIGH + menuDepth_ - 1 );
|
||||
menu->triggerPlaylistEnterEvent( MENU_INDEX_HIGH + menuDepth_ - 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
menu->triggerEvent( "playlistEnter", menuDepth_ - 1 );
|
||||
menu->triggerPlaylistEnterEvent( menuDepth_ - 1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(std::vector<Component *>::iterator it = LayerComponents.begin(); it != LayerComponents.end(); ++it)
|
||||
{
|
||||
(*it)->triggerEvent( "playlistEnter", menuDepth_ - 1 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Page::playlistExit()
|
||||
{
|
||||
Item *item = selectedItem_;
|
||||
|
||||
if(!item) return;
|
||||
for(MenuVector_T::iterator it = menus_.begin(); it != menus_.end(); it++)
|
||||
{
|
||||
for(std::vector<ScrollingList *>::iterator it2 = menus_[std::distance(menus_.begin(), it)].begin(); it2 != menus_[std::distance(menus_.begin(), it)].end(); it2++)
|
||||
{
|
||||
ScrollingList *menu = *it2;
|
||||
if(menuDepth_-1 == static_cast<unsigned int>(distance(menus_.begin(), it)))
|
||||
{
|
||||
// Also trigger animations for index i for active menu
|
||||
menu->triggerEvent( "playlistExit", MENU_INDEX_HIGH + menuDepth_ - 1 );
|
||||
menu->triggerPlaylistExitEvent( MENU_INDEX_HIGH + menuDepth_ - 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
menu->triggerEvent( "playlistExit", menuDepth_ - 1 );
|
||||
menu->triggerPlaylistExitEvent( menuDepth_ - 1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(std::vector<Component *>::iterator it = LayerComponents.begin(); it != LayerComponents.end(); ++it)
|
||||
{
|
||||
(*it)->triggerEvent( "playlistExit", menuDepth_ - 1 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Page::triggerEvent( std::string action )
|
||||
{
|
||||
for(std::vector<Component *>::iterator it = LayerComponents.begin(); it != LayerComponents.end(); ++it)
|
||||
|
||||
@ -98,6 +98,8 @@ public:
|
||||
void menuScroll();
|
||||
void highlightEnter();
|
||||
void highlightExit();
|
||||
void playlistEnter();
|
||||
void playlistExit();
|
||||
void triggerEvent( std::string action );
|
||||
void setText( std::string text, int id );
|
||||
void addPlaylist();
|
||||
|
||||
@ -857,6 +857,8 @@ AnimationEvents *PageBuilder::createTweenInstance(xml_node<> *componentXml)
|
||||
buildTweenSet(tweens, componentXml, "onMenuExit", "menuExit");
|
||||
buildTweenSet(tweens, componentXml, "onGameEnter", "gameEnter");
|
||||
buildTweenSet(tweens, componentXml, "onGameExit", "gameExit");
|
||||
buildTweenSet(tweens, componentXml, "onPlaylistEnter", "playlistEnter");
|
||||
buildTweenSet(tweens, componentXml, "onPlaylistExit", "playlistExit");
|
||||
|
||||
buildTweenSet(tweens, componentXml, "onMenuActionInputEnter", "menuActionInputEnter");
|
||||
buildTweenSet(tweens, componentXml, "onMenuActionInputExit", "menuActionInputExit");
|
||||
|
||||
@ -453,7 +453,7 @@ void RetroFE::run( )
|
||||
|
||||
// Switch playlist; start onHighlightExit animation
|
||||
case RETROFE_PLAYLIST_REQUEST:
|
||||
currentPage_->highlightExit( );
|
||||
currentPage_->playlistExit( );
|
||||
currentPage_->setScrolling(Page::ScrollDirectionIdle);
|
||||
state = RETROFE_PLAYLIST_EXIT;
|
||||
break;
|
||||
@ -473,7 +473,7 @@ void RetroFE::run( )
|
||||
{
|
||||
currentPage_->onNewItemSelected( );
|
||||
currentPage_->reallocateMenuSpritePoints( );
|
||||
currentPage_->highlightEnter( );
|
||||
currentPage_->playlistEnter( );
|
||||
state = RETROFE_PLAYLIST_ENTER;
|
||||
}
|
||||
break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user