/* * CHeroWindow.h, part of VCMI engine * * Authors: listed in file AUTHORS in main folder * * License: GNU General Public License v2.0 or later * Full text of license available in license.txt file, in main folder * */ #pragma once #include "../widgets/CWindowWithArtifacts.h" #include "CWindowObject.h" #include "../../lib/bonuses/IBonusBearer.h" #include VCMI_LIB_NAMESPACE_BEGIN class CGHeroInstance; VCMI_LIB_NAMESPACE_END class CButton; class CHeroWindow; class LClickableAreaHero; class LRClickableAreaWText; class LRClickableAreaWTextComp; class CArtifactsOfHeroMain; class MoraleLuckBox; class CToggleButton; class CToggleGroup; class CGStatusBar; class CTextBox; class CGarrisonInt; /// Button which switches hero selection class CHeroSwitcher : public CIntObject { const CGHeroInstance * hero; std::shared_ptr image; CHeroWindow * owner; public: void clickPressed(const Point & cursorPosition) override; CHeroSwitcher(CHeroWindow * owner_, Point pos_, const CGHeroInstance * hero_); }; class CHeroWindow : public CStatusbarWindow, public IGarrisonHolder, public CWindowWithArtifacts { std::shared_ptr name; std::shared_ptr title; std::shared_ptr banner; std::vector> heroList; std::shared_ptr listSelection; std::shared_ptr portraitArea; std::shared_ptr portraitImage; std::vector> primSkillAreas; std::vector> primSkillImages; std::vector> primSkillValues; std::shared_ptr expValue; std::shared_ptr expArea; std::shared_ptr manaValue; std::shared_ptr spellPointsArea; std::shared_ptr specArea; std::shared_ptr specImage; std::shared_ptr specName; std::shared_ptr morale; std::shared_ptr luck; std::vector> secSkillAreas; std::vector> secSkillImages; std::vector> secSkillNames; std::vector> secSkillValues; std::shared_ptr quitButton; std::shared_ptr dismissLabel; std::shared_ptr dismissButton; std::shared_ptr questlogLabel; std::shared_ptr questlogButton; std::shared_ptr commanderButton; std::shared_ptr backpackButton; std::shared_ptr tacticsButton; std::shared_ptr formations; std::shared_ptr garr; std::shared_ptr arts; std::vector> labels; public: const CGHeroInstance * curHero; CHeroWindow(const CGHeroInstance * hero); void update(const CGHeroInstance * hero, bool redrawNeeded = false); //sets main displayed hero void dismissCurrent(); //dissmissed currently displayed hero (curHero) void commanderWindow(); void switchHero(); //changes displayed hero void updateGarrisons() override; void createBackpackWindow(); //friends friend void CHeroArtPlace::clickPressed(const Point & cursorPosition); friend class CPlayerInterface; };