1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

disable animation button

This commit is contained in:
Laserlicht 2023-12-24 00:41:29 +01:00 committed by GitHub
parent 896f3108ee
commit 39c58a9d94
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",