diff --git a/src/js/commandline-lists.js b/src/js/commandline-lists.js index 3dc8b3d45..fc1f12421 100644 --- a/src/js/commandline-lists.js +++ b/src/js/commandline-lists.js @@ -929,6 +929,9 @@ let commandsSoundOnClick = { id: "setSoundOnClick1", display: "click", configValue: "1", + hover: () => { + Sound.previewClick("1"); + }, exec: () => { UpdateConfig.setPlaySoundOnClick("1"); Sound.playClick(Config.playSoundOnClick); @@ -938,6 +941,9 @@ let commandsSoundOnClick = { id: "setSoundOnClick2", display: "beep", configValue: "2", + hover: () => { + Sound.previewClick("2"); + }, exec: () => { UpdateConfig.setPlaySoundOnClick("2"); Sound.playClick(Config.playSoundOnClick); @@ -947,6 +953,9 @@ let commandsSoundOnClick = { id: "setSoundOnClick3", display: "pop", configValue: "3", + hover: () => { + Sound.previewClick("3"); + }, exec: () => { UpdateConfig.setPlaySoundOnClick("3"); Sound.playClick(Config.playSoundOnClick); @@ -956,6 +965,9 @@ let commandsSoundOnClick = { id: "setSoundOnClick4", display: "nk creams", configValue: "4", + hover: () => { + Sound.previewClick("4"); + }, exec: () => { UpdateConfig.setPlaySoundOnClick("4"); Sound.playClick(Config.playSoundOnClick); @@ -965,6 +977,9 @@ let commandsSoundOnClick = { id: "setSoundOnClick5", display: "typewriter", configValue: "5", + hover: () => { + Sound.previewClick("5"); + }, exec: () => { UpdateConfig.setPlaySoundOnClick("5"); Sound.playClick(Config.playSoundOnClick); @@ -974,6 +989,9 @@ let commandsSoundOnClick = { id: "setSoundOnClick6", display: "osu", configValue: "6", + hover: () => { + Sound.previewClick("6"); + }, exec: () => { UpdateConfig.setPlaySoundOnClick("6"); Sound.playClick(Config.playSoundOnClick); @@ -983,6 +1001,9 @@ let commandsSoundOnClick = { id: "setSoundOnClick7", display: "hitmarker", configValue: "7", + hover: () => { + Sound.previewClick("7"); + }, exec: () => { UpdateConfig.setPlaySoundOnClick("7"); Sound.playClick(Config.playSoundOnClick); diff --git a/src/js/sound.js b/src/js/sound.js index d699838e5..3397f1fd9 100644 --- a/src/js/sound.js +++ b/src/js/sound.js @@ -218,6 +218,12 @@ export function init() { }; } +export function previewClick(val) { + if (clickSounds === null) init(); + clickSounds[val][0].sounds[0].seek(0); + clickSounds[val][0].sounds[0].play(); +} + export function playClick() { if (Config.playSoundOnClick === "off") return; if (clickSounds === null) init();