Add setting to stack bits (#1452)

This commit is contained in:
apa420
2019-12-21 10:36:46 +01:00
committed by pajlada
parent d5001b97f4
commit be898e88dd
4 changed files with 30 additions and 0 deletions
@@ -1286,6 +1286,32 @@ Outcome TwitchMessageBuilder::tryParseCheermote(const QString &string)
int cheerValue = match.captured(1).toInt();
if (getSettings()->stackBits)
{
if (this->bitsStacked)
{
return Success;
}
if (cheerEmote.staticEmote)
{
this->emplace<EmoteElement>(cheerEmote.staticEmote,
MessageElementFlag::BitsStatic);
}
if (cheerEmote.animatedEmote)
{
this->emplace<EmoteElement>(cheerEmote.animatedEmote,
MessageElementFlag::BitsAnimated);
}
if (cheerEmote.color != QColor())
{
this->emplace<TextElement>(QString::number(this->bitsLeft),
MessageElementFlag::BitsAmount,
cheerEmote.color);
}
this->bitsStacked = true;
return Success;
}
if (this->bitsLeft >= cheerValue)
{
this->bitsLeft -= cheerValue;