112 CBTeamLvl = new QComboBox(GBoxTeam); |
112 CBTeamLvl = new QComboBox(GBoxTeam); |
113 CBTeamLvl->setIconSize(QSize(48, 48)); |
113 CBTeamLvl->setIconSize(QSize(48, 48)); |
114 CBTeamLvl->addItem(QIcon(":/res/botlevels/0.png"), QComboBox::tr("Human")); |
114 CBTeamLvl->addItem(QIcon(":/res/botlevels/0.png"), QComboBox::tr("Human")); |
115 for(int i = 5; i > 0; i--) |
115 for(int i = 5; i > 0; i--) |
116 CBTeamLvl->addItem( |
116 CBTeamLvl->addItem( |
117 QIcon(QString(":/res/botlevels/%1.png").arg(6 - i)), |
117 QIcon(QString(":/res/botlevels/%1.png").arg(6 - i)), |
118 QString("%1 %2").arg(QComboBox::tr("Level")).arg(i) |
118 QString("%1 %2").arg(QComboBox::tr("Level")).arg(i) |
119 ); |
119 ); |
120 GBTLayout->addWidget(CBTeamLvl, 1, 1); |
120 GBTLayout->addWidget(CBTeamLvl, 1, 1); |
121 |
121 |
122 CBGrave = new QComboBox(GBoxTeam); |
122 CBGrave = new QComboBox(GBoxTeam); |
123 CBGrave->setMaxCount(65535); |
123 CBGrave->setMaxCount(65535); |
124 CBGrave->setIconSize(QSize(32, 32)); |
124 CBGrave->setIconSize(QSize(32, 32)); |
220 connect(signalMapper2, SIGNAL(mapped(int)), this, SLOT(setRandomName(int))); |
221 connect(signalMapper2, SIGNAL(mapped(int)), this, SLOT(setRandomName(int))); |
221 |
222 |
222 for(int i = 0; i < HEDGEHOGS_PER_TEAM; i++) |
223 for(int i = 0; i < HEDGEHOGS_PER_TEAM; i++) |
223 { |
224 { |
224 connect(HHNameEdit[i], SIGNAL(editingFinished()), signalMapper1, SLOT(map())); |
225 connect(HHNameEdit[i], SIGNAL(editingFinished()), signalMapper1, SLOT(map())); |
225 signalMapper1->setMapping(HHNameEdit[i], i); |
226 signalMapper1->setMapping(HHNameEdit[i], i); |
226 |
227 |
227 connect(btnRandomHogName[i], SIGNAL(clicked()), signalMapper2, SLOT(map())); |
228 connect(btnRandomHogName[i], SIGNAL(clicked()), signalMapper2, SLOT(map())); |
228 signalMapper2->setMapping(btnRandomHogName[i], i); |
229 signalMapper2->setMapping(btnRandomHogName[i], i); |
229 } |
230 } |
230 |
231 |
231 connect(btnRandomTeam, SIGNAL(clicked()), this, SLOT(setRandomNames())); |
232 connect(btnRandomTeam, SIGNAL(clicked()), this, SLOT(setRandomNames())); |
232 |
233 |
233 connect(btnTestSound, SIGNAL(clicked()), this, SLOT(testSound())); |
234 connect(btnTestSound, SIGNAL(clicked()), this, SLOT(testSound())); |
234 |
235 |
235 connect(CBFort, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(CBFort_activated(const QString &))); |
236 connect(CBFort, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(CBFort_activated(const QString &))); |
236 } |
237 } |
237 |
238 |
238 PageEditTeam::PageEditTeam(QWidget* parent) : |
239 PageEditTeam::PageEditTeam(QWidget* parent) : |
239 AbstractPage(parent) |
240 AbstractPage(parent) |
240 { |
241 { |
241 initPage(); |
242 initPage(); |
242 |
243 |
243 QRegExp pngSuffix("\\.png$"); |
244 QRegExp pngSuffix("\\.png$"); |
244 |
245 |
342 HWDataManager & dataMgr = HWDataManager::instance(); |
343 HWDataManager & dataMgr = HWDataManager::instance(); |
343 |
344 |
344 QString voiceDir = QString("Sounds/voices/") + CBVoicepack->currentText(); |
345 QString voiceDir = QString("Sounds/voices/") + CBVoicepack->currentText(); |
345 |
346 |
346 QStringList list = dataMgr.entryList( |
347 QStringList list = dataMgr.entryList( |
347 voiceDir, |
348 voiceDir, |
348 QDir::Files, |
349 QDir::Files, |
349 QStringList() << |
350 QStringList() << |
350 "Illgetyou.ogg" << |
351 "Illgetyou.ogg" << |
351 "Incoming.ogg" << |
352 "Incoming.ogg" << |
352 "Stupid.ogg" << |
353 "Stupid.ogg" << |
353 "Coward.ogg" << |
354 "Coward.ogg" << |
354 "Firstblood.ogg" |
355 "Firstblood.ogg" |
355 ); |
356 ); |
356 |
357 |
357 if (!list.isEmpty()) |
358 if (!list.isEmpty()) |
358 SDLInteraction::instance().playSoundFile( |
359 SDLInteraction::instance().playSoundFile( |
359 dataMgr.findFileForRead(voiceDir + "/" + |
360 dataMgr.findFileForRead(voiceDir + "/" + |
360 list[rand() % list.size()]) |
361 list[rand() % list.size()]) |
361 ); |
362 ); |
362 } |
363 } |
363 |
364 |
364 void PageEditTeam::createTeam(const QString & name, const QString & playerHash) |
365 void PageEditTeam::createTeam(const QString & name, const QString & playerHash) |
365 { |
366 { |