mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-04-11 06:45:06 +00:00
story menu diff sorted
This commit is contained in:
parent
8589c10c75
commit
0ce82e49d0
|
@ -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
|
// Filter to only include difficulties that are present in all songs
|
||||||
for (songIndex in 1...songList.length)
|
for (songIndex in 1...songList.length)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue