diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index f4821a220..e5fbca78e 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -1523,6 +1523,19 @@ void GuiMenu::openOtherOptions() } }); + // Strip extra MAME name info. + auto mameNameStripExtraInfo = std::make_shared(); + 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(); diff --git a/es-core/src/MameNames.h b/es-core/src/MameNames.h index d9ba48036..144017010 100644 --- a/es-core/src/MameNames.h +++ b/es-core/src/MameNames.h @@ -12,6 +12,7 @@ #ifndef ES_CORE_MAMENAMES_H #define ES_CORE_MAMENAMES_H +#include "Settings.h" #include "utils/StringUtil.h" #include @@ -36,7 +37,11 @@ public: std::string getCleanName(const std::string& mameName) { - return Utils::String::removeParenthesis(getRealName(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) diff --git a/es-core/src/Settings.cpp b/es-core/src/Settings.cpp index f5aa295de..7bd9482ee 100644 --- a/es-core/src/Settings.cpp +++ b/es-core/src/Settings.cpp @@ -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