From 439b9a71aa071d431e1948f34015c290b8e02f10 Mon Sep 17 00:00:00 2001 From: Cam the Kirby <92703353+CamtheKirby@users.noreply.github.com> Date: Wed, 22 May 2024 21:41:16 -0500 Subject: [PATCH] Less Lag Option --- source/OptionsMenu.hx | 7 ++++++- source/PlayState.hx | 9 ++++++++- source/SaveDataHandler.hx | 3 +++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx index 1c1cf87..12b15fa 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -94,6 +94,7 @@ class OptionsMenu extends MusicBeatState + "\n" + (FlxG.save.data.disableFps ? LanguageManager.getTextString('option_enable_fps') : LanguageManager.getTextString('option_disable_fps')) + "\n" + (CompatTool.save.data.compatMode ? LanguageManager.getTextString('option_enable_compat') : LanguageManager.getTextString('option_disable_compat')) + "\n" + (FlxG.save.data.modchart ? 'Mod Chart OFF' : 'Mod Chart ON') + + "\n" + (FlxG.save.data.lessLag ? 'Less Lag OFF' : 'Less Lag ON') ); grpControls = new FlxTypedGroup(); @@ -211,7 +212,11 @@ class OptionsMenu extends MusicBeatState updateGroupControls(CompatTool.save.data.compatMode ? LanguageManager.getTextString('option_enable_compat') : LanguageManager.getTextString('option_disable_compat'), 11, 'Vertical'); case 12: if (!awaitingExploitation) FlxG.save.data.modchart = !FlxG.save.data.modchart; - updateGroupControls(FlxG.save.data.modchart ? 'Mod Chart OFF' : 'Mod Chart ON', 12, 'Vertical'); + updateGroupControls(FlxG.save.data.modchart ? 'Mod Chart OFF' : 'Mod Chart ON', 12, 'Vertical'); + + case 13: + FlxG.save.data.lessLag = !FlxG.save.data.lessLag; + updateGroupControls(FlxG.save.data.lessLag ? 'Less Lag OFF' : 'Less Lag ON', 12, 'Vertical'); } } diff --git a/source/PlayState.hx b/source/PlayState.hx index 09b6944..6eec541 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -4172,7 +4172,7 @@ class PlayState extends MusicBeatState } } cameraMoveOnNote(noteToPlay, 'dad'); - + if (FlxG.save.data.lessLag) { dadStrums.forEach(function(sprite:StrumNote) { if (Math.abs(Math.round(Math.abs(daNote.noteData)) % dadStrumAmount) == sprite.ID) @@ -4204,6 +4204,7 @@ class PlayState extends MusicBeatState } sprite.pressingKey5 = daNote.noteStyle == 'shape'; }); + } daNote.hitByOpponent = true; @@ -4976,6 +4977,7 @@ class PlayState extends MusicBeatState coolText.screenCenter(); coolText.x = FlxG.width * 0.55; } + if (FlxG.save.data.lessLag) { var rating = new FlxSprite().loadGraphic(Paths.image("ui/" + assetPath + daRating)); rating.screenCenter(); rating.x = coolText.x - 40; @@ -5070,6 +5072,7 @@ class PlayState extends MusicBeatState startDelay: Conductor.crochet * 0.001 }); } +} private function popUpScore(strumtime:Float, note:Note):Void @@ -5953,7 +5956,9 @@ class PlayState extends MusicBeatState if(botPlay) { if (Math.abs(Math.round(Math.abs(note.noteData)) % playerStrumAmount) == spr.ID) { + if (FlxG.save.data.lessLag) { spr.playAnim('confirm', true); + } spr.animation.finishCallback = function(name:String) { spr.playAnim('static', true); @@ -5963,7 +5968,9 @@ class PlayState extends MusicBeatState } else { if (Math.abs(note.noteData) == spr.ID) { + if (FlxG.save.data.lessLag) { spr.playAnim('confirm', true); + } } } }); diff --git a/source/SaveDataHandler.hx b/source/SaveDataHandler.hx index 85c1fef..86759fa 100644 --- a/source/SaveDataHandler.hx +++ b/source/SaveDataHandler.hx @@ -72,5 +72,8 @@ class SaveDataHandler if (FlxG.save.data.practiceMode == null) FlxG.save.data.practiceMode = false; + + if (FlxG.save.data.lessLag == null) + FlxG.save.data.lesslag = false; } } \ No newline at end of file