mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-03 00:46:55 +02:00
Merge pull request #2 from Laserlicht/disable_animation_button
disable animation button if large spellbook used
This commit is contained in:
@ -162,9 +162,15 @@ GeneralOptionsTab::GeneralOptionsTab()
|
|||||||
setBoolSetting("general", "enableUiEnhancements", value);
|
setBoolSetting("general", "enableUiEnhancements", value);
|
||||||
});
|
});
|
||||||
|
|
||||||
addCallback("enableLargeSpellbookChanged", [](bool value)
|
addCallback("enableLargeSpellbookChanged", [this](bool value)
|
||||||
{
|
{
|
||||||
setBoolSetting("gameTweaks", "enableLargeSpellbook", 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)
|
addCallback("audioMuteFocusChanged", [](bool value)
|
||||||
@ -196,6 +202,10 @@ GeneralOptionsTab::GeneralOptionsTab()
|
|||||||
|
|
||||||
std::shared_ptr<CToggleButton> spellbookAnimationCheckbox = widget<CToggleButton>("spellbookAnimationCheckbox");
|
std::shared_ptr<CToggleButton> spellbookAnimationCheckbox = widget<CToggleButton>("spellbookAnimationCheckbox");
|
||||||
spellbookAnimationCheckbox->setSelected(settings["video"]["spellbookAnimation"].Bool());
|
spellbookAnimationCheckbox->setSelected(settings["video"]["spellbookAnimation"].Bool());
|
||||||
|
if(settings["gameTweaks"]["enableLargeSpellbook"].Bool())
|
||||||
|
spellbookAnimationCheckbox->disable();
|
||||||
|
else
|
||||||
|
spellbookAnimationCheckbox->enable();
|
||||||
|
|
||||||
std::shared_ptr<CToggleButton> fullscreenBorderlessCheckbox = widget<CToggleButton>("fullscreenBorderlessCheckbox");
|
std::shared_ptr<CToggleButton> fullscreenBorderlessCheckbox = widget<CToggleButton>("fullscreenBorderlessCheckbox");
|
||||||
if (fullscreenBorderlessCheckbox)
|
if (fullscreenBorderlessCheckbox)
|
||||||
|
@ -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",
|
"type" : "verticalLayout",
|
||||||
"customType" : "checkbox",
|
"customType" : "checkbox",
|
||||||
|
Reference in New Issue
Block a user