Send and display owner name of own teams in online games (fixes bug 468)
authorWuzzy <Wuzzy2@mail.ru>
Wed, 09 Jan 2019 19:10:11 +0100
changeset 14534 db646b3c0b95
parent 14533 6446ddf0c0ba
child 14535 ec0afe1c6024
Send and display owner name of own teams in online games (fixes bug #468)
ChangeLog.txt
QTfrontend/team.cpp
QTfrontend/team.h
QTfrontend/ui/widget/teamselect.cpp
--- a/ChangeLog.txt	Tue Jan 08 03:03:21 2019 +0100
+++ b/ChangeLog.txt	Wed Jan 09 19:10:11 2019 +0100
@@ -13,6 +13,7 @@
  + Don't show crate spawn message for initial crates in missions
  + The Specialists: Unlock game scheme
  + The Specialists: Add script parameter support to set custom specialists order
+ + Display player name of own teams in online games
  * Use player-chosen team identity in campaigns and singleplayer missions
  * Fix last 2 characters in demo chat being missing
  * Fix homing bee flying weird if passing wrap world edge or target was placed beyond it
--- a/QTfrontend/team.cpp	Tue Jan 08 03:03:21 2019 +0100
+++ b/QTfrontend/team.cpp	Wed Jan 09 19:10:11 2019 +0100
@@ -349,6 +349,10 @@
     return m_owner;
 }
 
+void HWTeam::setOwner(const QString & owner)
+{
+    m_owner = owner;
+}
 
 
 // difficulty
--- a/QTfrontend/team.h	Tue Jan 08 03:03:21 2019 +0100
+++ b/QTfrontend/team.h	Wed Jan 09 19:10:11 2019 +0100
@@ -77,6 +77,7 @@
         QString name() const;
         unsigned char numHedgehogs() const;
         QString owner() const;
+        void setOwner(const QString & owner);
         QString voicepack() const;
 
         // attribute setters
--- a/QTfrontend/ui/widget/teamselect.cpp	Tue Jan 08 03:03:21 2019 +0100
+++ b/QTfrontend/ui/widget/teamselect.cpp	Wed Jan 09 19:10:11 2019 +0100
@@ -215,8 +215,9 @@
         // dont playing team => playing
         itDontPlay->setColor(framePlaying->getNextColor());
         team=*itDontPlay; // for net team info saving in framePlaying (we have only name with netID from network)
-        curPlayingTeams.push_back(*itDontPlay);
-        if(!m_acceptOuter) emit teamWillPlay(*itDontPlay);
+        team.setOwner(m_curUser);
+        curPlayingTeams.push_back(team);
+        if(!m_acceptOuter) emit teamWillPlay(team);
         m_curNotPlayingTeams.erase(itDontPlay);
 
         // Hide team notice if at least two teams.