From ba6b4ab1879a7bd3d295ebe6fa7b763d6004313a Mon Sep 17 00:00:00 2001 From: JVN-Pixels <146671762+JVNpixels@users.noreply.github.com> Date: Sat, 16 Nov 2024 14:02:13 -0800 Subject: [PATCH 1/6] Miss Sound Preference --- source/funkin/Preferences.hx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/source/funkin/Preferences.hx b/source/funkin/Preferences.hx index b3da56f657..a376f925ea 100644 --- a/source/funkin/Preferences.hx +++ b/source/funkin/Preferences.hx @@ -74,6 +74,25 @@ class Preferences return value; } + /** + * If enabled, the miss sound will play when the player misses a note. + * @default `true` + */ + public static var playMissSound(get, set):Bool; + + static function get_playMissSound():Bool + { + return Save?.instance?.options?.playMissSound; + } + + static function set_playMissSound(value:Bool):Bool + { + var save:Save = Save.instance; + save.options.playMissSound = value; + save.flush(); + return value; + } + /** * If disabled, flashing lights in the main menu and other areas will be less intense. * @default `true` From 0990842b69ec1fa78a3948804943908e512428ae Mon Sep 17 00:00:00 2001 From: JVN-Pixels <146671762+JVNpixels@users.noreply.github.com> Date: Sat, 16 Nov 2024 14:05:52 -0800 Subject: [PATCH 2/6] Update Save.hx --- source/funkin/save/Save.hx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/funkin/save/Save.hx b/source/funkin/save/Save.hx index 8403a1a775..7583937740 100644 --- a/source/funkin/save/Save.hx +++ b/source/funkin/save/Save.hx @@ -97,6 +97,7 @@ class Save downscroll: false, flashingLights: true, zoomCamera: true, + playMissSound: false, debugDisplay: false, autoPause: true, inputOffset: 0, @@ -1299,6 +1300,12 @@ typedef SaveDataOptions = */ var zoomCamera:Bool; + /** + * If enabled, the miss sound will play when the player misses a note. + * @default `true` + */ + var playMissSound:Bool; + /** * If enabled, an FPS and memory counter will be displayed even if this is not a debug build. * @default `false` From 919d98b0d942eb826fbe0476aa523388347079b8 Mon Sep 17 00:00:00 2001 From: JVN-Pixels <146671762+JVNpixels@users.noreply.github.com> Date: Sat, 16 Nov 2024 14:10:08 -0800 Subject: [PATCH 3/6] Update PreferencesMenu.hx --- source/funkin/ui/options/PreferencesMenu.hx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/funkin/ui/options/PreferencesMenu.hx b/source/funkin/ui/options/PreferencesMenu.hx index fb49807625..ae0137508d 100644 --- a/source/funkin/ui/options/PreferencesMenu.hx +++ b/source/funkin/ui/options/PreferencesMenu.hx @@ -72,6 +72,9 @@ class PreferencesMenu extends Page createPrefItemCheckbox('Auto Pause', 'Automatically pause the game when it loses focus', function(value:Bool):Void { Preferences.autoPause = value; }, Preferences.autoPause); + createPrefItemCheckbox('Play Miss Sound', 'Disable to stop the mute sound from playing when a miss occurs.', function(value:Bool):Void { + Preferences.playMissSound = value; + }, Preferences.playMissSound); #if web createPrefItemCheckbox('Unlocked Framerate', 'Enable to unlock the framerate', function(value:Bool):Void { From 6fa00edcbfdc9377613cd4e7bc9a2c43a24f3f30 Mon Sep 17 00:00:00 2001 From: JVN-Pixels <146671762+JVNpixels@users.noreply.github.com> Date: Sat, 16 Nov 2024 14:12:52 -0800 Subject: [PATCH 4/6] Update PlayState.hx --- source/funkin/play/PlayState.hx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index dbacf3fa96..cf592643be 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -2638,7 +2638,10 @@ class PlayState extends MusicBeatSubState if (playSound) { vocals.playerVolume = 0; - FunkinSound.playOnce(Paths.soundRandom('missnote', 1, 3), FlxG.random.float(0.5, 0.6)); + if (Preferences.playMissSound) + { + FunkinSound.playOnce(Paths.soundRandom('missnote', 1, 3), FlxG.random.float(0.5, 0.6)); + } } } From 84b48ed6646b2b800f6dc21d8d553196069fae00 Mon Sep 17 00:00:00 2001 From: JVN-Pixels <146671762+JVNpixels@users.noreply.github.com> Date: Sat, 16 Nov 2024 14:15:45 -0800 Subject: [PATCH 5/6] Update PreferencesMenu.hx --- source/funkin/ui/options/PreferencesMenu.hx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/funkin/ui/options/PreferencesMenu.hx b/source/funkin/ui/options/PreferencesMenu.hx index ae0137508d..10cff6273d 100644 --- a/source/funkin/ui/options/PreferencesMenu.hx +++ b/source/funkin/ui/options/PreferencesMenu.hx @@ -66,15 +66,15 @@ class PreferencesMenu extends Page createPrefItemCheckbox('Camera Zooming on Beat', 'Disable to stop the camera bouncing to the song', function(value:Bool):Void { Preferences.zoomCamera = value; }, Preferences.zoomCamera); + createPrefItemCheckbox('Play Miss Sound', 'Disable to stop the mute sound from playing when a miss occurs.', function(value:Bool):Void { + Preferences.playMissSound = value; + }, Preferences.playMissSound); createPrefItemCheckbox('Debug Display', 'Enable to show FPS and other debug stats', function(value:Bool):Void { Preferences.debugDisplay = value; }, Preferences.debugDisplay); createPrefItemCheckbox('Auto Pause', 'Automatically pause the game when it loses focus', function(value:Bool):Void { Preferences.autoPause = value; }, Preferences.autoPause); - createPrefItemCheckbox('Play Miss Sound', 'Disable to stop the mute sound from playing when a miss occurs.', function(value:Bool):Void { - Preferences.playMissSound = value; - }, Preferences.playMissSound); #if web createPrefItemCheckbox('Unlocked Framerate', 'Enable to unlock the framerate', function(value:Bool):Void { From 861e1e74825154f2b84550d9696e69023135c92d Mon Sep 17 00:00:00 2001 From: JVN-Pixels <146671762+JVNpixels@users.noreply.github.com> Date: Mon, 16 Dec 2024 07:30:56 -0800 Subject: [PATCH 6/6] Update PreferencesMenu.hx silly me --- source/funkin/ui/options/PreferencesMenu.hx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/funkin/ui/options/PreferencesMenu.hx b/source/funkin/ui/options/PreferencesMenu.hx index 10cff6273d..1ef7aa9a09 100644 --- a/source/funkin/ui/options/PreferencesMenu.hx +++ b/source/funkin/ui/options/PreferencesMenu.hx @@ -54,25 +54,25 @@ class PreferencesMenu extends Page */ function createPrefItems():Void { - createPrefItemCheckbox('Naughtyness', 'Toggle displaying raunchy content', function(value:Bool):Void { + createPrefItemCheckbox('Naughtyness', 'Toggle displaying raunchy content.', function(value:Bool):Void { Preferences.naughtyness = value; }, Preferences.naughtyness); - createPrefItemCheckbox('Downscroll', 'Enable to make notes move downwards', function(value:Bool):Void { + createPrefItemCheckbox('Downscroll', 'Enable to make notes move downwards.', function(value:Bool):Void { Preferences.downscroll = value; }, Preferences.downscroll); - createPrefItemCheckbox('Flashing Lights', 'Disable to dampen flashing effects', function(value:Bool):Void { + createPrefItemCheckbox('Flashing Lights', 'Disable to dampen flashing effects.', function(value:Bool):Void { Preferences.flashingLights = value; }, Preferences.flashingLights); - createPrefItemCheckbox('Camera Zooming on Beat', 'Disable to stop the camera bouncing to the song', function(value:Bool):Void { + createPrefItemCheckbox('Camera Zooming on Beat', 'Disable to stop the camera bouncing to the song.', function(value:Bool):Void { Preferences.zoomCamera = value; }, Preferences.zoomCamera); - createPrefItemCheckbox('Play Miss Sound', 'Disable to stop the mute sound from playing when a miss occurs.', function(value:Bool):Void { + createPrefItemCheckbox('Play Miss Sound', 'Disable to stop the miss sound from playing when a miss happens.', function(value:Bool):Void { Preferences.playMissSound = value; }, Preferences.playMissSound); - createPrefItemCheckbox('Debug Display', 'Enable to show FPS and other debug stats', function(value:Bool):Void { + createPrefItemCheckbox('Debug Display', 'Enable to show FPS and other debug stats.', function(value:Bool):Void { Preferences.debugDisplay = value; }, Preferences.debugDisplay); - createPrefItemCheckbox('Auto Pause', 'Automatically pause the game when it loses focus', function(value:Bool):Void { + createPrefItemCheckbox('Auto Pause', 'Automatically pause the game when it loses focus.', function(value:Bool):Void { Preferences.autoPause = value; }, Preferences.autoPause);