GCI task: idea
authorkragniz
Thu, 29 Dec 2011 09:35:04 +0100
changeset 6539 3222bb0612ca
parent 6538 5a1f49d84d95
child 6540 d04601edf73d
GCI task: idea
QTfrontend/net/newnetclient.cpp
QTfrontend/ui/page/pagenetgame.cpp
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/FrontendDataUtils.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/GameMode.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Grave.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Map.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Scheme.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Team.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Weapon.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/UserInput/TouchInterface.java
share/hedgewars/Data/Scripts/plist/Racer.plist
--- a/QTfrontend/net/newnetclient.cpp	Thu Dec 29 09:29:56 2011 +0100
+++ b/QTfrontend/net/newnetclient.cpp	Thu Dec 29 09:35:04 2011 +0100
@@ -81,6 +81,9 @@
 
     RawSendNet(QString("CREATE_ROOM%1%2").arg(delimeter).arg(room));
     isChief = true;
+
+    //set our ready status to be true
+    RawSendNet(QString("TOGGLE_READY"));
 }
 
 void HWNewNet::JoinRoom(const QString & room)
@@ -167,7 +170,7 @@
 }
 
 void HWNewNet::OnConnect()
-{
+{   
     netClientState = Connected;
 }
 
@@ -341,8 +344,10 @@
                 {
                     for(int i = 2; i < lst.size(); ++i)
                     {
-                        if (lst[i] == mynick)
+                        if (lst[i] == mynick) {
                             emit setMyReadyStatus(setFlag);
+                        }
+
                         emit setReadyStatus(lst[i], setFlag);
                     }
                 }
--- a/QTfrontend/ui/page/pagenetgame.cpp	Thu Dec 29 09:29:56 2011 +0100
+++ b/QTfrontend/ui/page/pagenetgame.cpp	Thu Dec 29 09:35:04 2011 +0100
@@ -67,6 +67,7 @@
     leRoomName->setMinimumWidth(200);
     leRoomName->setMaximumWidth(400);
 
+    //Button to signify whether the player is ready to start playing
     BtnGo = new QPushButton(this);
     BtnGo->setToolTip(QPushButton::tr("Ready"));
     BtnGo->setIcon(QIcon(":/res/lightbulb_off.png"));
@@ -74,7 +75,6 @@
     BtnGo->setMinimumWidth(50);
     BtnGo->setMinimumHeight(50);
 
-
     bottomLayout->addWidget(leRoomName);
     BtnUpdate = addButton(QAction::tr("Update"), bottomLayout, 1);
 
@@ -172,6 +172,10 @@
     BtnStart->setVisible(isMaster);
     BtnUpdate->setVisible(isMaster);
     leRoomName->setVisible(isMaster);
+
+    //disable the `toggle ready` button, because the start button does the same
+    //job when the user is chief
+    BtnGo->setVisible(!isMaster);
 }
 
 void PageNetGame::setUser(const QString & nickname)