CExchangeWindow.h 2.8 KB

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