diff --git a/source/funkin/Preferences.hx b/source/funkin/Preferences.hx index 2b129564..a941be4c 100644 --- a/source/funkin/Preferences.hx +++ b/source/funkin/Preferences.hx @@ -490,6 +490,21 @@ class Preferences return value; } + public static var missNoteSounds(get, set):Bool; + + static function get_missNoteSounds():Bool + { + return Save?.instance?.options?.missNoteSounds; + } + + static function set_missNoteSounds(value:Bool):Bool + { + var save:Save = Save.instance; + save.options.missNoteSounds = value; + save.flush(); + return value; + } + #if web // We create a haxe version of this just for readability. // We use these to override `window.requestAnimationFrame` in Javascript to uncap the framerate / "animation" request rate diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index 8a37923a..8bcf7fc6 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -2963,7 +2963,7 @@ 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.missNoteSounds) FunkinSound.playOnce(Paths.soundRandom('missnote', 1, 3), FlxG.random.float(0.5, 0.6)); } } diff --git a/source/funkin/save/Save.hx b/source/funkin/save/Save.hx index 1a620c2e..05de8e00 100644 --- a/source/funkin/save/Save.hx +++ b/source/funkin/save/Save.hx @@ -105,7 +105,7 @@ class Save #end antialiasing: false, flashingLights: true, zoomCamera: true, judgeCounter: true, comboHUD: true, extraScoreText: true, coloredHealthBar: true, showTimings: true, debugDisplay: true, autoPause: true, autoFullscreen: false, laneAlpha: 15, strumAlpha: 85, badsShitsCauseMiss: false, - inputOffset: 0, audioVisualOffset: 0, unlockedFramerate: false, + inputOffset: 0, audioVisualOffset: 0, unlockedFramerate: false, missNoteSounds: true, #else framerate: 60, noteHitSound: NoteHitSoundType.None, noteHitSoundVolume: 100, noteSplash: true, inputSystem: InputSystemType.Pbot, naughtyness: true, downscroll: false, middlescroll: false, @@ -114,7 +114,7 @@ class Save #end antialiasing: true, flashingLights: true, zoomCamera: true, judgeCounter: true, comboHUD: true, extraScoreText: true, coloredHealthBar: true, showTimings: true, debugDisplay: true, autoPause: true, autoFullscreen: false, laneAlpha: 0, strumAlpha: 100, badsShitsCauseMiss: false, - inputOffset: 0, audioVisualOffset: 0, unlockedFramerate: false, + inputOffset: 0, audioVisualOffset: 0, unlockedFramerate: false, missNoteSounds: true, #end controls: @@ -1451,6 +1451,8 @@ typedef SaveDataOptions = */ var audioVisualOffset:Int; + var missNoteSounds:Bool; + /** * Whether we want the framerate to be unlocked on HTML5 builds. * @default `false` diff --git a/source/funkin/ui/charSelect/CharSelectGF.hx b/source/funkin/ui/charSelect/CharSelectGF.hx index 1b62b75b..825e1ffc 100644 --- a/source/funkin/ui/charSelect/CharSelectGF.hx +++ b/source/funkin/ui/charSelect/CharSelectGF.hx @@ -73,7 +73,7 @@ class CharSelectGF extends FlxAtlasSprite implements IBPMSyncedScriptedClass public function onStepHit(event:SongTimeScriptEvent):Void {} - var danceEvery:Int = 2; + // var danceEvery:Int = 2; public function onBeatHit(event:SongTimeScriptEvent):Void { @@ -82,9 +82,15 @@ class CharSelectGF extends FlxAtlasSprite implements IBPMSyncedScriptedClass // I tried make this not interrupt an existing idle, // but isAnimationFinished() and isLoopComplete() both don't work! What the hell? // danceEvery isn't necessary if that gets fixed. + + // if (currentGFPath.endsWith("freyaChill")) + // danceEvery = 1; + // else + // danceEvery = 2; + if (getCurrentAnimation() == "idle" && (event.beat % danceEvery == 0)) { - trace('GF beat hit'); + // trace('GF beat hit'); playAnimation("idle", true, false, false); } }; diff --git a/source/funkin/ui/options/PreferencesMenu.hx b/source/funkin/ui/options/PreferencesMenu.hx index fe4beb87..dd1a8c29 100644 --- a/source/funkin/ui/options/PreferencesMenu.hx +++ b/source/funkin/ui/options/PreferencesMenu.hx @@ -188,6 +188,10 @@ class PreferencesMenu extends Page Preferences.flashingLights = value; yeahBf(value); }, Preferences.flashingLights); + createPrefItemCheckbox('Note Miss Sounds', 'Enable to play a sound when you miss a note', function(value:Bool):Void { + Preferences.missNoteSounds = value; + yeahBf(value); + }, Preferences.missNoteSounds); createPrefItemCheckbox('Colored Health Bar', 'Enable to make the health bar use icon-based colors', function(value:Bool):Void { Preferences.coloredHealthBar = value; yeahBf(value); @@ -283,6 +287,7 @@ class PreferencesMenu extends Page #if (desktop || web) createPrefItemCheckbox('Launch in Fullscreen', 'Enable to automatically launch the game in fullscreen on startup', function(value:Bool):Void { Preferences.autoFullscreen = value; + yeahBf(value); }, Preferences.autoFullscreen); #end #if mobile