Added support for placing images in a 'custom' folder in the downloaded_media directory and view these using the media viewer

This commit is contained in:
Leon Styhre 2023-09-23 19:09:14 +02:00
parent 915ea23508
commit 00646abd17
3 changed files with 10 additions and 0 deletions

View file

@ -299,6 +299,12 @@ const std::string FileData::getTitleScreenPath() const
return getMediafilePath("titlescreens");
}
const std::string FileData::getCustomImagePath() const
{
// Return path to the custom image.
return getMediafilePath("custom");
}
const std::string FileData::getVideoPath() const
{
const std::vector<std::string> extList {".avi", ".mkv", ".mov", ".mp4", ".wmv"};

View file

@ -95,6 +95,7 @@ public:
const std::string getMiximagePath() const;
const std::string getScreenshotPath() const;
const std::string getTitleScreenPath() const;
const std::string getCustomImagePath() const;
const std::string getVideoPath() const;
const std::string getManualPath() const;

View file

@ -306,6 +306,9 @@ void MediaViewer::findMedia()
if ((mediaFile = mGame->getMiximagePath()) != "")
mImageFiles.push_back(std::make_pair(mediaFile, ImageInfo("MIXIMAGE", true)));
if ((mediaFile = mGame->getCustomImagePath()) != "")
mImageFiles.push_back(std::make_pair(mediaFile, ImageInfo("CUSTOM", true)));
if (!mImageFiles.empty())
mHasImages = true;
}