CExchangeWindow.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * CExchangeWindow.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 "../widgets/CExchangeController.h"
  13. class CGarrisonSlot;
  14. class CMultiLineLabel;
  15. class LRClickableAreaWText;
  16. class CExchangeWindow : public CStatusbarWindow, public IGarrisonHolder, public CWindowWithArtifacts
  17. {
  18. std::array<std::shared_ptr<CLabel>, 2> titles;
  19. std::vector<std::shared_ptr<CAnimImage>> primSkillImages;//shared for both heroes
  20. std::array<std::vector<std::shared_ptr<CLabel>>, 2> primSkillValues;
  21. std::array<std::shared_ptr<CAnimImage>, 2> specImages;
  22. std::array<std::shared_ptr<CAnimImage>, 2> expImages;
  23. std::array<std::shared_ptr<CLabel>, 2> expValues;
  24. std::array<std::shared_ptr<CAnimImage>, 2> manaImages;
  25. std::array<std::shared_ptr<CLabel>, 2> manaValues;
  26. std::vector<std::shared_ptr<LRClickableAreaWTextComp>> primSkillAreas;
  27. std::array<std::vector<std::shared_ptr<CSecSkillPlace>>, 2> secSkills;
  28. std::array<std::shared_ptr<CMultiLineLabel>, 2> secSkillsFull;
  29. std::array<std::shared_ptr<LRClickableAreaWText>, 2> secSkillsFullArea;
  30. std::array<std::shared_ptr<CHeroArea>, 2> heroAreas;
  31. std::array<std::shared_ptr<LRClickableAreaWText>, 2> specialtyAreas;
  32. std::array<std::shared_ptr<LRClickableAreaWText>, 2> experienceAreas;
  33. std::array<std::shared_ptr<LRClickableAreaWText>, 2> spellPointsAreas;
  34. std::array<std::shared_ptr<MoraleLuckBox>, 2> morale;
  35. std::array<std::shared_ptr<MoraleLuckBox>, 2> luck;
  36. std::shared_ptr<CButton> quit;
  37. std::array<std::shared_ptr<CButton>, 2> questlogButton;
  38. std::shared_ptr<CGarrisonInt> garr;
  39. std::shared_ptr<CButton> buttonMoveUnitsFromLeftToRight;
  40. std::shared_ptr<CButton> buttonMoveUnitsFromRightToLeft;
  41. std::shared_ptr<CButton> buttonMoveArtifactsFromLeftToRight;
  42. std::shared_ptr<CButton> buttonMoveArtifactsFromRightToLeft;
  43. std::shared_ptr<CButton> exchangeUnitsButton;
  44. std::shared_ptr<CButton> exchangeArtifactsButton;
  45. std::vector<std::shared_ptr<CButton>> moveUnitFromLeftToRightButtons;
  46. std::vector<std::shared_ptr<CButton>> moveUnitFromRightToLeftButtons;
  47. std::shared_ptr<CButton> backpackButtonLeft;
  48. std::shared_ptr<CButton> backpackButtonRight;
  49. CExchangeController controller;
  50. void creatureArrowButtonCallback(bool leftToRight, SlotID slotID);
  51. void moveArtifactsCallback(bool leftToRight);
  52. void swapArtifactsCallback();
  53. void moveUnitsShortcut(bool leftToRight);
  54. void backpackShortcut(bool leftHero);
  55. void questLogShortcut();
  56. std::array<const CGHeroInstance *, 2> heroInst;
  57. std::array<std::shared_ptr<CArtifactsOfHeroMain>, 2> artifs;
  58. const CGarrisonSlot * getSelectedSlotID() const;
  59. public:
  60. CExchangeWindow(ObjectInstanceID hero1, ObjectInstanceID hero2, QueryID queryID);
  61. void keyPressed(EShortcut key) override;
  62. void updateArtifacts() override;
  63. // IGarrisonHolder impl
  64. void updateGarrisons() override;
  65. bool holdsGarrison(const CArmedInstance * army) override;
  66. };