From 05aab868455500ede7cc1d3d3f9a2006392d5f12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82?= <44851575+zneix@users.noreply.github.com> Date: Sun, 22 Nov 2020 15:54:58 +0100 Subject: [PATCH] Added links to twitchemotes.com to Twitch emotes' context menus (#2214) --- CHANGELOG.md | 1 + src/providers/twitch/TwitchEmotes.cpp | 17 +++++++++-------- src/widgets/helper/ChannelView.cpp | 6 +++++- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a3f73062..23d529ae3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Minor: Added a navigation list to the settings and reordered them. - Major: Added "Channel Filters". See https://wiki.chatterino.com/Filters/ for how they work or how to configure them. (#1748, #2083, #2090, #2200) - Major: Added Streamer Mode configuration (under `Settings -> General`), where you can select which features of Chatterino should behave differently when you are in Streamer Mode. (#2001) +- Minor: Added a link to twitchemotes.com to conext menu when right-clicking Twitch emotes. (#2214) - Minor: Improved viewer list window. - Minor: Added emote completion with `:` to the whispers channel (#2075) - Minor: Made the current channels emotes appear at the top of the emote picker popup. (#2057) diff --git a/src/providers/twitch/TwitchEmotes.cpp b/src/providers/twitch/TwitchEmotes.cpp index e7a3bea06..0f1bf546b 100644 --- a/src/providers/twitch/TwitchEmotes.cpp +++ b/src/providers/twitch/TwitchEmotes.cpp @@ -74,14 +74,15 @@ EmotePtr TwitchEmotes::getOrCreateEmote(const EmoteId &id, if (!shared) { - (*cache)[id] = shared = std::make_shared( - Emote{EmoteName{name}, - ImageSet{ - Image::fromUrl(getEmoteLink(id, "1.0"), 1), - Image::fromUrl(getEmoteLink(id, "2.0"), 0.5), - Image::fromUrl(getEmoteLink(id, "3.0"), 0.25), - }, - Tooltip{name + "
Twitch Emote"}, Url{}}); + (*cache)[id] = shared = std::make_shared(Emote{ + EmoteName{name}, + ImageSet{ + Image::fromUrl(getEmoteLink(id, "1.0"), 1), + Image::fromUrl(getEmoteLink(id, "2.0"), 0.5), + Image::fromUrl(getEmoteLink(id, "3.0"), 0.25), + }, + Tooltip{name + "
Twitch Emote"}, + Url{QString("https://twitchemotes.com/emotes/%1").arg(id.string)}}); } return shared; diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index 014f0c773..55319f3ed 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -103,7 +103,11 @@ namespace { }); }; - if (creatorFlags.has(MessageElementFlag::BttvEmote)) + if (creatorFlags.has(MessageElementFlag::TwitchEmote)) + { + addPageLink("TwitchEmotes"); + } + else if (creatorFlags.has(MessageElementFlag::BttvEmote)) { addPageLink("BTTV"); }