bugfix for "Idle players are not show correctly if they join YOUR game" #198
This commit is contained in:
@@ -563,16 +563,6 @@ void gameLobbyDialogImpl::updateGameItem(QList <QStandardItem*> itemList, unsign
|
|||||||
PlayerIdList::const_iterator end = info.players.end();
|
PlayerIdList::const_iterator end = info.players.end();
|
||||||
|
|
||||||
while (i != end) {
|
while (i != end) {
|
||||||
//mark players as active
|
|
||||||
int it1 = 0;
|
|
||||||
while (myNickListModel->item(it1)) {
|
|
||||||
if (myNickListModel->item(it1, 0)->data(Qt::UserRole) == *i) {
|
|
||||||
myNickListModel->item(it1, 0)->setData("active", 34);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
++it1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(myPlayerId == *i) {
|
if(myPlayerId == *i) {
|
||||||
itemList.at(0)->setData( "MeInThisGame", 16);
|
itemList.at(0)->setData( "MeInThisGame", 16);
|
||||||
itemList.at(0)->setBackground(QBrush(QColor(0, 255, 0, 127)));
|
itemList.at(0)->setBackground(QBrush(QColor(0, 255, 0, 127)));
|
||||||
@@ -594,6 +584,22 @@ void gameLobbyDialogImpl::updateGameItem(QList <QStandardItem*> itemList, unsign
|
|||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//reset players iterator
|
||||||
|
i = info.players.begin();
|
||||||
|
end = info.players.end();
|
||||||
|
while (i != end) {
|
||||||
|
//mark players as active
|
||||||
|
int it1 = 0;
|
||||||
|
while (myNickListModel->item(it1)) {
|
||||||
|
if (myNickListModel->item(it1, 0)->data(Qt::UserRole) == *i) {
|
||||||
|
myNickListModel->item(it1, 0)->setData("active", 34);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
++it1;
|
||||||
|
}
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
|
||||||
QString playerStr;
|
QString playerStr;
|
||||||
playerStr.sprintf("%u/%u", (unsigned)info.players.size(), (unsigned)info.data.maxNumberOfPlayers);
|
playerStr.sprintf("%u/%u", (unsigned)info.players.size(), (unsigned)info.data.maxNumberOfPlayers);
|
||||||
itemList.at(1)->setData(playerStr, Qt::DisplayRole);
|
itemList.at(1)->setData(playerStr, Qt::DisplayRole);
|
||||||
|
|||||||
Reference in New Issue
Block a user