From a9764bb9c37d5dc4d64ea755601592fa510c70b9 Mon Sep 17 00:00:00 2001 From: YoshiCrafter29 Date: Tue, 18 Oct 2022 09:52:48 +0200 Subject: [PATCH] sex --- source/funkin/game/NoteGroup.hx | 16 ++++++++++++---- .../funkin/options/keybinds/KeybindsOptions.hx | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/source/funkin/game/NoteGroup.hx b/source/funkin/game/NoteGroup.hx index 10c54899..c08245ad 100644 --- a/source/funkin/game/NoteGroup.hx +++ b/source/funkin/game/NoteGroup.hx @@ -1,5 +1,6 @@ package funkin.game; +import flixel.util.FlxSort; import flixel.FlxCamera; import funkin.system.Conductor; import flixel.group.FlxGroup.FlxTypedGroup; @@ -7,6 +8,17 @@ import flixel.group.FlxGroup.FlxTypedGroup; class NoteGroup extends FlxTypedGroup { var __loopSprite:Note; var i:Int = 0; + + public function addNotes(notes:Array) { + for(e in notes) add(e); + sortNotes(); + } + + public function sortNotes() { + sort(function(i, n1, n2) { + return FlxSort.byValues(FlxSort.ASCENDING, n1.strumTime, n2.strumTime); + }); + } public override function update(elapsed:Float) { i = 0; __loopSprite = null; @@ -20,10 +32,6 @@ class NoteGroup extends FlxTypedGroup { } } - // public override function sort() { - - // } - public override function draw() { @:privateAccess var oldDefaultCameras = FlxCamera._defaultCameras; @:privateAccess if (cameras != null) FlxCamera._defaultCameras = cameras; diff --git a/source/funkin/options/keybinds/KeybindsOptions.hx b/source/funkin/options/keybinds/KeybindsOptions.hx index 21b214b9..5307957b 100644 --- a/source/funkin/options/keybinds/KeybindsOptions.hx +++ b/source/funkin/options/keybinds/KeybindsOptions.hx @@ -209,6 +209,7 @@ class KeybindsOptions extends MusicBeatSubstate { else FlxG.switchState(new OptionsMenu()); controls.setKeyboardScheme(Solo); + Options.save(); return; }