Added support for the physicalmedia image type to the image, video and carousel elements.

This commit is contained in:
Leon Styhre 2022-06-07 17:32:42 +02:00
parent b9c480505a
commit 9480f125bb
3 changed files with 29 additions and 5 deletions

View file

@ -138,9 +138,10 @@ void GamelistView::onThemeChanged(const std::shared_ptr<ThemeData>& theme)
mCarousel = std::make_unique<CarouselComponent<FileData*>>();
if (element.second.has("itemType")) {
const std::string itemType {element.second.get<std::string>("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 != "") {

View file

@ -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 != "") {

View file

@ -339,14 +339,16 @@ template <typename T> void CarouselComponent<T>::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")