CHeroWindow.h 2.4 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. /// Button which switches hero selection
  24. class CHeroSwitcher : public CIntObject
  25. {
  26. public:
  27. int id;
  28. CHeroWindow * getOwner();
  29. virtual void clickLeft(tribool down, bool previousState);
  30. CHeroSwitcher(int serial);
  31. };
  32. class CHeroWindow: public CWindowWithGarrison, public CWindowWithArtifacts
  33. {
  34. enum ELabel {};
  35. std::map<ELabel, CLabel*> labels;
  36. CPicture *background;
  37. CGStatusBar * ourBar; //heroWindow's statusBar
  38. //general graphics
  39. CDefEssential *flags;
  40. //buttons
  41. //AdventureMapButton * gar4button; //splitting
  42. std::vector<CHeroSwitcher *> heroListMi; //new better list of heroes
  43. //clickable areas
  44. LRClickableAreaWText * portraitArea;
  45. std::vector<LRClickableAreaWTextComp *> primSkillAreas;
  46. LRClickableAreaWText * expArea;
  47. LRClickableAreaWText * spellPointsArea;
  48. LRClickableAreaWText * specArea;//speciality
  49. MoraleLuckBox * morale, * luck;
  50. std::vector<LRClickableAreaWTextComp *> secSkillAreas;
  51. public:
  52. const CGHeroInstance * curHero;
  53. AdventureMapButton * quitButton, * dismissButton, * questlogButton; //general
  54. CHighlightableButton *tacticsButton; //garrison / formation handling;
  55. CHighlightableButtonsGroup *formations;
  56. int player;
  57. CHeroWindow(const CGHeroInstance *hero); //c-tor
  58. ~CHeroWindow(); //d-tor
  59. void update(const CGHeroInstance * hero, bool redrawNeeded = false); //sets main displayed hero
  60. void showAll(SDL_Surface * to); //shows and activates adv. map interface
  61. // void redrawCurBack(); //redraws curBAck from scratch
  62. void quit(); //stops displaying hero window and disposes
  63. void dismissCurrent(); //dissmissed currently displayed hero (curHero)
  64. void questlog(); //show quest log in hero window
  65. void switchHero(); //changes displayed hero
  66. //friends
  67. friend void CArtPlace::clickLeft(tribool down, bool previousState);
  68. friend class CPlayerInterface;
  69. };
  70. #endif // __CHEROWINDOW_H__