mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Merge pull request #3366 from Laserlicht/battle_informations
Battle stacks informations
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include "../CMusicHandler.h"
|
||||
#include "../CGameInfo.h"
|
||||
#include "../gui/CGuiHandler.h"
|
||||
#include "../gui/WindowHandler.h"
|
||||
#include "../render/Colors.h"
|
||||
#include "../render/Canvas.h"
|
||||
#include "../render/IRenderHandler.h"
|
||||
@@ -812,6 +813,9 @@ void BattleStacksController::updateHoveredStacks()
|
||||
{
|
||||
auto newStacks = selectHoveredStacks();
|
||||
|
||||
if(newStacks.size() == 0)
|
||||
owner.windowObject->updateStackInfoWindow(nullptr);
|
||||
|
||||
for(const auto * stack : mouseHoveredStacks)
|
||||
{
|
||||
if (vstd::contains(newStacks, stack))
|
||||
@@ -828,11 +832,15 @@ void BattleStacksController::updateHoveredStacks()
|
||||
if (vstd::contains(mouseHoveredStacks, stack))
|
||||
continue;
|
||||
|
||||
owner.windowObject->updateStackInfoWindow(newStacks.size() == 1 && vstd::find_pos(newStacks, stack) == 0 ? stack : nullptr);
|
||||
stackAnimation[stack->unitId()]->setBorderColor(AnimationControls::getBlueBorder());
|
||||
if (stackAnimation[stack->unitId()]->framesInGroup(ECreatureAnimType::MOUSEON) > 0 && stack->alive() && !stack->isFrozen())
|
||||
stackAnimation[stack->unitId()]->playOnce(ECreatureAnimType::MOUSEON);
|
||||
}
|
||||
|
||||
if(mouseHoveredStacks != newStacks)
|
||||
GH.windows().totalRedraw(); //fix for frozen stack info window and blue border in action bar
|
||||
|
||||
mouseHoveredStacks = newStacks;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user