mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Compare commits
1 commit
bed8ac4eb0
...
9a1c5adb7c
Author | SHA1 | Date | |
---|---|---|---|
9a1c5adb7c |
|
@ -54,7 +54,6 @@
|
||||||
- Bugfix: Fixed event emotes not showing up in autocomplete and popups. (#5239, #5580, #5582, #5632)
|
- Bugfix: Fixed event emotes not showing up in autocomplete and popups. (#5239, #5580, #5582, #5632)
|
||||||
- Bugfix: Fixed tab visibility being controllable in the emote popup. (#5530)
|
- Bugfix: Fixed tab visibility being controllable in the emote popup. (#5530)
|
||||||
- Bugfix: Fixed account switch not being saved if no other settings were changed. (#5558)
|
- Bugfix: Fixed account switch not being saved if no other settings were changed. (#5558)
|
||||||
- Bugfix: Fixed 7TV badges being inadvertently animated. (#5674)
|
|
||||||
- Bugfix: Fixed some tooltips not being readable. (#5578)
|
- Bugfix: Fixed some tooltips not being readable. (#5578)
|
||||||
- Bugfix: Fixed log files being locked longer than needed. (#5592)
|
- Bugfix: Fixed log files being locked longer than needed. (#5592)
|
||||||
- Bugfix: Fixed global badges not showing in anonymous mode. (#5599)
|
- Bugfix: Fixed global badges not showing in anonymous mode. (#5599)
|
||||||
|
|
|
@ -59,7 +59,7 @@ void SeventvBadges::registerBadge(const QJsonObject &badgeJson)
|
||||||
|
|
||||||
auto emote = Emote{
|
auto emote = Emote{
|
||||||
.name = EmoteName{},
|
.name = EmoteName{},
|
||||||
.images = SeventvEmotes::createImageSet(badgeJson, true),
|
.images = SeventvEmotes::createImageSet(badgeJson),
|
||||||
.tooltip = Tooltip{badgeJson["tooltip"].toString()},
|
.tooltip = Tooltip{badgeJson["tooltip"].toString()},
|
||||||
.homePage = Url{},
|
.homePage = Url{},
|
||||||
.id = EmoteId{badgeID},
|
.id = EmoteId{badgeID},
|
||||||
|
|
|
@ -106,18 +106,12 @@ CreateEmoteResult createEmote(const QJsonObject &activeEmote,
|
||||||
? createAliasedTooltip(emoteName.string, baseEmoteName.string,
|
? createAliasedTooltip(emoteName.string, baseEmoteName.string,
|
||||||
author.string, isGlobal)
|
author.string, isGlobal)
|
||||||
: createTooltip(emoteName.string, author.string, isGlobal);
|
: createTooltip(emoteName.string, author.string, isGlobal);
|
||||||
auto imageSet = SeventvEmotes::createImageSet(emoteData, false);
|
auto imageSet = SeventvEmotes::createImageSet(emoteData);
|
||||||
|
|
||||||
auto emote = Emote({
|
auto emote =
|
||||||
emoteName,
|
Emote({emoteName, imageSet, tooltip,
|
||||||
imageSet,
|
Url{EMOTE_LINK_FORMAT.arg(emoteId.string)}, zeroWidth, emoteId,
|
||||||
tooltip,
|
author, makeConditionedOptional(aliasedName, baseEmoteName)});
|
||||||
Url{EMOTE_LINK_FORMAT.arg(emoteId.string)},
|
|
||||||
zeroWidth,
|
|
||||||
emoteId,
|
|
||||||
author,
|
|
||||||
makeConditionedOptional(aliasedName, baseEmoteName),
|
|
||||||
});
|
|
||||||
|
|
||||||
return {emote, emoteId, emoteName, !emote.images.getImage1()->isEmpty()};
|
return {emote, emoteId, emoteName, !emote.images.getImage1()->isEmpty()};
|
||||||
}
|
}
|
||||||
|
@ -433,8 +427,7 @@ void SeventvEmotes::getEmoteSet(
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageSet SeventvEmotes::createImageSet(const QJsonObject &emoteData,
|
ImageSet SeventvEmotes::createImageSet(const QJsonObject &emoteData)
|
||||||
bool useStatic)
|
|
||||||
{
|
{
|
||||||
auto host = emoteData["host"].toObject();
|
auto host = emoteData["host"].toObject();
|
||||||
// "//cdn.7tv[...]"
|
// "//cdn.7tv[...]"
|
||||||
|
@ -470,21 +463,9 @@ ImageSet SeventvEmotes::createImageSet(const QJsonObject &emoteData,
|
||||||
baseWidth = width;
|
baseWidth = width;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto name = [&] {
|
auto image = Image::fromUrl(
|
||||||
if (useStatic)
|
{QString("https:%1/%2").arg(baseUrl, file["name"].toString())},
|
||||||
{
|
scale, {static_cast<int>(width), file["height"].toInt(16)});
|
||||||
auto staticName = file["static_name"].toString();
|
|
||||||
if (!staticName.isEmpty())
|
|
||||||
{
|
|
||||||
return staticName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return file["name"].toString();
|
|
||||||
}();
|
|
||||||
|
|
||||||
auto image =
|
|
||||||
Image::fromUrl({QString("https:%1/%2").arg(baseUrl, name)}, scale,
|
|
||||||
{static_cast<int>(width), file["height"].toInt(16)});
|
|
||||||
|
|
||||||
sizes.at(nextSize) = image;
|
sizes.at(nextSize) = image;
|
||||||
nextSize++;
|
nextSize++;
|
||||||
|
|
|
@ -153,10 +153,8 @@ public:
|
||||||
* Creates an image set from a 7TV emote or badge.
|
* Creates an image set from a 7TV emote or badge.
|
||||||
*
|
*
|
||||||
* @param emoteData { host: { files: [], url } }
|
* @param emoteData { host: { files: [], url } }
|
||||||
* @param useStatic use static version if possible
|
|
||||||
*/
|
*/
|
||||||
static ImageSet createImageSet(const QJsonObject &emoteData,
|
static ImageSet createImageSet(const QJsonObject &emoteData);
|
||||||
bool useStatic);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Atomic<std::shared_ptr<const EmoteMap>> global_;
|
Atomic<std::shared_ptr<const EmoteMap>> global_;
|
||||||
|
|
Loading…
Reference in a new issue