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

Army window

This commit is contained in:
Laserlicht
2023-12-22 21:26:40 +01:00
committed by GitHub
parent c8d024ae11
commit 72911ec9a3
4 changed files with 95 additions and 1 deletions

View File

@ -446,6 +446,43 @@ void HeroInfoBasicPanel::show(Canvas & to)
CIntObject::show(to);
}
ArmyInfoBasicPanel::ArmyInfoBasicPanel(const InfoAboutArmy & army, Point * position, bool initializeBackground)
: CIntObject(0)
{
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
if (position != nullptr)
moveTo(*position);
if(initializeBackground)
{
background = std::make_shared<CPicture>(ImagePath::builtin("CHRPOP"));
background->getSurface()->setBlitMode(EImageBlitMode::OPAQUE);
background->colorize(army.owner);
}
initializeData(army);
}
void ArmyInfoBasicPanel::initializeData(const InfoAboutArmy & army)
{
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
}
void ArmyInfoBasicPanel::update(const InfoAboutArmy & updatedInfo)
{
icons.clear();
labels.clear();
initializeData(updatedInfo);
}
void ArmyInfoBasicPanel::show(Canvas & to)
{
showAll(to);
CIntObject::show(to);
}
HeroInfoWindow::HeroInfoWindow(const InfoAboutHero & hero, Point * position)
: CWindowObject(RCLICK_POPUP | SHADOW_DISABLED, ImagePath::builtin("CHRPOP"))
{