120 { |
120 { |
121 this->gameSettings = gameSettings; |
121 this->gameSettings = gameSettings; |
122 this->sdli = sdli; |
122 this->sdli = sdli; |
123 this->notify = notify; |
123 this->notify = notify; |
124 if(notify && gameSettings->value("frontend/sound", true).toBool()) { |
124 if(notify && gameSettings->value("frontend/sound", true).toBool()) { |
125 QDir tmpdir; |
125 QFile tmpfile; |
126 |
126 sdli->SDLMusicInit(); |
127 tmpdir.cd(datadir->absolutePath()); |
127 for(int i=0;i<4;i++) { |
128 tmpdir.cd("Sounds/voices"); |
128 tmpfile.setFileName(cfgdir->absolutePath() + "/Data/Sounds/voices/Classic/Hello.ogg"); |
129 sdli->SDLMusicInit(); |
129 if (tmpfile.exists()) sound[i] = Mix_LoadWAV(QFileInfo(tmpfile).absoluteFilePath().toLocal8Bit().constData()); |
130 sound[0] = Mix_LoadWAV(QString(tmpdir.absolutePath() + "/Classic/Hello.ogg").toLocal8Bit().constData()); |
130 else sound[i] = Mix_LoadWAV(QString(datadir->absolutePath() + |
131 sound[1] = Mix_LoadWAV(QString(tmpdir.absolutePath() + "/Default/Hello.ogg").toLocal8Bit().constData()); |
131 "/Sounds/voices/Classic/Hello.ogg").toLocal8Bit().constData()); |
132 sound[2] = Mix_LoadWAV(QString(tmpdir.absolutePath() + "/Mobster/Hello.ogg").toLocal8Bit().constData()); |
132 } |
133 sound[3] = Mix_LoadWAV(QString(tmpdir.absolutePath() + "/Russian/Hello.ogg").toLocal8Bit().constData()); |
|
134 } |
133 } |
135 |
134 |
136 mainLayout.setSpacing(1); |
135 mainLayout.setSpacing(1); |
137 mainLayout.setMargin(1); |
136 mainLayout.setMargin(1); |
138 mainLayout.setSizeConstraint(QLayout::SetMinimumSize); |
137 mainLayout.setSizeConstraint(QLayout::SetMinimumSize); |