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

Split large spellbook from UI enhancements setting

This commit is contained in:
Dydzio 2023-11-26 19:16:53 +01:00
parent aed0f09a7d
commit a4d76b2529
5 changed files with 28 additions and 4 deletions

View File

@ -111,7 +111,9 @@
"vcmi.systemOptions.hapticFeedbackButton.hover" : "Haptic feedback",
"vcmi.systemOptions.hapticFeedbackButton.help" : "{Haptic feedback}\n\nToggle the haptic feedback on touch inputs.",
"vcmi.systemOptions.enableUiEnhancementsButton.hover" : "Interface Enhancements",
"vcmi.systemOptions.enableUiEnhancementsButton.help" : "{Interface Enhancements}\n\nToggle various quality of life interface improvements. Such as a larger spell book, backpack, etc. Disable to have a more classic experience.",
"vcmi.systemOptions.enableUiEnhancementsButton.help" : "{Interface Enhancements}\n\nToggle various quality of life interface improvements. Such as a backpack button etc. Disable to have a more classic experience.",
"vcmi.systemOptions.enableLargeSpellbookButton.hover" : "Large Spell Book",
"vcmi.systemOptions.enableLargeSpellbookButton.help" : "{Large Spell Book}\n\nEnables larger spell book that fits more spells per page. Spell book page change animation does not work with this setting enabled.",
"vcmi.adventureOptions.infoBarPick.hover" : "Show Messages in Info Panel",
"vcmi.adventureOptions.infoBarPick.help" : "{Show Messages in Info Panel}\n\nWhenever possible, game messages from visiting map objects will be shown in the info panel, instead of popping up in a separate window.",

View File

@ -97,13 +97,13 @@ public:
} spellsorter;
CSpellWindow::CSpellWindow(const CGHeroInstance * _myHero, CPlayerInterface * _myInt, bool openOnBattleSpells):
CWindowObject(PLAYER_COLORED | (settings["general"]["enableUiEnhancements"].Bool() ? BORDERED : 0)),
CWindowObject(PLAYER_COLORED | (settings["general"]["enableLargeSpellbook"].Bool() ? BORDERED : 0)),
battleSpellsOnly(openOnBattleSpells),
selectedTab(4),
currentPage(0),
myHero(_myHero),
myInt(_myInt),
isBigSpellbook(settings["general"]["enableUiEnhancements"].Bool()),
isBigSpellbook(settings["general"]["enableLargeSpellbook"].Bool()),
spellsPerPage(24),
offL(-11),
offR(195),

View File

@ -162,6 +162,11 @@ GeneralOptionsTab::GeneralOptionsTab()
setBoolSetting("general", "enableUiEnhancements", value);
});
addCallback("enableLargeSpellbookChanged", [](bool value)
{
setBoolSetting("general", "enableLargeSpellbook", value);
});
//moved from "other" tab that is disabled for now to avoid excessible tabs with barely any content
addCallback("availableCreaturesAsDwellingChanged", [=](int value)
{
@ -206,6 +211,10 @@ GeneralOptionsTab::GeneralOptionsTab()
if (enableUiEnhancementsCheckbox)
enableUiEnhancementsCheckbox->setSelected(settings["general"]["enableUiEnhancements"].Bool());
std::shared_ptr<CToggleButton> enableLargeSpellbookCheckbox = widget<CToggleButton>("enableLargeSpellbookCheckbox");
if (enableLargeSpellbookCheckbox)
enableLargeSpellbookCheckbox->setSelected(settings["general"]["enableLargeSpellbook"].Bool());
std::shared_ptr<CSlider> musicSlider = widget<CSlider>("musicSlider");
musicSlider->scrollTo(CCS->musich->getVolume());

View File

@ -39,7 +39,8 @@
"useSavePrefix",
"savePrefix",
"startTurnAutosave",
"enableUiEnhancements"
"enableUiEnhancements",
"enableLargeSpellbook"
],
"properties" : {
"playerName" : {
@ -131,6 +132,10 @@
"enableUiEnhancements" : {
"type": "boolean",
"default": true
},
"enableLargeSpellbook" : {
"type": "boolean",
"default": false
}
}
},

View File

@ -50,6 +50,9 @@
{
"text": "vcmi.systemOptions.framerateButton.hover"
},
{
"text": "vcmi.systemOptions.enableLargeSpellbookButton.hover"
},
{
"text": "core.genrltxt.577"
},
@ -102,6 +105,11 @@
"help": "vcmi.systemOptions.framerateButton",
"callback": "framerateChanged"
},
{
"name": "enableLargeSpellbookCheckbox",
"help": "vcmi.systemOptions.enableLargeSpellbookButton",
"callback": "enableLargeSpellbookChanged"
},
{
"name": "spellbookAnimationCheckbox",
"help": "core.help.364",