1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

possibility to show small queue outside

This commit is contained in:
Laserlicht 2024-02-01 21:17:08 +01:00 committed by GitHub
parent 25188aead8
commit 5e3f0e631c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View File

@ -857,12 +857,14 @@ StackQueue::StackQueue(bool Embedded, BattleInterface & owner)
if(embedded)
{
queueSize = std::clamp(static_cast<int>(settings["battle"]["queueSmallSlots"].Float()), 1, 19);
int32_t queueSmallOutsideYOffset = 65;
bool queueSmallOutside = settings["battle"]["queueSmallOutside"].Bool() && (pos.y - queueSmallOutsideYOffset) >= 0;
queueSize = std::clamp(static_cast<int>(settings["battle"]["queueSmallSlots"].Float()), 1, queueSmallOutside ? GH.screenDimensions().x / 41 : 19);
pos.w = queueSize * 41;
pos.h = 49;
pos.x += parent->pos.w/2 - pos.w/2;
pos.y += 10;
pos.y += queueSmallOutside ? -queueSmallOutsideYOffset : 10;
icons = GH.renderHandler().loadAnimation(AnimationPath::builtin("CPRSMALL"));
stateIcons = GH.renderHandler().loadAnimation(AnimationPath::builtin("VCMI/BATTLEQUEUE/STATESSMALL"));

View File

@ -304,7 +304,7 @@
"type" : "object",
"additionalProperties" : false,
"default" : {},
"required" : [ "speedFactor", "mouseShadow", "cellBorders", "stackRange", "movementHighlightOnHover", "rangeLimitHighlightOnHover", "showQueue", "swipeAttackDistance", "queueSize", "stickyHeroInfoWindows", "enableAutocombatSpells", "endWithAutocombat", "queueSmallSlots" ],
"required" : [ "speedFactor", "mouseShadow", "cellBorders", "stackRange", "movementHighlightOnHover", "rangeLimitHighlightOnHover", "showQueue", "swipeAttackDistance", "queueSize", "stickyHeroInfoWindows", "enableAutocombatSpells", "endWithAutocombat", "queueSmallSlots", "queueSmallOutside" ],
"properties" : {
"speedFactor" : {
"type" : "number",
@ -358,6 +358,10 @@
"queueSmallSlots" : {
"type": "number",
"default": 10
},
"queueSmallOutside" : {
"type": "boolean",
"default": false
}
}
},