100 HWProto::addStringToBuffer(buf, QString("eammprob %1").arg(ammostr.mid(cAmmoNumber, cAmmoNumber))); |
118 HWProto::addStringToBuffer(buf, QString("eammprob %1").arg(ammostr.mid(cAmmoNumber, cAmmoNumber))); |
101 HWProto::addStringToBuffer(buf, QString("eammdelay %1").arg(ammostr.mid(2 * cAmmoNumber, cAmmoNumber))); |
119 HWProto::addStringToBuffer(buf, QString("eammdelay %1").arg(ammostr.mid(2 * cAmmoNumber, cAmmoNumber))); |
102 HWProto::addStringToBuffer(buf, QString("eammreinf %1").arg(ammostr.mid(3 * cAmmoNumber, cAmmoNumber))); |
120 HWProto::addStringToBuffer(buf, QString("eammreinf %1").arg(ammostr.mid(3 * cAmmoNumber, cAmmoNumber))); |
103 if(gamecfg->schemeData(15).toBool() || !gamecfg->schemeData(21).toBool()) HWProto::addStringToBuffer(buf, QString("eammstore")); |
121 if(gamecfg->schemeData(15).toBool() || !gamecfg->schemeData(21).toBool()) HWProto::addStringToBuffer(buf, QString("eammstore")); |
104 HWProto::addStringListToBuffer(buf, |
122 HWProto::addStringListToBuffer(buf, |
105 team.teamGameConfig(gamecfg->getInitHealth())); |
123 team.teamGameConfig(gamecfg->getInitHealth(), config)); |
106 ; |
124 ; |
107 } |
125 } |
108 } |
126 } |
|
127 |
109 RawSendIPC(buf); |
128 RawSendIPC(buf); |
110 } |
129 } |
111 |
130 |
112 void HWGame::SendConfig() |
131 void HWGame::SendConfig() |
113 { |
132 { |
116 |
135 |
117 void HWGame::SendQuickConfig() |
136 void HWGame::SendQuickConfig() |
118 { |
137 { |
119 QByteArray teamscfg; |
138 QByteArray teamscfg; |
120 ThemeModel * themeModel = DataManager::instance().themeModel(); |
139 ThemeModel * themeModel = DataManager::instance().themeModel(); |
|
140 |
|
141 addKeyBindings(&teamscfg); |
121 |
142 |
122 HWProto::addStringToBuffer(teamscfg, "TL"); |
143 HWProto::addStringToBuffer(teamscfg, "TL"); |
123 HWProto::addStringToBuffer(teamscfg, QString("etheme %1") |
144 HWProto::addStringToBuffer(teamscfg, QString("etheme %1") |
124 .arg((themeModel->rowCount() > 0) ? themeModel->index(rand() % themeModel->rowCount()).data().toString() : "steel")); |
145 .arg((themeModel->rowCount() > 0) ? themeModel->index(rand() % themeModel->rowCount()).data().toString() : "steel")); |
125 HWProto::addStringToBuffer(teamscfg, "eseed " + QUuid::createUuid().toString()); |
146 HWProto::addStringToBuffer(teamscfg, "eseed " + QUuid::createUuid().toString()); |
130 team1.setDifficulty(0); |
151 team1.setDifficulty(0); |
131 team1.setColor(0); |
152 team1.setColor(0); |
132 team1.setNumHedgehogs(4); |
153 team1.setNumHedgehogs(4); |
133 HWNamegen::teamRandomNames(team1,true); |
154 HWNamegen::teamRandomNames(team1,true); |
134 HWProto::addStringListToBuffer(teamscfg, |
155 HWProto::addStringListToBuffer(teamscfg, |
135 team1.teamGameConfig(100)); |
156 team1.teamGameConfig(100, config)); |
136 |
157 |
137 HWTeam team2; |
158 HWTeam team2; |
138 team2.setDifficulty(4); |
159 team2.setDifficulty(4); |
139 team2.setColor(1); |
160 team2.setColor(1); |
140 team2.setNumHedgehogs(4); |
161 team2.setNumHedgehogs(4); |
141 do |
162 do |
142 HWNamegen::teamRandomNames(team2,true); |
163 HWNamegen::teamRandomNames(team2,true); |
143 while(!team2.name().compare(team1.name()) || !team2.hedgehog(0).Hat.compare(team1.hedgehog(0).Hat)); |
164 while(!team2.name().compare(team1.name()) || !team2.hedgehog(0).Hat.compare(team1.hedgehog(0).Hat)); |
144 HWProto::addStringListToBuffer(teamscfg, |
165 HWProto::addStringListToBuffer(teamscfg, |
145 team2.teamGameConfig(100)); |
166 team2.teamGameConfig(100, config)); |
146 |
167 |
147 HWProto::addStringToBuffer(teamscfg, QString("eammloadt %1").arg(cDefaultAmmoStore->mid(0, cAmmoNumber))); |
168 HWProto::addStringToBuffer(teamscfg, QString("eammloadt %1").arg(cDefaultAmmoStore->mid(0, cAmmoNumber))); |
148 HWProto::addStringToBuffer(teamscfg, QString("eammprob %1").arg(cDefaultAmmoStore->mid(cAmmoNumber, cAmmoNumber))); |
169 HWProto::addStringToBuffer(teamscfg, QString("eammprob %1").arg(cDefaultAmmoStore->mid(cAmmoNumber, cAmmoNumber))); |
149 HWProto::addStringToBuffer(teamscfg, QString("eammdelay %1").arg(cDefaultAmmoStore->mid(2 * cAmmoNumber, cAmmoNumber))); |
170 HWProto::addStringToBuffer(teamscfg, QString("eammdelay %1").arg(cDefaultAmmoStore->mid(2 * cAmmoNumber, cAmmoNumber))); |
150 HWProto::addStringToBuffer(teamscfg, QString("eammreinf %1").arg(cDefaultAmmoStore->mid(3 * cAmmoNumber, cAmmoNumber))); |
171 HWProto::addStringToBuffer(teamscfg, QString("eammreinf %1").arg(cDefaultAmmoStore->mid(3 * cAmmoNumber, cAmmoNumber))); |
151 HWProto::addStringToBuffer(teamscfg, QString("eammstore")); |
172 HWProto::addStringToBuffer(teamscfg, QString("eammstore")); |
152 HWProto::addStringToBuffer(teamscfg, QString("eammstore")); |
173 HWProto::addStringToBuffer(teamscfg, QString("eammstore")); |
|
174 |
153 RawSendIPC(teamscfg); |
175 RawSendIPC(teamscfg); |
154 } |
176 } |
155 |
177 |
156 void HWGame::SendTrainingConfig() |
178 void HWGame::SendTrainingConfig() |
157 { |
179 { |
158 QByteArray traincfg; |
180 QByteArray traincfg; |
159 HWProto::addStringToBuffer(traincfg, "TL"); |
181 HWProto::addStringToBuffer(traincfg, "TL"); |
160 HWProto::addStringToBuffer(traincfg, "eseed " + QUuid::createUuid().toString()); |
182 HWProto::addStringToBuffer(traincfg, "eseed " + QUuid::createUuid().toString()); |
161 HWProto::addStringToBuffer(traincfg, "escript " + training); |
183 HWProto::addStringToBuffer(traincfg, "escript " + training); |
162 |
184 |
|
185 addKeyBindings(&traincfg); |
|
186 |
163 RawSendIPC(traincfg); |
187 RawSendIPC(traincfg); |
164 } |
188 } |
165 |
189 |
166 void HWGame::SendCampaignConfig() |
190 void HWGame::SendCampaignConfig() |
167 { |
191 { |
168 QByteArray campaigncfg; |
192 QByteArray campaigncfg; |
169 HWProto::addStringToBuffer(campaigncfg, "TL"); |
193 HWProto::addStringToBuffer(campaigncfg, "TL"); |
170 HWProto::addStringToBuffer(campaigncfg, "eseed " + QUuid::createUuid().toString()); |
194 HWProto::addStringToBuffer(campaigncfg, "eseed " + QUuid::createUuid().toString()); |
171 |
195 |
172 HWProto::addStringToBuffer(campaigncfg, "escript " + campaignScript); |
196 HWProto::addStringToBuffer(campaigncfg, "escript " + campaignScript); |
|
197 |
|
198 addKeyBindings(&campaigncfg); |
173 |
199 |
174 RawSendIPC(campaigncfg); |
200 RawSendIPC(campaigncfg); |
175 } |
201 } |
176 |
202 |
177 void HWGame::SendNetConfig() |
203 void HWGame::SendNetConfig() |
327 arguments << tr("en.txt"); |
363 arguments << tr("en.txt"); |
328 arguments << "--frame-interval"; |
364 arguments << "--frame-interval"; |
329 arguments << QString::number(config->timerInterval()); |
365 arguments << QString::number(config->timerInterval()); |
330 arguments << "--volume"; |
366 arguments << "--volume"; |
331 arguments << QString::number(config->volume()); |
367 arguments << QString::number(config->volume()); |
|
368 arguments << "--fullscreen-width"; |
|
369 arguments << QString::number(resolutions.first.width()); |
|
370 arguments << "--fullscreen-height"; |
|
371 arguments << QString::number(resolutions.first.height()); |
332 arguments << "--width"; |
372 arguments << "--width"; |
333 arguments << QString::number(resolution.width()); |
373 arguments << QString::number(resolutions.second.width()); |
334 arguments << "--height"; |
374 arguments << "--height"; |
335 arguments << QString::number(resolution.height()); |
375 arguments << QString::number(resolutions.second.height()); |
336 arguments << "--raw-quality"; |
376 arguments << "--raw-quality"; |
337 arguments << QString::number(config->translateQuality()); |
377 arguments << QString::number(config->translateQuality()); |
338 arguments << "--stereo"; |
378 arguments << "--stereo"; |
339 arguments << QString::number(config->stereoMode()); |
379 arguments << QString::number(config->stereoMode()); |
340 if (config->vid_Fullscreen()) |
380 if (config->vid_Fullscreen()) |