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

Fix battle settings UI labels, add "dont show battle intro" setting

This commit is contained in:
Dydzio 2023-02-15 20:29:29 +01:00
parent 1d153f4ee9
commit 775db89241
5 changed files with 42 additions and 5 deletions

View File

@ -71,6 +71,8 @@
"vcmi.battleOptions.animationsSpeed5.help": "Sets animation speed to super fast",
"vcmi.battleOptions.animationsSpeed6.hover": "6",
"vcmi.battleOptions.animationsSpeed6.help": "Sets animation speed to extremely fast",
"vcmi.battleOptions.skipBattleIntroMusic.hover": "Skip intro music",
"vcmi.battleOptions.skipBattleIntroMusic.help": "{Skip intro music}\n\n Skip short music that plays at beginning of each battle before action starts.",
"vcmi.otherOptions.availableCreaturesAsDwellingLabel.hover" : "Show available creatures in town summary",
"vcmi.otherOptions.availableCreaturesAsDwellingLabel.help" : "{Show available creatures in town summary}\n\n Shows creatures available to purchase instead of their growth in town summary (bottom-left corner).",

View File

@ -30,6 +30,7 @@ BattleOptionsTab::BattleOptionsTab(BattleInterface * owner):
addCallback("animationSpeedChanged", std::bind(&BattleOptionsTab::animationSpeedChangedCallback, this, _1));
addCallback("showQueueChanged", std::bind(&BattleOptionsTab::showQueueChangedCallback, this, _1));
addCallback("queueSizeChanged", std::bind(&BattleOptionsTab::queueSizeChangedCallback, this, _1));
addCallback("skipBattleIntroMusicChanged", std::bind(&BattleOptionsTab::skipBattleIntroMusicChangedCallback, this, _1));
build(config);
std::shared_ptr<CToggleGroup> animationSpeedToggle = widget<CToggleGroup>("animationSpeedPicker");
@ -49,6 +50,9 @@ BattleOptionsTab::BattleOptionsTab(BattleInterface * owner):
std::shared_ptr<CToggleButton> showQueueCheckbox = widget<CToggleButton>("showQueueCheckbox");
showQueueCheckbox->setSelected((bool)settings["battle"]["showQueue"].Bool());
std::shared_ptr<CToggleButton> skipBattleIntroMusicCheckbox = widget<CToggleButton>("skipBattleIntroMusicCheckbox");
skipBattleIntroMusicCheckbox->setSelected((bool)settings["gameTweaks"]["skipBattleIntroMusic"].Bool());
}
int BattleOptionsTab::getAnimSpeed() const
@ -128,3 +132,9 @@ void BattleOptionsTab::queueSizeChangedCallback(int value)
size->String() = stringifiedValue;
}
void BattleOptionsTab::skipBattleIntroMusicChangedCallback(bool value)
{
Settings musicSkipSettingValue = settings.write["gameTweaks"]["skipBattleIntroMusic"];
musicSkipSettingValue->Bool() = value;
}

View File

@ -27,6 +27,7 @@ private:
void animationSpeedChangedCallback(int value);
void showQueueChangedCallback(bool value);
void queueSizeChangedCallback(int value);
void skipBattleIntroMusicChangedCallback(bool value);
public:
BattleOptionsTab(BattleInterface * owner = nullptr);
};

View File

@ -479,7 +479,8 @@
"forceMovementInfo",
"numericCreaturesQuantities",
"availableCreaturesAsDwellingLabel",
"compactTownCreatureInfo"
"compactTownCreatureInfo",
"skipBattleIntroMusic"
],
"properties": {
"showGrid": {
@ -501,6 +502,10 @@
"compactTownCreatureInfo" : {
"type" : "boolean",
"default" : false
},
"skipBattleIntroMusic" : {
"type" : "boolean",
"default" : false
}
}
}

View File

@ -95,7 +95,7 @@
},
{
"name": "generalOptionsLabel1",
"name": "viewGridLabel",
"type": "label",
"font": "medium",
"alignment": "left",
@ -104,7 +104,7 @@
"position": {"x": 61, "y": 27}
},
{
"name": "generalOptionsLabel2",
"name": "showMovementRangeLabel",
"type": "label",
"font": "medium",
"alignment": "left",
@ -113,7 +113,7 @@
"position": {"x": 61, "y": 60}
},
{
"name": "generalOptionsLabel3",
"name": "mouseShadowLabel",
"type": "label",
"font": "medium",
"alignment": "left",
@ -122,7 +122,7 @@
"position": {"x": 61, "y": 93}
},
{
"name": "generalOptionsLabel4",
"name": "battleCasualtiesLabel",
"type": "label",
"font": "medium",
"alignment": "left",
@ -334,6 +334,25 @@
}
],
"callback": "queueSizeChanged"
},
{
"name": "skipBattleIntroMusicLabel",
"type": "label",
"font": "medium",
"alignment": "left",
"color": "white",
"text": "vcmi.battleOptions.skipBattleIntroMusic.hover",
"position": {"x": 61, "y": 472}
},
{
"name": "skipBattleIntroMusicCheckbox",
"type": "toggleButton",
"image": "sysopchk.def",
"help": "vcmi.battleOptions.skipBattleIntroMusic",
"position": {"x": 25, "y": 470},
"callback": "skipBattleIntroMusicChanged"
}
]
}