1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

basic function ready

This commit is contained in:
Laserlicht
2023-09-17 15:28:05 +02:00
committed by GitHub
parent cfc5bac540
commit 69da4d59bf
2 changed files with 32 additions and 14 deletions

View File

@@ -24,6 +24,8 @@
#include "../../lib/CGeneralTextHandler.h" #include "../../lib/CGeneralTextHandler.h"
#include "../../lib/CCreatureHandler.h" #include "../../lib/CCreatureHandler.h"
#include "../../lib/CHeroHandler.h" #include "../../lib/CHeroHandler.h"
#include "../../lib/CSkillHandler.h"
#include "../../lib/spells/CSpellHandler.h"
CHeroOverview::CHeroOverview(const HeroTypeID & h) CHeroOverview::CHeroOverview(const HeroTypeID & h)
: CWindowObject(BORDERED | RCLICK_POPUP), hero { h } : CWindowObject(BORDERED | RCLICK_POPUP), hero { h }
@@ -197,9 +199,8 @@ void CHeroOverview::genHeader()
} }
} }
// war machine title // war machine title
labelWarMachineTitle = std::make_shared<CLabel>(302 + borderOffset, 4 * borderOffset + yOffset + 30 + 32 + 28, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, "TODO: War Machine"); labelWarMachineTitle = std::make_shared<CLabel>(302 + borderOffset, 4 * borderOffset + yOffset + 30 + 32 + 27, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, "TODO: War Machine");
// war machine // war machine
i = 0; i = 0;
@@ -218,18 +219,32 @@ void CHeroOverview::genHeader()
} }
} }
/*std::shared_ptr<CLabel> labelArmyTitle; // secskill title
std::vector<std::shared_ptr<CAnimImage>> imageArmy; labelSecSkillTitle = std::make_shared<CLabel>(302 + borderOffset, 6 * borderOffset + yOffset + 30 + 32 + 20 + 30 + 32 + 8, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, "TODO: Sek. Skills");
std::vector<std::shared_ptr<CLabel>> labelArmyNames;
std::shared_ptr<CLabel> labelWarMachineTitle; // spell title
std::vector<std::shared_ptr<CAnimImage>> imageWarMachine; labelSpellTitle = std::make_shared<CLabel>(302 + (292 / 2) + 3 * borderOffset, 6 * borderOffset + yOffset + 30 + 32 + 20 + 30 + 32 + 8, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, "TODO: Spells");
std::vector<std::shared_ptr<CLabel>> labelWarMachineNames;
std::shared_ptr<CLabel> labelSpellBookTitle; // secskill
std::shared_ptr<CAnimImage> imageSpellBook; i = 0;
std::vector<std::shared_ptr<CAnimImage>> imageSpells; for(auto & skill : (*CGI->heroh)[heroIndex]->secSkillsInit)
std::vector<std::shared_ptr<CLabel>> labelSpellsNames;*/ {
imageSecSkills.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("SECSK32"), (*CGI->skillh)[skill.first]->getIconIndex(), 0, 302, 7 * borderOffset + yOffset + 30 + 32 + 20 + 30 + 32 + 30 + i * (32 + borderOffset)));
labelSecSkillsNames.push_back(std::make_shared<CLabel>(302 + 32 + 2 * borderOffset, 8 * borderOffset + yOffset + 30 + 32 + 20 + 30 + 32 + 30 + i * (32 + borderOffset) - 5, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->levels[skill.second - 1]));
labelSecSkillsNames.push_back(std::make_shared<CLabel>(302 + 32 + 2 * borderOffset, 8 * borderOffset + yOffset + 30 + 32 + 20 + 30 + 32 + 30 + i * (32 + borderOffset) + 10, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, (*CGI->skillh)[skill.first]->getNameTranslated()));
i++;
}
// spell
i = 0;
for(auto & spell : (*CGI->heroh)[heroIndex]->spells)
{
imageSpells.push_back(std::make_shared<CAnimImage>(GH.renderHandler().loadAnimation(AnimationPath::builtin("SPELLBON")), (*CGI->spellh)[spell]->getIconIndex(), Rect(302 + (292 / 2) + 2 * borderOffset, 7 * borderOffset + yOffset + 30 + 32 + 20 + 30 + 32 + 30 + i * (32 + borderOffset), 32, 32), 0));
labelSpellsNames.push_back(std::make_shared<CLabel>(302 + (292 / 2) + 3 * borderOffset + 32 + borderOffset, 8 * borderOffset + yOffset + 30 + 32 + 20 + 30 + 32 + 30 + i * (32 + borderOffset) + 3, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, (*CGI->spellh)[spell]->getNameTranslated()));
i++;
}
} }
void CHeroOverview::genHeroWindow() void CHeroOverview::genHeroWindow()

View File

@@ -45,11 +45,14 @@ class CHeroOverview : public CWindowObject
std::shared_ptr<CLabel> labelWarMachineTitle; std::shared_ptr<CLabel> labelWarMachineTitle;
std::vector<std::shared_ptr<CAnimImage>> imageWarMachine; std::vector<std::shared_ptr<CAnimImage>> imageWarMachine;
std::shared_ptr<CLabel> labelSpellBookTitle; std::shared_ptr<CLabel> labelSpellTitle;
std::shared_ptr<CAnimImage> imageSpellBook;
std::vector<std::shared_ptr<CAnimImage>> imageSpells; std::vector<std::shared_ptr<CAnimImage>> imageSpells;
std::vector<std::shared_ptr<CLabel>> labelSpellsNames; std::vector<std::shared_ptr<CLabel>> labelSpellsNames;
std::shared_ptr<CLabel> labelSecSkillTitle;
std::vector<std::shared_ptr<CAnimImage>> imageSecSkills;
std::vector<std::shared_ptr<CLabel>> labelSecSkillsNames;
void genHeader(); void genHeader();
void genHeroWindow(); void genHeroWindow();