mirror-chatterino2/src/resources.hpp

79 lines
2 KiB
C++
Raw Normal View History

#pragma once
2017-01-13 18:59:11 +01:00
2017-06-11 09:31:45 +02:00
#include "messages/lazyloadedimage.hpp"
2017-01-18 21:30:23 +01:00
2017-06-15 23:13:01 +02:00
#include <map>
#include <mutex>
2017-01-18 21:30:23 +01:00
namespace chatterino {
2017-01-13 18:59:11 +01:00
class EmoteManager;
class WindowManager;
2017-01-13 18:59:11 +01:00
class Resources
{
public:
explicit Resources(EmoteManager &emoteManager, WindowManager &windowManager);
messages::LazyLoadedImage *badgeStaff;
messages::LazyLoadedImage *badgeAdmin;
messages::LazyLoadedImage *badgeGlobalModerator;
messages::LazyLoadedImage *badgeModerator;
messages::LazyLoadedImage *badgeTurbo;
messages::LazyLoadedImage *badgeBroadcaster;
messages::LazyLoadedImage *badgePremium;
messages::LazyLoadedImage *badgeVerified;
messages::LazyLoadedImage *cheerBadge100000;
messages::LazyLoadedImage *cheerBadge10000;
messages::LazyLoadedImage *cheerBadge5000;
messages::LazyLoadedImage *cheerBadge1000;
messages::LazyLoadedImage *cheerBadge100;
messages::LazyLoadedImage *cheerBadge1;
2017-06-15 23:13:01 +02:00
std::map<std::string, messages::LazyLoadedImage *> cheerBadges;
struct BadgeVersion {
BadgeVersion() = delete;
2017-06-16 08:03:13 +02:00
explicit BadgeVersion(QJsonObject &&root, EmoteManager &emoteManager,
WindowManager &windowManager);
2017-06-15 23:13:01 +02:00
messages::LazyLoadedImage *badgeImage1x;
messages::LazyLoadedImage *badgeImage2x;
messages::LazyLoadedImage *badgeImage4x;
std::string description;
std::string title;
std::string clickAction;
2017-06-16 08:03:13 +02:00
std::string clickURL;
2017-06-15 23:13:01 +02:00
};
struct BadgeSet {
std::map<std::string, BadgeVersion> versions;
};
std::map<std::string, BadgeSet> badgeSets;
bool dynamicBadgesLoaded = false;
messages::LazyLoadedImage *buttonBan;
messages::LazyLoadedImage *buttonTimeout;
2017-06-15 23:13:01 +02:00
struct Channel {
std::string id;
std::mutex globalMapMutex;
void loadData();
// std::atomic<bool> loaded = false;
};
// channelId
std::map<std::string, Channel> channels;
void loadChannelData(const std::string &roomID, bool bypassCache = false);
2017-01-13 18:59:11 +01:00
};
} // namespace chatterino