From 9480f125bb44f1e37cfa2deff00a5037fa7defc9 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Tue, 7 Jun 2022 17:32:42 +0200 Subject: [PATCH] Added support for the physicalmedia image type to the image, video and carousel elements. --- es-app/src/views/GamelistView.cpp | 14 +++++++++++--- es-app/src/views/SystemView.cpp | 14 ++++++++++++++ es-core/src/components/primary/CarouselComponent.h | 6 ++++-- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/es-app/src/views/GamelistView.cpp b/es-app/src/views/GamelistView.cpp index 2fa833cca..08ff79f7b 100644 --- a/es-app/src/views/GamelistView.cpp +++ b/es-app/src/views/GamelistView.cpp @@ -138,9 +138,10 @@ void GamelistView::onThemeChanged(const std::shared_ptr& theme) mCarousel = std::make_unique>(); if (element.second.has("itemType")) { const std::string itemType {element.second.get("itemType")}; - if (itemType == "marquee" || itemType == "cover" || itemType == "3dbox" || - itemType == "screenshot" || itemType == "titlescreen" || - itemType == "backcover" || itemType == "miximage" || + if (itemType == "marquee" || itemType == "cover" || + itemType == "backcover" || itemType == "3dbox" || + itemType == "physicalmedia" || itemType == "screenshot" || + itemType == "titlescreen" || itemType == "miximage" || itemType == "fanart") { mCarousel->setItemType(itemType); } @@ -853,6 +854,13 @@ void GamelistView::setGameImage(FileData* file, GuiComponent* comp) break; } } + else if (imageType == "physicalmedia") { + path = file->getPhysicalMediaPath(); + if (path != "") { + comp->setImage(path); + break; + } + } else if (imageType == "fanart") { path = file->getFanArtPath(); if (path != "") { diff --git a/es-app/src/views/SystemView.cpp b/es-app/src/views/SystemView.cpp index 3b3591733..d67347b22 100644 --- a/es-app/src/views/SystemView.cpp +++ b/es-app/src/views/SystemView.cpp @@ -800,6 +800,13 @@ void SystemView::updateGameSelectors() break; } } + else if (imageType == "physicalmedia") { + path = games.front()->getPhysicalMediaPath(); + if (path != "") { + image->setImage(path); + break; + } + } else if (imageType == "fanart") { path = games.front()->getFanArtPath(); if (path != "") { @@ -947,6 +954,13 @@ void SystemView::updateGameSelectors() break; } } + else if (imageType == "physicalmedia") { + path = games.front()->getPhysicalMediaPath(); + if (path != "") { + video->setImage(path); + break; + } + } else if (imageType == "fanart") { path = games.front()->getFanArtPath(); if (path != "") { diff --git a/es-core/src/components/primary/CarouselComponent.h b/es-core/src/components/primary/CarouselComponent.h index 6d9abfaa3..488ab16e4 100644 --- a/es-core/src/components/primary/CarouselComponent.h +++ b/es-core/src/components/primary/CarouselComponent.h @@ -339,14 +339,16 @@ template void CarouselComponent::onDemandTextureLoad() entry.data.itemPath = game->getMarqueePath(); else if (mItemType == "cover") entry.data.itemPath = game->getCoverPath(); + else if (mItemType == "backcover") + entry.data.itemPath = game->getBackCoverPath(); else if (mItemType == "3dbox") entry.data.itemPath = game->get3DBoxPath(); + else if (mItemType == "physicalmedia") + entry.data.itemPath = game->getPhysicalMediaPath(); else if (mItemType == "screenshot") entry.data.itemPath = game->getScreenshotPath(); else if (mItemType == "titlescreen") entry.data.itemPath = game->getTitleScreenPath(); - else if (mItemType == "backcover") - entry.data.itemPath = game->getBackCoverPath(); else if (mItemType == "miximage") entry.data.itemPath = game->getMiximagePath(); else if (mItemType == "fanart")