1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-22 22:13:35 +02:00
vcmi/client/windows/CHeroWindow.h

116 lines
3.3 KiB
C++
Raw Normal View History

/*
* 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
2023-07-07 00:08:29 +02:00
#include "../widgets/CWindowWithArtifacts.h"
#include "CWindowObject.h"
2023-04-27 15:10:33 +02:00
2023-04-30 18:13:55 +02:00
#include "../../lib/bonuses/IBonusBearer.h"
2023-07-07 00:08:29 +02:00
#include <vcmi/FactionMember.h>
VCMI_LIB_NAMESPACE_BEGIN
class CGHeroInstance;
VCMI_LIB_NAMESPACE_END
class CButton;
class CHeroWindow;
2009-06-18 18:05:00 +03:00
class LClickableAreaHero;
class LRClickableAreaWText;
class LRClickableAreaWTextComp;
2023-04-23 13:33:47 +02:00
class CArtifactsOfHeroMain;
class MoraleLuckBox;
class CToggleButton;
class CToggleGroup;
class CGStatusBar;
class CTextBox;
2023-07-07 00:08:29 +02:00
class CGarrisonInt;
/// Button which switches hero selection
class CHeroSwitcher : public CIntObject
{
const CGHeroInstance * hero;
std::shared_ptr<CAnimImage> image;
CHeroWindow * owner;
public:
void clickPressed(const Point & cursorPosition) override;
CHeroSwitcher(CHeroWindow * owner_, Point pos_, const CGHeroInstance * hero_);
};
2023-07-07 00:08:29 +02:00
class CHeroWindow : public CStatusbarWindow, public IGarrisonHolder, public CWindowWithArtifacts
{
std::shared_ptr<CLabel> name;
std::shared_ptr<CLabel> title;
std::shared_ptr<CAnimImage> banner;
std::vector<std::shared_ptr<CHeroSwitcher>> heroList;
std::shared_ptr<CPicture> listSelection;
std::shared_ptr<LRClickableAreaWText> portraitArea;
std::shared_ptr<CAnimImage> portraitImage;
std::vector<std::shared_ptr<LRClickableAreaWTextComp>> primSkillAreas;
std::vector<std::shared_ptr<CAnimImage>> primSkillImages;
std::vector<std::shared_ptr<CLabel>> primSkillValues;
std::shared_ptr<CLabel> expValue;
std::shared_ptr<LRClickableAreaWText> expArea;
std::shared_ptr<CLabel> manaValue;
std::shared_ptr<LRClickableAreaWText> spellPointsArea;
std::shared_ptr<LRClickableAreaWText> specArea;
std::shared_ptr<CAnimImage> specImage;
std::shared_ptr<CLabel> specName;
std::shared_ptr<MoraleLuckBox> morale;
std::shared_ptr<MoraleLuckBox> luck;
std::vector<std::shared_ptr<LRClickableAreaWTextComp>> secSkillAreas;
std::vector<std::shared_ptr<CAnimImage>> secSkillImages;
std::vector<std::shared_ptr<CLabel>> secSkillNames;
std::vector<std::shared_ptr<CLabel>> secSkillValues;
std::shared_ptr<CButton> quitButton;
std::shared_ptr<CTextBox> dismissLabel;
std::shared_ptr<CButton> dismissButton;
std::shared_ptr<CTextBox> questlogLabel;
std::shared_ptr<CButton> questlogButton;
std::shared_ptr<CButton> commanderButton;
2023-07-06 21:14:12 +02:00
std::shared_ptr<CButton> backpackButton;
std::shared_ptr<CToggleButton> tacticsButton;
std::shared_ptr<CToggleGroup> formations;
std::shared_ptr<CGarrisonInt> garr;
2023-04-23 13:33:47 +02:00
std::shared_ptr<CArtifactsOfHeroMain> arts;
2016-10-16 02:52:11 +02:00
std::vector<std::shared_ptr<CLabel>> 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;
2023-07-06 21:14:12 +02:00
void createBackpackWindow();
//friends
friend void CHeroArtPlace::clickPressed(const Point & cursorPosition);
friend class CPlayerInterface;
};