mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-30 10:33: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
|
|
@ -119,7 +119,8 @@ QVariant GamesModel::data(const QModelIndex &index, int role) const
|
|||
return QString::fromStdString(gameentry.creator_info().name());
|
||||
case Qt::DecorationRole: {
|
||||
QPixmap avatarPixmap = UserLevelPixmapGenerator::generatePixmap(
|
||||
13, (UserLevelFlags)gameentry.creator_info().user_level(), false,
|
||||
13, (UserLevelFlags)gameentry.creator_info().user_level(),
|
||||
gameentry.creator_info().pawn_colors(), false,
|
||||
QString::fromStdString(gameentry.creator_info().privlevel()));
|
||||
return QIcon(avatarPixmap);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -140,9 +140,9 @@ void PlayerListWidget::updatePlayerProperties(const ServerInfo_PlayerProperties
|
|||
}
|
||||
if (prop.has_user_info()) {
|
||||
player->setData(3, Qt::UserRole, prop.user_info().user_level());
|
||||
player->setIcon(
|
||||
3, QIcon(UserLevelPixmapGenerator::generatePixmap(12, UserLevelFlags(prop.user_info().user_level()), false,
|
||||
QString::fromStdString(prop.user_info().privlevel()))));
|
||||
player->setIcon(3, QIcon(UserLevelPixmapGenerator::generatePixmap(
|
||||
12, UserLevelFlags(prop.user_info().user_level()), prop.user_info().pawn_colors(), false,
|
||||
QString::fromStdString(prop.user_info().privlevel()))));
|
||||
player->setText(4, QString::fromStdString(prop.user_info().name()));
|
||||
const QString country = QString::fromStdString(prop.user_info().country());
|
||||
if (!country.isEmpty())
|
||||
|
|
|
|||
|
|
@ -103,9 +103,9 @@ void PlayerTarget::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*o
|
|||
|
||||
QPixmap tempPixmap;
|
||||
if (fullPixmap.isNull())
|
||||
tempPixmap =
|
||||
UserLevelPixmapGenerator::generatePixmap(translatedSize.height(), UserLevelFlags(info->user_level()),
|
||||
false, QString::fromStdString(info->privlevel()));
|
||||
tempPixmap = UserLevelPixmapGenerator::generatePixmap(
|
||||
translatedSize.height(), UserLevelFlags(info->user_level()), info->pawn_colors(), false,
|
||||
QString::fromStdString(info->privlevel()));
|
||||
else
|
||||
tempPixmap = fullPixmap.scaled(translatedSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue