2008-01-10 21:01:25 +02:00
|
|
|
#pragma once
|
|
|
|
#include "CPlayerInterface.h"
|
2008-01-19 15:19:58 +02:00
|
|
|
#include "CAdvmapInterface.h"
|
2008-01-10 21:01:25 +02:00
|
|
|
|
2008-01-11 20:56:39 +02:00
|
|
|
template <typename T> class AdventureMapButton;
|
2008-01-19 15:19:58 +02:00
|
|
|
struct SDL_Surface;
|
2008-01-10 21:01:25 +02:00
|
|
|
class CGHeroInstance;
|
2008-01-12 14:55:45 +02:00
|
|
|
class CDefHandler;
|
2008-01-19 15:19:58 +02:00
|
|
|
class CArtifact;
|
2008-01-25 21:09:41 +02:00
|
|
|
class CHeroWindow;
|
2008-01-19 15:19:58 +02:00
|
|
|
|
2008-01-19 20:58:24 +02:00
|
|
|
class LClickableArea: public ClickableL
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void clickLeft (tribool down);
|
|
|
|
virtual void activate();
|
|
|
|
virtual void deactivate();
|
|
|
|
};
|
|
|
|
|
2008-01-27 18:07:27 +02:00
|
|
|
class RClickableArea: public ClickableR
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void clickRight (tribool down);
|
|
|
|
virtual void activate();
|
|
|
|
virtual void deactivate();
|
|
|
|
};
|
|
|
|
|
2008-01-25 21:09:41 +02:00
|
|
|
class LClickableAreaHero : public LClickableArea
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
int id;
|
|
|
|
CHeroWindow * owner;
|
|
|
|
virtual void clickLeft (tribool down);
|
|
|
|
};
|
|
|
|
|
2008-01-28 14:28:18 +02:00
|
|
|
class LRClickableAreaWText: public LClickableArea, public RClickableArea
|
2008-01-27 18:07:27 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
std::string text;
|
|
|
|
virtual void activate();
|
|
|
|
virtual void deactivate();
|
|
|
|
virtual void clickLeft (tribool down);
|
|
|
|
virtual void clickRight (tribool down);
|
|
|
|
};
|
|
|
|
|
2008-01-28 14:28:18 +02:00
|
|
|
class LRClickableAreaWTextComp: public LClickableArea, public RClickableArea
|
2008-01-20 15:53:11 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
std::string text;
|
2008-01-28 14:28:18 +02:00
|
|
|
int baseType;
|
2008-01-27 18:07:27 +02:00
|
|
|
int bonus, type;
|
|
|
|
virtual void activate();
|
|
|
|
virtual void deactivate();
|
2008-01-20 15:53:11 +02:00
|
|
|
virtual void clickLeft (tribool down);
|
2008-01-27 18:07:27 +02:00
|
|
|
virtual void clickRight (tribool down);
|
2008-01-20 15:53:11 +02:00
|
|
|
};
|
|
|
|
|
2008-01-29 15:55:14 +02:00
|
|
|
class CArtPlace: public ClickableL, public IShowable, public LRClickableAreaWTextComp
|
2008-01-19 15:19:58 +02:00
|
|
|
{
|
2008-01-20 17:26:34 +02:00
|
|
|
private:
|
|
|
|
bool active;
|
2008-01-19 15:19:58 +02:00
|
|
|
public:
|
|
|
|
const CArtifact * ourArt;
|
|
|
|
CArtPlace(CArtifact * art);
|
|
|
|
void clickLeft (tribool down);
|
2008-01-29 15:55:14 +02:00
|
|
|
void clickRight (tribool down);
|
2008-01-19 15:19:58 +02:00
|
|
|
void activate();
|
|
|
|
void deactivate();
|
|
|
|
void show(SDL_Surface * to = NULL);
|
2008-01-20 15:53:11 +02:00
|
|
|
~CArtPlace();
|
2008-01-19 15:19:58 +02:00
|
|
|
};
|
2008-01-10 21:01:25 +02:00
|
|
|
|
2008-01-20 14:34:39 +02:00
|
|
|
class CHeroWindow: public IActivable, public IShowable, public virtual CIntObject
|
2008-01-10 21:01:25 +02:00
|
|
|
{
|
2008-01-12 14:55:45 +02:00
|
|
|
SDL_Surface * background, * curBack;
|
2008-01-10 21:01:25 +02:00
|
|
|
const CGHeroInstance * curHero;
|
2008-01-11 20:56:39 +02:00
|
|
|
|
2008-01-12 14:55:45 +02:00
|
|
|
//general graphics
|
2008-01-13 18:24:24 +02:00
|
|
|
CDefHandler * skillpics, *flags;
|
2008-01-12 14:55:45 +02:00
|
|
|
|
2008-01-11 20:56:39 +02:00
|
|
|
//buttons
|
2008-01-13 18:24:24 +02:00
|
|
|
AdventureMapButton<CHeroWindow> * quitButton, * dismissButton, * questlogButton, //general
|
2008-01-13 21:42:21 +02:00
|
|
|
* gar1button, * gar2button, * gar3button, * gar4button, //garrison / formation handling
|
|
|
|
* leftArtRoll, * rightArtRoll;
|
2008-01-25 21:09:41 +02:00
|
|
|
//std::vector< AdventureMapButton<CHeroWindow> * > heroList; //list of heroes
|
|
|
|
std::vector<LClickableAreaHero *> heroListMi; //new better list of heroes
|
2008-01-19 15:19:58 +02:00
|
|
|
|
|
|
|
//artifact places
|
|
|
|
CArtPlace * artHead, * artLRing, * artRRing, * artLHand, * artRhand,
|
|
|
|
* artFeet, * artSpellBook, * artMach1, * artMach2, * artMach3,
|
|
|
|
* artMach4, * artMisc1, * artMisc2, * artMisc3, * artMisc4,
|
|
|
|
* artMisc5, * artTorso, * artNeck, * artShoulders; //heroes' artifacts
|
2008-01-19 20:58:24 +02:00
|
|
|
std::vector<CArtPlace *> backpack; //hero's visible backpack (only 5 elements!)
|
|
|
|
int backpackPos; //unmber of first art visible in backpack (in hero's vector)
|
|
|
|
//clickable areas
|
2008-01-27 18:07:27 +02:00
|
|
|
LRClickableAreaWText * portraitArea;
|
|
|
|
std::vector<LRClickableAreaWTextComp *> primSkillAreas;
|
|
|
|
LRClickableAreaWText * expArea;
|
2008-01-29 15:55:14 +02:00
|
|
|
LRClickableAreaWText * spellPointsArea;
|
2008-01-28 14:28:18 +02:00
|
|
|
std::vector<LRClickableAreaWTextComp *> secSkillAreas;
|
2008-01-10 21:01:25 +02:00
|
|
|
public:
|
2008-01-25 21:09:41 +02:00
|
|
|
int player;
|
2008-01-11 20:56:39 +02:00
|
|
|
CHeroWindow(int playerColor); //c-tor
|
2008-01-10 21:01:25 +02:00
|
|
|
~CHeroWindow(); //d-tor
|
|
|
|
void setHero(const CGHeroInstance * hero); //sets main displayed hero
|
2008-01-11 20:56:39 +02:00
|
|
|
void activate(); //activates hero window;
|
2008-01-20 14:34:39 +02:00
|
|
|
void deactivate(); //activates hero window;
|
2008-01-10 21:01:25 +02:00
|
|
|
virtual void show(SDL_Surface * to = NULL); //shows hero window
|
2008-01-15 20:50:52 +02:00
|
|
|
void redrawCurBack(); //redraws curBAck from scratch
|
2008-01-11 20:56:39 +02:00
|
|
|
void quit(); //stops displaying hero window
|
2008-01-12 14:55:45 +02:00
|
|
|
void dismissCurrent(); //dissmissed currently displayed hero (curHero) //TODO: make it working
|
2008-01-13 21:42:21 +02:00
|
|
|
void questlog(); //show quest log in hero window
|
2008-01-13 18:24:24 +02:00
|
|
|
void gar1(); //garrison / formation handling
|
|
|
|
void gar2(); //garrison / formation handling
|
|
|
|
void gar3(); //garrison / formation handling
|
|
|
|
void gar4(); //garrison / formation handling
|
2008-01-13 21:42:21 +02:00
|
|
|
void leftArtRoller(); //scrolls artifacts in bag left
|
|
|
|
void rightArtRoller(); //scrolls artifacts in bag right
|
|
|
|
void switchHero(); //changes displayed hero
|
2008-01-19 15:19:58 +02:00
|
|
|
};
|