mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +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
|
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);
|
Point size(438, 187);
|
||||||
|
|
||||||
auto image = ENGINE->renderHandler().createImage(size, CanvasScalingPolicy::IGNORE);
|
auto image = ENGINE->renderHandler().createImage(size, CanvasScalingPolicy::IGNORE);
|
||||||
Canvas canvas = image->getCanvas();
|
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);
|
Rect r(4, 40, 102, 132);
|
||||||
canvas.drawColor(r, Colors::BLACK);
|
canvas.drawColor(r, Colors::BLACK);
|
||||||
canvas.drawBorder(r, Colors::YELLOW);
|
canvas.drawBorder(r, Colors::YELLOW);
|
||||||
@@ -618,9 +611,6 @@ AssetGenerator::CanvasPtr AssetGenerator::createCreatureInfoPanel(int boxesAmoun
|
|||||||
|
|
||||||
AssetGenerator::CanvasPtr AssetGenerator::createCreatureInfoPanelElement(CreatureInfoPanelElement element) const
|
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 {
|
std::map<CreatureInfoPanelElement, Point> size {
|
||||||
{BONUS_EFFECTS, Point(438, 59)},
|
{BONUS_EFFECTS, Point(438, 59)},
|
||||||
{SPELL_EFFECTS, Point(438, 42)},
|
{SPELL_EFFECTS, Point(438, 42)},
|
||||||
@@ -632,10 +622,6 @@ AssetGenerator::CanvasPtr AssetGenerator::createCreatureInfoPanelElement(Creatur
|
|||||||
auto image = ENGINE->renderHandler().createImage(size[element], CanvasScalingPolicy::IGNORE);
|
auto image = ENGINE->renderHandler().createImage(size[element], CanvasScalingPolicy::IGNORE);
|
||||||
Canvas canvas = image->getCanvas();
|
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 rectangleColor = ColorRGBA(0, 0, 0, 75);
|
||||||
const ColorRGBA rectangleColorRed = ColorRGBA(32, 0, 0, 150);
|
const ColorRGBA rectangleColorRed = ColorRGBA(32, 0, 0, 150);
|
||||||
const ColorRGBA borderColor = ColorRGBA(128, 100, 75);
|
const ColorRGBA borderColor = ColorRGBA(128, 100, 75);
|
||||||
@@ -654,12 +640,47 @@ AssetGenerator::CanvasPtr AssetGenerator::createCreatureInfoPanelElement(Creatur
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SPELL_EFFECTS:
|
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;
|
break;
|
||||||
case BUTTON_PANEL:
|
case BUTTON_PANEL:
|
||||||
|
canvas.drawColorBlended(Rect(382, 5, 52, 36), Colors::BLACK);
|
||||||
break;
|
break;
|
||||||
case COMMANDER_BACKGROUND:
|
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;
|
break;
|
||||||
case COMMANDER_ABILITIES:
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include "../widgets/Buttons.h"
|
#include "../widgets/Buttons.h"
|
||||||
#include "../widgets/CComponent.h"
|
#include "../widgets/CComponent.h"
|
||||||
#include "../widgets/CComponentHolder.h"
|
#include "../widgets/CComponentHolder.h"
|
||||||
|
#include "../widgets/GraphicalPrimitiveCanvas.h"
|
||||||
#include "../widgets/Images.h"
|
#include "../widgets/Images.h"
|
||||||
#include "../widgets/TextControls.h"
|
#include "../widgets/TextControls.h"
|
||||||
#include "../widgets/ObjectLists.h"
|
#include "../widgets/ObjectLists.h"
|
||||||
@@ -831,6 +832,8 @@ void CStackWindow::init()
|
|||||||
{
|
{
|
||||||
OBJECT_CONSTRUCTION;
|
OBJECT_CONSTRUCTION;
|
||||||
|
|
||||||
|
background = std::make_shared<CFilledTexture>(ImagePath::builtin("DIBOXBCK"), pos);
|
||||||
|
|
||||||
if(!info->stackNode)
|
if(!info->stackNode)
|
||||||
{
|
{
|
||||||
fakeNode = std::make_unique<CStackInstance>(nullptr, info->creature->getId(), 1, true);
|
fakeNode = std::make_unique<CStackInstance>(nullptr, info->creature->getId(), 1, true);
|
||||||
@@ -846,6 +849,8 @@ void CStackWindow::init()
|
|||||||
|
|
||||||
initBonusesList();
|
initBonusesList();
|
||||||
initSections();
|
initSections();
|
||||||
|
|
||||||
|
background->pos = pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CStackWindow::initBonusesList()
|
void CStackWindow::initBonusesList()
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ class CArtPlace;
|
|||||||
class CCommanderArtPlace;
|
class CCommanderArtPlace;
|
||||||
class LRClickableArea;
|
class LRClickableArea;
|
||||||
class GraphicalPrimitiveCanvas;
|
class GraphicalPrimitiveCanvas;
|
||||||
|
class CFilledTexture;
|
||||||
|
|
||||||
class CCommanderSkillIcon : public LRClickableAreaWText //TODO: maybe bring commander skill button initialization logic inside?
|
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);
|
MainSection(CStackWindow * owner, int yOffset, bool showExp, bool showArt);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
std::shared_ptr<CFilledTexture> background;
|
||||||
|
|
||||||
std::shared_ptr<CArtPlace> stackArtifact;
|
std::shared_ptr<CArtPlace> stackArtifact;
|
||||||
std::shared_ptr<CButton> stackArtifactButton;
|
std::shared_ptr<CButton> stackArtifactButton;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user