Prepare for detailed overlay messages

This commit is contained in:
Henrik Rydgård committed 2023-06-21 01:08:25 +02:00
1 parent ff75eced70
commit c76b6a48ab
3 files changed
+11 -4

No files matched your search

+4 -1
View File
@@ -40,7 +40,7 @@ std::vector<OnScreenDisplay::ProgressBar> OnScreenDisplay::ProgressBars() {
return bars_; // makes a copy.
}
void OnScreenDisplay::Show(OSDType type, const std::string &text, float duration_s, const char *id) {
void OnScreenDisplay::Show(OSDType type, const std::string &text, const std::string &text2, float duration_s, const char *id) {
// Automatic duration based on type.
if (duration_s <= 0.0f) {
switch (type) {
@@ -68,7 +68,9 @@ void OnScreenDisplay::Show(OSDType type, const std::string &text, float duration
Entry msg = *iter;
msg.endTime = now + duration_s;
msg.text = text;
msg.text2 = text2;
msg.type = type;
// Move to top (should we? maybe not?)
entries_.erase(iter);
entries_.insert(entries_.begin(), msg);
return;
@@ -78,6 +80,7 @@ void OnScreenDisplay::Show(OSDType type, const std::string &text, float duration
Entry msg;
msg.text = text;
msg.text2 = text2;
msg.endTime = now + duration_s;
msg.type = type;
msg.id = id;