mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
fix: don't show conceded players, fix: compute multicolumn layout correctly when dealing with odd number of players
This commit is contained in:
parent
b001421cfe
commit
3ed26e11ae
4 changed files with 10 additions and 7 deletions
|
|
@ -88,6 +88,8 @@ void PlayerListWidget::updatePlayerProperties(ServerInfo_PlayerProperties *prop)
|
|||
|
||||
player->setIcon(1, prop->getSpectator() ? spectatorIcon : playerIcon);
|
||||
player->setData(1, Qt::UserRole, !prop->getSpectator());
|
||||
player->setData(2, Qt::UserRole, prop->getConceded());
|
||||
player->setData(2, Qt::UserRole + 1, prop->getReadyStart());
|
||||
player->setIcon(2, gameStarted ? (prop->getConceded() ? concededIcon : QIcon()) : (prop->getReadyStart() ? readyIcon : notReadyIcon));
|
||||
player->setData(3, Qt::UserRole, prop->getUserInfo()->getUserLevel());
|
||||
player->setIcon(3, QIcon(UserLevelPixmapGenerator::generatePixmap(12, prop->getUserInfo()->getUserLevel())));
|
||||
|
|
@ -141,7 +143,7 @@ void PlayerListWidget::setGameStarted(bool _gameStarted)
|
|||
QMapIterator<int, QTreeWidgetItem *> i(players);
|
||||
while (i.hasNext()) {
|
||||
QTreeWidgetItem *twi = i.next().value();
|
||||
twi->setIcon(2, gameStarted ? QIcon() : notReadyIcon);
|
||||
twi->setIcon(2, gameStarted ? (twi->data(2, Qt::UserRole).toBool() ? concededIcon : QIcon()) : (twi->data(2, Qt::UserRole + 1).toBool() ? readyIcon : notReadyIcon));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue