From c67237672cd75d4d3e2468a16e8788edba52b509 Mon Sep 17 00:00:00 2001 From: KamFretoZ <14798312+kamfretoz@users.noreply.github.com> Date: Mon, 28 Oct 2024 21:02:15 +0700 Subject: [PATCH] Qt/Savestate: Add option to disable savestate selector UI --- pcsx2-qt/Settings/AdvancedSettingsWidget.cpp | 4 ++++ pcsx2-qt/Settings/AdvancedSettingsWidget.ui | 23 +++++++++++++------- pcsx2/Config.h | 1 + pcsx2/Hotkeys.cpp | 9 ++++++-- pcsx2/ImGui/FullscreenUI.cpp | 3 +++ pcsx2/Pcsx2Config.cpp | 1 + 6 files changed, 31 insertions(+), 10 deletions(-) diff --git a/pcsx2-qt/Settings/AdvancedSettingsWidget.cpp b/pcsx2-qt/Settings/AdvancedSettingsWidget.cpp index 75ca121bc9..acd4903fe4 100644 --- a/pcsx2-qt/Settings/AdvancedSettingsWidget.cpp +++ b/pcsx2-qt/Settings/AdvancedSettingsWidget.cpp @@ -56,6 +56,9 @@ AdvancedSettingsWidget::AdvancedSettingsWidget(SettingsWindow* dialog, QWidget* SettingWidgetBinder::BindWidgetToFloatSetting(sif, m_ui.ntscFrameRate, "EmuCore/GS", "FramerateNTSC", 59.94f); SettingWidgetBinder::BindWidgetToFloatSetting(sif, m_ui.palFrameRate, "EmuCore/GS", "FrameratePAL", 50.00f); + dialog->registerWidgetHelp(m_ui.savestateSelector, tr("Use Save State Selector"), tr("Checked"), + tr("Show a save state selector UI when switching slots instead of showing a notification bubble.")); + SettingWidgetBinder::BindWidgetToIntSetting( sif, m_ui.savestateCompressionMethod, "EmuCore", "SavestateCompressionType", static_cast(SavestateCompressionMethod::Zstandard)); @@ -67,6 +70,7 @@ AdvancedSettingsWidget::AdvancedSettingsWidget(SettingsWindow* dialog, QWidget* SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.backupSaveStates, "EmuCore", "BackupSavestate", true); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.saveStateOnShutdown, "EmuCore", "SaveStateOnShutdown", false); + SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.savestateSelector, "EmuCore", "UseSavestateSelector", true); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.pineEnable, "EmuCore", "EnablePINE", false); SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.pineSlot, "EmuCore", "PINESlot", 28011); diff --git a/pcsx2-qt/Settings/AdvancedSettingsWidget.ui b/pcsx2-qt/Settings/AdvancedSettingsWidget.ui index 054730063b..197fda8c7c 100644 --- a/pcsx2-qt/Settings/AdvancedSettingsWidget.ui +++ b/pcsx2-qt/Settings/AdvancedSettingsWidget.ui @@ -32,9 +32,9 @@ 0 - 0 + -447 790 - 1023 + 1049 @@ -422,10 +422,10 @@ Savestate Settings - - + + - Compression Method: + Save State On Shutdown @@ -491,10 +491,17 @@ - - + + - Save State On Shutdown + Compression Method: + + + + + + + Use Save State Selector diff --git a/pcsx2/Config.h b/pcsx2/Config.h index 88f4da719c..fc64f1c22b 100644 --- a/pcsx2/Config.h +++ b/pcsx2/Config.h @@ -1276,6 +1276,7 @@ struct Pcsx2Config EnableGameFixes : 1, // enables automatic game fixes SaveStateOnShutdown : 1, // default value for saving state on shutdown EnableDiscordPresence : 1, // enables discord rich presence integration + UseSavestateSelector: 1, InhibitScreensaver : 1, BackupSavestate : 1, McdFolderAutoManage : 1, diff --git a/pcsx2/Hotkeys.cpp b/pcsx2/Hotkeys.cpp index a6d96cded9..b71e5494f5 100644 --- a/pcsx2/Hotkeys.cpp +++ b/pcsx2/Hotkeys.cpp @@ -106,6 +106,11 @@ static bool CanPause() return true; } +static bool UseSavestateSelector() +{ + return EmuConfig.UseSavestateSelector; +} + BEGIN_HOTKEY_LIST(g_common_hotkeys) DEFINE_HOTKEY("OpenPauseMenu", TRANSLATE_NOOP("Hotkeys", "System"), TRANSLATE_NOOP("Hotkeys", "Open Pause Menu"), [](s32 pressed) { @@ -222,12 +227,12 @@ DEFINE_HOTKEY("InputRecToggleMode", TRANSLATE_NOOP("Hotkeys", "System"), DEFINE_HOTKEY("PreviousSaveStateSlot", TRANSLATE_NOOP("Hotkeys", "Save States"), TRANSLATE_NOOP("Hotkeys", "Select Previous Save Slot"), [](s32 pressed) { if (!pressed && VMManager::HasValidVM()) - SaveStateSelectorUI::SelectPreviousSlot(true); + SaveStateSelectorUI::SelectPreviousSlot(UseSavestateSelector()); }) DEFINE_HOTKEY("NextSaveStateSlot", TRANSLATE_NOOP("Hotkeys", "Save States"), TRANSLATE_NOOP("Hotkeys", "Select Next Save Slot"), [](s32 pressed) { if (!pressed && VMManager::HasValidVM()) - SaveStateSelectorUI::SelectNextSlot(true); + SaveStateSelectorUI::SelectNextSlot(UseSavestateSelector()); }) DEFINE_HOTKEY("SaveStateToSlot", TRANSLATE_NOOP("Hotkeys", "Save States"), TRANSLATE_NOOP("Hotkeys", "Save State To Selected Slot"), [](s32 pressed) { diff --git a/pcsx2/ImGui/FullscreenUI.cpp b/pcsx2/ImGui/FullscreenUI.cpp index d6cd8a6320..743066c1dd 100644 --- a/pcsx2/ImGui/FullscreenUI.cpp +++ b/pcsx2/ImGui/FullscreenUI.cpp @@ -3168,6 +3168,9 @@ void FullscreenUI::DrawInterfaceSettingsPage() DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_ARCHIVE, "Create Save State Backups"), FSUI_CSTR("Creates a backup copy of a save state if it already exists when the save is created. The backup copy has a .backup suffix"), "EmuCore", "BackupSavestate", true); + DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_INFO_CIRCLE, "Use Save State Selector"), + FSUI_CSTR("Show a save state selector UI when switching slots instead of showing a notification bubble."), + "EmuCore", "UseSavestateSelector", true); if (DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_LIGHTBULB, "Use Light Theme"), FSUI_CSTR("Uses a light coloured theme instead of the default dark theme."), "UI", "UseLightFullscreenUITheme", false)) { diff --git a/pcsx2/Pcsx2Config.cpp b/pcsx2/Pcsx2Config.cpp index be60b540fe..071ff140eb 100644 --- a/pcsx2/Pcsx2Config.cpp +++ b/pcsx2/Pcsx2Config.cpp @@ -1928,6 +1928,7 @@ void Pcsx2Config::LoadSaveCore(SettingsWrapper& wrap) SettingsWrapBitBool(EnableRecordingTools); SettingsWrapBitBool(EnableGameFixes); SettingsWrapBitBool(SaveStateOnShutdown); + SettingsWrapBitBool(UseSavestateSelector); SettingsWrapBitBool(EnableDiscordPresence); SettingsWrapBitBool(InhibitScreensaver); SettingsWrapBitBool(HostFs);