Skip to content

Commit

Permalink
Less Lag Option
Browse files Browse the repository at this point in the history
  • Loading branch information
CamLikesKirby committed May 23, 2024
1 parent 4e3fb3a commit 439b9a7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
7 changes: 6 additions & 1 deletion source/OptionsMenu.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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<Alphabet>();
Expand Down Expand Up @@ -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');
}
}

Expand Down
9 changes: 8 additions & 1 deletion source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -4204,6 +4204,7 @@ class PlayState extends MusicBeatState
}
sprite.pressingKey5 = daNote.noteStyle == 'shape';
});
}

daNote.hitByOpponent = true;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -5070,6 +5072,7 @@ class PlayState extends MusicBeatState
startDelay: Conductor.crochet * 0.001
});
}
}


private function popUpScore(strumtime:Float, note:Note):Void
Expand Down Expand Up @@ -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);
Expand All @@ -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);
}
}
}
});
Expand Down
3 changes: 3 additions & 0 deletions source/SaveDataHandler.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 439b9a7

Please sign in to comment.