GUI: next steps advanced game infos in lobby, signals changed
This commit is contained in:
@@ -131,8 +131,8 @@ void ServerGuiWrapper::SignalNetClientNotification(int notificationId) { if (myC
|
|||||||
void ServerGuiWrapper::SignalNetClientStatsUpdate(const ServerStats &stats) { if (myClientcb) myClientcb->SignalNetClientStatsUpdate(stats); }
|
void ServerGuiWrapper::SignalNetClientStatsUpdate(const ServerStats &stats) { if (myClientcb) myClientcb->SignalNetClientStatsUpdate(stats); }
|
||||||
void ServerGuiWrapper::SignalNetClientShowTimeoutDialog(NetTimeoutReason reason, unsigned remainingSec) { if (myClientcb) myClientcb->SignalNetClientShowTimeoutDialog(reason, remainingSec); }
|
void ServerGuiWrapper::SignalNetClientShowTimeoutDialog(NetTimeoutReason reason, unsigned remainingSec) { if (myClientcb) myClientcb->SignalNetClientShowTimeoutDialog(reason, remainingSec); }
|
||||||
void ServerGuiWrapper::SignalNetClientRemovedFromGame(int notificationId) { if (myClientcb) myClientcb->SignalNetClientRemovedFromGame(notificationId); }
|
void ServerGuiWrapper::SignalNetClientRemovedFromGame(int notificationId) { if (myClientcb) myClientcb->SignalNetClientRemovedFromGame(notificationId); }
|
||||||
void ServerGuiWrapper::SignalNetClientSelfJoined(unsigned playerId, const string &playerName, PlayerRights rights) { if (myClientcb) myClientcb->SignalNetClientSelfJoined(playerId, playerName, rights); }
|
void ServerGuiWrapper::SignalNetClientSelfJoined(unsigned playerId, const string &playerName, bool isGameAdmin) { if (myClientcb) myClientcb->SignalNetClientSelfJoined(playerId, playerName, isGameAdmin); }
|
||||||
void ServerGuiWrapper::SignalNetClientPlayerJoined(unsigned playerId, const string &playerName, PlayerRights rights) { if (myClientcb) myClientcb->SignalNetClientPlayerJoined(playerId, playerName, rights); }
|
void ServerGuiWrapper::SignalNetClientPlayerJoined(unsigned playerId, const string &playerName, bool isGameAdmin) { if (myClientcb) myClientcb->SignalNetClientPlayerJoined(playerId, playerName, isGameAdmin); }
|
||||||
void ServerGuiWrapper::SignalNetClientPlayerChanged(unsigned playerId, const string &newPlayerName) { if (myClientcb) myClientcb->SignalNetClientPlayerChanged(playerId, newPlayerName); }
|
void ServerGuiWrapper::SignalNetClientPlayerChanged(unsigned playerId, const string &newPlayerName) { if (myClientcb) myClientcb->SignalNetClientPlayerChanged(playerId, newPlayerName); }
|
||||||
void ServerGuiWrapper::SignalNetClientPlayerLeft(unsigned playerId, const string &playerName, int removeReason) { if (myClientcb) myClientcb->SignalNetClientPlayerLeft(playerId, playerName, removeReason); }
|
void ServerGuiWrapper::SignalNetClientPlayerLeft(unsigned playerId, const string &playerName, int removeReason) { if (myClientcb) myClientcb->SignalNetClientPlayerLeft(playerId, playerName, removeReason); }
|
||||||
void ServerGuiWrapper::SignalNetClientNewGameAdmin(unsigned playerId, const string &playerName) { if (myClientcb) myClientcb->SignalNetClientNewGameAdmin(playerId, playerName); }
|
void ServerGuiWrapper::SignalNetClientNewGameAdmin(unsigned playerId, const string &playerName) { if (myClientcb) myClientcb->SignalNetClientNewGameAdmin(playerId, playerName); }
|
||||||
|
|||||||
@@ -111,8 +111,8 @@ public:
|
|||||||
void SignalNetClientStatsUpdate(const ServerStats &stats);
|
void SignalNetClientStatsUpdate(const ServerStats &stats);
|
||||||
void SignalNetClientShowTimeoutDialog(NetTimeoutReason reason, unsigned remainingSec);
|
void SignalNetClientShowTimeoutDialog(NetTimeoutReason reason, unsigned remainingSec);
|
||||||
void SignalNetClientRemovedFromGame(int notificationId);
|
void SignalNetClientRemovedFromGame(int notificationId);
|
||||||
void SignalNetClientSelfJoined(unsigned playerId, const std::string &playerName, PlayerRights rights);
|
void SignalNetClientSelfJoined(unsigned playerId, const std::string &playerName, bool isGameAdmin);
|
||||||
void SignalNetClientPlayerJoined(unsigned playerId, const std::string &playerName, PlayerRights rights);
|
void SignalNetClientPlayerJoined(unsigned playerId, const std::string &playerName, bool isGameAdmin);
|
||||||
void SignalNetClientPlayerChanged(unsigned playerId, const std::string &newPlayerName);
|
void SignalNetClientPlayerChanged(unsigned playerId, const std::string &newPlayerName);
|
||||||
void SignalNetClientPlayerLeft(unsigned playerId, const std::string &playerName, int removeReason);
|
void SignalNetClientPlayerLeft(unsigned playerId, const std::string &playerName, int removeReason);
|
||||||
void SignalNetClientNewGameAdmin(unsigned playerId, const std::string &playerName);
|
void SignalNetClientNewGameAdmin(unsigned playerId, const std::string &playerName);
|
||||||
|
|||||||
@@ -317,7 +317,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label_gameType">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Game type:</string>
|
<string>Game type:</string>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#include <net/socket_msg.h>
|
#include <net/socket_msg.h>
|
||||||
|
|
||||||
gameLobbyDialogImpl::gameLobbyDialogImpl(startWindowImpl *parent, ConfigFile *c)
|
gameLobbyDialogImpl::gameLobbyDialogImpl(startWindowImpl *parent, ConfigFile *c)
|
||||||
: QDialog(parent), myW(NULL), myStartWindow(parent), myConfig(c), currentGameName(""), myPlayerId(0), myCurrentGameId(0), isAdmin(false), inGame(false), guestMode(false), blinkingButtonAnimationState(true), myChat(NULL), keyUpCounter(0)
|
: QDialog(parent), myW(NULL), myStartWindow(parent), myConfig(c), currentGameName(""), myPlayerId(0), myCurrentGameId(0), isGameAdministrator(false), inGame(false), guestMode(false), blinkingButtonAnimationState(true), myChat(NULL), keyUpCounter(0)
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
@@ -195,6 +195,29 @@ void gameLobbyDialogImpl::createGame()
|
|||||||
|
|
||||||
currentGameName = myCreateInternetGameDialog->lineEdit_gameName->text();
|
currentGameName = myCreateInternetGameDialog->lineEdit_gameName->text();
|
||||||
|
|
||||||
|
switch (gameData.gameType) {
|
||||||
|
case GAME_TYPE_NORMAL: {
|
||||||
|
label_typeIcon->setPixmap(QPixmap(":/gfx/player_play.png"));
|
||||||
|
label_typeText->setText(tr("Standard"));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GAME_TYPE_REGISTERED_ONLY: {
|
||||||
|
label_typeIcon->setPixmap(QPixmap(":/gfx/registered.png"));
|
||||||
|
label_typeText->setText(tr("Registered players only"));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GAME_TYPE_INVITE_ONLY: {
|
||||||
|
label_typeIcon->setPixmap(QPixmap(":/gfx/list_add_user.png"));
|
||||||
|
label_typeText->setText(tr("Invited players only"));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GAME_TYPE_RANKING: {
|
||||||
|
label_typeIcon->setPixmap(QPixmap(":/gfx/cup.png"));
|
||||||
|
label_typeText->setText(tr("Ranking game"));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
hideShowGameDescription(TRUE);
|
hideShowGameDescription(TRUE);
|
||||||
|
|
||||||
label_SmallBlind->setText(QString("%L1").arg(gameData.firstSmallBlind));
|
label_SmallBlind->setText(QString("%L1").arg(gameData.firstSmallBlind));
|
||||||
@@ -208,6 +231,8 @@ void gameLobbyDialogImpl::createGame()
|
|||||||
|
|
||||||
label_TimeoutForPlayerAction->setText(QString::number(gameData.playerActionTimeoutSec));
|
label_TimeoutForPlayerAction->setText(QString::number(gameData.playerActionTimeoutSec));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mySession->clientCreateGame(gameData, currentGameName.toUtf8().constData(), myCreateInternetGameDialog->lineEdit_Password->text().toUtf8().constData());
|
mySession->clientCreateGame(gameData, currentGameName.toUtf8().constData(), myCreateInternetGameDialog->lineEdit_Password->text().toUtf8().constData());
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -294,7 +319,7 @@ void gameLobbyDialogImpl::refresh(int actionID) {
|
|||||||
void gameLobbyDialogImpl::removedFromGame(int /*reason*/)
|
void gameLobbyDialogImpl::removedFromGame(int /*reason*/)
|
||||||
{
|
{
|
||||||
inGame = false;
|
inGame = false;
|
||||||
isAdmin = false;
|
isGameAdministrator = false;
|
||||||
leftGameDialogUpdate();
|
leftGameDialogUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -313,6 +338,29 @@ void gameLobbyDialogImpl::gameSelected(const QModelIndex &index, const QModelInd
|
|||||||
assert(mySession);
|
assert(mySession);
|
||||||
GameInfo info(mySession->getClientGameInfo(myGameListModel->item(myGameListSortFilterProxyModel->mapToSource(index).row(), 0)->data(Qt::UserRole).toUInt()));
|
GameInfo info(mySession->getClientGameInfo(myGameListModel->item(myGameListSortFilterProxyModel->mapToSource(index).row(), 0)->data(Qt::UserRole).toUInt()));
|
||||||
|
|
||||||
|
switch (info.data.gameType) {
|
||||||
|
case GAME_TYPE_NORMAL: {
|
||||||
|
label_typeIcon->setPixmap(QPixmap(":/gfx/player_play.png"));
|
||||||
|
label_typeText->setText(tr("Standard"));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GAME_TYPE_REGISTERED_ONLY: {
|
||||||
|
label_typeIcon->setPixmap(QPixmap(":/gfx/registered.png"));
|
||||||
|
label_typeText->setText(tr("Registered players only"));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GAME_TYPE_INVITE_ONLY: {
|
||||||
|
label_typeIcon->setPixmap(QPixmap(":/gfx/list_add_user.png"));
|
||||||
|
label_typeText->setText(tr("Invited players only"));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GAME_TYPE_RANKING: {
|
||||||
|
label_typeIcon->setPixmap(QPixmap(":/gfx/cup.png"));
|
||||||
|
label_typeText->setText(tr("Ranking game"));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
hideShowGameDescription(TRUE);
|
hideShowGameDescription(TRUE);
|
||||||
label_SmallBlind->setText(QString("%L1").arg(info.data.firstSmallBlind));
|
label_SmallBlind->setText(QString("%L1").arg(info.data.firstSmallBlind));
|
||||||
label_StartCash->setText(QString("%L1").arg(info.data.startMoney));
|
label_StartCash->setText(QString("%L1").arg(info.data.startMoney));
|
||||||
@@ -583,6 +631,8 @@ void gameLobbyDialogImpl::clearDialog()
|
|||||||
header->setData(0, Qt::UserRole, 0);
|
header->setData(0, Qt::UserRole, 0);
|
||||||
|
|
||||||
hideShowGameDescription(FALSE);
|
hideShowGameDescription(FALSE);
|
||||||
|
label_typeIcon->setText(" ");
|
||||||
|
label_typeText->setText(" ");
|
||||||
label_SmallBlind->setText("");
|
label_SmallBlind->setText("");
|
||||||
label_StartCash->setText("");
|
label_StartCash->setText("");
|
||||||
label_blindsRaiseIntervall->setText("");
|
label_blindsRaiseIntervall->setText("");
|
||||||
@@ -622,7 +672,7 @@ void gameLobbyDialogImpl::clearDialog()
|
|||||||
myChat->clearChat();
|
myChat->clearChat();
|
||||||
treeWidget_NickList->clear();
|
treeWidget_NickList->clear();
|
||||||
inGame = false;
|
inGame = false;
|
||||||
isAdmin = false;
|
isGameAdministrator = false;
|
||||||
myPlayerId = 0;
|
myPlayerId = 0;
|
||||||
|
|
||||||
hideShowGameDescription(FALSE);
|
hideShowGameDescription(FALSE);
|
||||||
@@ -637,7 +687,7 @@ void gameLobbyDialogImpl::clearDialog()
|
|||||||
|
|
||||||
void gameLobbyDialogImpl::checkPlayerQuantity() {
|
void gameLobbyDialogImpl::checkPlayerQuantity() {
|
||||||
|
|
||||||
if(isAdmin){
|
if(isGameAdministrator){
|
||||||
pushButton_Kick->show();
|
pushButton_Kick->show();
|
||||||
pushButton_StartGame->show();
|
pushButton_StartGame->show();
|
||||||
checkBox_fillUpWithComputerOpponents->show();
|
checkBox_fillUpWithComputerOpponents->show();
|
||||||
@@ -690,25 +740,25 @@ void gameLobbyDialogImpl::blinkingStartButtonAnimation() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gameLobbyDialogImpl::joinedNetworkGame(unsigned playerId, QString playerName, int rights) {
|
void gameLobbyDialogImpl::joinedNetworkGame(unsigned playerId, QString playerName, bool isGameAdmin) {
|
||||||
|
|
||||||
// Update dialog
|
// Update dialog
|
||||||
inGame = true;
|
inGame = true;
|
||||||
joinedGameDialogUpdate();
|
joinedGameDialogUpdate();
|
||||||
|
|
||||||
myPlayerId = playerId;
|
myPlayerId = playerId;
|
||||||
isAdmin = rights == PLAYER_RIGHTS_ADMIN;
|
isGameAdministrator = isGameAdmin;
|
||||||
addConnectedPlayer(playerId, playerName, rights);
|
addConnectedPlayer(playerId, playerName, isGameAdmin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void gameLobbyDialogImpl::addConnectedPlayer(unsigned playerId, QString playerName, int rights) {
|
void gameLobbyDialogImpl::addConnectedPlayer(unsigned playerId, QString playerName, bool isGameAdmin) {
|
||||||
|
|
||||||
QTreeWidgetItem *item = new QTreeWidgetItem(treeWidget_connectedPlayers, 0);
|
QTreeWidgetItem *item = new QTreeWidgetItem(treeWidget_connectedPlayers, 0);
|
||||||
item->setData(0, Qt::UserRole, playerId);
|
item->setData(0, Qt::UserRole, playerId);
|
||||||
item->setData(0, Qt::DisplayRole, playerName);
|
item->setData(0, Qt::DisplayRole, playerName);
|
||||||
|
|
||||||
if(rights == PLAYER_RIGHTS_ADMIN) item->setBackground(0, QBrush(QColor(0, 255, 0, 127)));
|
if(isGameAdmin) item->setBackground(0, QBrush(QColor(0, 255, 0, 127)));
|
||||||
|
|
||||||
if(this->isVisible() && inGame && myConfig->readConfigInt("PlayNetworkGameNotification")) {
|
if(this->isVisible() && inGame && myConfig->readConfigInt("PlayNetworkGameNotification")) {
|
||||||
if(treeWidget_connectedPlayers->topLevelItemCount() < treeWidget_connectedPlayers->headerItem()->data(0, Qt::UserRole).toInt()) {
|
if(treeWidget_connectedPlayers->topLevelItemCount() < treeWidget_connectedPlayers->headerItem()->data(0, Qt::UserRole).toInt()) {
|
||||||
@@ -822,7 +872,7 @@ void gameLobbyDialogImpl::newGameAdmin(unsigned playerId, QString)
|
|||||||
|
|
||||||
if (inGame && myPlayerId == playerId)
|
if (inGame && myPlayerId == playerId)
|
||||||
{
|
{
|
||||||
isAdmin = true;
|
isGameAdministrator = true;
|
||||||
checkPlayerQuantity();
|
checkPlayerQuantity();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -876,6 +926,8 @@ void gameLobbyDialogImpl::leftGameDialogUpdate() {
|
|||||||
header->setData(0, Qt::UserRole, 0);
|
header->setData(0, Qt::UserRole, 0);
|
||||||
|
|
||||||
hideShowGameDescription(FALSE);
|
hideShowGameDescription(FALSE);
|
||||||
|
label_typeIcon->setText(" ");
|
||||||
|
label_typeText->setText(" ");
|
||||||
label_SmallBlind->setText("");
|
label_SmallBlind->setText("");
|
||||||
label_StartCash->setText("");
|
label_StartCash->setText("");
|
||||||
label_blindsRaiseIntervall->setText("");
|
label_blindsRaiseIntervall->setText("");
|
||||||
@@ -925,7 +977,7 @@ void gameLobbyDialogImpl::updateDialogBlinds(const GameData &gameData) {
|
|||||||
void gameLobbyDialogImpl::playerSelected(QTreeWidgetItem* item, QTreeWidgetItem*) {
|
void gameLobbyDialogImpl::playerSelected(QTreeWidgetItem* item, QTreeWidgetItem*) {
|
||||||
|
|
||||||
if (item)
|
if (item)
|
||||||
pushButton_Kick->setEnabled(isAdmin);
|
pushButton_Kick->setEnabled(isGameAdministrator);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gameLobbyDialogImpl::startGame() {
|
void gameLobbyDialogImpl::startGame() {
|
||||||
@@ -1007,6 +1059,7 @@ bool gameLobbyDialogImpl::event ( QEvent * event ) {
|
|||||||
void gameLobbyDialogImpl::hideShowGameDescription(bool show) {
|
void gameLobbyDialogImpl::hideShowGameDescription(bool show) {
|
||||||
|
|
||||||
if(show) {
|
if(show) {
|
||||||
|
label_gameType->show();
|
||||||
label_gameDesc2->show();
|
label_gameDesc2->show();
|
||||||
label_gameDesc3->show();
|
label_gameDesc3->show();
|
||||||
label_gameDesc4->show();
|
label_gameDesc4->show();
|
||||||
@@ -1015,6 +1068,7 @@ void gameLobbyDialogImpl::hideShowGameDescription(bool show) {
|
|||||||
label_gameDesc7->show();
|
label_gameDesc7->show();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
label_gameType->show();
|
||||||
label_gameDesc2->hide();
|
label_gameDesc2->hide();
|
||||||
label_gameDesc3->hide();
|
label_gameDesc3->hide();
|
||||||
label_gameDesc4->hide();
|
label_gameDesc4->hide();
|
||||||
|
|||||||
@@ -81,8 +81,8 @@ public slots:
|
|||||||
void checkPlayerQuantity();
|
void checkPlayerQuantity();
|
||||||
void blinkingStartButtonAnimation();
|
void blinkingStartButtonAnimation();
|
||||||
|
|
||||||
void joinedNetworkGame(unsigned, QString, int);
|
void joinedNetworkGame(unsigned, QString, bool);
|
||||||
void addConnectedPlayer(unsigned, QString, int);
|
void addConnectedPlayer(unsigned, QString, bool);
|
||||||
void updatePlayer(unsigned, QString);
|
void updatePlayer(unsigned, QString);
|
||||||
void removePlayer(unsigned, QString);
|
void removePlayer(unsigned, QString);
|
||||||
void newGameAdmin(unsigned, QString);
|
void newGameAdmin(unsigned, QString);
|
||||||
@@ -128,7 +128,7 @@ private:
|
|||||||
QString currentGameName;
|
QString currentGameName;
|
||||||
unsigned myPlayerId;
|
unsigned myPlayerId;
|
||||||
unsigned myCurrentGameId;
|
unsigned myCurrentGameId;
|
||||||
bool isAdmin;
|
bool isGameAdministrator;
|
||||||
bool inGame;
|
bool inGame;
|
||||||
bool guestMode;
|
bool guestMode;
|
||||||
|
|
||||||
|
|||||||
@@ -134,8 +134,8 @@ void GuiWrapper::SignalNetClientNotification(int notificationId) { myStartWindow
|
|||||||
void GuiWrapper::SignalNetClientStatsUpdate(const ServerStats &stats) { myStartWindow->signalNetClientStatsUpdate(stats); }
|
void GuiWrapper::SignalNetClientStatsUpdate(const ServerStats &stats) { myStartWindow->signalNetClientStatsUpdate(stats); }
|
||||||
void GuiWrapper::SignalNetClientShowTimeoutDialog(NetTimeoutReason reason, unsigned remainingSec) { myStartWindow->signalNetClientShowTimeoutDialog(reason, remainingSec); }
|
void GuiWrapper::SignalNetClientShowTimeoutDialog(NetTimeoutReason reason, unsigned remainingSec) { myStartWindow->signalNetClientShowTimeoutDialog(reason, remainingSec); }
|
||||||
void GuiWrapper::SignalNetClientRemovedFromGame(int notificationId) { myStartWindow->signalNetClientRemovedFromGame(notificationId); }
|
void GuiWrapper::SignalNetClientRemovedFromGame(int notificationId) { myStartWindow->signalNetClientRemovedFromGame(notificationId); }
|
||||||
void GuiWrapper::SignalNetClientSelfJoined(unsigned playerId, const string &playerName, PlayerRights rights) { myStartWindow->signalNetClientSelfJoined(playerId, QString::fromUtf8(playerName.c_str()), rights); }
|
void GuiWrapper::SignalNetClientSelfJoined(unsigned playerId, const string &playerName, bool isGameAdmin) { myStartWindow->signalNetClientSelfJoined(playerId, QString::fromUtf8(playerName.c_str()), isGameAdmin); }
|
||||||
void GuiWrapper::SignalNetClientPlayerJoined(unsigned playerId, const string &playerName, PlayerRights rights) { myStartWindow->signalNetClientPlayerJoined(playerId, QString::fromUtf8(playerName.c_str()), rights); }
|
void GuiWrapper::SignalNetClientPlayerJoined(unsigned playerId, const string &playerName, bool isGameAdmin) { myStartWindow->signalNetClientPlayerJoined(playerId, QString::fromUtf8(playerName.c_str()), isGameAdmin); }
|
||||||
void GuiWrapper::SignalNetClientPlayerChanged(unsigned playerId, const string &newPlayerName)
|
void GuiWrapper::SignalNetClientPlayerChanged(unsigned playerId, const string &newPlayerName)
|
||||||
{
|
{
|
||||||
myStartWindow->signalNetClientPlayerChanged(playerId, QString::fromUtf8(newPlayerName.c_str()));
|
myStartWindow->signalNetClientPlayerChanged(playerId, QString::fromUtf8(newPlayerName.c_str()));
|
||||||
|
|||||||
@@ -122,8 +122,8 @@ public:
|
|||||||
void SignalNetClientStatsUpdate(const ServerStats &stats);
|
void SignalNetClientStatsUpdate(const ServerStats &stats);
|
||||||
void SignalNetClientShowTimeoutDialog(NetTimeoutReason reason, unsigned remainingSec);
|
void SignalNetClientShowTimeoutDialog(NetTimeoutReason reason, unsigned remainingSec);
|
||||||
void SignalNetClientRemovedFromGame(int notificationId);
|
void SignalNetClientRemovedFromGame(int notificationId);
|
||||||
void SignalNetClientSelfJoined(unsigned playerId, const std::string &playerName, PlayerRights rights);
|
void SignalNetClientSelfJoined(unsigned playerId, const std::string &playerName, bool isGameAdmin);
|
||||||
void SignalNetClientPlayerJoined(unsigned playerId, const std::string &playerName, PlayerRights rights);
|
void SignalNetClientPlayerJoined(unsigned playerId, const std::string &playerName, bool isGameAdmin);
|
||||||
void SignalNetClientPlayerChanged(unsigned playerId, const std::string &newPlayerName);
|
void SignalNetClientPlayerChanged(unsigned playerId, const std::string &newPlayerName);
|
||||||
void SignalNetClientPlayerLeft(unsigned playerId, const std::string &playerName, int removeReason);
|
void SignalNetClientPlayerLeft(unsigned playerId, const std::string &playerName, int removeReason);
|
||||||
void SignalNetClientNewGameAdmin(unsigned playerId, const std::string &playerName);
|
void SignalNetClientNewGameAdmin(unsigned playerId, const std::string &playerName);
|
||||||
|
|||||||
@@ -70,14 +70,14 @@ void startNetworkGameDialogImpl::refresh(int actionID) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void startNetworkGameDialogImpl::joinedNetworkGame(unsigned playerId, QString playerName, int rights) {
|
void startNetworkGameDialogImpl::joinedNetworkGame(unsigned playerId, QString playerName, bool admin) {
|
||||||
|
|
||||||
myPlayerId = playerId;
|
myPlayerId = playerId;
|
||||||
isAdmin = rights == PLAYER_RIGHTS_ADMIN;
|
isAdmin = admin;
|
||||||
addConnectedPlayer(playerId, playerName, rights);
|
addConnectedPlayer(playerId, playerName, admin);
|
||||||
}
|
}
|
||||||
|
|
||||||
void startNetworkGameDialogImpl::addConnectedPlayer(unsigned playerId, QString playerName, int /*rights*/) {
|
void startNetworkGameDialogImpl::addConnectedPlayer(unsigned playerId, QString playerName, bool) {
|
||||||
|
|
||||||
// TODO mark admin
|
// TODO mark admin
|
||||||
QTreeWidgetItem *item = new QTreeWidgetItem(treeWidget, 0);
|
QTreeWidgetItem *item = new QTreeWidgetItem(treeWidget, 0);
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ public slots:
|
|||||||
void refresh(int actionID);
|
void refresh(int actionID);
|
||||||
void accept();
|
void accept();
|
||||||
void reject();
|
void reject();
|
||||||
void joinedNetworkGame(unsigned playerId, QString playerName, int rights);
|
void joinedNetworkGame(unsigned playerId, QString playerName, bool admin);
|
||||||
void addConnectedPlayer(unsigned playerId, QString playerName, int rights);
|
void addConnectedPlayer(unsigned playerId, QString playerName, bool admin);
|
||||||
void updatePlayer(unsigned playerId, QString newPlayerName);
|
void updatePlayer(unsigned playerId, QString newPlayerName);
|
||||||
void removePlayer(unsigned playerId, QString playerName);
|
void removePlayer(unsigned playerId, QString playerName);
|
||||||
void newGameAdmin(unsigned playerId, QString playerName);
|
void newGameAdmin(unsigned playerId, QString playerName);
|
||||||
|
|||||||
@@ -128,8 +128,8 @@ startWindowImpl::startWindowImpl(ConfigFile *c)
|
|||||||
connect(this, SIGNAL(signalNetClientNewGameAdmin(unsigned, QString)), myStartNetworkGameDialog, SLOT(newGameAdmin(unsigned, QString)));
|
connect(this, SIGNAL(signalNetClientNewGameAdmin(unsigned, QString)), myStartNetworkGameDialog, SLOT(newGameAdmin(unsigned, QString)));
|
||||||
connect(this, SIGNAL(signalNetClientGameListNew(unsigned)), myStartNetworkGameDialog, SLOT(gameCreated(unsigned)));
|
connect(this, SIGNAL(signalNetClientGameListNew(unsigned)), myStartNetworkGameDialog, SLOT(gameCreated(unsigned)));
|
||||||
|
|
||||||
connect(this, SIGNAL(signalNetClientSelfJoined(unsigned, QString, int)), myGameLobbyDialog, SLOT(joinedNetworkGame(unsigned, QString, int)));
|
connect(this, SIGNAL(signalNetClientSelfJoined(unsigned, QString, bool)), myGameLobbyDialog, SLOT(joinedNetworkGame(unsigned, QString, bool)));
|
||||||
connect(this, SIGNAL(signalNetClientPlayerJoined(unsigned, QString, int)), myGameLobbyDialog, SLOT(addConnectedPlayer(unsigned, QString, int)));
|
connect(this, SIGNAL(signalNetClientPlayerJoined(unsigned, QString, bool)), myGameLobbyDialog, SLOT(addConnectedPlayer(unsigned, QString, bool)));
|
||||||
connect(this, SIGNAL(signalNetClientPlayerChanged(unsigned, QString)), myGameLobbyDialog, SLOT(updatePlayer(unsigned, QString)));
|
connect(this, SIGNAL(signalNetClientPlayerChanged(unsigned, QString)), myGameLobbyDialog, SLOT(updatePlayer(unsigned, QString)));
|
||||||
connect(this, SIGNAL(signalNetClientPlayerLeft(unsigned, QString)), myGameLobbyDialog, SLOT(removePlayer(unsigned, QString)));
|
connect(this, SIGNAL(signalNetClientPlayerLeft(unsigned, QString)), myGameLobbyDialog, SLOT(removePlayer(unsigned, QString)));
|
||||||
connect(this, SIGNAL(signalNetClientNewGameAdmin(unsigned, QString)), myGameLobbyDialog, SLOT(newGameAdmin(unsigned, QString)));
|
connect(this, SIGNAL(signalNetClientNewGameAdmin(unsigned, QString)), myGameLobbyDialog, SLOT(newGameAdmin(unsigned, QString)));
|
||||||
|
|||||||
Reference in New Issue
Block a user