QTfrontend/pageeditteam.cpp
changeset 5549 ccfb9b8ab9d1
parent 5545 980d44fe2d4c
child 5886 a4a620f68b22
equal deleted inserted replaced
5547:2fe1d68a102c 5549:ccfb9b8ab9d1
   356     Mix_Chunk *sound;
   356     Mix_Chunk *sound;
   357     QDir tmpdir;
   357     QDir tmpdir;
   358     mySdli->SDLMusicInit();
   358     mySdli->SDLMusicInit();
   359     
   359     
   360     tmpdir.cd(cfgdir->absolutePath());
   360     tmpdir.cd(cfgdir->absolutePath());
   361     if (!tmpdir.cd("Data/Sounds/voices") && !tmpdir.cd(CBVoicepack->currentText())) {
   361     tmpdir.cd("Data/Sounds/voices");
       
   362     tmpdir.cd(CBVoicepack->currentText());
       
   363     
       
   364     if (!tmpdir.exists()) {
   362         tmpdir.cd(datadir->absolutePath());
   365         tmpdir.cd(datadir->absolutePath());
   363         tmpdir.cd("Sounds/voices");
   366         tmpdir.cd("Sounds/voices");
   364         tmpdir.cd(CBVoicepack->currentText());
   367         tmpdir.cd(CBVoicepack->currentText());
   365     }
   368     }
   366 
   369 
   367     QStringList list = tmpdir.entryList(QStringList() << "Illgetyou.ogg" << "Incoming.ogg" << "Stupid.ogg" << "Coward.ogg" << "Firstblood.ogg", QDir::Files);
   370     QStringList list = tmpdir.entryList(QStringList() << "Illgetyou.ogg" << "Incoming.ogg" << "Stupid.ogg" << "Coward.ogg" << "Firstblood.ogg", QDir::Files);
   368 
       
   369     if (list.size()) {
   371     if (list.size()) {
   370         sound = Mix_LoadWAV(QString(tmpdir.absolutePath() + "/" + list[rand() % list.size()]).toLocal8Bit().constData());
   372         sound = Mix_LoadWAV(QString(tmpdir.absolutePath() + "/" + list[rand() % list.size()]).toLocal8Bit().constData());
   371         Mix_PlayChannel(-1, sound, 0);
   373         Mix_PlayChannel(-1, sound, 0);
   372     }
   374     }
   373 }
   375 }