diff --git a/RetroFE/Source/Graphics/Component/Component.cpp b/RetroFE/Source/Graphics/Component/Component.cpp index 795351b..054556e 100644 --- a/RetroFE/Source/Graphics/Component/Component.cpp +++ b/RetroFE/Source/Graphics/Component/Component.cpp @@ -25,8 +25,8 @@ Component::Component(Page &p) { tweens_ = NULL; backgroundTexture_ = NULL; + menuScrollReload_ = false; freeGraphicsMemory(); - } Component::Component(const Component ©) @@ -56,6 +56,7 @@ void Component::freeGraphicsMemory() animationType_ = ""; animationRequested_ = false; newItemSelected = false; + newScrollItemSelected = false; menuIndex_ = -1; currentTweens_ = NULL; @@ -118,6 +119,11 @@ void Component::setNewItemSelected() newItemSelected = true; } +void Component::setNewScrollItemSelected() +{ + newScrollItemSelected = true; +} + bool Component::isIdle() { return (currentTweenComplete_ || animationType_ == "idle" || animationType_ == "menuIdle"); @@ -399,3 +405,15 @@ bool Component::isPlaying() { return false; } + + +void Component::setMenuScrollReload(bool menuScrollReload) +{ + menuScrollReload_ = menuScrollReload; +} + + +bool Component::getMenuScrollReload() +{ + return menuScrollReload_; +} diff --git a/RetroFE/Source/Graphics/Component/Component.h b/RetroFE/Source/Graphics/Component/Component.h index ad95098..a5e0d1a 100644 --- a/RetroFE/Source/Graphics/Component/Component.h +++ b/RetroFE/Source/Graphics/Component/Component.h @@ -36,9 +36,11 @@ public: void triggerEvent(std::string event, int menuIndex = -1); void setPlaylist(std::string name ); void setNewItemSelected(); + void setNewScrollItemSelected(); bool isIdle(); bool isMenuScrolling(); bool newItemSelected; + bool newScrollItemSelected; virtual void update(float dt); virtual void draw(); @@ -46,6 +48,8 @@ public: virtual bool isPlaying(); ViewInfo baseViewInfo; std::string collectionName; + void setMenuScrollReload(bool menuScrollReload); + bool getMenuScrollReload(); protected: Page &page; @@ -67,5 +71,6 @@ private: std::string animationRequestedType_; std::string animationType_; bool animationRequested_; + bool menuScrollReload_; int menuIndex_; }; diff --git a/RetroFE/Source/Graphics/Component/ReloadableMedia.cpp b/RetroFE/Source/Graphics/Component/ReloadableMedia.cpp index 9a48223..c134bfd 100644 --- a/RetroFE/Source/Graphics/Component/ReloadableMedia.cpp +++ b/RetroFE/Source/Graphics/Component/ReloadableMedia.cpp @@ -63,11 +63,13 @@ void ReloadableMedia::enableTextFallback_(bool value) void ReloadableMedia::update(float dt) { - if (newItemSelected) + if (newItemSelected || + (newScrollItemSelected && getMenuScrollReload())) { reloadTexture(); - newItemSelected = false; + newItemSelected = false; + newScrollItemSelected = false; } if(loadedComponent_) diff --git a/RetroFE/Source/Graphics/Component/ReloadableScrollingText.cpp b/RetroFE/Source/Graphics/Component/ReloadableScrollingText.cpp index 13e47f7..b4ce42b 100644 --- a/RetroFE/Source/Graphics/Component/ReloadableScrollingText.cpp +++ b/RetroFE/Source/Graphics/Component/ReloadableScrollingText.cpp @@ -88,7 +88,8 @@ void ReloadableScrollingText::update(float dt) } } - if (newItemSelected) + if (newItemSelected || + (newScrollItemSelected && getMenuScrollReload())) { reloadTexture( ); newItemSelected = false; diff --git a/RetroFE/Source/Graphics/Component/ReloadableText.cpp b/RetroFE/Source/Graphics/Component/ReloadableText.cpp index 7573ce2..c6df57a 100644 --- a/RetroFE/Source/Graphics/Component/ReloadableText.cpp +++ b/RetroFE/Source/Graphics/Component/ReloadableText.cpp @@ -56,7 +56,9 @@ ReloadableText::~ReloadableText() void ReloadableText::update(float dt) { - if (newItemSelected || type_ == "time") + if (newItemSelected || + (newScrollItemSelected && getMenuScrollReload()) || + type_ == "time") { ReloadTexture(); newItemSelected = false; diff --git a/RetroFE/Source/Graphics/Page.cpp b/RetroFE/Source/Graphics/Page.cpp index f79963b..c14664e 100644 --- a/RetroFE/Source/Graphics/Page.cpp +++ b/RetroFE/Source/Graphics/Page.cpp @@ -164,6 +164,19 @@ void Page::onNewItemSelected() } +void Page::onNewScrollItemSelected() +{ + if(!(activeMenu_.size() > 0 && activeMenu_[0])) return; + selectedItem_ = activeMenu_[0]->getSelectedItem(); + + for(std::vector::iterator it = LayerComponents.begin(); it != LayerComponents.end(); ++it) + { + (*it)->setNewScrollItemSelected(); + } + +} + + void Page::highlightLoadArt() { if(!(activeMenu_.size() > 0 && activeMenu_[0])) return; @@ -1171,6 +1184,7 @@ void Page::scroll(bool forward) menu->scroll(forward); } } + onNewScrollItemSelected(); if(highlightSoundChunk_) { highlightSoundChunk_->play(); diff --git a/RetroFE/Source/Graphics/Page.h b/RetroFE/Source/Graphics/Page.h index dda6569..bbb2247 100644 --- a/RetroFE/Source/Graphics/Page.h +++ b/RetroFE/Source/Graphics/Page.h @@ -44,6 +44,7 @@ public: virtual ~Page(); void deInitialize(); virtual void onNewItemSelected(); + virtual void onNewScrollItemSelected(); void highlightLoadArt(); bool pushCollection(CollectionInfo *collection); bool popCollection(); diff --git a/RetroFE/Source/Graphics/PageBuilder.cpp b/RetroFE/Source/Graphics/PageBuilder.cpp index c9f3611..1761912 100644 --- a/RetroFE/Source/Graphics/PageBuilder.cpp +++ b/RetroFE/Source/Graphics/PageBuilder.cpp @@ -342,6 +342,13 @@ bool PageBuilder::buildComponents(xml_node<> *layout, Page *page) for(xml_node<> *componentXml = layout->first_node("container"); componentXml; componentXml = componentXml->next_sibling("container")) { Container *c = new Container(*page); + xml_attribute<> *menuScrollReload = componentXml->first_attribute("menuScrollReload"); + if (menuScrollReload && + (Utils::toLower(menuScrollReload->value()) == "true" || + Utils::toLower(menuScrollReload->value()) == "yes")) + { + c->setMenuScrollReload(true); + } buildViewInfo(componentXml, c->baseViewInfo); loadTweens(c, componentXml); page->addComponent(c); @@ -366,6 +373,13 @@ bool PageBuilder::buildComponents(xml_node<> *layout, Page *page) altImagePath = Utils::combinePath(Configuration::absolutePath, "layouts", layoutName, std::string(src->value())); Image *c = new Image(imagePath, altImagePath, *page, scaleX_, scaleY_); + xml_attribute<> *menuScrollReload = componentXml->first_attribute("menuScrollReload"); + if (menuScrollReload && + (Utils::toLower(menuScrollReload->value()) == "true" || + Utils::toLower(menuScrollReload->value()) == "yes")) + { + c->setMenuScrollReload(true); + } buildViewInfo(componentXml, c->baseViewInfo); loadTweens(c, componentXml); page->addComponent(c); @@ -393,6 +407,13 @@ bool PageBuilder::buildComponents(xml_node<> *layout, Page *page) int numLoops = numLoopsXml ? Utils::convertInt(numLoopsXml->value()) : 1; Video *c = new Video(videoPath, altVideoPath, numLoops, *page, scaleX_, scaleY_); + xml_attribute<> *menuScrollReload = componentXml->first_attribute("menuScrollReload"); + if (menuScrollReload && + (Utils::toLower(menuScrollReload->value()) == "true" || + Utils::toLower(menuScrollReload->value()) == "yes")) + { + c->setMenuScrollReload(true); + } buildViewInfo(componentXml, c->baseViewInfo); loadTweens(c, componentXml); page->addComponent(c); @@ -412,9 +433,14 @@ bool PageBuilder::buildComponents(xml_node<> *layout, Page *page) { Font *font = addFont(componentXml, NULL); Text *c = new Text(value->value(), *page, font, scaleX_, scaleY_); - + xml_attribute<> *menuScrollReload = componentXml->first_attribute("menuScrollReload"); + if (menuScrollReload && + (Utils::toLower(menuScrollReload->value()) == "true" || + Utils::toLower(menuScrollReload->value()) == "yes")) + { + c->setMenuScrollReload(true); + } buildViewInfo(componentXml, c->baseViewInfo); - loadTweens(c, componentXml); page->addComponent(c); } @@ -424,9 +450,14 @@ bool PageBuilder::buildComponents(xml_node<> *layout, Page *page) { Font *font = addFont(componentXml, NULL); Text *c = new Text("", *page, font, scaleX_, scaleY_); - + xml_attribute<> *menuScrollReload = componentXml->first_attribute("menuScrollReload"); + if (menuScrollReload && + (Utils::toLower(menuScrollReload->value()) == "true" || + Utils::toLower(menuScrollReload->value()) == "yes")) + { + c->setMenuScrollReload(true); + } buildViewInfo(componentXml, c->baseViewInfo); - loadTweens(c, componentXml); page->addComponent(c); page->setStatusTextComponent(c); @@ -560,6 +591,13 @@ void PageBuilder::loadReloadableImages(xml_node<> *layout, std::string tagName, pluralPostfix = pluralPostfixXml->value(); } c = new ReloadableText(type->value(), *page, config_, font, layoutKey, timeFormat, textFormat, singlePrefix, singlePostfix, pluralPrefix, pluralPostfix, scaleX_, scaleY_); + xml_attribute<> *menuScrollReload = componentXml->first_attribute("menuScrollReload"); + if (menuScrollReload && + (Utils::toLower(menuScrollReload->value()) == "true" || + Utils::toLower(menuScrollReload->value()) == "yes")) + { + c->setMenuScrollReload(true); + } } } else if(tagName == "reloadableScrollingText") @@ -623,14 +661,27 @@ void PageBuilder::loadReloadableImages(xml_node<> *layout, std::string tagName, pluralPostfix = pluralPostfixXml->value(); } c = new ReloadableScrollingText(config_, systemMode, layoutMode, type->value(), singlePrefix, singlePostfix, pluralPrefix, pluralPostfix, textFormat, alignment, *page, selectedOffset, font, scaleX_, scaleY_, direction, scrollingSpeed, startPosition, startTime, endTime); + xml_attribute<> *menuScrollReload = componentXml->first_attribute("menuScrollReload"); + if (menuScrollReload && + (Utils::toLower(menuScrollReload->value()) == "true" || + Utils::toLower(menuScrollReload->value()) == "yes")) + { + c->setMenuScrollReload(true); + } } } else { Font *font = addFont(componentXml, NULL); c = new ReloadableMedia(config_, systemMode, layoutMode, commonMode, type->value(), *page, selectedOffset, (tagName == "reloadableVideo"), font, scaleX_, scaleY_); + xml_attribute<> *menuScrollReload = componentXml->first_attribute("menuScrollReload"); + if (menuScrollReload && + (Utils::toLower(menuScrollReload->value()) == "true" || + Utils::toLower(menuScrollReload->value()) == "yes")) + { + c->setMenuScrollReload(true); + } xml_attribute<> *textFallback = componentXml->first_attribute("textFallback"); - if(textFallback && Utils::toLower(textFallback->value()) == "true") { static_cast(c)->enableTextFallback_(true); diff --git a/RetroFE/Source/Version.cpp b/RetroFE/Source/Version.cpp index e013370..ac97f45 100644 --- a/RetroFE/Source/Version.cpp +++ b/RetroFE/Source/Version.cpp @@ -21,7 +21,7 @@ std::string retrofe_version_major = "0"; std::string retrofe_version_minor = "8"; -std::string retrofe_version_build = "14"; +std::string retrofe_version_build = "14b1"; std::string Version::getString( )