Assorted fixes to auto resolution. Fixes too low resolution and also #8002, plus notification spam

This commit is contained in:
Henrik Rydgard committed 2015-09-25 19:10:09 +02:00
1 parent eed2f9d9d5
commit 70cb4372c1
6 files changed
+16 -12

No files matched your search

+6 -3
View File
@@ -53,14 +53,16 @@ restart:
}
}
void OnScreenMessages::Show(const std::string &message, float duration_s, uint32_t color, int icon, bool checkUnique) {
void OnScreenMessages::Show(const std::string &text, float duration_s, uint32_t color, int icon, bool checkUnique, const char *id) {
double now = time_now_d();
std::lock_guard<std::recursive_mutex> guard(mutex_);
if (checkUnique) {
for (auto iter = messages_.begin(); iter != messages_.end(); ++iter) {
if (iter->text == message) {
if (iter->text == text || (id && !strcmp(iter->id, id))) {
Message msg = *iter;
msg.endTime = now + duration_s;
msg.text = text;
msg.color = color;
messages_.erase(iter);
messages_.insert(messages_.begin(), msg);
return;
@@ -68,10 +70,11 @@ void OnScreenMessages::Show(const std::string &message, float duration_s, uint32
}
}
Message msg;
msg.text = message;
msg.text = text;
msg.color = color;
msg.endTime = now + duration_s;
msg.icon = icon;
msg.id = id;
messages_.insert(messages_.begin(), msg);
}