mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Sort emotes alphabetically in emote picker (#1499)
This commit is contained in:
parent
410de82261
commit
4b1202437b
|
@ -482,6 +482,10 @@ void TwitchAccount::parseEmotes(const rapidjson::Document &root)
|
|||
emoteData->emotes.emplace(code, emote);
|
||||
}
|
||||
|
||||
std::sort(emoteSet->emotes.begin(), emoteSet->emotes.end(),
|
||||
[](const TwitchEmote &l, const TwitchEmote &r) {
|
||||
return l.name.string < r.name.string;
|
||||
});
|
||||
emoteData->emoteSets.emplace_back(emoteSet);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -32,7 +32,14 @@ namespace {
|
|||
|
||||
if (!map.empty())
|
||||
{
|
||||
for (const auto &emote : map)
|
||||
std::vector<std::pair<EmoteName, EmotePtr>> vec(map.begin(),
|
||||
map.end());
|
||||
std::sort(vec.begin(), vec.end(),
|
||||
[](const std::pair<EmoteName, EmotePtr> &l,
|
||||
const std::pair<EmoteName, EmotePtr> &r) {
|
||||
return l.first.string < r.first.string;
|
||||
});
|
||||
for (const auto &emote : vec)
|
||||
{
|
||||
builder
|
||||
.emplace<EmoteElement>(emote.second,
|
||||
|
|
Loading…
Reference in a new issue