mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-28 17:43:54 -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
|
|
@ -191,8 +191,9 @@ void ChatView::appendMessage(QString message,
|
|||
const int pixelSize = QFontInfo(cursor.charFormat().font()).pixelSize();
|
||||
bool isBuddy = userListProxy->isUserBuddy(userName);
|
||||
const QString privLevel = userInfo.has_privlevel() ? QString::fromStdString(userInfo.privlevel()) : "NONE";
|
||||
cursor.insertImage(
|
||||
UserLevelPixmapGenerator::generatePixmap(pixelSize, userLevel, isBuddy, privLevel).toImage());
|
||||
cursor.insertImage(UserLevelPixmapGenerator::generatePixmap(pixelSize, userLevel, userInfo.pawn_colors(),
|
||||
isBuddy, privLevel)
|
||||
.toImage());
|
||||
cursor.insertText(" ");
|
||||
cursor.setCharFormat(senderFormat);
|
||||
cursor.insertText(userName);
|
||||
|
|
|
|||
|
|
@ -90,8 +90,8 @@ void UserInfoBox::updateInfo(const ServerInfo_User &user)
|
|||
|
||||
const std::string &bmp = user.avatar_bmp();
|
||||
if (!avatarPixmap.loadFromData((const uchar *)bmp.data(), static_cast<uint>(bmp.size()))) {
|
||||
avatarPixmap =
|
||||
UserLevelPixmapGenerator::generatePixmap(64, userLevel, false, QString::fromStdString(user.privlevel()));
|
||||
avatarPixmap = UserLevelPixmapGenerator::generatePixmap(64, userLevel, user.pawn_colors(), false,
|
||||
QString::fromStdString(user.privlevel()));
|
||||
}
|
||||
|
||||
nameLabel.setText(QString::fromStdString(user.name()));
|
||||
|
|
@ -106,8 +106,8 @@ void UserInfoBox::updateInfo(const ServerInfo_User &user)
|
|||
countryLabel3.setText("");
|
||||
}
|
||||
|
||||
userLevelIcon.setPixmap(
|
||||
UserLevelPixmapGenerator::generatePixmap(15, userLevel, false, QString::fromStdString(user.privlevel())));
|
||||
userLevelIcon.setPixmap(UserLevelPixmapGenerator::generatePixmap(15, userLevel, user.pawn_colors(), false,
|
||||
QString::fromStdString(user.privlevel())));
|
||||
QString userLevelText;
|
||||
if (userLevel.testFlag(ServerInfo_User::IsAdmin))
|
||||
userLevelText = tr("Administrator");
|
||||
|
|
|
|||
|
|
@ -344,8 +344,8 @@ void UserListTWI::setUserInfo(const ServerInfo_User &_userInfo)
|
|||
userInfo = _userInfo;
|
||||
|
||||
setData(0, Qt::UserRole, userInfo.user_level());
|
||||
setIcon(0, QIcon(UserLevelPixmapGenerator::generatePixmap(12, UserLevelFlags(userInfo.user_level()), false,
|
||||
QString::fromStdString(userInfo.privlevel()))));
|
||||
setIcon(0, UserLevelPixmapGenerator::generateIcon(12, UserLevelFlags(userInfo.user_level()), userInfo.pawn_colors(),
|
||||
false, QString::fromStdString(userInfo.privlevel())));
|
||||
setIcon(1, QIcon(CountryPixmapGenerator::generatePixmap(12, QString::fromStdString(userInfo.country()))));
|
||||
setData(2, Qt::UserRole, QString::fromStdString(userInfo.name()));
|
||||
setData(2, Qt::DisplayRole, QString::fromStdString(userInfo.name()));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue