Show picked outcome in prediction badges. (#3357)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -1101,6 +1101,22 @@ void TwitchMessageBuilder::appendTwitchBadges()
|
||||
.arg(subMonths);
|
||||
}
|
||||
}
|
||||
else if (badge.flag_ == MessageElementFlag::BadgePredictions)
|
||||
{
|
||||
auto badgeInfoIt = badgeInfos.find(badge.key_);
|
||||
if (badgeInfoIt != badgeInfos.end())
|
||||
{
|
||||
auto predictionText =
|
||||
badgeInfoIt->second
|
||||
.replace("\\s", " ") // standard IRC escapes
|
||||
.replace("\\:", ";")
|
||||
.replace("\\\\", "\\")
|
||||
.replace("⸝", ","); // twitch's comma escape
|
||||
// Careful, the first character is RIGHT LOW PARAPHRASE BRACKET or U+2E1D, which just looks like a comma
|
||||
|
||||
tooltip = QString("Predicted %1").arg(predictionText);
|
||||
}
|
||||
}
|
||||
|
||||
this->emplace<BadgeElement>(badgeEmote.get(), badge.flag_)
|
||||
->setTooltip(tooltip);
|
||||
|
||||
Reference in New Issue
Block a user