CExchangeWindow.h 2.9 KB

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