Qt: Fix Enable Per-Game Settings option

This commit is contained in:
Connor McLaughlin 2022-11-23 00:34:50 +10:00 committed by refractionpcsx2
parent b30e93389c
commit 5026dda9ca
3 changed files with 14 additions and 4 deletions

View File

@ -49,10 +49,17 @@ EmulationSettingsWidget::EmulationSettingsWidget(SettingsDialog* dialog, QWidget
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.cheats, "EmuCore", "EnableCheats", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.widescreenPatches, "EmuCore", "EnableWideScreenPatches", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.noInterlacingPatches, "EmuCore", "EnableNoInterlacingPatches", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.perGameSettings, "EmuCore", "EnablePerGameSettings", true);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.hostFilesystem, "EmuCore", "HostFs", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.warnAboutUnsafeSettings, "EmuCore", "WarnAboutUnsafeSettings", true);
// Per-game settings is special, we don't want to bind it if we're editing per-game settings.
m_ui.perGameSettings->setEnabled(!dialog->isPerGameSettings());
if (!dialog->isPerGameSettings())
{
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.perGameSettings, "EmuCore", "EnablePerGameSettings", true);
connect(m_ui.perGameSettings, &QCheckBox::stateChanged, g_emu_thread, &EmuThread::reloadGameSettings);
}
dialog->registerWidgetHelp(m_ui.normalSpeed, tr("Normal Speed"), "100%",
tr("Sets the target emulation speed. It is not guaranteed that this speed will be reached, "
"and if not, the emulator will run as fast as it can manage."));

View File

@ -2633,8 +2633,11 @@ void FullscreenUI::DrawEmulationSettingsPage()
"EnableWideScreenPatches", false);
DrawToggleSetting(bsi, "Enable No-Interlacing Patches", "Enables loading no-interlacing patches from pnach files.", "EmuCore",
"EnableNoInterlacingPatches", false);
DrawToggleSetting(bsi, "Enable Per-Game Settings", "Enables loading ini overlays from gamesettings, or custom settings per-game.",
"EmuCore", "EnablePerGameSettings", true);
if (DrawToggleSetting(bsi, "Enable Per-Game Settings", "Enables loading ini overlays from gamesettings, or custom settings per-game.",
"EmuCore", "EnablePerGameSettings", IsEditingGameSettings(bsi)))
{
Host::RunOnCPUThread(&VMManager::ReloadGameSettings);
}
DrawToggleSetting(bsi, "Enable Host Filesystem", "Enables access to files from the host: namespace in the virtual machine.", "EmuCore",
"HostFs", false);
DrawToggleSetting(bsi, "Warn About Unsafe Settings", "Displays warnings when settings are enabled which may break games.", "EmuCore",

View File

@ -421,7 +421,7 @@ void VMManager::RequestDisplaySize(float scale /*= 0.0f*/)
bool VMManager::UpdateGameSettingsLayer()
{
std::unique_ptr<INISettingsInterface> new_interface;
if (s_game_crc != 0)
if (s_game_crc != 0 && Host::GetBaseBoolSettingValue("EmuCore", "EnablePerGameSettings", true))
{
std::string filename(GetGameSettingsPath(s_game_serial.c_str(), s_game_crc));
if (!FileSystem::FileExists(filename.c_str()))