CHeroWindow.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. class CSlider;
  30. /// Button which switches hero selection
  31. class CHeroSwitcher : public CIntObject
  32. {
  33. const CGHeroInstance * hero;
  34. std::shared_ptr<CAnimImage> image;
  35. CHeroWindow * owner;
  36. public:
  37. void clickPressed(const Point & cursorPosition) override;
  38. CHeroSwitcher(CHeroWindow * owner_, Point pos_, const CGHeroInstance * hero_);
  39. };
  40. class CHeroWindow : public CStatusbarWindow, public IGarrisonHolder, public CWindowWithArtifacts
  41. {
  42. std::shared_ptr<CLabel> name;
  43. std::shared_ptr<CLabel> title;
  44. std::shared_ptr<CAnimImage> banner;
  45. std::vector<std::shared_ptr<CHeroSwitcher>> heroList;
  46. std::shared_ptr<CPicture> listSelection;
  47. std::shared_ptr<LRClickableAreaWText> portraitArea;
  48. std::shared_ptr<CAnimImage> portraitImage;
  49. std::vector<std::shared_ptr<LRClickableAreaWTextComp>> primSkillAreas;
  50. std::vector<std::shared_ptr<CAnimImage>> primSkillImages;
  51. std::vector<std::shared_ptr<CLabel>> primSkillValues;
  52. std::shared_ptr<CLabel> expValue;
  53. std::shared_ptr<LRClickableAreaWText> expArea;
  54. std::shared_ptr<CLabel> manaValue;
  55. std::shared_ptr<LRClickableAreaWText> spellPointsArea;
  56. std::shared_ptr<LRClickableAreaWText> specArea;
  57. std::shared_ptr<CAnimImage> specImage;
  58. std::shared_ptr<CLabel> specName;
  59. std::shared_ptr<MoraleLuckBox> morale;
  60. std::shared_ptr<MoraleLuckBox> luck;
  61. std::vector< std::shared_ptr<CSecSkillPlace>> secSkills;
  62. std::vector<std::shared_ptr<CLabel>> secSkillNames;
  63. std::vector<std::shared_ptr<CLabel>> secSkillValues;
  64. std::shared_ptr<CSlider> secSkillSlider;
  65. std::shared_ptr<CButton> quitButton;
  66. std::shared_ptr<CTextBox> dismissLabel;
  67. std::shared_ptr<CButton> dismissButton;
  68. std::shared_ptr<CTextBox> questlogLabel;
  69. std::shared_ptr<CButton> questlogButton;
  70. std::shared_ptr<CButton> commanderButton;
  71. std::shared_ptr<CButton> backpackButton;
  72. std::shared_ptr<CToggleButton> tacticsButton;
  73. std::shared_ptr<CToggleGroup> formations;
  74. std::shared_ptr<CGarrisonInt> garr;
  75. std::shared_ptr<CArtifactsOfHeroMain> arts;
  76. std::vector<std::shared_ptr<CLabel>> labels;
  77. public:
  78. const CGHeroInstance * curHero;
  79. CHeroWindow(const CGHeroInstance * hero);
  80. void updateArtifacts() override;
  81. void dismissCurrent(); //dismissed currently displayed hero (curHero)
  82. void commanderWindow();
  83. void switchHero(); //changes displayed hero
  84. void updateGarrisons() override;
  85. bool holdsGarrison(const CArmedInstance * army) override;
  86. void createBackpackWindow();
  87. //friends
  88. friend class CPlayerInterface;
  89. };