Huge refactor

- Remove some underscore-prefixes
 - Start using this-> more
 - Remove a few of the singletons (We pass references to managers to
         things that need it now. Might not be much better, but for now
         it works. It also shows what places might be slightly wrong
         designed)
This commit is contained in:
Rasmus Karlsson
2017-06-13 21:13:58 +02:00
parent 55b04ee7eb
commit 59d383c161
37 changed files with 630 additions and 523 deletions
+19 -96
View File
@@ -4,108 +4,31 @@
namespace chatterino {
class EmoteManager;
class WindowManager;
class Resources
{
public:
static void load();
explicit Resources(EmoteManager &emoteManager, WindowManager &windowManager);
// badges
static messages::LazyLoadedImage *getBadgeStaff()
{
return badgeStaff;
}
messages::LazyLoadedImage *badgeStaff;
messages::LazyLoadedImage *badgeAdmin;
messages::LazyLoadedImage *badgeGlobalModerator;
messages::LazyLoadedImage *badgeModerator;
messages::LazyLoadedImage *badgeTurbo;
messages::LazyLoadedImage *badgeBroadcaster;
messages::LazyLoadedImage *badgePremium;
static messages::LazyLoadedImage *getBadgeAdmin()
{
return badgeAdmin;
}
messages::LazyLoadedImage *cheerBadge100000;
messages::LazyLoadedImage *cheerBadge10000;
messages::LazyLoadedImage *cheerBadge5000;
messages::LazyLoadedImage *cheerBadge1000;
messages::LazyLoadedImage *cheerBadge100;
messages::LazyLoadedImage *cheerBadge1;
static messages::LazyLoadedImage *getBadgeGlobalmod()
{
return badgeGlobalmod;
}
static messages::LazyLoadedImage *getBadgeModerator()
{
return badgeModerator;
}
static messages::LazyLoadedImage *getBadgeTurbo()
{
return badgeTurbo;
}
static messages::LazyLoadedImage *getBadgeBroadcaster()
{
return badgeBroadcaster;
}
static messages::LazyLoadedImage *getBadgePremium()
{
return badgePremium;
}
// cheer badges
static messages::LazyLoadedImage *getCheerBadge100000()
{
return cheerBadge100000;
}
static messages::LazyLoadedImage *getCheerBadge10000()
{
return cheerBadge10000;
}
static messages::LazyLoadedImage *getCheerBadge5000()
{
return cheerBadge5000;
}
static messages::LazyLoadedImage *getCheerBadge1000()
{
return cheerBadge1000;
}
static messages::LazyLoadedImage *getCheerBadge100()
{
return cheerBadge100;
}
static messages::LazyLoadedImage *getCheerBadge1()
{
return cheerBadge1;
}
static messages::LazyLoadedImage *getButtonBan()
{
return buttonBan;
}
static messages::LazyLoadedImage *getButtonTimeout()
{
return buttonTimeout;
}
private:
Resources();
static messages::LazyLoadedImage *badgeStaff;
static messages::LazyLoadedImage *badgeAdmin;
static messages::LazyLoadedImage *badgeGlobalmod;
static messages::LazyLoadedImage *badgeModerator;
static messages::LazyLoadedImage *badgeTurbo;
static messages::LazyLoadedImage *badgeBroadcaster;
static messages::LazyLoadedImage *badgePremium;
static messages::LazyLoadedImage *cheerBadge100000;
static messages::LazyLoadedImage *cheerBadge10000;
static messages::LazyLoadedImage *cheerBadge5000;
static messages::LazyLoadedImage *cheerBadge1000;
static messages::LazyLoadedImage *cheerBadge100;
static messages::LazyLoadedImage *cheerBadge1;
static messages::LazyLoadedImage *buttonBan;
static messages::LazyLoadedImage *buttonTimeout;
messages::LazyLoadedImage *buttonBan;
messages::LazyLoadedImage *buttonTimeout;
};
} // namespace chatterino