diff --git a/src/core/system.cpp b/src/core/system.cpp index 91464f17b..11f1ce804 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -1323,9 +1323,10 @@ void System::UpdateFolderPaths() return; } - const std::string old_gamesettings(EmuFolders::GameSettings); - const std::string old_inputprofiles(EmuFolders::InputProfiles); - const std::string old_memorycards(EmuFolders::MemoryCards); + const std::string old_cheats = EmuFolders::Cheats; + const std::string old_gamesettings = EmuFolders::GameSettings; + const std::string old_inputprofiles = EmuFolders::InputProfiles; + const std::string old_memorycards = EmuFolders::MemoryCards; // have to manually grab the lock here, because of the ReloadGameSettings() below. { @@ -1337,7 +1338,17 @@ void System::UpdateFolderPaths() if (IsValid()) { if (old_gamesettings != EmuFolders::GameSettings && UpdateGameSettingsLayer()) + { + if (!IsReplayingGPUDump()) + Cheats::ReloadCheats(old_cheats != EmuFolders::Cheats, true, false, true, false); + ApplySettings(false); + } + else if (old_cheats != EmuFolders::Cheats) + { + if (!IsReplayingGPUDump()) + Cheats::ReloadCheats(true, false, false, true, false); + } if (!s_state.input_profile_name.empty() && old_inputprofiles != EmuFolders::InputProfiles) { @@ -1422,7 +1433,7 @@ bool System::GetGameSettingsInterface(INISettingsInterface* sif, const GameDatab ERROR_LOG("Failed to parse separate disc game settings ini '{}': {}", Path::GetFileName(sif->GetPath()), error.GetDescription()); - sif->Clear(); + sif->ClearContentsAndDirty(true); return false; } } @@ -1433,7 +1444,7 @@ bool System::GetGameSettingsInterface(INISettingsInterface* sif, const GameDatab Path::GetFileName(sif->GetPath())); // return empty ini struct? - sif->Clear(); + sif->ClearContentsAndDirty(true); return false; } } @@ -1444,7 +1455,7 @@ bool System::GetGameSettingsInterface(INISettingsInterface* sif, const GameDatab ERROR_LOG("Failed to parse game settings ini '{}': {}", Path::GetFileName(sif->GetPath()), error.GetDescription()); - sif->Clear(); + sif->ClearContentsAndDirty(true); return false; } } @@ -1454,7 +1465,7 @@ bool System::GetGameSettingsInterface(INISettingsInterface* sif, const GameDatab INFO_COLOR_LOG(StrongCyan, "No game settings found (tried '{}')", Path::GetFileName(sif->GetPath())); // return empty ini struct? - sif->Clear(); + sif->ClearContentsAndDirty(true); return false; } @@ -1520,15 +1531,13 @@ void System::UpdateInputSettingsLayer(std::string input_profile_name, std::uniqu { ERROR_LOG("Failed to parse input profile ini '{}': {}", Path::GetFileName(s_state.input_settings_interface.GetPath()), error.GetDescription()); - s_state.input_settings_interface.ClearPathAndContents(); - input_profile_name = {}; + s_state.input_settings_interface.ClearContentsAndDirty(true); } } else { WARNING_LOG("No input profile found (tried '{}')", Path::GetFileName(s_state.input_settings_interface.GetPath())); - s_state.input_settings_interface.ClearPathAndContents(); - input_profile_name = {}; + s_state.input_settings_interface.ClearContentsAndDirty(true); } } else diff --git a/src/duckstation-qt/controllersettingswindow.cpp b/src/duckstation-qt/controllersettingswindow.cpp index 84ff70a12..442ad9e8f 100644 --- a/src/duckstation-qt/controllersettingswindow.cpp +++ b/src/duckstation-qt/controllersettingswindow.cpp @@ -116,8 +116,8 @@ ControllerSettingsWindow* ControllerSettingsWindow::editControllerSettingsForGam dlg->setWindowFlag(Qt::Window); dlg->setAttribute(Qt::WA_DeleteOnClose); dlg->setWindowModality(Qt::WindowModal); - dlg->setWindowTitle(parent->windowTitle()); - dlg->setWindowIcon(parent->windowIcon()); + dlg->setWindowTitle(parent->window()->windowTitle()); + dlg->setWindowIcon(parent->window()->windowIcon()); dlg->show(); return dlg; } diff --git a/src/duckstation-qt/gamesummarywidget.cpp b/src/duckstation-qt/gamesummarywidget.cpp index 977ae4298..0d1db1688 100644 --- a/src/duckstation-qt/gamesummarywidget.cpp +++ b/src/duckstation-qt/gamesummarywidget.cpp @@ -314,6 +314,16 @@ void GameSummaryWidget::onSeparateDiscSettingsChanged(Qt::CheckState state) m_dialog->setBoolSettingValue("Main", "UseSeparateConfigForDiscSet", true); else m_dialog->removeSettingValue("Main", "UseSeparateConfigForDiscSet"); + + // Need to update for all discs when clearing separate-disc-settings. + if (state == Qt::Unchecked) + { + for (const std::string_view& serial : m_dialog->getDatabaseEntry()->disc_set->serials) + { + if (serial != m_dialog->getGameSerial()) + System::ReloadSettingsForPath(System::GetGameSettingsPath(serial, true)); + } + } } void GameSummaryWidget::onChangeSerialClicked() diff --git a/src/util/ini_settings_interface.cpp b/src/util/ini_settings_interface.cpp index 55c87c3b3..01c88c433 100644 --- a/src/util/ini_settings_interface.cpp +++ b/src/util/ini_settings_interface.cpp @@ -426,6 +426,12 @@ void INISettingsInterface::Clear(bool clear_memory /* = false */) } } +void INISettingsInterface::ClearContentsAndDirty(bool clear_memory) +{ + Clear(clear_memory); + m_dirty = false; +} + void INISettingsInterface::ClearPathAndContents() { Clear(true); diff --git a/src/util/ini_settings_interface.h b/src/util/ini_settings_interface.h index 6f0988398..e787abc59 100644 --- a/src/util/ini_settings_interface.h +++ b/src/util/ini_settings_interface.h @@ -51,6 +51,7 @@ public: std::string SaveToString(SectionSaveOrder save_order = {}) const; void Clear(bool clear_memory = false); + void ClearContentsAndDirty(bool clear_memory); void ClearPathAndContents(); void CompactStrings();