mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-28 16:53:40 +01:00
Config: Add game name to game-specific inis.
This commit is contained in:
1 parent
27608349ee
commit
ecf509c362
6 files changed
+43
-46
No files matched your search
+7
-4
@@ -1215,8 +1215,7 @@ void Config::Save(const char *saveReason) {
|
||||
g_Config.iCpuCore = (int)CPUCore::JIT;
|
||||
}
|
||||
if (iniFilename_.size() && g_Config.bSaveSettings) {
|
||||
|
||||
saveGameConfig(gameId_);
|
||||
saveGameConfig(gameId_, gameIdTitle_);
|
||||
|
||||
CleanRecent();
|
||||
IniFile iniFile;
|
||||
@@ -1452,9 +1451,10 @@ bool Config::hasGameConfig(const std::string &pGameId) {
|
||||
return File::Exists(fullIniFilePath);
|
||||
}
|
||||
|
||||
void Config::changeGameSpecific(const std::string &pGameId) {
|
||||
void Config::changeGameSpecific(const std::string &pGameId, const std::string &title) {
|
||||
Save("changeGameSpecific");
|
||||
gameId_ = pGameId;
|
||||
gameIdTitle_ = title;
|
||||
bGameSpecific = !pGameId.empty();
|
||||
}
|
||||
|
||||
@@ -1484,7 +1484,7 @@ std::string Config::getGameConfigFile(const std::string &pGameId) {
|
||||
return iniFileNameFull;
|
||||
}
|
||||
|
||||
bool Config::saveGameConfig(const std::string &pGameId) {
|
||||
bool Config::saveGameConfig(const std::string &pGameId, const std::string &title) {
|
||||
if (pGameId.empty()) {
|
||||
return false;
|
||||
}
|
||||
@@ -1493,6 +1493,9 @@ bool Config::saveGameConfig(const std::string &pGameId) {
|
||||
|
||||
IniFile iniFile;
|
||||
|
||||
IniFile::Section *top = iniFile.GetOrCreateSection("");
|
||||
top->AddComment(StringFromFormat("Game config for %s - %s", pGameId.c_str(), title.c_str()));
|
||||
|
||||
IterateSettings(iniFile, [](IniFile::Section *section, ConfigSetting *setting) {
|
||||
if (setting->perGame_) {
|
||||
setting->Set(section);
|
||||
|
||||
Reference in new issue
Block a user