mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
put the account emotes into groups
This commit is contained in:
parent
85505a055d
commit
a3e4c92b9f
|
@ -442,6 +442,7 @@ void EmoteManager::refreshTwitchEmotes(const std::shared_ptr<TwitchAccount> &use
|
|||
[=, &emoteData](const QJsonObject &root) {
|
||||
emoteData.emoteSets.clear();
|
||||
emoteData.emoteCodes.clear();
|
||||
|
||||
auto emoticonSets = root.value("emoticon_sets").toObject();
|
||||
for (QJsonObject::iterator it = emoticonSets.begin(); it != emoticonSets.end(); ++it) {
|
||||
std::string emoteSetString = it.key().toStdString();
|
||||
|
|
|
@ -22,9 +22,9 @@ EmotePopup::EmotePopup()
|
|||
this->viewEmotes = new ChannelView();
|
||||
this->viewEmojis = new ChannelView();
|
||||
|
||||
this->viewEmotes->setOverrideFlags((MessageElement::Flags)(
|
||||
this->viewEmotes->setOverrideFlags(MessageElement::Flags(
|
||||
MessageElement::Default | MessageElement::AlwaysShow | MessageElement::EmoteImages));
|
||||
this->viewEmojis->setOverrideFlags((MessageElement::Flags)(
|
||||
this->viewEmojis->setOverrideFlags(MessageElement::Flags(
|
||||
MessageElement::Default | MessageElement::AlwaysShow | MessageElement::EmoteImages));
|
||||
|
||||
this->viewEmotes->setEnableScrollingToBottom(false);
|
||||
|
@ -86,8 +86,34 @@ void EmotePopup::loadChannel(ChannelPtr _channel)
|
|||
|
||||
QString userID = app->accounts->twitch.getCurrent()->getUserId();
|
||||
|
||||
addEmotes(app->emotes->twitchAccountEmotes[userID.toStdString()].emotes,
|
||||
"Twitch Account Emotes", "Twitch Account Emote");
|
||||
// fourtf: the entire emote manager needs to be refactored so there's no point in trying to
|
||||
// fix this pile of garbage
|
||||
for (const auto &set : app->emotes->twitchAccountEmotes[userID.toStdString()].emoteSets) {
|
||||
// TITLE
|
||||
messages::MessageBuilder builder1;
|
||||
|
||||
builder1.append(new TextElement("Twitch Account Emotes", MessageElement::Text));
|
||||
|
||||
builder1.getMessage()->flags |= Message::Centered;
|
||||
emoteChannel->addMessage(builder1.getMessage());
|
||||
|
||||
// EMOTES
|
||||
messages::MessageBuilder builder2;
|
||||
builder2.getMessage()->flags |= Message::Centered;
|
||||
builder2.getMessage()->flags |= Message::DisableCompactEmotes;
|
||||
|
||||
for (const auto &emote : set.second) {
|
||||
[&](const QString &key, const util::EmoteData &value) {
|
||||
builder2.append((new EmoteElement(value, MessageElement::Flags::AlwaysShow))
|
||||
->setLink(Link(Link::InsertText, key)));
|
||||
}(QString::fromStdString(emote.code),
|
||||
app->emotes->getTwitchEmoteById(QString::fromStdString(emote.id).toLong(),
|
||||
QString::fromStdString(emote.code)));
|
||||
}
|
||||
|
||||
emoteChannel->addMessage(builder2.getMessage());
|
||||
}
|
||||
|
||||
addEmotes(app->emotes->bttvGlobalEmotes, "BetterTTV Global Emotes", "BetterTTV Global Emote");
|
||||
addEmotes(*channel->bttvChannelEmotes.get(), "BetterTTV Channel Emotes",
|
||||
"BetterTTV Channel Emote");
|
||||
|
|
Loading…
Reference in a new issue