From a38f1bdd45ba7ce4211ddfeaec8bdd9ed2a56d0a Mon Sep 17 00:00:00 2001 From: CyndaquilDAC <65635932+CyndaquilDAC@users.noreply.github.com> Date: Mon, 19 Jul 2021 23:56:03 -0500 Subject: [PATCH] miss sfx option --- source/Options.hx | 20 ++++++++++++++++++++ source/OptionsMenu.hx | 3 ++- source/PlayState.hx | 9 ++++++--- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/source/Options.hx b/source/Options.hx index b55cab7..37403ff 100644 --- a/source/Options.hx +++ b/source/Options.hx @@ -324,6 +324,26 @@ class AntialiasingOption extends Option } } +class MissSoundsOption extends Option +{ + public function new(desc:String) + { + super(); + description = desc; + } + public override function press():Bool + { + FlxG.save.data.missSounds = !FlxG.save.data.missSounds; + display = updateDisplay(); + return true; + } + + private override function updateDisplay():String + { + return "Miss Sounds " + (!FlxG.save.data.missSounds ? "off" : "on"); + } +} + class ShowInput extends Option { public function new(desc:String) diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx index a80b1c4..bb4f9e8 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -55,8 +55,9 @@ class OptionsMenu extends MusicBeatState new FlashingLightsOption("Toggle flashing lights that can cause epileptic seizures and strain."), new WatermarkOption("Enable and disable all watermarks from the engine."), new AntialiasingOption("Toggle antialiasing, improving graphics quality at a slight performance penalty."), + new MissSoundsOption("Toggle miss sounds playing when you don't hit a note."), new ScoreScreen("Show the score screen after the end of a song"), - new ShowInput("Display every single input in the score screen."), + new ShowInput("Display every single input on the score screen."), new Optimization("No characters or backgrounds. Just a rhythm game, with none of the extra bells and whistles."), new GraphicLoading("On startup, cache every character. Significantly decrease load times. (HIGH MEMORY)"), new BotPlay("Showcase your charts and mods with autoplay.") diff --git a/source/PlayState.hx b/source/PlayState.hx index 6e51302..811f7e5 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -4035,9 +4035,12 @@ class PlayState extends MusicBeatState else songScore -= 10; - FlxG.sound.play(Paths.soundRandom('missnote', 1, 3), FlxG.random.float(0.1, 0.2)); - // FlxG.sound.play(Paths.sound('missnote1'), 1, false); - // FlxG.log.add('played imss note'); + if(FlxG.save.data.missSounds) + { + FlxG.sound.play(Paths.soundRandom('missnote', 1, 3), FlxG.random.float(0.1, 0.2)); + // FlxG.sound.play(Paths.sound('missnote1'), 1, false); + // FlxG.log.add('played imss note'); + } // Hole switch statement replaced with a single line :) boyfriend.playAnim('sing' + dataSuffix[direction] + 'miss', true);