CHeroWindow.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #ifndef __CHEROWINDOW_H__
  2. #define __CHEROWINDOW_H__
  3. #include "../lib/HeroBonus.h"
  4. //#include "CPlayerInterface.h"
  5. /*
  6. * CHeroWindow.h, part of VCMI engine
  7. *
  8. * Authors: listed in file AUTHORS in main folder
  9. *
  10. * License: GNU General Public License v2.0 or later
  11. * Full text of license available in license.txt file, in main folder
  12. *
  13. */
  14. class AdventureMapButton;
  15. struct SDL_Surface;
  16. class CGHeroInstance;
  17. class CDefHandler;
  18. class CArtifact;
  19. class CHeroWindow;
  20. class LClickableAreaHero;
  21. class LRClickableAreaWText;
  22. class LRClickableAreaWTextComp;
  23. class CArtifactsOfHero;
  24. /// Button which switches hero selection
  25. class CHeroSwitcher : public CIntObject
  26. {
  27. public:
  28. int id;
  29. CHeroWindow * getOwner();
  30. virtual void clickLeft(tribool down, bool previousState);
  31. CHeroSwitcher(int serial);
  32. };
  33. //helper class for calculating values of hero bonuses without bonuses from picked up artifact
  34. class CHeroWithMaybePickedArtifact : public IBonusBearer
  35. {
  36. public:
  37. const CGHeroInstance *hero;
  38. CWindowWithArtifacts *cww;
  39. CHeroWithMaybePickedArtifact(CWindowWithArtifacts *Cww, const CGHeroInstance *Hero);
  40. const TBonusListPtr getAllBonuses(const CSelector &selector, const CSelector &limit, const CBonusSystemNode *root = NULL, const std::string &cachingStr = "") const OVERRIDE;
  41. };
  42. class CHeroWindow: public CWindowWithGarrison, public CWindowWithArtifacts
  43. {
  44. enum ELabel {};
  45. std::map<ELabel, CLabel*> labels;
  46. CPicture *background;
  47. CGStatusBar * ourBar; //heroWindow's statusBar
  48. //general graphics
  49. CDefEssential *flags;
  50. //buttons
  51. //AdventureMapButton * gar4button; //splitting
  52. std::vector<CHeroSwitcher *> heroListMi; //new better list of heroes
  53. //clickable areas
  54. LRClickableAreaWText * portraitArea;
  55. std::vector<LRClickableAreaWTextComp *> primSkillAreas;
  56. LRClickableAreaWText * expArea;
  57. LRClickableAreaWText * spellPointsArea;
  58. LRClickableAreaWText * specArea;//speciality
  59. MoraleLuckBox * morale, * luck;
  60. std::vector<LRClickableAreaWTextComp *> secSkillAreas;
  61. CHeroWithMaybePickedArtifact heroWArt;
  62. public:
  63. const CGHeroInstance * curHero;
  64. AdventureMapButton * quitButton, * dismissButton, * questlogButton; //general
  65. CHighlightableButton *tacticsButton; //garrison / formation handling;
  66. CHighlightableButtonsGroup *formations;
  67. int player;
  68. CHeroWindow(const CGHeroInstance *hero); //c-tor
  69. ~CHeroWindow(); //d-tor
  70. void update(const CGHeroInstance * hero, bool redrawNeeded = false); //sets main displayed hero
  71. void showAll(SDL_Surface * to); //shows and activates adv. map interface
  72. // void redrawCurBack(); //redraws curBAck from scratch
  73. void quit(); //stops displaying hero window and disposes
  74. void dismissCurrent(); //dissmissed currently displayed hero (curHero)
  75. void questlog(); //show quest log in hero window
  76. void switchHero(); //changes displayed hero
  77. //friends
  78. friend void CArtPlace::clickLeft(tribool down, bool previousState);
  79. friend class CPlayerInterface;
  80. };
  81. #endif // __CHEROWINDOW_H__