mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-26 08:05:38 +00:00
Clearing an arcade game name in the metadata editor now sets it to the expanded MAME name.
This commit is contained in:
parent
2db8724f4a
commit
909f96622d
|
@ -14,6 +14,7 @@
|
||||||
#include "FileData.h"
|
#include "FileData.h"
|
||||||
#include "FileFilterIndex.h"
|
#include "FileFilterIndex.h"
|
||||||
#include "Gamelist.h"
|
#include "Gamelist.h"
|
||||||
|
#include "MameNames.h"
|
||||||
#include "SystemData.h"
|
#include "SystemData.h"
|
||||||
#include "Window.h"
|
#include "Window.h"
|
||||||
#include "components/ButtonComponent.h"
|
#include "components/ButtonComponent.h"
|
||||||
|
@ -21,6 +22,7 @@
|
||||||
#include "components/DateTimeEditComponent.h"
|
#include "components/DateTimeEditComponent.h"
|
||||||
#include "components/MenuComponent.h"
|
#include "components/MenuComponent.h"
|
||||||
#include "components/RatingComponent.h"
|
#include "components/RatingComponent.h"
|
||||||
|
|
||||||
#include "components/SwitchComponent.h"
|
#include "components/SwitchComponent.h"
|
||||||
#include "components/TextComponent.h"
|
#include "components/TextComponent.h"
|
||||||
#include "guis/GuiGameScraper.h"
|
#include "guis/GuiGameScraper.h"
|
||||||
|
@ -422,11 +424,15 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window,
|
||||||
gamePath = Utils::FileSystem::getStem(mScraperParams.game->getPath());
|
gamePath = Utils::FileSystem::getStem(mScraperParams.game->getPath());
|
||||||
|
|
||||||
// OK callback (apply new value to ed).
|
// OK callback (apply new value to ed).
|
||||||
auto updateVal = [ed, currentKey, originalValue,
|
auto updateVal = [ed, currentKey, originalValue, gamePath,
|
||||||
gamePath](const std::string& newVal) {
|
scraperParams](const std::string& newVal) {
|
||||||
// If the user has entered a blank game name, then set the name to the ROM
|
// If the user has entered a blank game name, then set the name to the ROM
|
||||||
// filename (minus the extension).
|
// filename (minus the extension).
|
||||||
if (currentKey == "name" && newVal == "") {
|
if (currentKey == "name" && newVal == "") {
|
||||||
|
if (scraperParams.game->isArcadeGame())
|
||||||
|
ed->setValue(MameNames::getInstance().getCleanName(
|
||||||
|
scraperParams.game->getCleanName()));
|
||||||
|
else
|
||||||
ed->setValue(gamePath);
|
ed->setValue(gamePath);
|
||||||
if (gamePath == originalValue)
|
if (gamePath == originalValue)
|
||||||
ed->setColor(DEFAULT_TEXTCOLOR);
|
ed->setColor(DEFAULT_TEXTCOLOR);
|
||||||
|
|
Loading…
Reference in a new issue