CHeroWindow.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #ifndef __CHEROWINDOW_H__
  2. #define __CHEROWINDOW_H__
  3. #include "CPlayerInterface.h"
  4. /*
  5. * CHeroWindow.h, part of VCMI engine
  6. *
  7. * Authors: listed in file AUTHORS in main folder
  8. *
  9. * License: GNU General Public License v2.0 or later
  10. * Full text of license available in license.txt file, in main folder
  11. *
  12. */
  13. class AdventureMapButton;
  14. struct SDL_Surface;
  15. class CGHeroInstance;
  16. class CDefHandler;
  17. class CArtifact;
  18. class CHeroWindow;
  19. class LClickableAreaHero;
  20. class LRClickableAreaWText;
  21. class LRClickableAreaWTextComp;
  22. class CArtifactsOfHero;
  23. class CHeroSwitcher : public CIntObject
  24. {
  25. public:
  26. int id;
  27. CHeroWindow * owner;
  28. virtual void clickLeft(tribool down, bool previousState);
  29. CHeroSwitcher();
  30. };
  31. class CHeroWindow: public CWindowWithGarrison
  32. {
  33. SDL_Surface * background, * curBack;
  34. CStatusBar * ourBar; //heroWindow's statusBar
  35. //general graphics
  36. CDefEssential *flags;
  37. //buttons
  38. //AdventureMapButton * gar4button; //splitting
  39. std::vector<CHeroSwitcher *> heroListMi; //new better list of heroes
  40. CArtifactsOfHero * artifs;
  41. //clickable areas
  42. LRClickableAreaWText * portraitArea;
  43. std::vector<LRClickableAreaWTextComp *> primSkillAreas;
  44. LRClickableAreaWText * expArea;
  45. LRClickableAreaWText * spellPointsArea;
  46. LRClickableAreaWText * specArea;//speciality
  47. MoraleLuckBox * morale, * luck;
  48. std::vector<LRClickableAreaWTextComp *> secSkillAreas;
  49. public:
  50. const CGHeroInstance * curHero;
  51. AdventureMapButton * quitButton, * dismissButton, * questlogButton; //general
  52. CHighlightableButton *gar2button; //garrison / formation handling;
  53. CHighlightableButtonsGroup *formations;
  54. int player;
  55. CHeroWindow(int playerColor); //c-tor
  56. ~CHeroWindow(); //d-tor
  57. void setHero(const CGHeroInstance * hero); //sets main displayed hero
  58. void activate(); //activates hero window;
  59. void deactivate(); //activates hero window;
  60. virtual void show(SDL_Surface * to); //shows hero window
  61. void showAll(SDL_Surface * to){show(to);};
  62. void redrawCurBack(); //redraws curBAck from scratch
  63. void dispose(); //free resources not needed after closing windows and reset state
  64. void quit(); //stops displaying hero window and disposes
  65. void dismissCurrent(); //dissmissed currently displayed hero (curHero)
  66. void questlog(); //show quest log in hero window
  67. void switchHero(); //changes displayed hero
  68. void setPlayer(int Player);
  69. //friends
  70. friend void CArtPlace::clickLeft(tribool down, bool previousState);
  71. friend class CPlayerInterface;
  72. };
  73. #endif // __CHEROWINDOW_H__