QTfrontend/pageeditteam.cpp
changeset 5545 980d44fe2d4c
parent 5308 c57a8878eebe
child 5549 ccfb9b8ab9d1
equal deleted inserted replaced
5543:5e597b725316 5545:980d44fe2d4c
   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     tmpdir.cd("Data/Sounds/voices");
   361     if (!tmpdir.cd("Data/Sounds/voices") && !tmpdir.cd(CBVoicepack->currentText())) {
   362     tmpdir.cd(CBVoicepack->currentText());
       
   363     
       
   364     if (!tmpdir.exists()) {
       
   365         tmpdir.cd(datadir->absolutePath());
   362         tmpdir.cd(datadir->absolutePath());
   366         tmpdir.cd("Sounds/voices");
   363         tmpdir.cd("Sounds/voices");
   367         tmpdir.cd(CBVoicepack->currentText());
   364         tmpdir.cd(CBVoicepack->currentText());
   368     }
   365     }
   369 
   366 
   370     QStringList list = tmpdir.entryList(QStringList() << "Illgetyou.ogg" << "Incoming.ogg" << "Stupid.ogg" << "Coward.ogg" << "Firstblood.ogg", QDir::Files);
   367     QStringList list = tmpdir.entryList(QStringList() << "Illgetyou.ogg" << "Incoming.ogg" << "Stupid.ogg" << "Coward.ogg" << "Firstblood.ogg", QDir::Files);
       
   368 
   371     if (list.size()) {
   369     if (list.size()) {
   372         sound = Mix_LoadWAV(QString(tmpdir.absolutePath() + "/" + list[rand() % list.size()]).toLocal8Bit().constData());
   370         sound = Mix_LoadWAV(QString(tmpdir.absolutePath() + "/" + list[rand() % list.size()]).toLocal8Bit().constData());
   373         Mix_PlayChannel(-1, sound, 0);
   371         Mix_PlayChannel(-1, sound, 0);
   374     }
   372     }
   375 }
   373 }