Send notification to clients when a game in the lobby was started. Mark games as running in lobby dialog.
This commit is contained in:
@@ -209,8 +209,11 @@ void gameLobbyDialogImpl::updateGameItem(QTreeWidgetItem *item, unsigned gameId)
|
||||
playerStr.sprintf("%u/%u", info.players.size(), info.data.maxNumberOfPlayers);
|
||||
item->setData(1, Qt::DisplayRole, playerStr);
|
||||
|
||||
if (info.isPasswordProtected)
|
||||
if (info.mode == GAME_MODE_STARTED)
|
||||
item->setData(2, Qt::DisplayRole, "X");
|
||||
|
||||
if (info.isPasswordProtected)
|
||||
item->setData(3, Qt::DisplayRole, "X");
|
||||
}
|
||||
|
||||
void gameLobbyDialogImpl::addGame(unsigned gameId)
|
||||
@@ -220,6 +223,19 @@ void gameLobbyDialogImpl::addGame(unsigned gameId)
|
||||
updateGameItem(item, gameId);
|
||||
}
|
||||
|
||||
void gameLobbyDialogImpl::updateGameMode(unsigned gameId, int /*newMode*/)
|
||||
{
|
||||
QTreeWidgetItemIterator it(treeWidget_GameList);
|
||||
while (*it) {
|
||||
if ((*it)->data(0, Qt::UserRole) == gameId)
|
||||
{
|
||||
updateGameItem(*it, gameId);
|
||||
break;
|
||||
}
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
void gameLobbyDialogImpl::removeGame(unsigned gameId)
|
||||
{
|
||||
QTreeWidgetItemIterator it(treeWidget_GameList);
|
||||
|
||||
Reference in New Issue
Block a user