CHeroWindow.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. LRClickableAreaWTextComp * luck;
  39. LRClickableAreaWTextComp * morale;
  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. //friends
  61. friend void CArtPlace::clickLeft(tribool down, bool previousState);
  62. friend class CPlayerInterface;
  63. };
  64. #endif // __CHEROWINDOW_H__