1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

custom spell schools in spell book

This commit is contained in:
Laserlicht
2025-07-06 23:24:15 +02:00
parent d03d096aee
commit 3e6162a37a
12 changed files with 219 additions and 55 deletions

View File

@@ -49,6 +49,8 @@ void AssetGenerator::initialize()
imageFiles[ImagePath::builtin("CampaignBackground7.png")] = [this]() { return createCampaignBackground(7); };
imageFiles[ImagePath::builtin("CampaignBackground8.png")] = [this]() { return createCampaignBackground(8); };
imageFiles[ImagePath::builtin("SpelTabNone.png")] = [this](){ return createSpellTabNone();};
for (PlayerColor color(0); color < PlayerColor::PLAYER_LIMIT; ++color)
imageFiles[ImagePath::builtin("DialogBoxBackground_" + color.toString())] = [this, color](){ return createPlayerColoredBackground(color);};
@@ -306,6 +308,19 @@ AssetGenerator::CanvasPtr AssetGenerator::createCampaignBackground(int selection
return image;
}
AssetGenerator::CanvasPtr AssetGenerator::createSpellTabNone() const
{
auto img1 = ENGINE->renderHandler().loadAnimation(AnimationPath::builtin("SPELTAB"), EImageBlitMode::COLORKEY)->getImage(0);
auto img2 = ENGINE->renderHandler().loadAnimation(AnimationPath::builtin("SPELTAB"), EImageBlitMode::COLORKEY)->getImage(4);
auto image = ENGINE->renderHandler().createImage(img1->dimensions(), CanvasScalingPolicy::IGNORE);
Canvas canvas = image->getCanvas();
canvas.draw(img1, Point(0, img1->height() / 2), Rect(0, img1->height() / 2, img1->width(), img1->height() / 2));
canvas.draw(img2, Point(0, 0), Rect(0, 0, img2->width(), img2->height() / 2));
return image;
}
AssetGenerator::CanvasPtr AssetGenerator::createChroniclesCampaignImages(int chronicle) const
{
auto imgPathBg = ImagePath::builtin("chronicles_" + std::to_string(chronicle) + "/GamSelBk");

View File

@@ -50,6 +50,7 @@ private:
CanvasPtr createPlayerColoredBackground(const PlayerColor & player) const;
CanvasPtr createCombatUnitNumberWindow(float multR, float multG, float multB) const;
CanvasPtr createCampaignBackground(int selection) const;
CanvasPtr createSpellTabNone() const;
CanvasPtr createChroniclesCampaignImages(int chronicle) const;
CanvasPtr createPaletteShiftedImage(const AnimationPath & source, const std::vector<PaletteAnimation> & animation, int frameIndex, int paletteShiftCounter) const;