CHeroBackpackWindow.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * CHeroBackpackWindow.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. class CFilledTexture;
  13. class CHeroBackpackWindow : public CStatusbarWindow, public CWindowWithArtifacts
  14. {
  15. public:
  16. CHeroBackpackWindow(const CGHeroInstance * hero, const std::vector<CArtifactsOfHeroPtr> & artsSets);
  17. void notFocusedClick() override;
  18. protected:
  19. std::shared_ptr<CArtifactsOfHeroBackpack> arts;
  20. std::vector<std::shared_ptr<CButton>> buttons;
  21. std::shared_ptr<CFilledTexture> stretchedBackground;
  22. const int windowMargin = 5;
  23. void showAll(Canvas & to) override;
  24. };
  25. class CHeroQuickBackpackWindow : public CWindowWithArtifacts
  26. {
  27. public:
  28. CHeroQuickBackpackWindow(const CGHeroInstance * hero, ArtifactPosition targetSlot);
  29. void gesture(bool on, const Point & initialPosition, const Point & finalPosition) override;
  30. void gesturePanning(const Point & initialPosition, const Point & currentPosition, const Point & lastUpdateDistance) override;
  31. void notFocusedClick() override;
  32. private:
  33. std::shared_ptr<CArtifactsOfHeroQuickBackpack> arts;
  34. std::shared_ptr<CFilledTexture> stretchedBackground;
  35. const int windowMargin = 5;
  36. void showAll(Canvas & to) override;
  37. };