This commit is contained in:
syuilo
2018-05-21 02:13:39 +09:00
parent 51e3c11acb
commit 42c811a523
18 changed files with 146 additions and 136 deletions

View File

@@ -22,7 +22,7 @@ export default Vue.extend({
},
computed: {
lightmode(): boolean {
return localStorage.getItem('lightmode') == 'true';
return this.$store.state.device.lightmode;
},
style(): any {
return {

View File

@@ -149,9 +149,9 @@ export default Vue.extend({
onMessage(message) {
// サウンドを再生する
if ((this as any).os.isEnableSounds) {
if (this.$store.state.device.enableSounds) {
const sound = new Audio(`${url}/assets/message.mp3`);
sound.volume = localStorage.getItem('soundVolume') ? parseInt(localStorage.getItem('soundVolume'), 10) / 100 : 0.5;
sound.volume = this.$store.state.device.soundVolume;
sound.play();
}

View File

@@ -162,9 +162,9 @@ export default Vue.extend({
this.o.put(this.myColor, pos);
// サウンドを再生する
if ((this as any).os.isEnableSounds) {
if (this.$store.state.device.enableSounds) {
const sound = new Audio(`${url}/assets/othello-put-me.mp3`);
sound.volume = localStorage.getItem('soundVolume') ? parseInt(localStorage.getItem('soundVolume'), 10) / 100 : 0.5;
sound.volume = this.$store.state.device.soundVolume;
sound.play();
}
@@ -186,9 +186,9 @@ export default Vue.extend({
this.$forceUpdate();
// サウンドを再生する
if ((this as any).os.isEnableSounds && x.color != this.myColor) {
if (this.$store.state.device.enableSounds && 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 : 0.5;
sound.volume = this.$store.state.device.soundVolume;
sound.play();
}
},