mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
remeining assets and global background
This commit is contained in:
@@ -548,18 +548,11 @@ AssetGenerator::AnimationLayoutMap AssetGenerator::createAdventureMapButton(cons
|
||||
|
||||
AssetGenerator::CanvasPtr AssetGenerator::createCreatureInfoPanel(int boxesAmount) const
|
||||
{
|
||||
auto locator = ImageLocator(ImagePath::builtin("DiBoxBck"), EImageBlitMode::OPAQUE);
|
||||
std::shared_ptr<IImage> img = ENGINE->renderHandler().loadImage(locator);
|
||||
|
||||
Point size(438, 187);
|
||||
|
||||
auto image = ENGINE->renderHandler().createImage(size, CanvasScalingPolicy::IGNORE);
|
||||
Canvas canvas = image->getCanvas();
|
||||
|
||||
for (int y = 0; y < size.y; y += img->height())
|
||||
for (int x = 0; x < size.x; x += img->width())
|
||||
canvas.draw(img, Point(x, y), Rect(0, 0, std::min(img->width(), size.x - x), std::min(img->height(), size.y - y)));
|
||||
|
||||
Rect r(4, 40, 102, 132);
|
||||
canvas.drawColor(r, Colors::BLACK);
|
||||
canvas.drawBorder(r, Colors::YELLOW);
|
||||
@@ -618,9 +611,6 @@ AssetGenerator::CanvasPtr AssetGenerator::createCreatureInfoPanel(int boxesAmoun
|
||||
|
||||
AssetGenerator::CanvasPtr AssetGenerator::createCreatureInfoPanelElement(CreatureInfoPanelElement element) const
|
||||
{
|
||||
auto locator = ImageLocator(ImagePath::builtin("DiBoxBck"), EImageBlitMode::OPAQUE);
|
||||
std::shared_ptr<IImage> img = ENGINE->renderHandler().loadImage(locator);
|
||||
|
||||
std::map<CreatureInfoPanelElement, Point> size {
|
||||
{BONUS_EFFECTS, Point(438, 59)},
|
||||
{SPELL_EFFECTS, Point(438, 42)},
|
||||
@@ -631,10 +621,6 @@ AssetGenerator::CanvasPtr AssetGenerator::createCreatureInfoPanelElement(Creatur
|
||||
|
||||
auto image = ENGINE->renderHandler().createImage(size[element], CanvasScalingPolicy::IGNORE);
|
||||
Canvas canvas = image->getCanvas();
|
||||
|
||||
for (int y = 0; y < size[element].y; y += img->height())
|
||||
for (int x = 0; x < size[element].x; x += img->width())
|
||||
canvas.draw(img, Point(x, y), Rect(0, 0, std::min(img->width(), size[element].x - x), std::min(img->height(), size[element].y - y)));
|
||||
|
||||
const ColorRGBA rectangleColor = ColorRGBA(0, 0, 0, 75);
|
||||
const ColorRGBA rectangleColorRed = ColorRGBA(32, 0, 0, 150);
|
||||
@@ -654,12 +640,47 @@ AssetGenerator::CanvasPtr AssetGenerator::createCreatureInfoPanelElement(Creatur
|
||||
}
|
||||
break;
|
||||
case SPELL_EFFECTS:
|
||||
for(int i = 0; i < 8; i++)
|
||||
{
|
||||
Rect r(6 + i * 54, 2, 48, 36);
|
||||
canvas.drawColorBlended(r, rectangleColor);
|
||||
canvas.drawBorder(r, borderColor);
|
||||
}
|
||||
break;
|
||||
case BUTTON_PANEL:
|
||||
canvas.drawColorBlended(Rect(382, 5, 52, 36), Colors::BLACK);
|
||||
break;
|
||||
case COMMANDER_BACKGROUND:
|
||||
for(int x = 0; x < 3; x++)
|
||||
{
|
||||
for(int y = 0; y < 3; y++)
|
||||
{
|
||||
Rect r(269 + x * 52, 21 + y * 52, 44, 44);
|
||||
canvas.drawColorBlended(r, rectangleColorRed);
|
||||
canvas.drawBorder(r, borderColor);
|
||||
}
|
||||
}
|
||||
for(int x = 0; x < 3; x++)
|
||||
{
|
||||
for(int y = 0; y < 2; y++)
|
||||
{
|
||||
Rect r(10 + x * 80, 20 + y * 80, 70, 70);
|
||||
canvas.drawColor(r, Colors::BLACK);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case COMMANDER_ABILITIES:
|
||||
for(int i = 0; i < 6; i++)
|
||||
{
|
||||
Rect r(37 + i * 63, 2, 54, 54);
|
||||
canvas.drawColorBlended(r, rectangleColorRed);
|
||||
canvas.drawBorder(r, borderColor);
|
||||
}
|
||||
for(int i = 0; i < 2; i++)
|
||||
{
|
||||
Rect r(10 + i * 401, 6, 22, 46);
|
||||
canvas.drawColor(r, Colors::BLACK);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "../widgets/Buttons.h"
|
||||
#include "../widgets/CComponent.h"
|
||||
#include "../widgets/CComponentHolder.h"
|
||||
#include "../widgets/GraphicalPrimitiveCanvas.h"
|
||||
#include "../widgets/Images.h"
|
||||
#include "../widgets/TextControls.h"
|
||||
#include "../widgets/ObjectLists.h"
|
||||
@@ -831,6 +832,8 @@ void CStackWindow::init()
|
||||
{
|
||||
OBJECT_CONSTRUCTION;
|
||||
|
||||
background = std::make_shared<CFilledTexture>(ImagePath::builtin("DIBOXBCK"), pos);
|
||||
|
||||
if(!info->stackNode)
|
||||
{
|
||||
fakeNode = std::make_unique<CStackInstance>(nullptr, info->creature->getId(), 1, true);
|
||||
@@ -846,6 +849,8 @@ void CStackWindow::init()
|
||||
|
||||
initBonusesList();
|
||||
initSections();
|
||||
|
||||
background->pos = pos;
|
||||
}
|
||||
|
||||
void CStackWindow::initBonusesList()
|
||||
|
||||
@@ -32,6 +32,7 @@ class CArtPlace;
|
||||
class CCommanderArtPlace;
|
||||
class LRClickableArea;
|
||||
class GraphicalPrimitiveCanvas;
|
||||
class CFilledTexture;
|
||||
|
||||
class CCommanderSkillIcon : public LRClickableAreaWText //TODO: maybe bring commander skill button initialization logic inside?
|
||||
{
|
||||
@@ -159,6 +160,8 @@ class CStackWindow : public CWindowObject
|
||||
MainSection(CStackWindow * owner, int yOffset, bool showExp, bool showArt);
|
||||
};
|
||||
|
||||
std::shared_ptr<CFilledTexture> background;
|
||||
|
||||
std::shared_ptr<CArtPlace> stackArtifact;
|
||||
std::shared_ptr<CButton> stackArtifactButton;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user