mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
updated
This commit is contained in:
parent
5758ac685c
commit
3ac2a69b8b
5 changed files with 12 additions and 2 deletions
|
|
@ -17,12 +17,13 @@ SoundEngine::SoundEngine(QObject *parent)
|
|||
|
||||
lastTapPlayed = QDateTime::currentDateTime();
|
||||
lastEndStepPlayed = QDateTime::currentDateTime();
|
||||
lastStartCombatPlayed = QDateTime::currentDateTime();
|
||||
}
|
||||
|
||||
void SoundEngine::cacheData()
|
||||
{
|
||||
static const QStringList fileNames = QStringList()
|
||||
<< "end_step" << "tap" << "player_joined";
|
||||
<< "end_step" << "tap" << "player_joined" << "start_combat";
|
||||
for (int i = 0; i < fileNames.size(); ++i) {
|
||||
QFile file(settingsCache->getSoundPath() + "/" + fileNames[i] + ".raw");
|
||||
if(!file.exists())
|
||||
|
|
@ -92,3 +93,10 @@ void SoundEngine::playerJoined()
|
|||
{
|
||||
playSound("player_joined");
|
||||
}
|
||||
|
||||
|
||||
void SoundEngine::startCombat() {
|
||||
if (lastStartCombatPlayed.secsTo(QDateTime::currentDateTime()) >= 1)
|
||||
playSound("start_combat");
|
||||
lastStartCombatPlayed = QDateTime::currentDateTime();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue