mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-13 01:24:46 -07:00
Add custom server-side pawn colors (#5543)
This commit is contained in:
parent
0fc05e15cd
commit
95cea0f191
23 changed files with 1748 additions and 49 deletions
|
|
@ -3,9 +3,13 @@
|
|||
|
||||
#include "user_level.h"
|
||||
|
||||
#include <QIcon>
|
||||
#include <QLoggingCategory>
|
||||
#include <QMap>
|
||||
#include <QPixmap>
|
||||
|
||||
inline Q_LOGGING_CATEGORY(PixelMapGeneratorLog, "pixel_map_generator");
|
||||
|
||||
class PhasePixmapGenerator
|
||||
{
|
||||
private:
|
||||
|
|
@ -61,13 +65,30 @@ public:
|
|||
class UserLevelPixmapGenerator
|
||||
{
|
||||
private:
|
||||
static QMap<QString, QPixmap> pmCache;
|
||||
static QMap<QString, QIcon> iconCache;
|
||||
|
||||
static QIcon generateIconDefault(int height, UserLevelFlags userLevel, bool isBuddy, const QString &privLevel);
|
||||
static QIcon generateIconWithColorOverride(int height,
|
||||
bool isBuddy,
|
||||
const QString &privLevel,
|
||||
std::optional<QString> colorLeft,
|
||||
std::optional<QString> colorRight);
|
||||
|
||||
public:
|
||||
static QPixmap generatePixmap(int height, UserLevelFlags userLevel, bool isBuddy, QString privLevel = "NONE");
|
||||
static QPixmap generatePixmap(int height,
|
||||
UserLevelFlags userLevel,
|
||||
ServerInfo_User::PawnColorsOverride pawnColors,
|
||||
bool isBuddy,
|
||||
const QString &privLevel);
|
||||
|
||||
static QIcon generateIcon(int height,
|
||||
UserLevelFlags userLevel,
|
||||
ServerInfo_User::PawnColorsOverride pawnColors,
|
||||
bool isBuddy,
|
||||
const QString &privLevel);
|
||||
static void clear()
|
||||
{
|
||||
pmCache.clear();
|
||||
iconCache.clear();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue