fixed conflicts
This commit is contained in:
parent
d1b243481b
commit
4c1e24c214
4 changed files with 10 additions and 10 deletions
|
@ -803,8 +803,8 @@ void MessageLogWidget::logSetActivePhase(int phase)
|
||||||
case 1: phaseName = tr("upkeep step"); break;
|
case 1: phaseName = tr("upkeep step"); break;
|
||||||
case 2: phaseName = tr("draw step"); break;
|
case 2: phaseName = tr("draw step"); break;
|
||||||
case 3: phaseName = tr("first main phase"); break;
|
case 3: phaseName = tr("first main phase"); break;
|
||||||
case 4: phaseName = tr("beginning of combat step"); soundEngine->startCombat(); break;
|
case 4: phaseName = tr("beginning of combat step"); break;
|
||||||
case 5: phaseName = tr("declare attackers step"); break;
|
case 5: phaseName = tr("declare attackers step"); soundEngine->attack(); break;
|
||||||
case 6: phaseName = tr("declare blockers step"); break;
|
case 6: phaseName = tr("declare blockers step"); break;
|
||||||
case 7: phaseName = tr("combat damage step"); break;
|
case 7: phaseName = tr("combat damage step"); break;
|
||||||
case 8: phaseName = tr("end of combat step"); break;
|
case 8: phaseName = tr("end of combat step"); break;
|
||||||
|
|
|
@ -17,13 +17,13 @@ SoundEngine::SoundEngine(QObject *parent)
|
||||||
|
|
||||||
lastTapPlayed = QDateTime::currentDateTime();
|
lastTapPlayed = QDateTime::currentDateTime();
|
||||||
lastEndStepPlayed = QDateTime::currentDateTime();
|
lastEndStepPlayed = QDateTime::currentDateTime();
|
||||||
lastStartCombatPlayed = QDateTime::currentDateTime();
|
lastAttackStepPlayed = QDateTime::currentDateTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SoundEngine::cacheData()
|
void SoundEngine::cacheData()
|
||||||
{
|
{
|
||||||
static const QStringList fileNames = QStringList()
|
static const QStringList fileNames = QStringList()
|
||||||
<< "end_step" << "tap" << "player_joined" << "start_combat";
|
<< "end_step" << "tap" << "player_joined" << "attack";
|
||||||
for (int i = 0; i < fileNames.size(); ++i) {
|
for (int i = 0; i < fileNames.size(); ++i) {
|
||||||
QFile file(settingsCache->getSoundPath() + "/" + fileNames[i] + ".raw");
|
QFile file(settingsCache->getSoundPath() + "/" + fileNames[i] + ".raw");
|
||||||
if(!file.exists())
|
if(!file.exists())
|
||||||
|
@ -95,8 +95,8 @@ void SoundEngine::playerJoined()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SoundEngine::startCombat() {
|
void SoundEngine::attack() {
|
||||||
if (lastStartCombatPlayed.secsTo(QDateTime::currentDateTime()) >= 1)
|
if (lastAttackStepPlayed.secsTo(QDateTime::currentDateTime()) >= 1)
|
||||||
playSound("start_combat");
|
playSound("attack");
|
||||||
lastStartCombatPlayed = QDateTime::currentDateTime();
|
lastAttackStepPlayed = QDateTime::currentDateTime();
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ private:
|
||||||
QAudioOutput *audio;
|
QAudioOutput *audio;
|
||||||
QDateTime lastTapPlayed;
|
QDateTime lastTapPlayed;
|
||||||
QDateTime lastEndStepPlayed;
|
QDateTime lastEndStepPlayed;
|
||||||
QDateTime lastStartCombatPlayed;
|
QDateTime lastAttackStepPlayed;
|
||||||
private slots:
|
private slots:
|
||||||
void cacheData();
|
void cacheData();
|
||||||
void soundEnabledChanged();
|
void soundEnabledChanged();
|
||||||
|
@ -27,7 +27,7 @@ public slots:
|
||||||
void endStep();
|
void endStep();
|
||||||
void tap();
|
void tap();
|
||||||
void playerJoined();
|
void playerJoined();
|
||||||
void startCombat();
|
void attack();
|
||||||
};
|
};
|
||||||
|
|
||||||
extern SoundEngine *soundEngine;
|
extern SoundEngine *soundEngine;
|
||||||
|
|
BIN
sounds/attack.raw
Normal file
BIN
sounds/attack.raw
Normal file
Binary file not shown.
Loading…
Reference in a new issue