2013-06-06 08:05:31 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <list>
|
|
|
|
|
|
|
|
#include "base/basictypes.h"
|
2014-02-10 11:38:23 +00:00
|
|
|
#include "math/geom2d.h"
|
2013-06-06 08:05:31 +00:00
|
|
|
#include "Common/StdMutex.h"
|
2013-05-22 16:00:06 +00:00
|
|
|
|
|
|
|
class DrawBuffer;
|
|
|
|
|
|
|
|
class OnScreenMessages {
|
|
|
|
public:
|
2013-12-05 15:15:33 +00:00
|
|
|
void Show(const std::string &message, float duration_s = 1.0f, uint32_t color = 0xFFFFFF, int icon = -1, bool checkUnique = true);
|
2013-05-22 16:00:06 +00:00
|
|
|
void ShowOnOff(const std::string &message, bool b, float duration_s = 1.0f, uint32_t color = 0xFFFFFF, int icon = -1);
|
2014-02-10 11:38:23 +00:00
|
|
|
void Draw(DrawBuffer &draw, const Bounds &bounds);
|
2013-05-22 16:00:06 +00:00
|
|
|
bool IsEmpty() const { return messages_.empty(); }
|
|
|
|
|
|
|
|
private:
|
|
|
|
struct Message {
|
|
|
|
int icon;
|
|
|
|
uint32_t color;
|
|
|
|
std::string text;
|
|
|
|
double endTime;
|
|
|
|
double duration;
|
|
|
|
};
|
|
|
|
|
|
|
|
std::list<Message> messages_;
|
|
|
|
std::recursive_mutex mutex_;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern OnScreenMessages osm;
|