CHeroBackpackWindow.h 1.4 KB

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