Config: Specify/save game title on load too.

Needed when we load and then save, of course.
This commit is contained in:
Unknown W. Brackets committed 2019-07-17 21:28:21 -07:00
1 parent 0b4f60272c
commit 5e2b4d9f1d
5 files changed
+11 -7

No files matched your search

+3 -3
View File
@@ -1189,7 +1189,7 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) {
//sadly it won't benefit from all the "version conversion" going on up-above
//but these configs shouldn't contain older versions anyhow
if (bGameSpecific) {
loadGameConfig(gameId_);
loadGameConfig(gameId_, gameIdTitle_);
}
CleanRecent();
@@ -1508,7 +1508,7 @@ bool Config::saveGameConfig(const std::string &pGameId, const std::string &title
return true;
}
bool Config::loadGameConfig(const std::string &pGameId) {
bool Config::loadGameConfig(const std::string &pGameId, const std::string &title) {
std::string iniFileNameFull = getGameConfigFile(pGameId);
if (!hasGameConfig(pGameId)) {
@@ -1516,7 +1516,7 @@ bool Config::loadGameConfig(const std::string &pGameId) {
return false;
}
changeGameSpecific(pGameId);
changeGameSpecific(pGameId, title);
IniFile iniFile;
iniFile.Load(iniFileNameFull);
+1 -1
View File
@@ -413,7 +413,7 @@ public:
void changeGameSpecific(const std::string &gameId = "", const std::string &title = "");
bool createGameConfig(const std::string &game_id);
bool deleteGameConfig(const std::string& pGameId);
bool loadGameConfig(const std::string &game_id);
bool loadGameConfig(const std::string &game_id, const std::string &title);
bool saveGameConfig(const std::string &pGameId, const std::string &title);
void unloadGameConfig();
std::string getGameConfigFile(const std::string &gameId);
+1 -1
View File
@@ -252,7 +252,7 @@ bool Load_PSP_ISO(FileLoader *fileLoader, std::string *error_string) {
}
//in case we didn't go through EmuScreen::boot
g_Config.loadGameConfig(id);
g_Config.loadGameConfig(id, g_paramSFO.GetValueString("TITLE"));
host->SendUIMessage("config_loaded", "");
INFO_LOG(LOADER,"Loading %s...", bootpath.c_str());
+1 -1
View File
@@ -202,7 +202,7 @@ void EmuScreen::bootGame(const std::string &filename) {
return;
if (!info->id.empty()) {
g_Config.loadGameConfig(info->id);
g_Config.loadGameConfig(info->id, info->GetTitle());
// Reset views in case controls are in a different place.
RecreateViews();
+5 -1
View File
@@ -132,7 +132,8 @@ void GameSettingsScreen::CreateViews() {
ReloadAllPostShaderInfo();
if (editThenRestore_) {
g_Config.loadGameConfig(gameID_);
std::shared_ptr<GameInfo> info = g_gameInfoCache->GetInfo(nullptr, gamePath_, 0);
g_Config.loadGameConfig(gameID_, info->GetTitle());
}
iAlternateSpeedPercent1_ = g_Config.iFpsLimit1 < 0 ? -1 : (g_Config.iFpsLimit1 * 100) / 60;
@@ -1051,6 +1052,9 @@ void GameSettingsScreen::onFinish(DialogResult result) {
Reporting::UpdateConfig();
g_Config.Save("GameSettingsScreen::onFinish");
if (editThenRestore_) {
// In case we didn't have the title yet before, try again.
std::shared_ptr<GameInfo> info = g_gameInfoCache->GetInfo(nullptr, gamePath_, 0);
g_Config.changeGameSpecific(gameID_, info->GetTitle());
g_Config.unloadGameConfig();
}