Add setting to stack bits (#1452)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -82,6 +82,7 @@ private:
|
||||
bool hasBits_ = false;
|
||||
QString bits;
|
||||
int bitsLeft;
|
||||
bool bitsStacked = false;
|
||||
bool historicalMessage_ = false;
|
||||
|
||||
QString userId_;
|
||||
|
||||
Reference in New Issue
Block a user