2009-04-04 22:26:41 +03:00
|
|
|
#ifndef __CHEROWINDOW_H__
|
|
|
|
#define __CHEROWINDOW_H__
|
|
|
|
|
|
|
|
|
|
|
|
#include "CPlayerInterface.h"
|
|
|
|
|
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
|
|
|
|
2010-07-13 08:25:40 +03:00
|
|
|
class CHeroSwitcher : public CIntObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
int id;
|
|
|
|
CHeroWindow * owner;
|
|
|
|
virtual void clickLeft(tribool down, bool previousState);
|
2009-04-04 22:26:41 +03:00
|
|
|
|
2010-07-13 08:25:40 +03:00
|
|
|
CHeroSwitcher();
|
|
|
|
};
|
2009-04-04 22:26:41 +03:00
|
|
|
|
2009-08-11 19:05:33 +03:00
|
|
|
class CHeroWindow: public CWindowWithGarrison
|
2009-04-04 22:26:41 +03:00
|
|
|
{
|
|
|
|
SDL_Surface * background, * curBack;
|
|
|
|
CStatusBar * ourBar; //heroWindow's statusBar
|
|
|
|
|
|
|
|
//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
|
|
|
|
2009-06-18 18:05:00 +03:00
|
|
|
CArtifactsOfHero * artifs;
|
|
|
|
|
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;
|
|
|
|
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
|
|
|
|
|
2009-04-04 22:26:41 +03:00
|
|
|
CHighlightableButton *gar2button; //garrison / formation handling;
|
|
|
|
CHighlightableButtonsGroup *formations;
|
|
|
|
int player;
|
|
|
|
CHeroWindow(int playerColor); //c-tor
|
|
|
|
~CHeroWindow(); //d-tor
|
2009-06-19 15:10:36 +03:00
|
|
|
void setHero(const CGHeroInstance * hero); //sets main displayed hero
|
2009-04-04 22:26:41 +03:00
|
|
|
void activate(); //activates hero window;
|
|
|
|
void deactivate(); //activates hero window;
|
2009-04-14 15:47:09 +03:00
|
|
|
virtual void show(SDL_Surface * to); //shows hero window
|
2009-08-17 11:50:31 +03:00
|
|
|
void showAll(SDL_Surface * to){show(to);};
|
2009-04-04 22:26:41 +03:00
|
|
|
void redrawCurBack(); //redraws curBAck from scratch
|
2009-06-10 23:48:55 +03:00
|
|
|
void dispose(); //free resources not needed after closing windows and reset state
|
|
|
|
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
|
2009-04-04 22:26:41 +03:00
|
|
|
void switchHero(); //changes displayed hero
|
2010-02-26 13:18:09 +02:00
|
|
|
void setPlayer(int Player);
|
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__
|