From 71d439c3f7a4f6082efa508dca8a0d5c4634a51a Mon Sep 17 00:00:00 2001 From: Vincent-FK Date: Sun, 22 Mar 2020 11:14:04 +0100 Subject: [PATCH] add xml events onMenuFastScrollPrev onMenuFastScrollNext onMenuScrollPrev onMenuScrollNext Signed-off-by: Vincent-FK --- RetroFE/Source/Graphics/Component/ScrollingList.cpp | 2 ++ RetroFE/Source/Graphics/Page.cpp | 8 ++++++-- RetroFE/Source/Graphics/PageBuilder.cpp | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/RetroFE/Source/Graphics/Component/ScrollingList.cpp b/RetroFE/Source/Graphics/Component/ScrollingList.cpp index 601e6bd..5ed495d 100644 --- a/RetroFE/Source/Graphics/Component/ScrollingList.cpp +++ b/RetroFE/Source/Graphics/Component/ScrollingList.cpp @@ -893,6 +893,8 @@ void ScrollingList::scroll( bool forward ) resetTweens( c, tweenPoints_->at( nextI ), scrollPoints_->at( i ), scrollPoints_->at( nextI ), scrollPeriod_ ); c->baseViewInfo.font = scrollPoints_->at( nextI )->font; // Use the font settings of the next index + c->triggerEvent( forward?"menuScrollNext":"menuScrollPrev" ); + c->update(0); c->triggerEvent( "menuScroll" ); } diff --git a/RetroFE/Source/Graphics/Page.cpp b/RetroFE/Source/Graphics/Page.cpp index 9ae53d7..5a5f233 100644 --- a/RetroFE/Source/Graphics/Page.cpp +++ b/RetroFE/Source/Graphics/Page.cpp @@ -444,6 +444,8 @@ void Page::menuScroll() for(std::vector::iterator it = LayerComponents.begin(); it != LayerComponents.end(); ++it) { + (*it)->triggerEvent( scrollDirectionForward_?"menuScrollNext":"menuScrollPrev", menuDepth_ - 1 ); + (*it)->update(0); (*it)->triggerEvent( "menuScroll", menuDepth_ - 1 ); } } @@ -457,6 +459,8 @@ void Page::menuFastScroll() for(std::vector::iterator it = LayerComponents.begin(); it != LayerComponents.end(); ++it) { + (*it)->triggerEvent( scrollDirectionForward_?"menuFastScrollNext":"menuFastScrollPrev", menuDepth_ - 1 ); + (*it)->update(0); (*it)->triggerEvent( "menuFastScroll", menuDepth_ - 1 ); } } @@ -671,6 +675,7 @@ void Page::setScrolling(ScrollDirection direction) switch(direction) { case ScrollDirectionForward: + scrollDirectionForward_=true; if(!scrollActive_) { menuScroll(); @@ -679,9 +684,9 @@ void Page::setScrolling(ScrollDirection direction) menuFastScroll(); } scrollActive_ = true; - scrollDirectionForward_=true; break; case ScrollDirectionBack: + scrollDirectionForward_=false; if(!scrollActive_) { menuScroll(); @@ -690,7 +695,6 @@ void Page::setScrolling(ScrollDirection direction) menuFastScroll(); } scrollActive_ = true; - scrollDirectionForward_=false; break; case ScrollDirectionIdle: default: diff --git a/RetroFE/Source/Graphics/PageBuilder.cpp b/RetroFE/Source/Graphics/PageBuilder.cpp index 8d252d8..a3b2f2a 100644 --- a/RetroFE/Source/Graphics/PageBuilder.cpp +++ b/RetroFE/Source/Graphics/PageBuilder.cpp @@ -936,7 +936,11 @@ AnimationEvents *PageBuilder::createTweenInstance(xml_node<> *componentXml) buildTweenSet(tweens, componentXml, "onIdle", "idle"); buildTweenSet(tweens, componentXml, "onMenuIdle", "menuIdle"); buildTweenSet(tweens, componentXml, "onMenuScroll", "menuScroll"); + buildTweenSet(tweens, componentXml, "onMenuScrollPrev", "menuScrollPrev"); + buildTweenSet(tweens, componentXml, "onMenuScrollNext", "menuScrollNext"); buildTweenSet(tweens, componentXml, "onMenuFastScroll", "menuFastScroll"); + buildTweenSet(tweens, componentXml, "onMenuFastScrollPrev", "menuFastScrollPrev"); + buildTweenSet(tweens, componentXml, "onMenuFastScrollNext", "menuFastScrollNext"); buildTweenSet(tweens, componentXml, "onHighlightEnter", "highlightEnter"); buildTweenSet(tweens, componentXml, "onHighlightExit", "highlightExit"); buildTweenSet(tweens, componentXml, "onMenuEnter", "menuEnter");