浏览代码

fix too much skills in kingdom overview

Laserlicht 4 月之前
父节点
当前提交
c2c8797ede
共有 2 个文件被更改,包括 9 次插入1 次删除
  1. 8 1
      client/windows/CKingdomInterface.cpp
  2. 1 0
      client/windows/CKingdomInterface.h

+ 8 - 1
client/windows/CKingdomInterface.cpp

@@ -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));
 	}
 
-	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);
 		heroInfo.push_back(std::make_shared<InfoBox>(Point(410+(int)i*36, 5), InfoBox::POS_NONE, InfoBox::SIZE_SMALL, data));
 	}

+ 1 - 0
client/windows/CKingdomInterface.h

@@ -310,6 +310,7 @@ class CHeroItem : public CIntObject, public IGarrisonHolder
 
 	std::shared_ptr<CToggleGroup> artButtons;
 	std::vector<std::shared_ptr<InfoBox>> heroInfo;
+	std::shared_ptr<CMultiLineLabel> heroInfoFull;
 	std::shared_ptr<MoraleLuckBox> morale;
 	std::shared_ptr<MoraleLuckBox> luck;