Changed 'launch string' to 'launch command' and the setting 'EnableSounds' to 'EnableNavigationSounds'.

This commit is contained in:
Leon Styhre 2020-07-08 17:06:34 +02:00
parent 5a7fb828a6
commit d1f8c3e385
9 changed files with 56 additions and 54 deletions

View file

@ -55,7 +55,7 @@ Some metadata is also marked as "statistic" - these are kept track of by ES and
* `playcount` - integer, the number of times this game has been played.
* `lastplayed` - statistic, datetime, the last date and time this game was played.
* `sortname` - string, used in sorting the gamelist in a system, instead of `name`.
* `launchstring` - optional tag that is used to override the emulator and core settings on a per-game basis.
* `launchcommand` - optional tag that is used to override the emulator and core settings on a per-game basis.
#### `<folder>`
* `name` - string, the displayed name for the folder.

View file

@ -447,9 +447,9 @@ void FileData::launchGame(Window* window)
// Check if there is a launch string override for the game
// and the corresponding option to use it has been set.
if (Settings::getInstance()->getBool("LaunchstringOverride") &&
!metadata.get("launchstring").empty())
command = metadata.get("launchstring");
if (Settings::getInstance()->getBool("LaunchCommandOverride") &&
!metadata.get("launchcommand").empty())
command = metadata.get("launchcommand");
else
command = mEnvData->mLaunchCommand;

View file

@ -27,7 +27,7 @@ MetaDataDecl gameDecls[] = {
{"broken", MD_BOOL, "false", false, "broken/not working", "enter broken off/on", false},
{"hidden", MD_BOOL, "false", false, "hidden", "enter hidden off/on", false},
{"kidgame", MD_BOOL, "false", false, "kidgame", "enter kidgame off/on", false},
{"launchstring", MD_LAUNCHSTRING, "", false, "launch string", "enter game launch string "
{"launchcommand", MD_LAUNCHCOMMAND, "", false, "launch command", "enter game launch command "
"(emulator override)", false},
{"playcount", MD_INT, "0", false, "play count", "enter number of times played", false},
{"lastplayed", MD_TIME, "0", true, "last played", "enter last played date", false}

View file

@ -23,7 +23,7 @@ enum MetaDataType {
// Specialized types.
MD_MULTILINE_STRING,
MD_LAUNCHSTRING,
MD_LAUNCHCOMMAND,
MD_PATH,
MD_RATING,
MD_DATE,

View file

@ -178,17 +178,19 @@ void GuiMenu::openSoundSettings()
video_audio->getState()); });
// Navigation sounds.
auto sounds_enabled = std::make_shared<SwitchComponent>(mWindow);
sounds_enabled->setState(Settings::getInstance()->getBool("EnableSounds"));
s->addWithLabel("ENABLE NAVIGATION SOUNDS", sounds_enabled);
s->addSaveFunc([sounds_enabled] {
if (sounds_enabled->getState() &&
!Settings::getInstance()->getBool("EnableSounds") &&
auto navigationsounds_enabled = std::make_shared<SwitchComponent>(mWindow);
navigationsounds_enabled->setState(Settings::getInstance()->
getBool("EnableNavigationSounds"));
s->addWithLabel("ENABLE NAVIGATION SOUNDS", navigationsounds_enabled);
s->addSaveFunc([navigationsounds_enabled] {
if (navigationsounds_enabled->getState() &&
!Settings::getInstance()->getBool("EnableNavigationSounds") &&
PowerSaver::getMode() == PowerSaver::INSTANT) {
Settings::getInstance()->setString("PowerSaverMode", "default");
PowerSaver::init();
}
Settings::getInstance()->setBool("EnableSounds", sounds_enabled->getState());
Settings::getInstance()->setBool("EnableNavigationSounds",
navigationsounds_enabled->getState());
});
}
@ -451,7 +453,7 @@ void GuiMenu::openOtherSettings()
"instant" && power_saver->getSelected() == "instant") {
Settings::getInstance()->setString("TransitionStyle", "instant");
Settings::getInstance()->setBool("MoveCarousel", false);
Settings::getInstance()->setBool("EnableSounds", false);
Settings::getInstance()->setBool("EnableNavigationSounds", false);
}
Settings::getInstance()->setString("PowerSaverMode", power_saver->getSelected());
PowerSaver::init();
@ -493,13 +495,13 @@ void GuiMenu::openOtherSettings()
Settings::getInstance()->setString("SaveGamelistsMode", gamelistsSaveMode->getSelected());
});
// Allow overriding of the launch string per game (the option
// Allow overriding of the launch command per game (the option
// to disable this is intended primarily for testing purposes).
auto launchstring_override = std::make_shared<SwitchComponent>(mWindow);
launchstring_override->setState(Settings::getInstance()->getBool("LaunchstringOverride"));
s->addWithLabel("ENABLE PER GAME LAUNCH STRING OVERRIDE", launchstring_override);
s->addSaveFunc([launchstring_override] { Settings::getInstance()->
setBool("LaunchstringOverride", launchstring_override->getState()); });
auto launchcommand_override = std::make_shared<SwitchComponent>(mWindow);
launchcommand_override->setState(Settings::getInstance()->getBool("LaunchCommandOverride"));
s->addWithLabel("ENABLE PER GAME LAUNCH COMMAND OVERRIDE", launchcommand_override);
s->addSaveFunc([launchcommand_override] { Settings::getInstance()->
setBool("LaunchCommandOverride", launchcommand_override->getState()); });
auto parse_gamelists = std::make_shared<SwitchComponent>(mWindow);
parse_gamelists->setState(Settings::getInstance()->getBool("ParseGamelistOnly"));

View file

@ -76,8 +76,8 @@ GuiMetaDataEd::GuiMetaDataEd(
continue;
// Don't show the launch string override entry if this option has been disabled.
if (!Settings::getInstance()->getBool("LaunchstringOverride") &&
iter->type == MD_LAUNCHSTRING) {
if (!Settings::getInstance()->getBool("LaunchCommandOverride") &&
iter->type == MD_LAUNCHCOMMAND) {
ed = std::make_shared<TextComponent>(window, "", Font::get(FONT_SIZE_SMALL,
FONT_PATH_LIGHT), 0x777777FF, ALIGN_RIGHT);
assert(ed);
@ -136,7 +136,7 @@ GuiMetaDataEd::GuiMetaDataEd(
row.addElement(ed, false);
break;
}
case MD_LAUNCHSTRING: {
case MD_LAUNCHCOMMAND: {
ed = std::make_shared<TextComponent>(window, "",
Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT), 0x777777FF, ALIGN_RIGHT);
row.addElement(ed, true);
@ -156,13 +156,13 @@ GuiMetaDataEd::GuiMetaDataEd(
ed->setValue(newVal); }; // OK callback (apply new value to ed).
std::string staticTextString = "Default value from es_systems.cfg:";
std::string defaultLaunchString = scraperParams.system->
std::string defaultLaunchCommand = scraperParams.system->
getSystemEnvData()->mLaunchCommand;
row.makeAcceptInputHandler([this, title, staticTextString,
defaultLaunchString, ed, updateVal, multiLine] {
defaultLaunchCommand, ed, updateVal, multiLine] {
mWindow->pushGui(new GuiComplexTextEditPopup(mWindow, getHelpStyle(),
title, staticTextString, defaultLaunchString, ed->getValue(),
title, staticTextString, defaultLaunchCommand, ed->getValue(),
updateVal, multiLine, "APPLY", "APPLY CHANGES?"));
});
break;

View file

@ -73,7 +73,7 @@ AudioManager::~AudioManager()
std::shared_ptr<AudioManager> & AudioManager::getInstance()
{
// Check if an AudioManager instance is already created, if not create one.
if (sInstance == nullptr && Settings::getInstance()->getBool("EnableSounds")) {
if (sInstance == nullptr && Settings::getInstance()->getBool("EnableNavigationSounds")) {
sInstance = std::shared_ptr<AudioManager>(new AudioManager);
}
return sInstance;

View file

@ -119,7 +119,7 @@ void Settings::setDefaults()
mStringMap["AudioDevice"] = "Master";
#endif
mBoolMap["VideoAudio"] = true;
mBoolMap["EnableSounds"] = true;
mBoolMap["EnableNavigationSounds"] = true;
// Audio out device for Video playback using OMX player.
mStringMap["OMXAudioDev"] = "both";
@ -170,7 +170,7 @@ void Settings::setDefaults()
mBoolMap["ScreenSaverOmxPlayer"] = false;
#endif
mStringMap["SaveGamelistsMode"] = "always";
mBoolMap["LaunchstringOverride"] = true;
mBoolMap["LaunchCommandOverride"] = true;
mBoolMap["ParseGamelistOnly"] = false;
mBoolMap["LocalArt"] = false;
mBoolMap["ShowHiddenFiles"] = false;

View file

@ -164,7 +164,7 @@ void Sound::play()
if(mSampleData == nullptr)
return;
if(!Settings::getInstance()->getBool("EnableSounds"))
if(!Settings::getInstance()->getBool("EnableNavigationSounds"))
return;
AudioManager::getInstance();