add sounds for turn and death
This commit is contained in:
parent
4081d805f0
commit
f628ab75dc
BIN
frontend/src/assets/sounds/beep-holdtone.mp3
Normal file
BIN
frontend/src/assets/sounds/beep-holdtone.mp3
Normal file
Binary file not shown.
BIN
frontend/src/assets/sounds/beep-organ.mp3
Normal file
BIN
frontend/src/assets/sounds/beep-organ.mp3
Normal file
Binary file not shown.
@ -16,8 +16,13 @@
|
|||||||
<script>
|
<script>
|
||||||
import message_sfx from '@/assets/sounds/tap-kissy.mp3'
|
import message_sfx from '@/assets/sounds/tap-kissy.mp3'
|
||||||
import notification_sfx from '@/assets/sounds/tap-sizzle.mp3'
|
import notification_sfx from '@/assets/sounds/tap-sizzle.mp3'
|
||||||
|
import turn_sfx from '@/assets/sounds/beep-holdtone.mp3'
|
||||||
|
import death_sfx from '@/assets/sounds/beep-organ.mp3'
|
||||||
export default {
|
export default {
|
||||||
name: 'Chat',
|
name: 'Chat',
|
||||||
|
props: {
|
||||||
|
username: String
|
||||||
|
},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
messages: [],
|
messages: [],
|
||||||
text: '',
|
text: '',
|
||||||
@ -30,7 +35,13 @@ export default {
|
|||||||
let params = msg.split('|')
|
let params = msg.split('|')
|
||||||
let type = params.shift().substring(1)
|
let type = params.shift().substring(1)
|
||||||
this.messages.push({text:this.$t(`chat.${type}`, params)});
|
this.messages.push({text:this.$t(`chat.${type}`, params)});
|
||||||
(new Audio(notification_sfx)).play();
|
if (type == 'turn' && params[0] == this.username) {
|
||||||
|
(new Audio(turn_sfx)).play();
|
||||||
|
}else if (type == 'died_role') {
|
||||||
|
(new Audio(death_sfx)).play();
|
||||||
|
}else{
|
||||||
|
(new Audio(notification_sfx)).play();
|
||||||
|
}
|
||||||
}else {
|
}else {
|
||||||
(new Audio(message_sfx)).play();
|
(new Audio(message_sfx)).play();
|
||||||
this.messages.push(msg);
|
this.messages.push(msg);
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
<player :isEndingTurn="wantsToEndTurn" :cancelEndingTurn="()=>{wantsToEndTurn = false}" :chooseCardFromPlayer="choose" :cancelChooseCardFromPlayer="()=>{hasToChoose=false}"/>
|
<player :isEndingTurn="wantsToEndTurn" :cancelEndingTurn="()=>{wantsToEndTurn = false}" :chooseCardFromPlayer="choose" :cancelChooseCardFromPlayer="()=>{hasToChoose=false}"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<chat/>
|
<chat :username="username"/>
|
||||||
<Chooser v-if="selectedInfo" :text="$t('details')" :cards="selectedInfo" :cancelText="$t('ok')" :cancel="()=>{selectedInfo = null}" :select="()=>{selectedInfo = null}"/>
|
<Chooser v-if="selectedInfo" :text="$t('details')" :cards="selectedInfo" :cancelText="$t('ok')" :cancel="()=>{selectedInfo = null}" :select="()=>{selectedInfo = null}"/>
|
||||||
<transition name="bounce">
|
<transition name="bounce">
|
||||||
<Chooser v-if="hasToChoose" :text="`${$t('choose_card')}${target_p?$t('choose_card_from') + target_p:''}`" :cards="chooseCards" :select="chooseCard"/>
|
<Chooser v-if="hasToChoose" :text="`${$t('choose_card')}${target_p?$t('choose_card_from') + target_p:''}`" :cards="chooseCards" :select="chooseCard"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user