Merge pull request #1538 from NeeEoo/sort-replay-by-new
Sort replays by newest
This commit is contained in:
commit
f618c67551
@ -44,7 +44,7 @@ class LoadReplayState extends MusicBeatState
|
|||||||
#end
|
#end
|
||||||
trace(controlsStrings);
|
trace(controlsStrings);
|
||||||
|
|
||||||
controlsStrings.sort(Reflect.compare);
|
controlsStrings.sort(sortByDate);
|
||||||
|
|
||||||
addWeek(['Bopeebo', 'Fresh', 'Dadbattle'], 1, ['dad']);
|
addWeek(['Bopeebo', 'Fresh', 'Dadbattle'], 1, ['dad']);
|
||||||
addWeek(['Spookeez', 'South', 'Monster'], 2, ['spooky']);
|
addWeek(['Spookeez', 'South', 'Monster'], 2, ['spooky']);
|
||||||
@ -106,6 +106,13 @@ class LoadReplayState extends MusicBeatState
|
|||||||
super.create();
|
super.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sortByDate(a:String, b:String) {
|
||||||
|
var aTime = Std.parseFloat(a.split("time")[1])/1000;
|
||||||
|
var bTime = Std.parseFloat(b.split("time")[1])/1000;
|
||||||
|
|
||||||
|
return Std.int(bTime - aTime); // Newest first
|
||||||
|
}
|
||||||
|
|
||||||
public function getWeekNumbFromSong(songName:String):Int
|
public function getWeekNumbFromSong(songName:String):Int
|
||||||
{
|
{
|
||||||
var week:Int = 0;
|
var week:Int = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user