Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
3ac2a69b
Commit
3ac2a69b
authored
May 20, 2015
by
Matt Lowe
Browse files
updated
parent
5758ac68
Changes
5
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/messagelogwidget.cpp
View file @
3ac2a69b
...
@@ -803,7 +803,7 @@ void MessageLogWidget::logSetActivePhase(int phase)
...
@@ -803,7 +803,7 @@ 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"
);
break
;
case
4
:
phaseName
=
tr
(
"beginning of combat step"
);
soundEngine
->
startCombat
();
break
;
case
5
:
phaseName
=
tr
(
"declare attackers step"
);
break
;
case
5
:
phaseName
=
tr
(
"declare attackers step"
);
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
;
...
...
cockatrice/src/soundengine.cpp
View file @
3ac2a69b
...
@@ -17,12 +17,13 @@ SoundEngine::SoundEngine(QObject *parent)
...
@@ -17,12 +17,13 @@ SoundEngine::SoundEngine(QObject *parent)
lastTapPlayed
=
QDateTime
::
currentDateTime
();
lastTapPlayed
=
QDateTime
::
currentDateTime
();
lastEndStepPlayed
=
QDateTime
::
currentDateTime
();
lastEndStepPlayed
=
QDateTime
::
currentDateTime
();
lastStartCombatPlayed
=
QDateTime
::
currentDateTime
();
}
}
void
SoundEngine
::
cacheData
()
void
SoundEngine
::
cacheData
()
{
{
static
const
QStringList
fileNames
=
QStringList
()
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
)
{
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
())
...
@@ -92,3 +93,10 @@ void SoundEngine::playerJoined()
...
@@ -92,3 +93,10 @@ void SoundEngine::playerJoined()
{
{
playSound
(
"player_joined"
);
playSound
(
"player_joined"
);
}
}
void
SoundEngine
::
startCombat
()
{
if
(
lastStartCombatPlayed
.
secsTo
(
QDateTime
::
currentDateTime
())
>=
1
)
playSound
(
"start_combat"
);
lastStartCombatPlayed
=
QDateTime
::
currentDateTime
();
}
cockatrice/src/soundengine.h
View file @
3ac2a69b
...
@@ -17,6 +17,7 @@ private:
...
@@ -17,6 +17,7 @@ private:
QAudioOutput
*
audio
;
QAudioOutput
*
audio
;
QDateTime
lastTapPlayed
;
QDateTime
lastTapPlayed
;
QDateTime
lastEndStepPlayed
;
QDateTime
lastEndStepPlayed
;
QDateTime
lastStartCombatPlayed
;
private
slots
:
private
slots
:
void
cacheData
();
void
cacheData
();
void
soundEnabledChanged
();
void
soundEnabledChanged
();
...
@@ -26,6 +27,7 @@ public slots:
...
@@ -26,6 +27,7 @@ public slots:
void
endStep
();
void
endStep
();
void
tap
();
void
tap
();
void
playerJoined
();
void
playerJoined
();
void
startCombat
();
};
};
extern
SoundEngine
*
soundEngine
;
extern
SoundEngine
*
soundEngine
;
...
...
sounds/player_joined.raw
View file @
3ac2a69b
No preview for this file type
sounds/start_combat.raw
0 → 100644
View file @
3ac2a69b
File added
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment