multiplayer colors enabled
authordisplacer
Sat, 28 Oct 2006 15:09:51 +0000
changeset 213 c5480c5b11ff
parent 212 c8c650b23e32
child 214 3cd2b0f4531e
multiplayer colors enabled
QTfrontend/game.cpp
QTfrontend/game.h
QTfrontend/hwform.cpp
--- a/QTfrontend/game.cpp	Sat Oct 28 13:18:23 2006 +0000
+++ b/QTfrontend/game.cpp	Sat Oct 28 15:09:51 2006 +0000
@@ -61,8 +61,9 @@
 	{
 		SendIPC("eaddteam");
 		LocalCFG(teams[i]);
-		SendIPC(QString("ecolor %1").arg(65535 << i * 8).toAscii());
-		for (int t = 0; t < hdNum[teams[i]]; t++)
+		QColor clr=m_teamsParams[teams[i]].teamColor;
+		SendIPC(QString("ecolor %1").arg(clr.rgb()).toAscii());//&0xFFFFFF
+		for (int t = 0; t < m_teamsParams[teams[i]].numHedgehogs; t++)
 			SendIPC(QString("eadd hh%1 0").arg(t).toAscii());
 	}
 }
@@ -189,12 +190,12 @@
 	return arguments;
 }
 
-void HWGame::AddTeam(const QString & teamname, unsigned char numHedgedogs)
+void HWGame::AddTeam(const QString & teamname, HWTeamTempParams teamParams)
 {
 	if (TeamCount == 5) return;
 	teams[TeamCount] = teamname;
 	TeamCount++;
-	hdNum[teamname]=numHedgedogs;
+	m_teamsParams[teamname]=teamParams;
 }
 
 void HWGame::SaveDemo(const QString & filename)
--- a/QTfrontend/game.h	Sat Oct 28 13:18:23 2006 +0000
+++ b/QTfrontend/game.h	Sat Oct 28 15:09:51 2006 +0000
@@ -36,7 +36,7 @@
 	Q_OBJECT
 public:
 	HWGame(GameUIConfig * config, GameCFGWidget * gamecfg);
-	void AddTeam(const QString & team, unsigned char numHedgedogs);
+	void AddTeam(const QString & team, HWTeamTempParams teamParams);
 	void PlayDemo(const QString & demofilename);
 	void StartLocal();
 	void StartQuick();
@@ -64,7 +64,7 @@
     };
 	char msgbuf[MAXMSGCHARS];
 	QString teams[5];
-	std::map<QString, unsigned char> hdNum;
+	std::map<QString, HWTeamTempParams> m_teamsParams;
 	QString seed;
 	int TeamCount;
 	GameUIConfig * config;
--- a/QTfrontend/hwform.cpp	Sat Oct 28 13:18:23 2006 +0000
+++ b/QTfrontend/hwform.cpp	Sat Oct 28 15:09:51 2006 +0000
@@ -254,7 +254,7 @@
 	list<HWTeam> teamslist=ui.pageMultiplayer->teamsSelect->getPlayingTeams();
 	for (list<HWTeam>::const_iterator it = teamslist.begin(); it != teamslist.end(); ++it ) {
 	  HWTeamTempParams params=ui.pageMultiplayer->teamsSelect->getTeamParams(it->TeamName);
-	  game->AddTeam(it->TeamName, params.numHedgehogs);
+	  game->AddTeam(it->TeamName, params);
 	}
 	game->StartLocal();
 }