TurnTimerWidget.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * TurnTimerWidget.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 "../gui/InterfaceObjectConfigurable.h"
  13. #include "../render/Canvas.h"
  14. #include "../render/Colors.h"
  15. class CAnimImage;
  16. class CLabel;
  17. class TurnTimerWidget : public InterfaceObjectConfigurable
  18. {
  19. private:
  20. class DrawRect : public CIntObject
  21. {
  22. const Rect rect;
  23. const ColorRGBA color;
  24. public:
  25. DrawRect(const Rect &, const ColorRGBA &);
  26. void showAll(Canvas & to) override;
  27. };
  28. int turnTime;
  29. int lastTurnTime;
  30. int cachedTurnTime;
  31. //std::shared_ptr<CAnimImage> watches;
  32. //std::shared_ptr<CLabel> label;
  33. std::shared_ptr<DrawRect> buildDrawRect(const JsonNode & config) const;
  34. public:
  35. //void tick(uint32_t msPassed) override;
  36. void show(Canvas & to) override;
  37. void tick(uint32_t msPassed) override;
  38. void setTime(int time);
  39. TurnTimerWidget();
  40. };