/* * 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 "../../lib/HeroBonus.h" #include "../widgets/CArtifactHolder.h" #include "../widgets/CGarrisonInt.h" class CButton; struct SDL_Surface; class CGHeroInstance; class CArtifact; class CHeroWindow; class LClickableAreaHero; class LRClickableAreaWText; class LRClickableAreaWTextComp; class CArtifactsOfHero; class MoraleLuckBox; class CToggleButton; class CToggleGroup; class CGStatusBar; class CTextBox; /// Button which switches hero selection class CHeroSwitcher : public CIntObject { const CGHeroInstance * hero; std::shared_ptr image; CHeroWindow * owner; public: void clickLeft(tribool down, bool previousState) override; CHeroSwitcher(CHeroWindow * owner_, Point pos_, const CGHeroInstance * hero_); }; //helper class for calculating values of hero bonuses without bonuses from picked up artifact class CHeroWithMaybePickedArtifact : public virtual IBonusBearer { public: const CGHeroInstance * hero; CWindowWithArtifacts * cww; CHeroWithMaybePickedArtifact(CWindowWithArtifacts * Cww, const CGHeroInstance * Hero); const TBonusListPtr getAllBonuses(const CSelector & selector, const CSelector & limit, const CBonusSystemNode * root = nullptr, const std::string & cachingStr = "") const override; int64_t getTreeVersion() const override; }; class CHeroWindow : public CWindowObject, public CGarrisonHolder, public CWindowWithArtifacts { std::shared_ptr name; std::shared_ptr title; std::shared_ptr banner; std::shared_ptr statusBar; 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; CHeroWithMaybePickedArtifact heroWArt; 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 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; //friends friend void CHeroArtPlace::clickLeft(tribool down, bool previousState); friend class CPlayerInterface; };