mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-10 10:13:09 +02:00
This commit is contained in:
parent
a2b73582cd
commit
d103a57073
3 changed files with 15 additions and 0 deletions
|
@ -38,6 +38,7 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import Othello, { Color } from '../../../../../common/othello/core';
|
import Othello, { Color } from '../../../../../common/othello/core';
|
||||||
|
import { url } from '../../../config';
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
props: ['game', 'connection'],
|
props: ['game', 'connection'],
|
||||||
|
@ -134,6 +135,13 @@ export default Vue.extend({
|
||||||
|
|
||||||
this.o.put(this.myColor, pos);
|
this.o.put(this.myColor, pos);
|
||||||
|
|
||||||
|
// サウンドを再生する
|
||||||
|
if ((this as any).os.isEnableSounds) {
|
||||||
|
const sound = new Audio(`${url}/assets/othello-put-me.mp3`);
|
||||||
|
sound.volume = localStorage.getItem('soundVolume') ? parseInt(localStorage.getItem('soundVolume'), 10) / 100 : 1;
|
||||||
|
sound.play();
|
||||||
|
}
|
||||||
|
|
||||||
this.connection.send({
|
this.connection.send({
|
||||||
type: 'set',
|
type: 'set',
|
||||||
pos
|
pos
|
||||||
|
@ -150,6 +158,13 @@ export default Vue.extend({
|
||||||
this.o.put(x.color, x.pos);
|
this.o.put(x.color, x.pos);
|
||||||
this.checkEnd();
|
this.checkEnd();
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
|
|
||||||
|
// サウンドを再生する
|
||||||
|
if ((this as any).os.isEnableSounds && x.color != this.myColor) {
|
||||||
|
const sound = new Audio(`${url}/assets/othello-put-you.mp3`);
|
||||||
|
sound.volume = localStorage.getItem('soundVolume') ? parseInt(localStorage.getItem('soundVolume'), 10) / 100 : 1;
|
||||||
|
sound.play();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
checkEnd() {
|
checkEnd() {
|
||||||
|
|
BIN
src/web/assets/othello-put-me.mp3
Normal file
BIN
src/web/assets/othello-put-me.mp3
Normal file
Binary file not shown.
BIN
src/web/assets/othello-put-you.mp3
Normal file
BIN
src/web/assets/othello-put-you.mp3
Normal file
Binary file not shown.
Loading…
Reference in a new issue