From 092a61e6a6a8cbf8c91aacb811f6e7d22ee9258b Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 20 Feb 2020 03:14:17 +0900 Subject: [PATCH] Better sfx --- locales/ja-JP.yml | 1 + src/client/assets/sounds/syuilo/down.mp3 | 3 +++ src/client/assets/sounds/syuilo/pope1.mp3 | 4 ++-- src/client/assets/sounds/syuilo/pope2.mp3 | 4 ++-- src/client/assets/sounds/syuilo/up.mp3 | 3 +++ src/client/assets/sounds/syuilo/waon.mp3 | 4 ++-- src/client/components/timeline.vue | 4 +++- src/client/pages/preferences/index.vue | 12 ++++++++++++ src/client/store.ts | 7 ++++--- 9 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 src/client/assets/sounds/syuilo/down.mp3 create mode 100644 src/client/assets/sounds/syuilo/up.mp3 diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index a76ab1f2c..c2241e6c1 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -431,6 +431,7 @@ volume: "音量" _sfx: note: "ノート" + noteMy: "ノート(自分)" notification: "通知" chat: "チャット" chatBg: "チャット(バックグラウンド)" diff --git a/src/client/assets/sounds/syuilo/down.mp3 b/src/client/assets/sounds/syuilo/down.mp3 new file mode 100644 index 000000000..3971d117a --- /dev/null +++ b/src/client/assets/sounds/syuilo/down.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f80048f15350e70aac71279cadb4f601c7217682044ae12f559579cd2909fb2 +size 18240 diff --git a/src/client/assets/sounds/syuilo/pope1.mp3 b/src/client/assets/sounds/syuilo/pope1.mp3 index a6ba0679f..541e3b78e 100644 --- a/src/client/assets/sounds/syuilo/pope1.mp3 +++ b/src/client/assets/sounds/syuilo/pope1.mp3 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e51c702cdc54322bad6451c0ee014624ed3b34f01555b85419fdaaa0fd04a2ea -size 19242 +oid sha256:1fab4cbee557ca8970bbe780ea0ae2889a42ad68e362b34a1cb8846814a3b833 +size 18240 diff --git a/src/client/assets/sounds/syuilo/pope2.mp3 b/src/client/assets/sounds/syuilo/pope2.mp3 index e8d116440..6cf8dbe3e 100644 --- a/src/client/assets/sounds/syuilo/pope2.mp3 +++ b/src/client/assets/sounds/syuilo/pope2.mp3 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:95d608e58c400ff40bba8a86cbe50e7a4a2f125e0248bfc079d830fa079e4b1c -size 19250 +oid sha256:09f99dd288a66667b889a43cb2110746514fd2bb473e86cf6e48a537694984b5 +size 18240 diff --git a/src/client/assets/sounds/syuilo/up.mp3 b/src/client/assets/sounds/syuilo/up.mp3 new file mode 100644 index 000000000..12a2ba381 --- /dev/null +++ b/src/client/assets/sounds/syuilo/up.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:880dcde2d0884c8c0dc7c422cd7e5d75c093da20ecdc1e7d9c0d9f6cebd0ecfa +size 18240 diff --git a/src/client/assets/sounds/syuilo/waon.mp3 b/src/client/assets/sounds/syuilo/waon.mp3 index e424adb8f..15a76bcd9 100644 --- a/src/client/assets/sounds/syuilo/waon.mp3 +++ b/src/client/assets/sounds/syuilo/waon.mp3 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4b31a7ae9f2922cd16a360d4514b2f7b0f9e7f118b78458b9addd98e00781b7e -size 19242 +oid sha256:6a30d2f1133ddcef4e0a6c1453c5b0660e84839dcba24cce0a40ba68ff4f448d +size 18240 diff --git a/src/client/components/timeline.vue b/src/client/components/timeline.vue index ba367bf23..6befd7c2a 100644 --- a/src/client/components/timeline.vue +++ b/src/client/components/timeline.vue @@ -53,7 +53,9 @@ export default Vue.extend({ (this.$refs.tl as any).prepend(note); if (this.sound) { - const audio = new Audio(`/assets/sounds/${this.$store.state.device.sfxNote}.mp3`); + const audio = new Audio(note.userId === this.$store.state.i.id + ? `/assets/sounds/${this.$store.state.device.sfxNoteMy}.mp3` + : `/assets/sounds/${this.$store.state.device.sfxNote}.mp3`); audio.volume = this.$store.state.device.sfxVolume; audio.play(); } diff --git a/src/client/pages/preferences/index.vue b/src/client/pages/preferences/index.vue index 419395918..9d57ddad5 100644 --- a/src/client/pages/preferences/index.vue +++ b/src/client/pages/preferences/index.vue @@ -17,6 +17,11 @@ + + + + + @@ -87,6 +92,8 @@ import { langs } from '../../config'; const sounds = [ null, + 'syuilo/up', + 'syuilo/down', 'syuilo/pope1', 'syuilo/pope2', 'syuilo/waon', @@ -170,6 +177,11 @@ export default Vue.extend({ set(value) { this.$store.commit('device/set', { key: 'sfxNote', value }); } }, + sfxNoteMy: { + get() { return this.$store.state.device.sfxNoteMy; }, + set(value) { this.$store.commit('device/set', { key: 'sfxNoteMy', value }); } + }, + sfxNotification: { get() { return this.$store.state.device.sfxNotification; }, set(value) { this.$store.commit('device/set', { key: 'sfxNotification', value }); } diff --git a/src/client/store.ts b/src/client/store.ts index 4a329a0eb..1a26bc82d 100644 --- a/src/client/store.ts +++ b/src/client/store.ts @@ -42,10 +42,11 @@ const defaultDeviceSettings = { showFixedPostForm: false, useNotificationsPopup: true, sfxVolume: 0.3, - sfxNote: 'syuilo/pope1', + sfxNote: 'syuilo/down', + sfxNoteMy: 'syuilo/up', sfxNotification: 'syuilo/pope2', - sfxChat: 'syuilo/waon', - sfxChatBg: null, + sfxChat: 'syuilo/pope1', + sfxChatBg: 'syuilo/waon', userData: {}, };