CResDataBar.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * CResDataBar.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 "../gui/CIntObject.h"
  12. /// Resources bar which shows information about how many gold, crystals,... you have
  13. /// Current date is displayed too
  14. class CResDataBar : public CIntObject
  15. {
  16. std::string buildDateString();
  17. std::shared_ptr<CPicture> background;
  18. std::map<GameResID, Point> resourcePositions;
  19. std::optional<Point> datePosition;
  20. public:
  21. /// For dynamically-sized UI windows, e.g. adventure map interface
  22. CResDataBar(const std::string & imageName, const Point & position);
  23. /// For fixed-size UI windows, e.g. CastleInterface
  24. CResDataBar(const std::string &defname, int x, int y, int offx, int offy, int resdist, int datedist);
  25. void setDatePosition(const Point & position);
  26. void setResourcePosition(const GameResID & resource, const Point & position);
  27. void colorize(PlayerColor player);
  28. void showAll(Canvas & to) override;
  29. };