2009-04-04 22:26:41 +03:00
|
|
|
#ifndef __CHEROWINDOW_H__
|
|
|
|
#define __CHEROWINDOW_H__
|
2011-05-10 01:20:47 +03:00
|
|
|
#include "..\lib\HeroBonus.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
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2009-04-04 22:26:41 +03:00
|
|
|
class AdventureMapButton;
|
|
|
|
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
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
int id;
|
2010-12-17 00:32:53 +02:00
|
|
|
|
|
|
|
CHeroWindow * getOwner();
|
2010-07-13 08:25:40 +03:00
|
|
|
virtual void clickLeft(tribool down, bool previousState);
|
2009-04-04 22:26:41 +03:00
|
|
|
|
2010-12-17 00:32:53 +02:00
|
|
|
CHeroSwitcher(int serial);
|
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);
|
|
|
|
void getAllBonuses(BonusList &out, const CSelector &selector, const CSelector &limit, const CBonusSystemNode *root = NULL) const OVERRIDE;
|
|
|
|
};
|
2010-12-17 00:32:53 +02:00
|
|
|
|
2011-01-06 22:00:19 +02:00
|
|
|
class CHeroWindow: public CWindowWithGarrison, public CWindowWithArtifacts
|
2009-04-04 22:26:41 +03:00
|
|
|
{
|
2010-12-17 00:32:53 +02:00
|
|
|
enum ELabel {};
|
|
|
|
std::map<ELabel, CLabel*> labels;
|
2010-12-17 20:47:07 +02:00
|
|
|
CPicture *background;
|
2010-12-17 00:32:53 +02:00
|
|
|
CGStatusBar * ourBar; //heroWindow's statusBar
|
2009-04-04 22:26:41 +03:00
|
|
|
|
|
|
|
//general graphics
|
2009-06-17 19:46:16 +03:00
|
|
|
CDefEssential *flags;
|
2009-04-04 22:26:41 +03:00
|
|
|
|
|
|
|
//buttons
|
2009-09-09 09:04:42 +03:00
|
|
|
//AdventureMapButton * gar4button; //splitting
|
2010-07-13 08:25:40 +03:00
|
|
|
std::vector<CHeroSwitcher *> heroListMi; //new better list of heroes
|
2009-04-04 22:26:41 +03:00
|
|
|
|
|
|
|
//clickable areas
|
|
|
|
LRClickableAreaWText * portraitArea;
|
|
|
|
std::vector<LRClickableAreaWTextComp *> primSkillAreas;
|
|
|
|
LRClickableAreaWText * expArea;
|
|
|
|
LRClickableAreaWText * spellPointsArea;
|
2010-02-01 01:22:25 +02:00
|
|
|
LRClickableAreaWText * specArea;//speciality
|
2010-02-07 17:06:14 +02:00
|
|
|
MoraleLuckBox * morale, * luck;
|
2009-04-04 22:26:41 +03:00
|
|
|
std::vector<LRClickableAreaWTextComp *> secSkillAreas;
|
2011-02-27 21:58:14 +02:00
|
|
|
CHeroWithMaybePickedArtifact heroWArt;
|
|
|
|
|
2009-04-04 22:26:41 +03:00
|
|
|
public:
|
2009-04-14 15:47:09 +03:00
|
|
|
const CGHeroInstance * curHero;
|
2009-06-19 15:10:36 +03:00
|
|
|
AdventureMapButton * quitButton, * dismissButton, * questlogButton; //general
|
|
|
|
|
2010-12-17 00:32:53 +02:00
|
|
|
CHighlightableButton *tacticsButton; //garrison / formation handling;
|
2009-04-04 22:26:41 +03:00
|
|
|
CHighlightableButtonsGroup *formations;
|
|
|
|
int player;
|
2010-12-17 00:32:53 +02:00
|
|
|
CHeroWindow(const CGHeroInstance *hero); //c-tor
|
2009-04-04 22:26:41 +03:00
|
|
|
~CHeroWindow(); //d-tor
|
2011-01-06 22:00:19 +02:00
|
|
|
|
|
|
|
void update(const CGHeroInstance * hero, bool redrawNeeded = false); //sets main displayed hero
|
2010-12-17 00:32:53 +02:00
|
|
|
void showAll(SDL_Surface * to); //shows and activates adv. map interface
|
|
|
|
// void redrawCurBack(); //redraws curBAck from scratch
|
|
|
|
void quit(); //stops displaying hero window and disposes
|
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
|
2010-12-17 00:32:53 +02: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;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __CHEROWINDOW_H__
|