CHeroWindow.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 CHeroWindow: public CWindowWithGarrison
  24. {
  25. SDL_Surface * background, * curBack;
  26. CStatusBar * ourBar; //heroWindow's statusBar
  27. //general graphics
  28. CDefEssential *flags;
  29. //buttons
  30. //AdventureMapButton * gar4button; //splitting
  31. std::vector<LClickableAreaHero *> heroListMi; //new better list of heroes
  32. CArtifactsOfHero * artifs;
  33. //clickable areas
  34. LRClickableAreaWText * portraitArea;
  35. std::vector<LRClickableAreaWTextComp *> primSkillAreas;
  36. LRClickableAreaWText * expArea;
  37. LRClickableAreaWText * spellPointsArea;
  38. LRClickableAreaWText * specArea;//speciality
  39. MoraleLuckBox * morale, * luck;
  40. std::vector<LRClickableAreaWTextComp *> secSkillAreas;
  41. public:
  42. const CGHeroInstance * curHero;
  43. AdventureMapButton * quitButton, * dismissButton, * questlogButton; //general
  44. CHighlightableButton *gar2button; //garrison / formation handling;
  45. CHighlightableButtonsGroup *formations;
  46. int player;
  47. CHeroWindow(int playerColor); //c-tor
  48. ~CHeroWindow(); //d-tor
  49. void setHero(const CGHeroInstance * hero); //sets main displayed hero
  50. void activate(); //activates hero window;
  51. void deactivate(); //activates hero window;
  52. virtual void show(SDL_Surface * to); //shows hero window
  53. void showAll(SDL_Surface * to){show(to);};
  54. void redrawCurBack(); //redraws curBAck from scratch
  55. void dispose(); //free resources not needed after closing windows and reset state
  56. void quit(); //stops displaying hero window and disposes
  57. void dismissCurrent(); //dissmissed currently displayed hero (curHero)
  58. void questlog(); //show quest log in hero window
  59. void switchHero(); //changes displayed hero
  60. void setPlayer(int Player);
  61. //friends
  62. friend void CArtPlace::clickLeft(tribool down, bool previousState);
  63. friend class CPlayerInterface;
  64. };
  65. #endif // __CHEROWINDOW_H__