CCreatureWindow.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #include "../global.h"
  2. #include "GUIBase.h"
  3. #include "GUIClasses.h"
  4. #include "../lib/HeroBonus.h"
  5. /*
  6. * CCreatureWindow.h, part of VCMI engine
  7. *
  8. * Authors: listed in file AUTHORS in main folder
  9. *
  10. * License: GNU General Public License v2.0 or later
  11. * Full text of license available in license.txt file, in main folder
  12. *
  13. */
  14. class Bonus;
  15. class CCreature;
  16. class CStackInstance;
  17. class CStack;
  18. class AdventureMapButton;
  19. class CCreatureWindow : public CIntObject
  20. {
  21. public:
  22. enum CreWinType {OTHER = 0, BATTLE = 1, ARMY = 2, HERO = 3}; //only last one should open permanently
  23. //bool active; //TODO: comment me
  24. int type;//0 - rclick popup; 1 - normal window
  25. CPicture *bitmap; //background
  26. std::string count; //creature count in text format
  27. boost::function<void()> dsm; //dismiss button callback
  28. boost::function<void()> Upg; //upgrade button callback
  29. CCreaturePic *anim; //related creature's animation
  30. const CCreature *c; //related creature
  31. std::vector<SComponent*> upgResCost; //cost of upgrade (if not possible then empty)
  32. std::vector<CPicture*> bonusGraphics;
  33. MoraleLuckBox *luck, *morale;
  34. LRClickableAreaWText * expArea; //displays exp details
  35. CArtPlace *creatureArtifact;
  36. CSlider * slider; //Abilities
  37. AdventureMapButton *dismiss, *upgrade, *ok;
  38. AdventureMapButton * leftArtRoll, * rightArtRoll; //artifact selection
  39. //TODO: Arifact drop
  40. CCreatureWindow(const CStack & stack, int type); //battle c-tor
  41. CCreatureWindow (const CStackInstance &stack, int Type); //pop-up c-tor
  42. CCreatureWindow(const CStackInstance &st, int Type, boost::function<void()> Upg, boost::function<void()> Dsm, UpgradeInfo *ui); //full garrison window
  43. CCreatureWindow(int Cid, int Type, int creatureCount); //c-tor
  44. void init(const CStackInstance *stack, const CBonusSystemNode *stackNode, const CGHeroInstance *heroOwner);
  45. void printLine(int nr, const std::string &text, int baseVal, int val=-1, bool range=false);
  46. ~CCreatureWindow(); //d-tor
  47. //void activate();
  48. void close();
  49. void clickRight(tribool down, bool previousState); //call-in
  50. //void keyPressed (const SDL_KeyboardEvent & key); //call-in
  51. void scrollArt(int dir);
  52. };
  53. class CBonusItem : LRClickableAreaWTextComp //responsible for displaying creature skill, active or not
  54. {
  55. const Bonus * bonus;
  56. };