mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-15 11:46:56 +02:00
adjustable queue size for embedded queue
This commit is contained in:
parent
dabb719c5f
commit
aa2fc4b88a
@ -852,9 +852,14 @@ StackQueue::StackQueue(bool Embedded, BattleInterface & owner)
|
|||||||
owner(owner)
|
owner(owner)
|
||||||
{
|
{
|
||||||
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
|
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
|
||||||
|
|
||||||
|
uint32_t queueSize = QUEUE_SIZE_BIG;
|
||||||
|
|
||||||
if(embedded)
|
if(embedded)
|
||||||
{
|
{
|
||||||
pos.w = QUEUE_SIZE * 41;
|
queueSize = std::clamp(static_cast<int>(settings["battle"]["queueSizeEmbeddedSlots"].Float()), 1, 19);
|
||||||
|
|
||||||
|
pos.w = queueSize * 41;
|
||||||
pos.h = 49;
|
pos.h = 49;
|
||||||
pos.x += parent->pos.w/2 - pos.w/2;
|
pos.x += parent->pos.w/2 - pos.w/2;
|
||||||
pos.y += 10;
|
pos.y += 10;
|
||||||
@ -878,7 +883,7 @@ StackQueue::StackQueue(bool Embedded, BattleInterface & owner)
|
|||||||
}
|
}
|
||||||
stateIcons->preload();
|
stateIcons->preload();
|
||||||
|
|
||||||
stackBoxes.resize(QUEUE_SIZE);
|
stackBoxes.resize(queueSize);
|
||||||
for (int i = 0; i < stackBoxes.size(); i++)
|
for (int i = 0; i < stackBoxes.size(); i++)
|
||||||
{
|
{
|
||||||
stackBoxes[i] = std::make_shared<StackBox>(this);
|
stackBoxes[i] = std::make_shared<StackBox>(this);
|
||||||
|
@ -239,7 +239,7 @@ class StackQueue : public CIntObject
|
|||||||
std::optional<uint32_t> getBoundUnitID() const;
|
std::optional<uint32_t> getBoundUnitID() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int QUEUE_SIZE = 10;
|
static const int QUEUE_SIZE_BIG = 10;
|
||||||
std::shared_ptr<CFilledTexture> background;
|
std::shared_ptr<CFilledTexture> background;
|
||||||
std::vector<std::shared_ptr<StackBox>> stackBoxes;
|
std::vector<std::shared_ptr<StackBox>> stackBoxes;
|
||||||
BattleInterface & owner;
|
BattleInterface & owner;
|
||||||
|
@ -304,7 +304,7 @@
|
|||||||
"type" : "object",
|
"type" : "object",
|
||||||
"additionalProperties" : false,
|
"additionalProperties" : false,
|
||||||
"default" : {},
|
"default" : {},
|
||||||
"required" : [ "speedFactor", "mouseShadow", "cellBorders", "stackRange", "movementHighlightOnHover", "rangeLimitHighlightOnHover", "showQueue", "swipeAttackDistance", "queueSize", "stickyHeroInfoWindows", "enableAutocombatSpells", "endWithAutocombat" ],
|
"required" : [ "speedFactor", "mouseShadow", "cellBorders", "stackRange", "movementHighlightOnHover", "rangeLimitHighlightOnHover", "showQueue", "swipeAttackDistance", "queueSize", "stickyHeroInfoWindows", "enableAutocombatSpells", "endWithAutocombat", "queueSizeEmbeddedSlots" ],
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"speedFactor" : {
|
"speedFactor" : {
|
||||||
"type" : "number",
|
"type" : "number",
|
||||||
@ -354,6 +354,10 @@
|
|||||||
"endWithAutocombat" : {
|
"endWithAutocombat" : {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": false
|
"default": false
|
||||||
|
},
|
||||||
|
"queueSizeEmbeddedSlots" : {
|
||||||
|
"type": "number",
|
||||||
|
"default": 10
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user