1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

Merge pull request #4304 from Laserlicht/quickspell-option

option to enable quickspell
This commit is contained in:
Ivan Savenko
2024-07-20 12:53:36 +03:00
committed by GitHub
7 changed files with 41 additions and 36 deletions

View File

@@ -238,6 +238,8 @@
"vcmi.battleOptions.skipBattleIntroMusic.help": "{Skip Intro Music}\n\nAllow actions during the intro music that plays at the beginning of each battle.",
"vcmi.battleOptions.endWithAutocombat.hover": "Ends battle",
"vcmi.battleOptions.endWithAutocombat.help": "{Ends battle}\n\nAuto-Combat plays battle to end instant",
"vcmi.battleOptions.showQuickSpell.hover": "Show Quickspell panel",
"vcmi.battleOptions.showQuickSpell.help": "{Show Quickspell panel}\n\nShow panel for quick selecting spells",
"vcmi.adventureMap.revisitObject.hover" : "Revisit Object",
"vcmi.adventureMap.revisitObject.help" : "{Revisit Object}\n\nIf a hero currently stands on a Map Object, he can revisit the location.",

View File

@@ -238,6 +238,8 @@
"vcmi.battleOptions.skipBattleIntroMusic.help": "{Intro-Musik überspringen}\n\n Überspringe die kurze Musik, die zu Beginn eines jeden Kampfes gespielt wird, bevor die Action beginnt. Kann auch durch Drücken der ESC-Taste übersprungen werden.",
"vcmi.battleOptions.endWithAutocombat.hover": "Kampf beenden",
"vcmi.battleOptions.endWithAutocombat.help": "{Kampf beenden}\n\nAutokampf spielt den Kampf sofort zu Ende",
"vcmi.battleOptions.showQuickSpell.hover": "Schnellzauber-Panel anzeigen",
"vcmi.battleOptions.showQuickSpell.help": "{Schnellzauber-Panel anzeigen}\n\nZeigt ein Panel, auf dem schnell Zauber ausgewählt werden können",
"vcmi.adventureMap.revisitObject.hover" : "Objekt erneut besuchen",
"vcmi.adventureMap.revisitObject.help" : "{Objekt erneut besuchen}\n\nSteht ein Held gerade auf einem Kartenobjekt, kann er den Ort erneut aufsuchen.",

View File

@@ -860,3 +860,10 @@ void BattleInterface::setStickyHeroWindowsVisibility(bool visible)
if(visible)
windowObject->showStickyHeroWindows();
}
void BattleInterface::setStickyQuickSpellWindowVisibility(bool visible)
{
windowObject->hideStickyQuickSpellWindow();
if(visible)
windowObject->showStickyQuickSpellWindow();
}

View File

@@ -184,6 +184,7 @@ public:
void setBattleQueueVisibility(bool visible);
void setStickyHeroWindowsVisibility(bool visible);
void setStickyQuickSpellWindowVisibility(bool visible);
void endNetwork();
void executeStagedAnimations();

View File

@@ -64,6 +64,10 @@ BattleOptionsTab::BattleOptionsTab(BattleInterface * owner)
{
showStickyHeroWindowsChangedCallback(value, owner);
});
addCallback("showQuickSpellChanged", [this, owner](bool value)
{
showQuickSpellChangedCallback(value, owner);
});
addCallback("enableAutocombatSpellsChanged", [this](bool value)
{
enableAutocombatSpellsChangedCallback(value);
@@ -95,6 +99,9 @@ BattleOptionsTab::BattleOptionsTab(BattleInterface * owner)
std::shared_ptr<CToggleButton> showStickyHeroInfoWindowsCheckbox = widget<CToggleButton>("showStickyHeroInfoWindowsCheckbox");
showStickyHeroInfoWindowsCheckbox->setSelected(settings["battle"]["stickyHeroInfoWindows"].Bool());
std::shared_ptr<CToggleButton> showQuickSpellCheckbox = widget<CToggleButton>("showQuickSpellCheckbox");
showQuickSpellCheckbox->setSelected(settings["battle"]["enableQuickSpellPanel"].Bool());
std::shared_ptr<CToggleButton> mouseShadowCheckbox = widget<CToggleButton>("mouseShadowCheckbox");
mouseShadowCheckbox->setSelected(settings["battle"]["mouseShadow"].Bool());
@@ -228,6 +235,19 @@ void BattleOptionsTab::showStickyHeroWindowsChangedCallback(bool value, BattleIn
}
}
void BattleOptionsTab::showQuickSpellChangedCallback(bool value, BattleInterface * parentBattleInterface)
{
if(!parentBattleInterface)
{
Settings showQuickSpell = settings.write["battle"]["enableQuickSpellPanel"];
showQuickSpell->Bool() = value;
}
else
{
parentBattleInterface->setStickyQuickSpellWindowVisibility(value);
}
}
void BattleOptionsTab::queueSizeChangedCallback(int value, BattleInterface * parentBattleInterface)
{
if (value == -1)

View File

@@ -32,6 +32,7 @@ private:
void queueSizeChangedCallback(int value, BattleInterface * parentBattleInterface);
void skipBattleIntroMusicChangedCallback(bool value);
void showStickyHeroWindowsChangedCallback(bool value, BattleInterface * parentBattleInterface);
void showQuickSpellChangedCallback(bool value, BattleInterface * parentBattleInterface);
void enableAutocombatSpellsChangedCallback(bool value);
void endWithAutocombatChangedCallback(bool value);
public:

View File

@@ -6,11 +6,6 @@
"items":
[
{
"name": "lineCreatureInfo",
"type": "horizontalLine",
"rect": { "x" : 5, "y" : 289, "w": 365, "h": 3}
},
{
"name": "lineAnimationSpeed",
"type": "horizontalLine",
@@ -21,11 +16,6 @@
"text": "core.genrltxt.396", // Auto-combat options
"position": {"x": 380, "y": 55}
},
{
"type" : "labelTitle",
"text": "core.genrltxt.397", // Creature info
"position": {"x": 10, "y": 265}
},
/////////////////////////////////////// Right section - Auto-combat settings (NOT IMPLEMENTED)
{
"name": "autoCombatLabels",
@@ -105,32 +95,6 @@
]
},
/////////////////////////////////////// Left section - checkboxes
{
"name": "creatureInfoLabels",
"type" : "verticalLayout",
"customType" : "labelDescription",
"position": {"x": 45, "y": 295},
"items":
[
{
"text": "core.genrltxt.402",
},
{
"text": "core.genrltxt.403",
}
]
},
{
"name": "creatureInfoCheckboxes",
"type" : "verticalLayout",
"customType" : "checkboxFake",
"position": {"x": 10, "y": 293},
"items":
[
{},
{}
]
},
{
"name": "generalOptionsLabels",
"type" : "verticalLayout",
@@ -153,6 +117,9 @@
{
"text": "vcmi.battleOptions.showStickyHeroInfoWindows.hover",
},
{
"text": "vcmi.battleOptions.showQuickSpell.hover",
},
{
"text": "core.genrltxt.406",
},
@@ -192,6 +159,11 @@
"help": "vcmi.battleOptions.showStickyHeroInfoWindows",
"callback": "showStickyHeroWindowsChanged"
},
{
"name": "showQuickSpellCheckbox",
"help": "vcmi.battleOptions.showQuickSpell",
"callback": "showQuickSpellChanged"
},
{
"name": "mouseShadowCheckbox",
"help": "core.help.429",