mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
fix too much skills in kingdom overview
This commit is contained in:
@@ -982,8 +982,15 @@ CHeroItem::CHeroItem(const CGHeroInstance * Hero)
|
|||||||
heroInfo.push_back(std::make_shared<InfoBox>(Point(78+(int)i*36, 26), InfoBox::POS_DOWN, InfoBox::SIZE_SMALL, data));
|
heroInfo.push_back(std::make_shared<InfoBox>(Point(78+(int)i*36, 26), InfoBox::POS_DOWN, InfoBox::SIZE_SMALL, data));
|
||||||
}
|
}
|
||||||
|
|
||||||
for(size_t i=0; i<GAME->interface()->cb->getSettings().getInteger(EGameSettings::HEROES_SKILL_PER_HERO); i++)
|
int slots = 8;
|
||||||
|
bool isMoreSkillsThanSlots = hero->secSkills.size() > slots;
|
||||||
|
for(size_t i=0; i<slots; i++)
|
||||||
{
|
{
|
||||||
|
if(isMoreSkillsThanSlots && i == slots - 1)
|
||||||
|
{
|
||||||
|
heroInfoFull = std::make_shared<CMultiLineLabel>(Rect(Point(410+(int)i*36, 5), Point(34, 28)), EFonts::FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, "...");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
auto data = std::make_shared<InfoBoxHeroData>(IInfoBoxData::HERO_SECONDARY_SKILL, hero, (int)i);
|
auto data = std::make_shared<InfoBoxHeroData>(IInfoBoxData::HERO_SECONDARY_SKILL, hero, (int)i);
|
||||||
heroInfo.push_back(std::make_shared<InfoBox>(Point(410+(int)i*36, 5), InfoBox::POS_NONE, InfoBox::SIZE_SMALL, data));
|
heroInfo.push_back(std::make_shared<InfoBox>(Point(410+(int)i*36, 5), InfoBox::POS_NONE, InfoBox::SIZE_SMALL, data));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -310,6 +310,7 @@ class CHeroItem : public CIntObject, public IGarrisonHolder
|
|||||||
|
|
||||||
std::shared_ptr<CToggleGroup> artButtons;
|
std::shared_ptr<CToggleGroup> artButtons;
|
||||||
std::vector<std::shared_ptr<InfoBox>> heroInfo;
|
std::vector<std::shared_ptr<InfoBox>> heroInfo;
|
||||||
|
std::shared_ptr<CMultiLineLabel> heroInfoFull;
|
||||||
std::shared_ptr<MoraleLuckBox> morale;
|
std::shared_ptr<MoraleLuckBox> morale;
|
||||||
std::shared_ptr<MoraleLuckBox> luck;
|
std::shared_ptr<MoraleLuckBox> luck;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user