#pragma once #include "common/Emotemap.hpp" #include #include #include #include #include namespace chatterino { class ResourceManager { public: ResourceManager(); ~ResourceManager() = delete; void initialize(); struct { QIcon left; QIcon right; QIcon up; QIcon down; QIcon move; } split; struct { QPixmap ban; QPixmap unban; QPixmap mod; QPixmap unmod; } buttons; chatterino::Image *badgeStaff; chatterino::Image *badgeAdmin; chatterino::Image *badgeGlobalModerator; chatterino::Image *badgeModerator; chatterino::Image *badgeTurbo; chatterino::Image *badgeBroadcaster; chatterino::Image *badgePremium; chatterino::Image *badgeVerified; chatterino::Image *badgeSubscriber; chatterino::Image *badgeCollapsed; chatterino::Image *cheerBadge100000; chatterino::Image *cheerBadge10000; chatterino::Image *cheerBadge5000; chatterino::Image *cheerBadge1000; chatterino::Image *cheerBadge100; chatterino::Image *cheerBadge1; chatterino::Image *moderationmode_enabled; chatterino::Image *moderationmode_disabled; chatterino::Image *splitHeaderContext; std::map cheerBadges; struct BadgeVersion { BadgeVersion() = delete; explicit BadgeVersion(QJsonObject &&root); chatterino::Image *badgeImage1x; chatterino::Image *badgeImage2x; chatterino::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; chatterino::Image *buttonBan; chatterino::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, chatterino::Image *_image) : tooltip(_tooltip) , image(_image) { } std::string tooltip; chatterino::Image *image; }; // username std::map> chatterinoBadges; void loadChannelData(const QString &roomID, bool bypassCache = false); void loadDynamicTwitchBadges(); void loadChatterinoBadges(); }; } // namespace chatterino