2011-03-03 20:25:48 +02:00
|
|
|
#include "../global.h"
|
|
|
|
#include "GUIBase.h"
|
|
|
|
#include "GUIClasses.h"
|
|
|
|
#include "../lib/HeroBonus.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* CCreatureWindow.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
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
class Bonus;
|
|
|
|
class CCreature;
|
|
|
|
class CStackInstance;
|
|
|
|
class CStack;
|
|
|
|
class AdventureMapButton;
|
2011-04-09 22:34:48 +03:00
|
|
|
class CBonusItem;
|
2011-03-03 20:25:48 +02:00
|
|
|
|
|
|
|
class CCreatureWindow : public CIntObject
|
|
|
|
{
|
|
|
|
public:
|
2011-03-06 14:12:22 +02:00
|
|
|
enum CreWinType {OTHER = 0, BATTLE = 1, ARMY = 2, HERO = 3}; //only last one should open permanently
|
2011-03-03 20:25:48 +02:00
|
|
|
//bool active; //TODO: comment me
|
|
|
|
int type;//0 - rclick popup; 1 - normal window
|
2011-04-09 22:34:48 +03:00
|
|
|
int bonusRows; //height of skill window
|
2011-03-03 20:25:48 +02:00
|
|
|
|
2011-04-09 22:34:48 +03:00
|
|
|
std::string count; //creature count in text format
|
2011-03-03 20:25:48 +02:00
|
|
|
const CCreature *c; //related creature
|
2011-04-09 22:34:48 +03:00
|
|
|
const CStackInstance *stack;
|
|
|
|
const CBonusSystemNode *stackNode;
|
|
|
|
const CGHeroInstance *heroOwner;
|
2011-03-03 20:25:48 +02:00
|
|
|
std::vector<SComponent*> upgResCost; //cost of upgrade (if not possible then empty)
|
2011-04-09 22:34:48 +03:00
|
|
|
std::vector<CBonusItem*> bonusItems;
|
2011-03-03 20:25:48 +02:00
|
|
|
|
2011-04-09 22:34:48 +03:00
|
|
|
CPicture *bitmap; //background
|
|
|
|
CCreaturePic *anim; //related creature's animation
|
2011-03-03 20:25:48 +02:00
|
|
|
MoraleLuckBox *luck, *morale;
|
|
|
|
LRClickableAreaWText * expArea; //displays exp details
|
|
|
|
CArtPlace *creatureArtifact;
|
|
|
|
CSlider * slider; //Abilities
|
|
|
|
AdventureMapButton *dismiss, *upgrade, *ok;
|
2011-03-06 14:12:22 +02:00
|
|
|
AdventureMapButton * leftArtRoll, * rightArtRoll; //artifact selection
|
2011-03-03 20:25:48 +02:00
|
|
|
//TODO: Arifact drop
|
|
|
|
|
2011-04-09 22:34:48 +03:00
|
|
|
boost::function<void()> dsm; //dismiss button callback
|
|
|
|
boost::function<void()> Upg; //upgrade button callback
|
|
|
|
|
2011-03-03 20:25:48 +02:00
|
|
|
CCreatureWindow(const CStack & stack, int type); //battle c-tor
|
|
|
|
CCreatureWindow (const CStackInstance &stack, int Type); //pop-up c-tor
|
|
|
|
CCreatureWindow(const CStackInstance &st, int Type, boost::function<void()> Upg, boost::function<void()> Dsm, UpgradeInfo *ui); //full garrison window
|
2011-03-06 14:12:22 +02:00
|
|
|
CCreatureWindow(int Cid, int Type, int creatureCount); //c-tor
|
2011-03-03 20:25:48 +02:00
|
|
|
void init(const CStackInstance *stack, const CBonusSystemNode *stackNode, const CGHeroInstance *heroOwner);
|
2011-04-09 22:34:48 +03:00
|
|
|
void showAll(SDL_Surface * to);
|
2011-03-03 20:25:48 +02:00
|
|
|
void printLine(int nr, const std::string &text, int baseVal, int val=-1, bool range=false);
|
2011-04-09 22:34:48 +03:00
|
|
|
void recreateSkillList(int pos);
|
2011-03-06 14:12:22 +02:00
|
|
|
~CCreatureWindow(); //d-tor
|
2011-03-03 20:25:48 +02:00
|
|
|
//void activate();
|
2011-04-09 22:34:48 +03:00
|
|
|
//void deactivate();
|
2011-03-03 20:25:48 +02:00
|
|
|
void close();
|
2011-03-06 14:12:22 +02:00
|
|
|
void clickRight(tribool down, bool previousState); //call-in
|
2011-04-09 22:34:48 +03:00
|
|
|
void sliderMoved(int newpos);
|
2011-03-03 20:25:48 +02:00
|
|
|
//void keyPressed (const SDL_KeyboardEvent & key); //call-in
|
|
|
|
void scrollArt(int dir);
|
|
|
|
};
|
|
|
|
|
2011-04-09 22:34:48 +03:00
|
|
|
class CBonusItem : public LRClickableAreaWTextComp //responsible for displaying creature skill, active or not
|
2011-03-03 20:25:48 +02:00
|
|
|
{
|
2011-04-09 22:34:48 +03:00
|
|
|
public:
|
|
|
|
std::string name, description;
|
|
|
|
CPicture * bonusGraphics;
|
|
|
|
bool visible;
|
|
|
|
|
|
|
|
CBonusItem();
|
|
|
|
CBonusItem(const Rect &Pos, const std::string &Name, const std::string &Description, const std::string &graphicsName);
|
|
|
|
~CBonusItem();
|
|
|
|
|
|
|
|
void setBonus (const Bonus &bonus);
|
|
|
|
void showAll (SDL_Surface * to);
|
2011-03-03 20:25:48 +02:00
|
|
|
};
|