From 3081c4f5cd5bcfaa29faea40454b605b05d3a841 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 29 Sep 2024 16:19:20 +1000 Subject: [PATCH] Qt: Fix disabling of some texture dumping options --- src/core/fullscreen_ui.cpp | 7 ++++--- src/duckstation-qt/graphicssettingswidget.cpp | 12 ++++++++++++ src/duckstation-qt/graphicssettingswidget.h | 1 + 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/core/fullscreen_ui.cpp b/src/core/fullscreen_ui.cpp index 7dd6c25df..a5cf930c0 100644 --- a/src/core/fullscreen_ui.cpp +++ b/src/core/fullscreen_ui.cpp @@ -4521,9 +4521,10 @@ void FullscreenUI::DrawDisplaySettingsPage() bsi, FSUI_CSTR("Enable Texture Dumping"), FSUI_CSTR("Enables dumping of textures to image files, which can be replaced. Not compatible with all games."), "TextureReplacements", "DumpTextures", false, texture_cache_enabled); - DrawToggleSetting(bsi, FSUI_CSTR("Dump Replaced Textures"), - FSUI_CSTR("Dumps textures that have replacements already loaded."), "TextureReplacements", - "DumpReplacedTextures", false, texture_cache_enabled); + DrawToggleSetting( + bsi, FSUI_CSTR("Dump Replaced Textures"), FSUI_CSTR("Dumps textures that have replacements already loaded."), + "TextureReplacements", "DumpReplacedTextures", false, + texture_cache_enabled && GetEffectiveBoolSetting(bsi, "TextureReplacements", "DumpTextures", false)); DrawToggleSetting(bsi, FSUI_CSTR("Enable VRAM Write Texture Replacement"), FSUI_CSTR("Enables the replacement of background textures in supported games."), diff --git a/src/duckstation-qt/graphicssettingswidget.cpp b/src/duckstation-qt/graphicssettingswidget.cpp index b8a13a383..3f7f3edee 100644 --- a/src/duckstation-qt/graphicssettingswidget.cpp +++ b/src/duckstation-qt/graphicssettingswidget.cpp @@ -280,6 +280,8 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget* &GraphicsSettingsWidget::onEnableTextureCacheChanged); connect(m_ui.enableTextureReplacements, &QCheckBox::checkStateChanged, this, &GraphicsSettingsWidget::onEnableAnyTextureReplacementsChanged); + connect(m_ui.enableTextureDumping, &QCheckBox::checkStateChanged, this, + &GraphicsSettingsWidget::onEnableTextureDumpingChanged); connect(m_ui.vramWriteReplacement, &QCheckBox::checkStateChanged, this, &GraphicsSettingsWidget::onEnableAnyTextureReplacementsChanged); connect(m_ui.textureReplacementOptions, &QPushButton::clicked, this, @@ -1137,6 +1139,16 @@ void GraphicsSettingsWidget::onEnableTextureCacheChanged() const bool tc_enabled = m_dialog->getEffectiveBoolValue("GPU", "EnableTextureCache", false); m_ui.enableTextureReplacements->setEnabled(tc_enabled); m_ui.enableTextureDumping->setEnabled(tc_enabled); + onEnableTextureDumpingChanged(); + onEnableAnyTextureReplacementsChanged(); +} + +void GraphicsSettingsWidget::onEnableTextureDumpingChanged() +{ + const bool tc_enabled = m_dialog->getEffectiveBoolValue("GPU", "EnableTextureCache", false); + const bool dumping_enabled = + tc_enabled && m_dialog->getEffectiveBoolValue("TextureReplacements", "DumpTextures", false); + m_ui.dumpReplacedTextures->setEnabled(dumping_enabled); } void GraphicsSettingsWidget::onEnableAnyTextureReplacementsChanged() diff --git a/src/duckstation-qt/graphicssettingswidget.h b/src/duckstation-qt/graphicssettingswidget.h index d698742a2..a807a3f7f 100644 --- a/src/duckstation-qt/graphicssettingswidget.h +++ b/src/duckstation-qt/graphicssettingswidget.h @@ -40,6 +40,7 @@ private Q_SLOTS: void onMediaCaptureAudioEnabledChanged(); void onEnableTextureCacheChanged(); + void onEnableTextureDumpingChanged(); void onEnableAnyTextureReplacementsChanged(); void onTextureReplacementOptionsClicked();