mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-30 03:25:47 -05:00
Alphabetical sort
This commit is contained in:
parent
ce0be2374d
commit
adda3020a9
3 changed files with 12 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
package funkin.modding.module;
|
||||
|
||||
import funkin.util.SortUtil;
|
||||
import funkin.modding.events.ScriptEvent.UpdateScriptEvent;
|
||||
import funkin.modding.events.ScriptEvent;
|
||||
import funkin.modding.events.ScriptEventDispatcher;
|
||||
|
@ -76,8 +77,7 @@ class ModuleHandler
|
|||
}
|
||||
else
|
||||
{
|
||||
// Sort alphabetically. Yes that's how this works.
|
||||
return a > b ? 1 : -1;
|
||||
return SortUtil.alphabetical(a, b);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -586,7 +586,7 @@ class BaseCharacter extends Bopper
|
|||
public override function playAnimation(name:String, restart:Bool = false, ?ignoreOther:Bool = false, ?reversed:Bool = false):Void
|
||||
{
|
||||
FlxG.watch.addQuick('playAnim(${characterName})', name);
|
||||
trace('playAnim(${characterName}): ${name}');
|
||||
// trace('playAnim(${characterName}): ${name}');
|
||||
super.playAnimation(name, restart, ignoreOther, reversed);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,4 +26,13 @@ class SortUtil
|
|||
{
|
||||
return FlxSort.byValues(order, a.data.strumTime, b.data.strumTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort predicate for sorting strings alphabetically.
|
||||
*/
|
||||
public static function alphabetical(a:String, b:String):Int
|
||||
{
|
||||
// Sort alphabetically. Yes that's how this works.
|
||||
return a > b ? 1 : -1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue