2023-08-13 12:06:35 +02:00
|
|
|
/*
|
2023-08-13 21:50:40 +02:00
|
|
|
* TurnTimerWidget.h, part of VCMI engine
|
2023-08-13 12:06:35 +02:00
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../gui/CIntObject.h"
|
2023-08-13 23:13:37 +02:00
|
|
|
#include "../gui/InterfaceObjectConfigurable.h"
|
|
|
|
#include "../render/Canvas.h"
|
|
|
|
#include "../render/Colors.h"
|
2023-08-13 12:06:35 +02:00
|
|
|
|
|
|
|
class CAnimImage;
|
|
|
|
class CLabel;
|
|
|
|
|
2023-08-13 23:13:37 +02:00
|
|
|
class TurnTimerWidget : public InterfaceObjectConfigurable
|
2023-08-13 12:06:35 +02:00
|
|
|
{
|
|
|
|
private:
|
2023-08-13 23:13:37 +02:00
|
|
|
|
|
|
|
class DrawRect : public CIntObject
|
|
|
|
{
|
|
|
|
const Rect rect;
|
|
|
|
const ColorRGBA color;
|
|
|
|
|
|
|
|
public:
|
|
|
|
DrawRect(const Rect &, const ColorRGBA &);
|
|
|
|
void showAll(Canvas & to) override;
|
|
|
|
};
|
2023-08-13 12:06:35 +02:00
|
|
|
|
|
|
|
int turnTime;
|
|
|
|
int lastTurnTime;
|
|
|
|
int cachedTurnTime;
|
|
|
|
|
2023-08-16 23:10:03 +02:00
|
|
|
std::set<int> notifications;
|
2023-08-13 23:13:37 +02:00
|
|
|
|
|
|
|
std::shared_ptr<DrawRect> buildDrawRect(const JsonNode & config) const;
|
2023-08-25 00:08:48 +02:00
|
|
|
|
2023-08-13 12:06:35 +02:00
|
|
|
public:
|
|
|
|
|
|
|
|
void show(Canvas & to) override;
|
|
|
|
void tick(uint32_t msPassed) override;
|
|
|
|
|
2023-08-25 00:08:48 +02:00
|
|
|
void setTime(PlayerColor player, int time);
|
2023-08-13 12:06:35 +02:00
|
|
|
|
|
|
|
TurnTimerWidget();
|
|
|
|
};
|