2009-04-15 17:03:31 +03:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
*
|
|
|
|
*/
|
2017-07-13 10:26:03 +02:00
|
|
|
#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>
|
2009-04-15 17:03:31 +03:00
|
|
|
|
2022-07-26 15:07:42 +02:00
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
class CGHeroInstance;
|
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_END
|
|
|
|
|
2014-08-03 14:16:19 +03:00
|
|
|
class CButton;
|
2009-04-04 22:26:41 +03:00
|
|
|
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;
|
2014-07-13 18:39:45 +03:00
|
|
|
class MoraleLuckBox;
|
2014-08-03 14:16:19 +03:00
|
|
|
class CToggleButton;
|
|
|
|
class CToggleGroup;
|
2014-07-15 10:14:49 +03:00
|
|
|
class CGStatusBar;
|
2018-04-07 13:34:11 +02:00
|
|
|
class CTextBox;
|
2023-07-07 00:08:29 +02:00
|
|
|
class CGarrisonInt;
|
2009-04-04 22:26:41 +03:00
|
|
|
|
2011-02-22 13:52:36 +02:00
|
|
|
/// Button which switches hero selection
|
2010-07-13 08:25:40 +03:00
|
|
|
class CHeroSwitcher : public CIntObject
|
|
|
|
{
|
2012-05-13 18:04:21 +03:00
|
|
|
const CGHeroInstance * hero;
|
2018-04-07 13:34:11 +02:00
|
|
|
std::shared_ptr<CAnimImage> image;
|
|
|
|
CHeroWindow * owner;
|
2010-07-13 08:25:40 +03:00
|
|
|
public:
|
2023-07-09 16:48:25 +02:00
|
|
|
void clickPressed(const Point & cursorPosition) override;
|
2009-04-04 22:26:41 +03:00
|
|
|
|
2018-04-07 13:34:11 +02:00
|
|
|
CHeroSwitcher(CHeroWindow * owner_, Point pos_, const CGHeroInstance * hero_);
|
2010-07-13 08:25:40 +03:00
|
|
|
};
|
2009-04-04 22:26:41 +03:00
|
|
|
|
2023-07-07 00:08:29 +02:00
|
|
|
class CHeroWindow : public CStatusbarWindow, public IGarrisonHolder, public CWindowWithArtifacts
|
2009-04-04 22:26:41 +03:00
|
|
|
{
|
2018-04-07 13:34:11 +02:00
|
|
|
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;
|
2018-04-07 13:34:11 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
2018-04-07 13:34:11 +02:00
|
|
|
std::vector<std::shared_ptr<CLabel>> labels;
|
2012-05-13 18:04:21 +03:00
|
|
|
|
|
|
|
public:
|
|
|
|
const CGHeroInstance * curHero;
|
|
|
|
|
2018-04-07 13:34:11 +02:00
|
|
|
CHeroWindow(const CGHeroInstance * hero);
|
2011-01-06 22:00:19 +02:00
|
|
|
|
|
|
|
void update(const CGHeroInstance * hero, bool redrawNeeded = false); //sets main displayed hero
|
2012-05-13 18:04:21 +03:00
|
|
|
|
2009-04-04 22:26:41 +03:00
|
|
|
void dismissCurrent(); //dissmissed currently displayed hero (curHero)
|
2012-05-16 20:29:05 +03:00
|
|
|
void commanderWindow();
|
2012-05-13 18:04:21 +03:00
|
|
|
void switchHero(); //changes displayed hero
|
2018-04-07 13:34:11 +02:00
|
|
|
void updateGarrisons() override;
|
2023-07-06 21:14:12 +02:00
|
|
|
void createBackpackWindow();
|
2009-04-04 22:26:41 +03:00
|
|
|
|
|
|
|
//friends
|
2023-07-08 13:33:04 +02:00
|
|
|
friend void CHeroArtPlace::clickPressed(const Point & cursorPosition);
|
2009-04-04 22:26:41 +03:00
|
|
|
friend class CPlayerInterface;
|
|
|
|
};
|