2011-12-14 00:23:17 +03:00
|
|
|
#pragma once
|
|
|
|
|
2011-05-10 04:15:10 +03:00
|
|
|
#include "../lib/HeroBonus.h"
|
2012-06-15 20:08:19 +03:00
|
|
|
#include "UIFramework/CIntObjectClasses.h"
|
|
|
|
#include "GUIClasses.h"
|
2009-04-04 22:26:41 +03:00
|
|
|
|
2011-02-06 19:26:27 +02:00
|
|
|
//#include "CPlayerInterface.h"
|
2009-04-04 22:26:41 +03:00
|
|
|
|
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
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2011-12-22 16:05:19 +03:00
|
|
|
class CAdventureMapButton;
|
2009-04-04 22:26:41 +03:00
|
|
|
struct SDL_Surface;
|
|
|
|
class CGHeroInstance;
|
|
|
|
class CDefHandler;
|
|
|
|
class CArtifact;
|
|
|
|
class CHeroWindow;
|
2009-06-18 18:05:00 +03:00
|
|
|
class LClickableAreaHero;
|
|
|
|
class LRClickableAreaWText;
|
|
|
|
class LRClickableAreaWTextComp;
|
|
|
|
class CArtifactsOfHero;
|
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;
|
|
|
|
CAnimImage *image;
|
2010-07-13 08:25:40 +03:00
|
|
|
public:
|
|
|
|
virtual void clickLeft(tribool down, bool previousState);
|
2009-04-04 22:26:41 +03:00
|
|
|
|
2012-05-13 18:04:21 +03:00
|
|
|
CHeroSwitcher(Point pos, const CGHeroInstance * hero);
|
2010-07-13 08:25:40 +03:00
|
|
|
};
|
2009-04-04 22:26:41 +03:00
|
|
|
|
2011-02-27 21:58:14 +02:00
|
|
|
//helper class for calculating values of hero bonuses without bonuses from picked up artifact
|
|
|
|
class CHeroWithMaybePickedArtifact : public IBonusBearer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
const CGHeroInstance *hero;
|
|
|
|
CWindowWithArtifacts *cww;
|
2010-12-17 00:32:53 +02:00
|
|
|
|
2011-02-27 21:58:14 +02:00
|
|
|
CHeroWithMaybePickedArtifact(CWindowWithArtifacts *Cww, const CGHeroInstance *Hero);
|
2011-09-06 16:59:26 +03:00
|
|
|
const TBonusListPtr getAllBonuses(const CSelector &selector, const CSelector &limit, const CBonusSystemNode *root = NULL, const std::string &cachingStr = "") const OVERRIDE;
|
2011-02-27 21:58:14 +02:00
|
|
|
};
|
2010-12-17 00:32:53 +02:00
|
|
|
|
2012-06-15 20:08:19 +03:00
|
|
|
class CHeroWindow: public CWindowObject, public CWindowWithGarrison, public CWindowWithArtifacts
|
2009-04-04 22:26:41 +03:00
|
|
|
{
|
2010-12-17 00:32:53 +02:00
|
|
|
CGStatusBar * ourBar; //heroWindow's statusBar
|
2009-04-04 22:26:41 +03:00
|
|
|
|
|
|
|
//buttons
|
2011-12-22 16:05:19 +03:00
|
|
|
//CAdventureMapButton * gar4button; //splitting
|
2012-05-13 18:04:21 +03:00
|
|
|
std::vector<CHeroSwitcher *> heroList; //list of heroes
|
|
|
|
CPicture * listSelection; //selection border
|
2009-04-04 22:26:41 +03:00
|
|
|
|
|
|
|
//clickable areas
|
|
|
|
LRClickableAreaWText * portraitArea;
|
2012-05-13 18:04:21 +03:00
|
|
|
CAnimImage * portraitImage;
|
|
|
|
|
2009-04-04 22:26:41 +03:00
|
|
|
std::vector<LRClickableAreaWTextComp *> primSkillAreas;
|
|
|
|
LRClickableAreaWText * expArea;
|
|
|
|
LRClickableAreaWText * spellPointsArea;
|
2013-01-17 21:15:00 +03:00
|
|
|
LRClickableAreaWText * specArea;//specialty
|
2012-05-13 18:04:21 +03:00
|
|
|
CAnimImage *specImage;
|
2010-02-07 17:06:14 +02:00
|
|
|
MoraleLuckBox * morale, * luck;
|
2009-04-04 22:26:41 +03:00
|
|
|
std::vector<LRClickableAreaWTextComp *> secSkillAreas;
|
2012-05-13 18:04:21 +03:00
|
|
|
std::vector<CAnimImage *> secSkillImages;
|
2011-02-27 21:58:14 +02:00
|
|
|
CHeroWithMaybePickedArtifact heroWArt;
|
|
|
|
|
2012-05-16 20:29:05 +03:00
|
|
|
CAdventureMapButton * quitButton, * dismissButton, * questlogButton, * commanderButton; //general
|
2009-06-19 15:10:36 +03:00
|
|
|
|
2010-12-17 00:32:53 +02:00
|
|
|
CHighlightableButton *tacticsButton; //garrison / formation handling;
|
2009-04-04 22:26:41 +03:00
|
|
|
CHighlightableButtonsGroup *formations;
|
2012-05-13 18:04:21 +03:00
|
|
|
|
|
|
|
public:
|
|
|
|
const CGHeroInstance * curHero;
|
|
|
|
|
2010-12-17 00:32:53 +02:00
|
|
|
CHeroWindow(const CGHeroInstance *hero); //c-tor
|
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
|
|
|
void showAll(SDL_Surface * to);
|
|
|
|
|
2009-04-04 22:26:41 +03:00
|
|
|
void dismissCurrent(); //dissmissed currently displayed hero (curHero)
|
2009-04-04 01:34:31 +03:00
|
|
|
void questlog(); //show quest log in hero window
|
2012-05-16 20:29:05 +03:00
|
|
|
void commanderWindow();
|
2012-05-13 18:04:21 +03:00
|
|
|
void switchHero(); //changes displayed hero
|
2009-04-04 22:26:41 +03:00
|
|
|
|
|
|
|
//friends
|
2009-08-11 19:05:33 +03:00
|
|
|
friend void CArtPlace::clickLeft(tribool down, bool previousState);
|
2009-04-04 22:26:41 +03:00
|
|
|
friend class CPlayerInterface;
|
|
|
|
};
|