From 5a5bc0bef8baa3ec8b7aaa8b26a4c6a5bc470e8f Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Thu, 7 Nov 2019 17:16:54 +0300 Subject: [PATCH] Uncheck sheathing checkboxes automatically when appropriate Fix their order and bogus saveSettingBool calls --- apps/launcher/advancedpage.cpp | 17 ++++++++++------- files/ui/advancedpage.ui | 12 ++++++------ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/apps/launcher/advancedpage.cpp b/apps/launcher/advancedpage.cpp index b5da49ed5e..6f2811e665 100644 --- a/apps/launcher/advancedpage.cpp +++ b/apps/launcher/advancedpage.cpp @@ -84,8 +84,11 @@ bool Launcher::AdvancedPage::loadSettings() loadSettingBool(normaliseRaceSpeedCheckBox, "normalise race speed", "Game"); connect(animSourcesCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotAnimSourcesToggled(bool))); loadSettingBool(animSourcesCheckBox, "use additional anim sources", "Game"); - loadSettingBool(weaponSheathingCheckBox, "weapon sheathing", "Game"); - loadSettingBool(shieldSheathingCheckBox, "shield sheathing", "Game"); + if (animSourcesCheckBox->checkState()) + { + loadSettingBool(weaponSheathingCheckBox, "weapon sheathing", "Game"); + loadSettingBool(shieldSheathingCheckBox, "shield sheathing", "Game"); + } // Input Settings loadSettingBool(grabCursorCheckBox, "grab cursor", "Input"); @@ -146,11 +149,6 @@ void Launcher::AdvancedPage::saveSettings() saveSettingBool(requireAppropriateAmmunitionCheckBox, "only appropriate ammunition bypasses resistance", "Game"); saveSettingBool(magicItemAnimationsCheckBox, "use magic item animations", "Game"); saveSettingBool(normaliseRaceSpeedCheckBox, "normalise race speed", "Game"); - if (animSourcesCheckBox->checkState()) - { - saveSettingBool(weaponSheathingCheckBox, "weapon sheathing", "Game"); - saveSettingBool(shieldSheathingCheckBox, "shield sheathing", "Game"); - } saveSettingBool(animSourcesCheckBox, "use additional anim sources", "Game"); saveSettingBool(weaponSheathingCheckBox, "weapon sheathing", "Game"); saveSettingBool(shieldSheathingCheckBox, "shield sheathing", "Game"); @@ -201,4 +199,9 @@ void Launcher::AdvancedPage::slotAnimSourcesToggled(bool checked) { weaponSheathingCheckBox->setEnabled(checked); shieldSheathingCheckBox->setEnabled(checked); + if (!checked) + { + weaponSheathingCheckBox->setCheckState(Qt::Unchecked); + shieldSheathingCheckBox->setCheckState(Qt::Unchecked); + } } diff --git a/files/ui/advancedpage.ui b/files/ui/advancedpage.ui index 79a9e9f5dc..8748a6d0b0 100644 --- a/files/ui/advancedpage.ui +++ b/files/ui/advancedpage.ui @@ -198,28 +198,28 @@ 0 - + false - <html><head/><body><p>Render holstered shield, requires modded assets.</p></body></html> + <html><head/><body><p>Render holstered weapons (with quivers and scabbards), requires modded assets.</p></body></html> - Shield sheathing + Weapon sheathing - + false - <html><head/><body><p>Render holstered weapons (with quivers and scabbards), requires modded assets.</p></body></html> + <html><head/><body><p>Render holstered shield, requires modded assets.</p></body></html> - Weapon sheathing + Shield sheathing