Use the correct ID when creating game configs from the pause screen

This commit is contained in:
Henrik Rydgård committed 2025-09-04 11:34:55 +02:00
1 parent 14016f84df
commit f89c169f8a
4 files changed
+7 -3

No files matched your search

+2
View File
@@ -1676,6 +1676,8 @@ bool Config::saveGameConfig(const std::string &pGameId, const std::string &title
KeyMap::SaveToIni(iniFile);
iniFile.Save(fullIniFilePath);
INFO_LOG(Log::Loader, "Game-specific config saved: '%s'", fullIniFilePath.c_str());
PostSaveCleanup(true);
return true;
}
+2 -2
View File
@@ -168,8 +168,8 @@ bool LoadParamSFOFromPBP(FileLoader *fileLoader) {
bool regionCheck = region != 'A' && region != 'E' && region != 'H' && region != 'I' && region != 'J' && region != 'K' && region != 'U' && region != 'X';
bool systemVerCheck = !systemVer.empty() && systemVer[0] >= '5';
if ((formatCheck || regionCheck || discTotalCheck || systemVerCheck) && !discID.empty()) {
// This is NOT a homebrew, so we set the ID (so it won't get set later).
// This is backwards and weird.
// This is NOT a homebrew, so we set the ID. Otherwise it'll later be generated
// on the first access. This is kinda backwards and weird.
g_paramSFO.SetValue("DISC_ID", discID, (int)discID.size());
std::string ver = paramSFO.GetValueString("DISC_VERSION");
if (ver.empty())
+1
View File
@@ -534,6 +534,7 @@ double g_lastSaveTime = -1.0;
std::string discId = g_paramSFO.GetValueString("DISC_ID");
std::string discVer = g_paramSFO.GetValueString("DISC_VERSION");
if (discId.empty()) {
// Should never happen.
discId = g_paramSFO.GenerateFakeID(Path());
discVer = "1.00";
}
+2 -1
View File
@@ -780,7 +780,8 @@ void GamePauseScreen::CallbackDeleteConfig(bool yes) {
UI::EventReturn GamePauseScreen::OnCreateConfig(UI::EventParams &e) {
std::shared_ptr<GameInfo> info = g_gameInfoCache->GetInfo(NULL, gamePath_, GameInfoFlags::PARAM_SFO);
if (info->Ready(GameInfoFlags::PARAM_SFO)) {
std::string gameId = g_paramSFO.GetDiscID();
ParamSFOData paramSFO = info->GetParamSFO();
std::string gameId = paramSFO.GetDiscID(); // This will end up generating the fake ID properly.
g_Config.createGameConfig(gameId);
g_Config.changeGameSpecific(gameId, info->GetTitle());
g_Config.saveGameConfig(gameId, info->GetTitle());