Skip to content

Commit

Permalink
feat: add setting to disable animated badges
Browse files Browse the repository at this point in the history
Chatterino2 disables them always, but we want to give the user a choice.
  • Loading branch information
Nerixyz committed Oct 24, 2024
1 parent fed59e8 commit 3bbcc9f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/providers/seventv/SeventvBadges.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "messages/Emote.hpp"
#include "messages/Image.hpp"
#include "providers/seventv/SeventvEmotes.hpp"
#include "singletons/Settings.hpp"

#include <QJsonArray>
#include <QUrl>
Expand Down Expand Up @@ -59,7 +60,8 @@ void SeventvBadges::registerBadge(const QJsonObject &badgeJson)

auto emote = Emote{
.name = EmoteName{},
.images = SeventvEmotes::createImageSet(badgeJson, true),
.images = SeventvEmotes::createImageSet(
badgeJson, !getSettings()->animateSevenTVBadges),
.tooltip = Tooltip{badgeJson["tooltip"].toString()},
.homePage = Url{},
.id = EmoteId{badgeID},
Expand Down
2 changes: 1 addition & 1 deletion src/providers/seventv/SeventvEmotes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ CreateEmoteResult createEmote(const QJsonObject &activeEmote,
? createAliasedTooltip(emoteName.string, baseEmoteName.string,
author.string, kind)
: createTooltip(emoteName.string, author.string, kind);
auto imageSet = SeventvEmotes::createImageSet(emoteData);
auto imageSet = SeventvEmotes::createImageSet(emoteData, false);

auto emote = Emote({
emoteName,
Expand Down
2 changes: 2 additions & 0 deletions src/singletons/Settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ class Settings
BoolSetting useCustomFfzVipBadges = {
"/appearance/badges/useCustomFfzVipBadges", true};
BoolSetting showBadgesSevenTV = {"/appearance/badges/seventv", true};
BoolSetting animateSevenTVBadges = {"/appearance/badges/animateSeventv",
true};
QSizeSetting lastPopupSize = {
"/appearance/lastPopup/size",
{300, 500},
Expand Down
1 change: 1 addition & 0 deletions src/widgets/settingspages/GeneralPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,7 @@ void GeneralPage::initLayout(GeneralPageView &layout)
s.useCustomFfzModeratorBadges);
layout.addCheckbox("Use custom FrankerFaceZ VIP badges",
s.useCustomFfzVipBadges);
layout.addCheckbox("Animate 7TV badges", s.animateSevenTVBadges);

layout.addSubtitle("Overlay");
layout.addIntInput(
Expand Down

0 comments on commit 3bbcc9f

Please sign in to comment.