mirror of
https://github.com/kokonect-link/cherrypick
synced 2024-12-01 08:18:45 +09:00
ボリュームが0のときサウンドを鳴らさないように
This commit is contained in:
parent
b378cabfc7
commit
49c2a9b372
@ -190,6 +190,7 @@ os.init(async () => {
|
|||||||
(vm as any).focus();
|
(vm as any).focus();
|
||||||
},
|
},
|
||||||
sound(type: string) {
|
sound(type: string) {
|
||||||
|
if (this.$store.state.device.sfxVolume === 0) return;
|
||||||
const sound = this.$store.state.device['sfx' + type.substr(0, 1).toUpperCase() + type.substr(1)];
|
const sound = this.$store.state.device['sfx' + type.substr(0, 1).toUpperCase() + type.substr(1)];
|
||||||
if (sound == null) return;
|
if (sound == null) return;
|
||||||
const audio = new Audio(`/assets/sounds/${sound}.mp3`);
|
const audio = new Audio(`/assets/sounds/${sound}.mp3`);
|
||||||
|
Loading…
Reference in New Issue
Block a user