CResDataBar.h 1.2 KB

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