mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Add setting to stack bits (#1452)
This commit is contained in:
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();
|
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)
|
if (this->bitsLeft >= cheerValue)
|
||||||
{
|
{
|
||||||
this->bitsLeft -= cheerValue;
|
this->bitsLeft -= cheerValue;
|
||||||
|
|
|
@ -82,6 +82,7 @@ private:
|
||||||
bool hasBits_ = false;
|
bool hasBits_ = false;
|
||||||
QString bits;
|
QString bits;
|
||||||
int bitsLeft;
|
int bitsLeft;
|
||||||
|
bool bitsStacked = false;
|
||||||
bool historicalMessage_ = false;
|
bool historicalMessage_ = false;
|
||||||
|
|
||||||
QString userId_;
|
QString userId_;
|
||||||
|
|
|
@ -120,6 +120,8 @@ public:
|
||||||
|
|
||||||
QStringSetting emojiSet = {"/emotes/emojiSet", "EmojiOne 2"};
|
QStringSetting emojiSet = {"/emotes/emojiSet", "EmojiOne 2"};
|
||||||
|
|
||||||
|
BoolSetting stackBits = {"/emotes/stackBits", false};
|
||||||
|
|
||||||
/// Links
|
/// Links
|
||||||
BoolSetting linksDoubleClickOnly = {"/links/doubleClickToOpen", false};
|
BoolSetting linksDoubleClickOnly = {"/links/doubleClickToOpen", false};
|
||||||
BoolSetting linkInfoTooltip = {"/links/linkInfoTooltip", false};
|
BoolSetting linkInfoTooltip = {"/links/linkInfoTooltip", false};
|
||||||
|
|
|
@ -391,6 +391,7 @@ void GeneralPage::initLayout(SettingsLayout &layout)
|
||||||
layout.addCheckbox("Animate", s.animateEmotes);
|
layout.addCheckbox("Animate", s.animateEmotes);
|
||||||
layout.addCheckbox("Animate only when Chatterino is focused",
|
layout.addCheckbox("Animate only when Chatterino is focused",
|
||||||
s.animationsWhenFocused);
|
s.animationsWhenFocused);
|
||||||
|
layout.addCheckbox("Stack bits", s.stackBits);
|
||||||
layout.addDropdown<float>(
|
layout.addDropdown<float>(
|
||||||
"Size", {"0.5x", "0.75x", "Default", "1.25x", "1.5x", "2x"},
|
"Size", {"0.5x", "0.75x", "Default", "1.25x", "1.5x", "2x"},
|
||||||
s.emoteScale,
|
s.emoteScale,
|
||||||
|
|
Loading…
Reference in a new issue