#pragma once #include "common/Singleton.hpp" #include "common/Emotemap.hpp" #include #include #include #include #include namespace chatterino { class Resources : public Singleton { public: Resources(); ~Resources() = delete; virtual void initialize(Application &app) override; struct { QIcon left; QIcon right; QIcon up; QIcon down; QIcon move; } split; struct { QPixmap ban; QPixmap unban; QPixmap mod; QPixmap unmod; } buttons; Image *badgeStaff; Image *badgeAdmin; Image *badgeGlobalModerator; Image *badgeModerator; Image *badgeTurbo; Image *badgeBroadcaster; Image *badgePremium; Image *badgeVerified; Image *badgeSubscriber; Image *badgeCollapsed; Image *cheerBadge100000; Image *cheerBadge10000; Image *cheerBadge5000; Image *cheerBadge1000; Image *cheerBadge100; Image *cheerBadge1; Image *moderationmode_enabled; Image *moderationmode_disabled; Image *splitHeaderContext; std::map cheerBadges; struct BadgeVersion { BadgeVersion() = delete; explicit BadgeVersion(QJsonObject &&root); Image *badgeImage1x; Image *badgeImage2x; Image *badgeImage4x; std::string description; std::string title; std::string clickAction; std::string clickURL; }; struct BadgeSet { std::map versions; }; std::map badgeSets; bool dynamicBadgesLoaded = false; Image *buttonBan; Image *buttonTimeout; struct JSONCheermoteSet { QString prefix; std::vector scales; std::vector backgrounds; std::vector states; QString type; QString updatedAt; int priority; struct CheermoteTier { int minBits; QString id; QString color; // Background State Scale std::map>> images; }; std::vector tiers; }; struct Cheermote { // a Cheermote indicates one tier QColor color; int minBits; EmoteData emoteDataAnimated; EmoteData emoteDataStatic; }; struct CheermoteSet { QRegularExpression regex; std::vector cheermotes; }; struct Channel { std::map badgeSets; std::vector jsonCheermoteSets; std::vector cheermoteSets; bool loaded = false; }; // channelId std::map channels; // Chatterino badges struct ChatterinoBadge { ChatterinoBadge(const std::string &_tooltip, Image *_image) : tooltip(_tooltip) , image(_image) { } std::string tooltip; Image *image; }; // username std::map> chatterinoBadges; void loadChannelData(const QString &roomID, bool bypassCache = false); void loadDynamicTwitchBadges(); void loadChatterinoBadges(); }; } // namespace chatterino