130 m_hedgehogs[i].Kills = teamfile.value(hh + "Kills", 0).toInt(); |
130 m_hedgehogs[i].Kills = teamfile.value(hh + "Kills", 0).toInt(); |
131 m_hedgehogs[i].Deaths = teamfile.value(hh + "Deaths", 0).toInt(); |
131 m_hedgehogs[i].Deaths = teamfile.value(hh + "Deaths", 0).toInt(); |
132 m_hedgehogs[i].Suicides = teamfile.value(hh + "Suicides", 0).toInt(); |
132 m_hedgehogs[i].Suicides = teamfile.value(hh + "Suicides", 0).toInt(); |
133 } |
133 } |
134 for(int i = 0; i < BINDS_NUMBER; i++) |
134 for(int i = 0; i < BINDS_NUMBER; i++) |
135 binds[i].strbind = teamfile.value(QString("Binds/%1").arg(binds[i].action), cbinds[i].strbind).toString(); |
135 m_binds[i].strbind = teamfile.value(QString("Binds/%1").arg(m_binds[i].action), cbinds[i].strbind).toString(); |
136 for(int i = 0; i < MAX_ACHIEVEMENTS; i++) |
136 for(int i = 0; i < MAX_ACHIEVEMENTS; i++) |
137 if(achievements[i][0][0]) |
137 if(achievements[i][0][0]) |
138 AchievementProgress[i] = teamfile.value(QString("Achievements/%1").arg(achievements[i][0]), 0).toUInt(); |
138 AchievementProgress[i] = teamfile.value(QString("Achievements/%1").arg(achievements[i][0]), 0).toUInt(); |
139 else |
139 else |
140 break; |
140 break; |
184 teamfile.setValue(hh + "Kills", m_hedgehogs[i].Kills); |
184 teamfile.setValue(hh + "Kills", m_hedgehogs[i].Kills); |
185 teamfile.setValue(hh + "Deaths", m_hedgehogs[i].Deaths); |
185 teamfile.setValue(hh + "Deaths", m_hedgehogs[i].Deaths); |
186 teamfile.setValue(hh + "Suicides", m_hedgehogs[i].Suicides); |
186 teamfile.setValue(hh + "Suicides", m_hedgehogs[i].Suicides); |
187 } |
187 } |
188 for(int i = 0; i < BINDS_NUMBER; i++) |
188 for(int i = 0; i < BINDS_NUMBER; i++) |
189 teamfile.setValue(QString("Binds/%1").arg(binds[i].action), binds[i].strbind); |
189 teamfile.setValue(QString("Binds/%1").arg(m_binds[i].action), m_binds[i].strbind); |
190 for(int i = 0; i < MAX_ACHIEVEMENTS; i++) |
190 for(int i = 0; i < MAX_ACHIEVEMENTS; i++) |
191 if(achievements[i][0][0]) |
191 if(achievements[i][0][0]) |
192 teamfile.setValue(QString("Achievements/%1").arg(achievements[i][0]), AchievementProgress[i]); |
192 teamfile.setValue(QString("Achievements/%1").arg(achievements[i][0]), AchievementProgress[i]); |
193 else |
193 else |
194 break; |
194 break; |
195 return true; |
195 return true; |
196 } |
196 } |
197 |
197 |
198 void HWTeam::SetToPage(HWForm * hwform) |
|
199 { |
|
200 hwform->ui.pageEditTeam->TeamNameEdit->setText(m_name); |
|
201 hwform->ui.pageEditTeam->CBTeamLvl->setCurrentIndex(m_difficulty); |
|
202 for(int i = 0; i < HEDGEHOGS_PER_TEAM; i++) |
|
203 { |
|
204 hwform->ui.pageEditTeam->HHNameEdit[i]->setText(m_hedgehogs[i].Name); |
|
205 if (m_hedgehogs[i].Hat.startsWith("Reserved")) |
|
206 hwform->ui.pageEditTeam->HHHats[i]->setCurrentIndex(hwform->ui.pageEditTeam->HHHats[i]->findData("Reserved "+m_hedgehogs[i].Hat.remove(0,40), Qt::DisplayRole)); |
|
207 else |
|
208 hwform->ui.pageEditTeam->HHHats[i]->setCurrentIndex(hwform->ui.pageEditTeam->HHHats[i]->findData(m_hedgehogs[i].Hat, Qt::DisplayRole)); |
|
209 } |
|
210 hwform->ui.pageEditTeam->CBGrave->setCurrentIndex(hwform->ui.pageEditTeam->CBGrave->findText(m_grave)); |
|
211 hwform->ui.pageEditTeam->CBFlag->setCurrentIndex(hwform->ui.pageEditTeam->CBFlag->findData(m_flag)); |
|
212 |
|
213 hwform->ui.pageEditTeam->CBFort->setCurrentIndex(hwform->ui.pageEditTeam->CBFort->findText(m_fort)); |
|
214 hwform->ui.pageEditTeam->CBVoicepack->setCurrentIndex(hwform->ui.pageEditTeam->CBVoicepack->findText(m_voicepack)); |
|
215 //hwform->ui.pageEditTeam->CBFort_activated(Fort); |
|
216 |
|
217 for(int i = 0; i < BINDS_NUMBER; i++) |
|
218 { |
|
219 hwform->ui.pageEditTeam->CBBind[i]->setCurrentIndex(hwform->ui.pageEditTeam->CBBind[i]->findData(binds[i].strbind)); |
|
220 } |
|
221 } |
|
222 |
|
223 void HWTeam::GetFromPage(HWForm * hwform) |
|
224 { |
|
225 m_name = hwform->ui.pageEditTeam->TeamNameEdit->text(); |
|
226 m_difficulty = hwform->ui.pageEditTeam->CBTeamLvl->currentIndex(); |
|
227 for(int i = 0; i < HEDGEHOGS_PER_TEAM; i++) |
|
228 { |
|
229 m_hedgehogs[i].Name = hwform->ui.pageEditTeam->HHNameEdit[i]->text(); |
|
230 if (hwform->ui.pageEditTeam->HHHats[i]->currentText().startsWith("Reserved")) |
|
231 m_hedgehogs[i].Hat = "Reserved"+playerHash+hwform->ui.pageEditTeam->HHHats[i]->currentText().remove(0,9); |
|
232 else |
|
233 m_hedgehogs[i].Hat = hwform->ui.pageEditTeam->HHHats[i]->currentText(); |
|
234 } |
|
235 |
|
236 m_grave = hwform->ui.pageEditTeam->CBGrave->currentText(); |
|
237 m_fort = hwform->ui.pageEditTeam->CBFort->currentText(); |
|
238 m_voicepack = hwform->ui.pageEditTeam->CBVoicepack->currentText(); |
|
239 m_flag = hwform->ui.pageEditTeam->CBFlag->itemData(hwform->ui.pageEditTeam->CBFlag->currentIndex()).toString(); |
|
240 for(int i = 0; i < BINDS_NUMBER; i++) |
|
241 { |
|
242 binds[i].strbind = hwform->ui.pageEditTeam->CBBind[i]->itemData(hwform->ui.pageEditTeam->CBBind[i]->currentIndex()).toString(); |
|
243 } |
|
244 } |
|
245 |
|
246 QStringList HWTeam::teamGameConfig(quint32 InitHealth) const |
198 QStringList HWTeam::teamGameConfig(quint32 InitHealth) const |
247 { |
199 { |
248 QStringList sl; |
200 QStringList sl; |
249 if (m_isNetTeam) |
201 if (m_isNetTeam) |
250 { |
202 { |
258 sl.push_back(QString("evoicepack " + m_voicepack)); |
210 sl.push_back(QString("evoicepack " + m_voicepack)); |
259 sl.push_back(QString("eflag " + m_flag)); |
211 sl.push_back(QString("eflag " + m_flag)); |
260 |
212 |
261 if (!m_isNetTeam) |
213 if (!m_isNetTeam) |
262 for(int i = 0; i < BINDS_NUMBER; i++) |
214 for(int i = 0; i < BINDS_NUMBER; i++) |
263 if(!binds[i].strbind.isEmpty()) |
215 if(!m_binds[i].strbind.isEmpty()) |
264 sl.push_back(QString("ebind " + binds[i].strbind + " " + binds[i].action)); |
216 sl.push_back(QString("ebind " + m_binds[i].strbind + " " + m_binds[i].action)); |
265 |
217 |
266 for (int t = 0; t < m_numHedgehogs; t++) |
218 for (int t = 0; t < m_numHedgehogs; t++) |
267 { |
219 { |
268 sl.push_back(QString("eaddhh %1 %2 %3") |
220 sl.push_back(QString("eaddhh %1 %2 %3") |
269 .arg(QString::number(m_difficulty), |
221 .arg(QString::number(m_difficulty), |