mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-14 19:25:16 -05:00
story menu diff sorted
This commit is contained in:
parent
8589c10c75
commit
0ce82e49d0
1 changed files with 25 additions and 0 deletions
|
@ -155,6 +155,31 @@ class Level implements IRegistryEntry<LevelData>
|
|||
}
|
||||
}
|
||||
|
||||
// sort the difficulties, since they may be out of order in the chart JSON
|
||||
var diffMap:Map<String, Int> = new Map<String, Int>();
|
||||
for (difficulty in difficulties)
|
||||
{
|
||||
var num:Int = 0;
|
||||
switch (difficulty)
|
||||
{
|
||||
case 'easy':
|
||||
num = 0;
|
||||
case 'normal':
|
||||
num = 1;
|
||||
case 'hard':
|
||||
num = 2;
|
||||
case 'erect':
|
||||
num = 3;
|
||||
case 'nightmare':
|
||||
num = 4;
|
||||
}
|
||||
diffMap.set(difficulty, num);
|
||||
}
|
||||
|
||||
difficulties.sort(function(a:String, b:String) {
|
||||
return diffMap.get(a) - diffMap.get(b);
|
||||
});
|
||||
|
||||
// Filter to only include difficulties that are present in all songs
|
||||
for (songIndex in 1...songList.length)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue