QTfrontend/game.cpp
changeset 253 e7b3687fcb2c
parent 249 ff85fa029541
child 267 bf7c1503f569
equal deleted inserted replaced
252:455f29b31ed9 253:e7b3687fcb2c
    49 void HWGame::SendTeamConfig(int index)
    49 void HWGame::SendTeamConfig(int index)
    50 {
    50 {
    51 	LocalCFG(teams[index]);
    51 	LocalCFG(teams[index]);
    52 }
    52 }
    53 
    53 
    54 void HWGame::SendConfig()
    54 void HWGame::commonConfig()
    55 {
    55 {
    56 	SendIPC(QString("eseed %1").arg(seed).toAscii());
    56 	SendIPC(QString("eseed %1").arg(seed).toAscii());
    57 	try {
    57 	try {
    58 	  QString currentMap=gamecfg->getCurrentMap();
    58 	  QString currentMap=gamecfg->getCurrentMap();
    59 	  SendIPC((QString("emap ")+currentMap).toAscii());
    59 	  SendIPC((QString("emap ")+currentMap).toAscii());
    62 	catch(const MapFileErrorException& e) {
    62 	catch(const MapFileErrorException& e) {
    63 	  SendIPC(QString("etheme %1").arg(config->GetRandomTheme()).toAscii());
    63 	  SendIPC(QString("etheme %1").arg(config->GetRandomTheme()).toAscii());
    64 	}
    64 	}
    65 	SendIPC("TL");
    65 	SendIPC("TL");
    66 	SendIPC(QString("e$gmflags %1").arg(gamecfg->getGameFlags()).toAscii());
    66 	SendIPC(QString("e$gmflags %1").arg(gamecfg->getGameFlags()).toAscii());
       
    67 }
       
    68 
       
    69 void HWGame::SendConfig()
       
    70 {
       
    71 	commonConfig();
    67 
    72 
    68 	for (int i = 0; i < TeamCount; i++)
    73 	for (int i = 0; i < TeamCount; i++)
    69 	{
    74 	{
    70 		HWTeam team(teams[i]);
    75 		HWTeam team(teams[i]);
    71 		team.LoadFromFile();
    76 		team.LoadFromFile();
    78 	}
    83 	}
    79 }
    84 }
    80 
    85 
    81 void HWGame::SendQuickConfig()
    86 void HWGame::SendQuickConfig()
    82 {
    87 {
    83 	SendIPC(QString("eseed %1").arg(seed).toAscii());
    88 	commonConfig();
    84 	SendIPC(QString("etheme %1").arg(config->GetRandomTheme()).toAscii());
       
    85 	SendIPC("TL");
       
    86 	SendIPC(QString("e$gmflags %1").arg(gamecfg->getGameFlags()).toAscii());
       
    87 
    89 
    88 	QByteArray teamscfg;
    90 	QByteArray teamscfg;
    89 	HWTeam team1(0);
    91 	HWTeam team1(0);
    90 	team1.difficulty = 0;
    92 	team1.difficulty = 0;
    91 	HWProto::addStringListToBuffer(teamscfg, team1.TeamGameConfig(65535, 4));
    93 	HWProto::addStringListToBuffer(teamscfg, team1.TeamGameConfig(65535, 4));