The scraper now shows the string actually being used for searching in the screen subtitle.

This commit is contained in:
Leon Styhre 2021-01-06 21:29:23 +01:00
parent 7c61d7b19d
commit 077a0e0e2c
2 changed files with 34 additions and 4 deletions

View file

@ -15,6 +15,7 @@
#include "components/TextComponent.h" #include "components/TextComponent.h"
#include "views/ViewController.h" #include "views/ViewController.h"
#include "FileData.h" #include "FileData.h"
#include "MameNames.h"
#include "SystemData.h" #include "SystemData.h"
GuiGameScraper::GuiGameScraper( GuiGameScraper::GuiGameScraper(
@ -32,8 +33,22 @@ GuiGameScraper::GuiGameScraper(
// Row 0 is a spacer. // Row 0 is a spacer.
mGameName = std::make_shared<TextComponent>(mWindow, std::string scrapeName;
Utils::FileSystem::getFileName(mSearchParams.game->getPath()) +
if (Settings::getInstance()->getBool("ScraperSearchMetadataName")) {
scrapeName = mSearchParams.game->getName();
}
else {
if (params.game->isArcadeGame() &&
Settings::getInstance()->getString("Scraper") == "thegamesdb")
scrapeName = Utils::FileSystem::getFileName(mSearchParams.game->getPath()) + " (" +
MameNames::getInstance()->getCleanName(mSearchParams.game->getCleanName()) +
")";
else
scrapeName = Utils::FileSystem::getFileName(mSearchParams.game->getPath());
}
mGameName = std::make_shared<TextComponent>(mWindow, scrapeName +
((mSearchParams.game->getType() == FOLDER) ? " " + ViewController::FOLDER_CHAR : ""), ((mSearchParams.game->getType() == FOLDER) ? " " + ViewController::FOLDER_CHAR : ""),
Font::get(FONT_SIZE_MEDIUM), 0x777777FF, ALIGN_CENTER); Font::get(FONT_SIZE_MEDIUM), 0x777777FF, ALIGN_CENTER);
mGrid.setEntry(mGameName, Vector2i(0, 1), false, true); mGrid.setEntry(mGameName, Vector2i(0, 1), false, true);

View file

@ -18,6 +18,7 @@
#include "guis/GuiScraperSearch.h" #include "guis/GuiScraperSearch.h"
#include "views/ViewController.h" #include "views/ViewController.h"
#include "Gamelist.h" #include "Gamelist.h"
#include "MameNames.h"
#include "SystemData.h" #include "SystemData.h"
#include "Window.h" #include "Window.h"
@ -130,10 +131,24 @@ void GuiScraperMulti::doNextSearch()
std::stringstream ss; std::stringstream ss;
mSystem->setText(Utils::String::toUpper(mSearchQueue.front().system->getFullName())); mSystem->setText(Utils::String::toUpper(mSearchQueue.front().system->getFullName()));
std::string scrapeName;
if (Settings::getInstance()->getBool("ScraperSearchMetadataName")) {
scrapeName = mSearchQueue.front().game->getName();
}
else {
if (mSearchQueue.front().game->isArcadeGame() &&
Settings::getInstance()->getString("Scraper") == "thegamesdb")
scrapeName = Utils::FileSystem::getFileName(mSearchQueue.front().game->getPath()) +
" (" + MameNames::getInstance()->getCleanName(mSearchQueue.front().game->
getCleanName()) + ")";
else
scrapeName = Utils::FileSystem::getFileName(mSearchQueue.front().game->getPath());
}
// Update subtitle. // Update subtitle.
ss.str(""); ss.str("");
ss << "GAME " << (mCurrentGame + 1) << " OF " << mTotalGames << " - " << ss << "GAME " << (mCurrentGame + 1) << " OF " << mTotalGames << " - " << scrapeName <<
Utils::FileSystem::getFileName(mSearchQueue.front().game->getPath()) <<
((mSearchQueue.front().game->getType() == FOLDER) ? " " + ((mSearchQueue.front().game->getType() == FOLDER) ? " " +
ViewController::FOLDER_CHAR : ""); ViewController::FOLDER_CHAR : "");
mSubtitle->setText(ss.str()); mSubtitle->setText(ss.str());