1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Merge pull request #2 from Laserlicht/disable_animation_button

disable animation button if large spellbook used
This commit is contained in:
Dydzio 2023-12-24 00:50:51 +01:00 committed by GitHub
commit ef80b840e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 1 deletions

View File

@ -162,9 +162,15 @@ GeneralOptionsTab::GeneralOptionsTab()
setBoolSetting("general", "enableUiEnhancements", value);
});
addCallback("enableLargeSpellbookChanged", [](bool value)
addCallback("enableLargeSpellbookChanged", [this](bool value)
{
setBoolSetting("gameTweaks", "enableLargeSpellbook", value);
std::shared_ptr<CToggleButton> spellbookAnimationCheckbox = widget<CToggleButton>("spellbookAnimationCheckbox");
if(value)
spellbookAnimationCheckbox->disable();
else
spellbookAnimationCheckbox->enable();
redraw();
});
addCallback("audioMuteFocusChanged", [](bool value)
@ -196,6 +202,10 @@ GeneralOptionsTab::GeneralOptionsTab()
std::shared_ptr<CToggleButton> spellbookAnimationCheckbox = widget<CToggleButton>("spellbookAnimationCheckbox");
spellbookAnimationCheckbox->setSelected(settings["video"]["spellbookAnimation"].Bool());
if(settings["gameTweaks"]["enableLargeSpellbook"].Bool())
spellbookAnimationCheckbox->disable();
else
spellbookAnimationCheckbox->enable();
std::shared_ptr<CToggleButton> fullscreenBorderlessCheckbox = widget<CToggleButton>("fullscreenBorderlessCheckbox");
if (fullscreenBorderlessCheckbox)

View File

@ -70,6 +70,35 @@
}
]
},
{
"type" : "verticalLayout",
"customType" : "checkboxFake",
"position" : {"x": 10, "y": 83},
"items" : [
{
"created" : "desktop"
},
{},
{
"created" : "desktop"
},
{
"created" : "desktop"
},
{},
{},
{
"name": "spellbookAnimationCheckboxPlaceholder"
},
{
"created" : "touchscreen"
},
{
"created" : "mobile"
},
{}
]
},
{
"type" : "verticalLayout",
"customType" : "checkbox",