From a5826ea6aebcf48f4cbda4dab4febb361a4ba834 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Tue, 22 Jul 2025 20:18:18 +1000 Subject: [PATCH] Qt: Hide apply image patches in game settings Doesn't makes sense, because game settings are applied after identification. --- src/core/fullscreen_ui.cpp | 20 +++++++++++++++----- src/duckstation-qt/consolesettingswidget.cpp | 10 +++++++--- src/duckstation-qt/consolesettingswidget.ui | 16 ++++++++-------- src/duckstation-qt/settingswindow.cpp | 3 +++ 4 files changed, 33 insertions(+), 16 deletions(-) diff --git a/src/core/fullscreen_ui.cpp b/src/core/fullscreen_ui.cpp index c3313f49d..2189a5c6b 100644 --- a/src/core/fullscreen_ui.cpp +++ b/src/core/fullscreen_ui.cpp @@ -4407,7 +4407,8 @@ void FullscreenUI::DrawConsoleSettingsPage() static constexpr std::array cdrom_read_seek_speed_values = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0}; - SettingsInterface* bsi = GetEditingSettingsInterface(); + SettingsInterface* const bsi = GetEditingSettingsInterface(); + const bool game_settings = IsEditingGameSettings(bsi); BeginMenuButtons(); ResetFocusHere(); @@ -4492,10 +4493,17 @@ void FullscreenUI::DrawConsoleSettingsPage() bsi, FSUI_ICONVSTR(ICON_FA_DOWNLOAD, "Preload Images to RAM"), FSUI_VSTR("Loads the game image into RAM. Useful for network paths that may become unreliable during gameplay."), "CDROM", "LoadImageToRAM", false); - DrawToggleSetting( - bsi, FSUI_ICONVSTR(ICON_FA_VEST_PATCHES, "Apply Image Patches"), - FSUI_VSTR("Automatically applies patches to disc images when they are present, currently only PPF is supported."), - "CDROM", "LoadImagePatches", false); + if (!game_settings) + { + DrawToggleSetting( + bsi, FSUI_ICONVSTR(ICON_FA_VEST_PATCHES, "Apply Image Patches"), + FSUI_VSTR("Automatically applies patches to disc images when they are present, currently only PPF is supported."), + "CDROM", "LoadImagePatches", false); + DrawToggleSetting(bsi, FSUI_ICONVSTR(ICON_FA_BAN, "Ignore Drive Subcode"), + FSUI_VSTR("Ignores the subchannel provided by the drive when using physical discs, instead " + "always generating subchannel data. Can improve read reliability on some drives."), + "CDROM", "IgnoreHostSubcode", false); + } DrawToggleSetting(bsi, FSUI_ICONVSTR(ICON_FA_LIST_OL, "Switch to Next Disc on Stop"), FSUI_VSTR("Automatically switches to the next disc in the game when the game stops the CD-ROM " "motor. Does not work for all games."), @@ -9675,6 +9683,8 @@ TRANSLATE_NOOP("FullscreenUI", "Identifies any new files added to the game direc TRANSLATE_NOOP("FullscreenUI", "If enabled, the display will be blended with the transparency of the overlay image."); TRANSLATE_NOOP("FullscreenUI", "If enabled, the transparency of the overlay image will be applied."); TRANSLATE_NOOP("FullscreenUI", "If not enabled, the current post processing chain will be ignored."); +TRANSLATE_NOOP("FullscreenUI", "Ignore Drive Subcode"); +TRANSLATE_NOOP("FullscreenUI", "Ignores the subchannel provided by the drive when using physical discs, instead always generating subchannel data. Can improve read reliability on some drives."); TRANSLATE_NOOP("FullscreenUI", "Image Path"); TRANSLATE_NOOP("FullscreenUI", "In the form below, specify the URLs to download covers from, with one template URL per line. The following variables are available:"); TRANSLATE_NOOP("FullscreenUI", "Includes the elapsed time since the application start in file logs."); diff --git a/src/duckstation-qt/consolesettingswidget.cpp b/src/duckstation-qt/consolesettingswidget.cpp index 921aa3497..d9eb24322 100644 --- a/src/duckstation-qt/consolesettingswidget.cpp +++ b/src/duckstation-qt/consolesettingswidget.cpp @@ -66,18 +66,22 @@ ConsoleSettingsWidget::ConsoleSettingsWidget(SettingsWindow* dialog, QWidget* pa SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.enableCPUClockSpeedControl, "CPU", "OverclockEnable", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.recompilerICache, "CPU", "RecompilerICache", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.cdromLoadImageToRAM, "CDROM", "LoadImageToRAM", false); - SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.cdromLoadImagePatches, "CDROM", "LoadImagePatches", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.cdromAutoDiscChange, "CDROM", "AutoDiscChange", false); if (!m_dialog->isPerGameSettings()) { + SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.cdromLoadImagePatches, "CDROM", "LoadImagePatches", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.cdromIgnoreDriveSubcode, "CDROM", "IgnoreHostSubcode", false); } else { - - m_ui.cdromIgnoreDriveSubcode->setEnabled(false); + m_ui.cdromGridLayout->removeWidget(m_ui.cdromIgnoreDriveSubcode); + delete m_ui.cdromIgnoreDriveSubcode; + m_ui.cdromIgnoreDriveSubcode = nullptr; + m_ui.cdromGridLayout->removeWidget(m_ui.cdromLoadImagePatches); + delete m_ui.cdromLoadImagePatches; + m_ui.cdromLoadImagePatches = nullptr; } SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.cdromSeekSpeedup, "CDROM", "SeekSpeedup", 1, diff --git a/src/duckstation-qt/consolesettingswidget.ui b/src/duckstation-qt/consolesettingswidget.ui index b65e6c92f..1ddef553c 100644 --- a/src/duckstation-qt/consolesettingswidget.ui +++ b/src/duckstation-qt/consolesettingswidget.ui @@ -308,7 +308,7 @@ - + @@ -316,13 +316,6 @@ - - - - Apply Image Patches - - - @@ -331,6 +324,13 @@ + + + Apply Image Patches + + + + Switch to Next Disc on Stop diff --git a/src/duckstation-qt/settingswindow.cpp b/src/duckstation-qt/settingswindow.cpp index 4e9e0fed4..9c3877c68 100644 --- a/src/duckstation-qt/settingswindow.cpp +++ b/src/duckstation-qt/settingswindow.cpp @@ -352,6 +352,9 @@ void SettingsWindow::onClearSettingsClicked() void SettingsWindow::registerWidgetHelp(QObject* object, QString title, QString recommended_value, QString text) { + if (!object) + return; + // construct rich text with formatted description QString full_text; full_text += "
";