瀏覽代碼

CHeroOverview secondary skill icons fixed

SoundSSGood 11 月之前
父節點
當前提交
f60813d86f

+ 3 - 3
client/widgets/CComponentHolder.cpp

@@ -266,11 +266,11 @@ CSecSkillPlace::CSecSkillPlace(const Point & position, const ImageSize & imageSi
 {
 {
 	OBJECT_CONSTRUCTION;
 	OBJECT_CONSTRUCTION;
 
 
-	auto imagePath = AnimationPath::builtin("SECSKILL");
+	auto imagePath = AnimationPath::builtin("SECSK82");
 	if(imageSize == ImageSize::MEDIUM)
 	if(imageSize == ImageSize::MEDIUM)
-		imagePath = AnimationPath::builtin("SECSK32");
+		imagePath = AnimationPath::builtin("SECSKILL");
 	if(imageSize == ImageSize::SMALL)
 	if(imageSize == ImageSize::SMALL)
-		imagePath = AnimationPath::builtin("SECSK82");
+		imagePath = AnimationPath::builtin("SECSK32");
 
 
 	image = std::make_shared<CAnimImage>(imagePath, 0);
 	image = std::make_shared<CAnimImage>(imagePath, 0);
 	component.type = ComponentType::SEC_SKILL;
 	component.type = ComponentType::SEC_SKILL;

+ 1 - 1
client/windows/CExchangeWindow.cpp

@@ -82,7 +82,7 @@ CExchangeWindow::CExchangeWindow(ObjectInstanceID hero1, ObjectInstanceID hero2,
 
 
 
 
 		for(int m=0; m < hero->secSkills.size(); ++m)
 		for(int m=0; m < hero->secSkills.size(); ++m)
-			secSkills[leftRight].push_back(std::make_shared<CSecSkillPlace>(Point(32 + 36 * m + 454 * leftRight, qeLayout ? 83 : 88), CSecSkillPlace::ImageSize::MEDIUM,
+			secSkills[leftRight].push_back(std::make_shared<CSecSkillPlace>(Point(32 + 36 * m + 454 * leftRight, qeLayout ? 83 : 88), CSecSkillPlace::ImageSize::SMALL,
 				hero->secSkills[m].first, hero->secSkills[m].second));
 				hero->secSkills[m].first, hero->secSkills[m].second));
 
 
 		specImages[leftRight] = std::make_shared<CAnimImage>(AnimationPath::builtin("UN32"), hero->getHeroType()->imageIndex, 0, 67 + 490 * leftRight, qeLayout ? 41 : 45);
 		specImages[leftRight] = std::make_shared<CAnimImage>(AnimationPath::builtin("UN32"), hero->getHeroType()->imageIndex, 0, 67 + 490 * leftRight, qeLayout ? 41 : 45);

+ 3 - 2
client/windows/CHeroOverview.cpp

@@ -18,7 +18,7 @@
 #include "../render/Colors.h"
 #include "../render/Colors.h"
 #include "../render/IImage.h"
 #include "../render/IImage.h"
 #include "../renderSDL/RenderHandler.h"
 #include "../renderSDL/RenderHandler.h"
-#include "../widgets/CComponent.h"
+#include"../widgets/CComponentHolder.h"
 #include "../widgets/Images.h"
 #include "../widgets/Images.h"
 #include "../widgets/TextControls.h"
 #include "../widgets/TextControls.h"
 #include "../widgets/GraphicalPrimitiveCanvas.h"
 #include "../widgets/GraphicalPrimitiveCanvas.h"
@@ -206,7 +206,8 @@ void CHeroOverview::genControls()
     i = 0;
     i = 0;
     for(auto & skill : (*CGI->heroh)[heroIdx]->secSkillsInit)
     for(auto & skill : (*CGI->heroh)[heroIdx]->secSkillsInit)
     {
     {
-        imageSecSkills.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("SECSK32"), (*CGI->skillh)[skill.first]->getIconIndex(skill.second + 2), 0, 302, 7 * borderOffset + yOffset + 186 + i * (32 + borderOffset)));
+        imageSecSkills.push_back(std::make_shared<CSecSkillPlace>(Point(302, 7 * borderOffset + yOffset + 186 + i * (32 + borderOffset)),
+            CSecSkillPlace::ImageSize::SMALL, skill.first, skill.second));
         labelSecSkillsNames.push_back(std::make_shared<CLabel>(334 + 2 * borderOffset, 8 * borderOffset + yOffset + 186 + i * (32 + borderOffset) - 5, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->levels[skill.second - 1]));
         labelSecSkillsNames.push_back(std::make_shared<CLabel>(334 + 2 * borderOffset, 8 * borderOffset + yOffset + 186 + i * (32 + borderOffset) - 5, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->levels[skill.second - 1]));
         labelSecSkillsNames.push_back(std::make_shared<CLabel>(334 + 2 * borderOffset, 8 * borderOffset + yOffset + 186 + i * (32 + borderOffset) + 10, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, (*CGI->skillh)[skill.first]->getNameTranslated()));
         labelSecSkillsNames.push_back(std::make_shared<CLabel>(334 + 2 * borderOffset, 8 * borderOffset + yOffset + 186 + i * (32 + borderOffset) + 10, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, (*CGI->skillh)[skill.first]->getNameTranslated()));
         i++;
         i++;

+ 2 - 1
client/windows/CHeroOverview.h

@@ -19,6 +19,7 @@ class CComponentBox;
 class CTextBox;
 class CTextBox;
 class TransparentFilledRectangle;
 class TransparentFilledRectangle;
 class SimpleLine;
 class SimpleLine;
+class CSecSkillPlace;
 
 
 class CHeroOverview : public CWindowObject
 class CHeroOverview : public CWindowObject
 {
 {
@@ -60,7 +61,7 @@ class CHeroOverview : public CWindowObject
     std::vector<std::shared_ptr<CLabel>> labelSpellsNames;
     std::vector<std::shared_ptr<CLabel>> labelSpellsNames;
 
 
     std::shared_ptr<CLabel> labelSecSkillTitle;
     std::shared_ptr<CLabel> labelSecSkillTitle;
-    std::vector<std::shared_ptr<CAnimImage>> imageSecSkills;
+    std::vector<std::shared_ptr<CSecSkillPlace>> imageSecSkills;
     std::vector<std::shared_ptr<CLabel>> labelSecSkillsNames;
     std::vector<std::shared_ptr<CLabel>> labelSecSkillsNames;
 
 
     void genBackground();
     void genBackground();

+ 1 - 1
client/windows/CHeroWindow.cpp

@@ -152,7 +152,7 @@ CHeroWindow::CHeroWindow(const CGHeroInstance * hero)
 	for(int i = 0; i < std::min<size_t>(hero->secSkills.size(), 8u); ++i)
 	for(int i = 0; i < std::min<size_t>(hero->secSkills.size(), 8u); ++i)
 	{
 	{
 		Rect r = Rect(i%2 == 0  ?  18  :  162,  276 + 48 * (i/2),  136,  42);
 		Rect r = Rect(i%2 == 0  ?  18  :  162,  276 + 48 * (i/2),  136,  42);
-		secSkills.emplace_back(std::make_shared<CSecSkillPlace>(r.topLeft(), CSecSkillPlace::ImageSize::LARGE));
+		secSkills.emplace_back(std::make_shared<CSecSkillPlace>(r.topLeft(), CSecSkillPlace::ImageSize::MEDIUM));
 
 
 		int x = (i % 2) ? 212 : 68;
 		int x = (i % 2) ? 212 : 68;
 		int y = 280 + 48 * (i/2);
 		int y = 280 + 48 * (i/2);

+ 1 - 1
client/windows/GUIClasses.cpp

@@ -896,7 +896,7 @@ CUniversityWindow::CItem::CItem(CUniversityWindow * _parent, int _ID, int X, int
 	pos.x += X;
 	pos.x += X;
 	pos.y += Y;
 	pos.y += Y;
 
 
-	skill = std::make_shared<CSecSkillPlace>(Point(), CSecSkillPlace::ImageSize::LARGE, _ID, 1);
+	skill = std::make_shared<CSecSkillPlace>(Point(), CSecSkillPlace::ImageSize::MEDIUM, _ID, 1);
 	skill->setClickPressedCallback([this](const CComponentHolder&, const Point& cursorPosition)
 	skill->setClickPressedCallback([this](const CComponentHolder&, const Point& cursorPosition)
 		{
 		{
 			bool skillKnown = parent->hero->getSecSkillLevel(ID);
 			bool skillKnown = parent->hero->getSecSkillLevel(ID);