CArtifactsOfHeroBackpack.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * CArtifactsOfHeroBackpack.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 "CArtifactsOfHeroBase.h"
  12. VCMI_LIB_NAMESPACE_BEGIN
  13. struct ArtifactLocation;
  14. VCMI_LIB_NAMESPACE_END
  15. class CListBoxWithCallback;
  16. class CArtifactsOfHeroBackpack : public CArtifactsOfHeroBase
  17. {
  18. public:
  19. CArtifactsOfHeroBackpack(const Point & position);
  20. void swapArtifacts(const ArtifactLocation & srcLoc, const ArtifactLocation & dstLoc);
  21. void pickUpArtifact(CHeroArtPlace & artPlace);
  22. void scrollBackpack(int offset) override;
  23. void updateBackpackSlots() override;
  24. size_t getActiveSlotRowsNum();
  25. private:
  26. std::shared_ptr<CListBoxWithCallback> backpackListBox;
  27. std::vector<std::shared_ptr<CPicture>> backpackSlotsBackgrounds;
  28. const size_t HERO_BACKPACK_WINDOW_SLOT_COLUMNS = 8;
  29. const size_t HERO_BACKPACK_WINDOW_SLOT_ROWS = 8;
  30. const int slotSizeWithMargin = 46;
  31. const int sliderPosOffsetX = 10;
  32. };