Added a menu option to retain extra MAME name information for unscraped game names.

This commit is contained in:
Leon Styhre 2023-02-14 17:28:43 +01:00
parent 47277f94b6
commit ed94a5b45b
3 changed files with 20 additions and 1 deletions

View file

@ -1523,6 +1523,19 @@ void GuiMenu::openOtherOptions()
}
});
// Strip extra MAME name info.
auto mameNameStripExtraInfo = std::make_shared<SwitchComponent>();
mameNameStripExtraInfo->setState(Settings::getInstance()->getBool("MAMENameStripExtraInfo"));
s->addWithLabel("STRIP EXTRA MAME NAME INFO (REQUIRES RESTART)", mameNameStripExtraInfo);
s->addSaveFunc([mameNameStripExtraInfo, s] {
if (Settings::getInstance()->getBool("MAMENameStripExtraInfo") !=
mameNameStripExtraInfo->getState()) {
Settings::getInstance()->setBool("MAMENameStripExtraInfo",
mameNameStripExtraInfo->getState());
s->setNeedsSaving();
}
});
#if defined(__unix__)
// Whether to disable desktop composition.
auto disableComposition = std::make_shared<SwitchComponent>();

View file

@ -12,6 +12,7 @@
#ifndef ES_CORE_MAMENAMES_H
#define ES_CORE_MAMENAMES_H
#include "Settings.h"
#include "utils/StringUtil.h"
#include <algorithm>
@ -36,7 +37,11 @@ public:
std::string getCleanName(const std::string& mameName)
{
static const bool stripInfo {Settings::getInstance()->getBool("MAMENameStripExtraInfo")};
if (stripInfo)
return Utils::String::removeParenthesis(getRealName(mameName));
else
return getRealName(mameName);
}
const bool isBios(const std::string& biosName)

View file

@ -270,6 +270,7 @@ void Settings::setDefaults()
mBoolMap["ShowHiddenGames"] = {true, true};
mBoolMap["CustomEventScripts"] = {false, false};
mBoolMap["ParseGamelistOnly"] = {false, false};
mBoolMap["MAMENameStripExtraInfo"] = {true, true};
#if defined(__unix__)
mBoolMap["DisableComposition"] = {false, false};
#endif