Allow restoring only settings, recents or controls to defaults.

Fixes #16381 , though could make even more granular later.

The only translation change was deleting one sentence from a longer
string - used Google Translate to assist me in removing the correct part
for a few of them, most were obvious. Hope they're all right.
This commit is contained in:
Henrik Rydgård committed 2023-01-31 18:56:18 +01:00
1 parent 01eabe7e98
commit c554f4e2b6
45 files changed
+122 -62

No files matched your search

+20 -6
View File
@@ -1815,17 +1815,31 @@ const Path Config::FindConfigFile(const std::string &baseFilename) {
return filename;
}
void Config::RestoreDefaults() {
void Config::RestoreDefaults(RestoreSettingsBits whatToRestore) {
if (bGameSpecific) {
deleteGameConfig(gameId_);
createGameConfig(gameId_);
Load();
} else {
if (File::Exists(iniFilename_))
File::Delete(iniFilename_);
ClearRecentIsos();
currentDirectory = defaultCurrentDirectory;
if (whatToRestore & RestoreSettingsBits::SETTINGS) {
if (File::Exists(iniFilename_))
File::Delete(iniFilename_);
}
if (whatToRestore & RestoreSettingsBits::CONTROLS) {
if (File::Exists(controllerIniFilename_))
File::Delete(controllerIniFilename_);
}
if (whatToRestore & RestoreSettingsBits::RECENT) {
ClearRecentIsos();
currentDirectory = defaultCurrentDirectory;
}
if (whatToRestore & (RestoreSettingsBits::SETTINGS | RestoreSettingsBits::CONTROLS)) {
Load();
}
}
Load();
}
bool Config::hasGameConfig(const std::string &pGameId) {