CHeroWindow.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. * CHeroWindow.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "CWindowWithArtifacts.h"
  12. #include "../../lib/bonuses/IBonusBearer.h"
  13. #include <vcmi/FactionMember.h>
  14. VCMI_LIB_NAMESPACE_BEGIN
  15. class CGHeroInstance;
  16. VCMI_LIB_NAMESPACE_END
  17. class CButton;
  18. class CHeroWindow;
  19. class LClickableAreaHero;
  20. class LRClickableAreaWText;
  21. class LRClickableAreaWTextComp;
  22. class CArtifactsOfHeroMain;
  23. class MoraleLuckBox;
  24. class CToggleButton;
  25. class CToggleGroup;
  26. class CGStatusBar;
  27. class CTextBox;
  28. class CGarrisonInt;
  29. /// Button which switches hero selection
  30. class CHeroSwitcher : public CIntObject
  31. {
  32. const CGHeroInstance * hero;
  33. std::shared_ptr<CAnimImage> image;
  34. CHeroWindow * owner;
  35. public:
  36. void clickPressed(const Point & cursorPosition) override;
  37. CHeroSwitcher(CHeroWindow * owner_, Point pos_, const CGHeroInstance * hero_);
  38. };
  39. class CHeroWindow : public CStatusbarWindow, public IGarrisonHolder, public CWindowWithArtifacts
  40. {
  41. std::shared_ptr<CLabel> name;
  42. std::shared_ptr<CLabel> title;
  43. std::shared_ptr<CAnimImage> banner;
  44. std::vector<std::shared_ptr<CHeroSwitcher>> heroList;
  45. std::shared_ptr<CPicture> listSelection;
  46. std::shared_ptr<LRClickableAreaWText> portraitArea;
  47. std::shared_ptr<CAnimImage> portraitImage;
  48. std::vector<std::shared_ptr<LRClickableAreaWTextComp>> primSkillAreas;
  49. std::vector<std::shared_ptr<CAnimImage>> primSkillImages;
  50. std::vector<std::shared_ptr<CLabel>> primSkillValues;
  51. std::shared_ptr<CLabel> expValue;
  52. std::shared_ptr<LRClickableAreaWText> expArea;
  53. std::shared_ptr<CLabel> manaValue;
  54. std::shared_ptr<LRClickableAreaWText> spellPointsArea;
  55. std::shared_ptr<LRClickableAreaWText> specArea;
  56. std::shared_ptr<CAnimImage> specImage;
  57. std::shared_ptr<CLabel> specName;
  58. std::shared_ptr<MoraleLuckBox> morale;
  59. std::shared_ptr<MoraleLuckBox> luck;
  60. std::vector< std::shared_ptr<CSecSkillPlace>> secSkills;
  61. std::vector<std::shared_ptr<CLabel>> secSkillNames;
  62. std::vector<std::shared_ptr<CLabel>> secSkillValues;
  63. std::shared_ptr<CButton> quitButton;
  64. std::shared_ptr<CTextBox> dismissLabel;
  65. std::shared_ptr<CButton> dismissButton;
  66. std::shared_ptr<CTextBox> questlogLabel;
  67. std::shared_ptr<CButton> questlogButton;
  68. std::shared_ptr<CButton> commanderButton;
  69. std::shared_ptr<CButton> backpackButton;
  70. std::shared_ptr<CToggleButton> tacticsButton;
  71. std::shared_ptr<CToggleGroup> formations;
  72. std::shared_ptr<CGarrisonInt> garr;
  73. std::shared_ptr<CArtifactsOfHeroMain> arts;
  74. std::vector<std::shared_ptr<CLabel>> labels;
  75. public:
  76. const CGHeroInstance * curHero;
  77. CHeroWindow(const CGHeroInstance * hero);
  78. void update() override;
  79. void dismissCurrent(); //dismissed currently displayed hero (curHero)
  80. void commanderWindow();
  81. void switchHero(); //changes displayed hero
  82. void updateGarrisons() override;
  83. bool holdsGarrison(const CArmedInstance * army) override;
  84. void createBackpackWindow();
  85. //friends
  86. friend class CPlayerInterface;
  87. };