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>
|
||||
import message_sfx from '@/assets/sounds/tap-kissy.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 {
|
||||
name: 'Chat',
|
||||
props: {
|
||||
username: String
|
||||
},
|
||||
data: () => ({
|
||||
messages: [],
|
||||
text: '',
|
||||
@ -30,7 +35,13 @@ export default {
|
||||
let params = msg.split('|')
|
||||
let type = params.shift().substring(1)
|
||||
this.messages.push({text:this.$t(`chat.${type}`, params)});
|
||||
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 {
|
||||
(new Audio(message_sfx)).play();
|
||||
this.messages.push(msg);
|
||||
|
@ -58,7 +58,7 @@
|
||||
<player :isEndingTurn="wantsToEndTurn" :cancelEndingTurn="()=>{wantsToEndTurn = false}" :chooseCardFromPlayer="choose" :cancelChooseCardFromPlayer="()=>{hasToChoose=false}"/>
|
||||
</div>
|
||||
</div>
|
||||
<chat/>
|
||||
<chat :username="username"/>
|
||||
<Chooser v-if="selectedInfo" :text="$t('details')" :cards="selectedInfo" :cancelText="$t('ok')" :cancel="()=>{selectedInfo = null}" :select="()=>{selectedInfo = null}"/>
|
||||
<transition name="bounce">
|
||||
<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