HeroInfoWindow.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * HeroInfoWindow.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 "../windows/CWindowObject.h"
  12. class CLabel;
  13. class CAnimImage;
  14. VCMI_LIB_NAMESPACE_BEGIN
  15. struct InfoAboutHero;
  16. VCMI_LIB_NAMESPACE_END
  17. class HeroInfoBasicPanel : public CIntObject //extracted from InfoWindow to fit better as non-popup embed element
  18. {
  19. private:
  20. std::shared_ptr<CPicture> background;
  21. std::vector<std::shared_ptr<CLabel>> labels;
  22. std::vector<std::shared_ptr<CAnimImage>> icons;
  23. public:
  24. HeroInfoBasicPanel(const InfoAboutHero & hero, const Point * position, bool initializeBackground = true);
  25. void show(Canvas & to) override;
  26. void initializeData(const InfoAboutHero & hero);
  27. void update(const InfoAboutHero & updatedInfo);
  28. };
  29. class HeroInfoWindow : public CWindowObject
  30. {
  31. private:
  32. std::shared_ptr<HeroInfoBasicPanel> content;
  33. public:
  34. HeroInfoWindow(const InfoAboutHero & hero, const Point * position);
  35. };