mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06: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 "FileFilterIndex.h"
|
||||
#include "Gamelist.h"
|
||||
#include "MameNames.h"
|
||||
#include "SystemData.h"
|
||||
#include "Window.h"
|
||||
#include "components/ButtonComponent.h"
|
||||
|
@ -21,6 +22,7 @@
|
|||
#include "components/DateTimeEditComponent.h"
|
||||
#include "components/MenuComponent.h"
|
||||
#include "components/RatingComponent.h"
|
||||
|
||||
#include "components/SwitchComponent.h"
|
||||
#include "components/TextComponent.h"
|
||||
#include "guis/GuiGameScraper.h"
|
||||
|
@ -422,12 +424,16 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window,
|
|||
gamePath = Utils::FileSystem::getStem(mScraperParams.game->getPath());
|
||||
|
||||
// OK callback (apply new value to ed).
|
||||
auto updateVal = [ed, currentKey, originalValue,
|
||||
gamePath](const std::string& newVal) {
|
||||
auto updateVal = [ed, currentKey, originalValue, gamePath,
|
||||
scraperParams](const std::string& newVal) {
|
||||
// If the user has entered a blank game name, then set the name to the ROM
|
||||
// filename (minus the extension).
|
||||
if (currentKey == "name" && newVal == "") {
|
||||
ed->setValue(gamePath);
|
||||
if (scraperParams.game->isArcadeGame())
|
||||
ed->setValue(MameNames::getInstance().getCleanName(
|
||||
scraperParams.game->getCleanName()));
|
||||
else
|
||||
ed->setValue(gamePath);
|
||||
if (gamePath == originalValue)
|
||||
ed->setColor(DEFAULT_TEXTCOLOR);
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue