fix/hack so that (own) messages sent in frontend are also visible in the game chat
authorsheepluva
Thu, 21 Mar 2013 10:08:30 +0100
changeset 8765 688062f1db59
parent 8762 388d2bf73ff9
child 8768 7450cb9c815b
fix/hack so that (own) messages sent in frontend are also visible in the game chat
QTfrontend/hwform.cpp
QTfrontend/net/newnetclient.cpp
QTfrontend/net/newnetclient.h
--- a/QTfrontend/hwform.cpp	Thu Mar 21 09:27:35 2013 +0100
+++ b/QTfrontend/hwform.cpp	Thu Mar 21 10:08:30 2013 +0100
@@ -1259,7 +1259,7 @@
     connect(hwnet, SIGNAL(roomMaster(bool)),
             ui.pageNetGame->chatWidget, SLOT(adminAccess(bool)), Qt::QueuedConnection);
     connect(ui.pageNetGame->chatWidget, SIGNAL(chatLine(const QString&)),
-            hwnet, SLOT(chatLineToNet(const QString&)));
+            hwnet, SLOT(chatLineToNetWithEcho(const QString&)));
     connect(ui.pageNetGame->BtnGo, SIGNAL(clicked()), hwnet, SLOT(ToggleReady()));
     connect(hwnet, SIGNAL(setMyReadyStatus(bool)),
             ui.pageNetGame, SLOT(setReadyStatus(bool)), Qt::QueuedConnection);
--- a/QTfrontend/net/newnetclient.cpp	Thu Mar 21 09:27:35 2013 +0100
+++ b/QTfrontend/net/newnetclient.cpp	Thu Mar 21 10:08:30 2013 +0100
@@ -850,6 +850,15 @@
         );
 }
 
+void HWNewNet::chatLineToNetWithEcho(const QString& str)
+{
+    if(str != "")
+    {
+        emit chatStringFromNet(HWProto::formatChatMsg(mynick, str));
+        chatLineToNet(str);
+    }
+}
+
 void HWNewNet::chatLineToNet(const QString& str)
 {
     if(str != "")
--- a/QTfrontend/net/newnetclient.h	Thu Mar 21 09:27:35 2013 +0100
+++ b/QTfrontend/net/newnetclient.h	Thu Mar 21 10:08:30 2013 +0100
@@ -143,6 +143,7 @@
     public slots:
         void ToggleReady();
         void chatLineToNet(const QString& str);
+        void chatLineToNetWithEcho(const QString&);
         void chatLineToLobby(const QString& str);
         void SendTeamMessage(const QString& str);
         void SendNet(const QByteArray & buf);