Quellcode durchsuchen

inherit CHeroWindow from CStatusbarWindow for proper status bar support

Andrey Filipenkov vor 3 Jahren
Ursprung
Commit
ebeff94130
2 geänderte Dateien mit 3 neuen und 4 gelöschten Zeilen
  1. 2 2
      client/windows/CHeroWindow.cpp
  2. 1 2
      client/windows/CHeroWindow.h

+ 2 - 2
client/windows/CHeroWindow.cpp

@@ -100,7 +100,7 @@ CHeroSwitcher::CHeroSwitcher(CHeroWindow * owner_, Point pos_, const CGHeroInsta
 }
 
 CHeroWindow::CHeroWindow(const CGHeroInstance * hero)
-	: CWindowObject(PLAYER_COLORED, "HeroScr4"),
+	: CStatusbarWindow(PLAYER_COLORED, "HeroScr4"),
 	heroWArt(this, hero)
 {
 	auto & heroscrn = CGI->generaltexth->heroscrn;
@@ -112,7 +112,7 @@ CHeroWindow::CHeroWindow(const CGHeroInstance * hero)
 	name = std::make_shared<CLabel>(190, 38, EFonts::FONT_BIG, EAlignment::CENTER, Colors::YELLOW);
 	title = std::make_shared<CLabel>(190, 65, EFonts::FONT_MEDIUM, EAlignment::CENTER, Colors::WHITE);
 
-	statusBar = CGStatusBar::create(7, 559, "ADROLLVR.bmp", 660);
+	statusbar = CGStatusBar::create(7, 559, "ADROLLVR.bmp", 660);
 
 	quitButton = std::make_shared<CButton>(Point(609, 516), "hsbtns.def", CButton::tooltip(heroscrn[17]), [=](){ close(); }, SDLK_RETURN);
 	quitButton->assignedKeys.insert(SDLK_ESCAPE);

+ 1 - 2
client/windows/CHeroWindow.h

@@ -57,13 +57,12 @@ public:
 	int64_t getTreeVersion() const override;
 };
 
-class CHeroWindow : public CWindowObject, public CGarrisonHolder, public CWindowWithArtifacts
+class CHeroWindow : public CStatusbarWindow, public CGarrisonHolder, public CWindowWithArtifacts
 {
 	std::shared_ptr<CLabel> name;
 	std::shared_ptr<CLabel> title;
 
 	std::shared_ptr<CAnimImage> banner;
-	std::shared_ptr<CGStatusBar> statusBar;
 
 	std::vector<std::shared_ptr<CHeroSwitcher>> heroList;
 	std::shared_ptr<CPicture> listSelection;