CHeroWindow.h 2.4 KB

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