diff --git a/RetroFE/Source/Graphics/Component/ReloadableMedia.cpp b/RetroFE/Source/Graphics/Component/ReloadableMedia.cpp index 679f0af..8d94a3d 100644 --- a/RetroFE/Source/Graphics/Component/ReloadableMedia.cpp +++ b/RetroFE/Source/Graphics/Component/ReloadableMedia.cpp @@ -28,10 +28,11 @@ #include #include -ReloadableMedia::ReloadableMedia(Configuration &config, bool systemMode, std::string type, Page &p, int displayOffset, bool isVideo, Font *font, float scaleX, float scaleY) +ReloadableMedia::ReloadableMedia(Configuration &config, bool systemMode, bool layoutMode, std::string type, Page &p, int displayOffset, bool isVideo, Font *font, float scaleX, float scaleY) : Component(p) , config_(config) , systemMode_(systemMode) + , layoutMode_(layoutMode) , loadedComponent_(NULL) , videoInst_(NULL) , isVideo_(isVideo) @@ -329,7 +330,20 @@ Component *ReloadableMedia::findComponent(std::string collection, std::string ty ImageBuilder imageBuild; // check the system folder - config_.getMediaPropertyAbsolutePath(collection, type, systemMode, imagePath); + if (layoutMode_) + { + std::string layoutName; + config_.getProperty("layout", layoutName); + imagePath = Utils::combinePath(Configuration::absolutePath, "layouts", layoutName, "collections", collection); + if (systemMode) + imagePath = Utils::combinePath(imagePath, "system_artwork"); + else + imagePath = Utils::combinePath(imagePath, "medium_artwork"); + } + else + { + config_.getMediaPropertyAbsolutePath(collection, type, systemMode, imagePath); + } if(type == "video") { diff --git a/RetroFE/Source/Graphics/Component/ReloadableMedia.h b/RetroFE/Source/Graphics/Component/ReloadableMedia.h index 8639666..ed07d77 100644 --- a/RetroFE/Source/Graphics/Component/ReloadableMedia.h +++ b/RetroFE/Source/Graphics/Component/ReloadableMedia.h @@ -27,7 +27,7 @@ class Image; class ReloadableMedia : public Component { public: - ReloadableMedia(Configuration &config, bool systemMode, std::string type, Page &page, int displayOffset, bool isVideo, Font *font, float scaleX, float scaleY); + ReloadableMedia(Configuration &config, bool systemMode, bool layoutMode, std::string type, Page &page, int displayOffset, bool isVideo, Font *font, float scaleX, float scaleY); virtual ~ReloadableMedia(); void update(float dt); void draw(); @@ -43,6 +43,7 @@ private: void reloadTexture(); Configuration &config_; bool systemMode_; + bool layoutMode_; Component *loadedComponent_; IVideo *videoInst_; bool isVideo_; diff --git a/RetroFE/Source/Graphics/PageBuilder.cpp b/RetroFE/Source/Graphics/PageBuilder.cpp index ed3ee4d..b554d77 100644 --- a/RetroFE/Source/Graphics/PageBuilder.cpp +++ b/RetroFE/Source/Graphics/PageBuilder.cpp @@ -406,6 +406,7 @@ void PageBuilder::loadReloadableImages(xml_node<> *layout, std::string tagName, xml_attribute<> *timeFormatXml = componentXml->first_attribute("timeFormat"); xml_attribute<> *selectedOffsetXml = componentXml->first_attribute("selectedOffset"); bool systemMode = false; + bool layoutMode = false; int selectedOffset = 0; if(tagName == "reloadableVideo") { @@ -430,6 +431,15 @@ void PageBuilder::loadReloadableImages(xml_node<> *layout, std::string tagName, { systemMode = true; } + if(sysMode == "layout") + { + layoutMode = true; + } + if(sysMode == "systemlayout") + { + systemMode = true; + layoutMode = true; + } } if(selectedOffsetXml) @@ -458,7 +468,7 @@ void PageBuilder::loadReloadableImages(xml_node<> *layout, std::string tagName, else { Font *font = addFont(componentXml, NULL); - c = new ReloadableMedia(config_, systemMode, type->value(), *page, selectedOffset, (tagName == "reloadableVideo"), font, scaleX_, scaleY_); + c = new ReloadableMedia(config_, systemMode, layoutMode, type->value(), *page, selectedOffset, (tagName == "reloadableVideo"), font, scaleX_, scaleY_); xml_attribute<> *textFallback = componentXml->first_attribute("textFallback"); if(textFallback && Utils::toLower(textFallback->value()) == "true")