Qt: Fix disabling of some texture dumping options

This commit is contained in:
Stenzek 2024-09-29 16:19:20 +10:00
parent 73fd97e770
commit 3081c4f5cd
No known key found for this signature in database
3 changed files with 17 additions and 3 deletions

View File

@ -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."),

View File

@ -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()

View File

@ -40,6 +40,7 @@ private Q_SLOTS:
void onMediaCaptureAudioEnabledChanged();
void onEnableTextureCacheChanged();
void onEnableTextureDumpingChanged();
void onEnableAnyTextureReplacementsChanged();
void onTextureReplacementOptionsClicked();