mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-03-23 05:15:14 -04:00
Merge branch 'gamerbross/freeplay-crash' into develop-0.4.0
This commit is contained in:
commit
4dca6671c4
1 changed files with 16 additions and 1 deletions
|
@ -29,6 +29,7 @@ import funkin.graphics.shaders.StrokeShader;
|
|||
import funkin.input.Controls;
|
||||
import funkin.play.PlayStatePlaylist;
|
||||
import funkin.play.song.Song;
|
||||
import funkin.ui.story.Level;
|
||||
import funkin.save.Save;
|
||||
import funkin.save.Save.SaveScoreData;
|
||||
import funkin.ui.AtlasText;
|
||||
|
@ -185,10 +186,24 @@ class FreeplayState extends MusicBeatSubState
|
|||
// programmatically adds the songs via LevelRegistry and SongRegistry
|
||||
for (levelId in LevelRegistry.instance.listSortedLevelIds())
|
||||
{
|
||||
for (songId in LevelRegistry.instance.parseEntryData(levelId).songs)
|
||||
var level:Level = LevelRegistry.instance.fetchEntry(levelId);
|
||||
|
||||
if (level == null)
|
||||
{
|
||||
trace('[WARN] Could not find level with id (${levelId})');
|
||||
continue;
|
||||
}
|
||||
|
||||
for (songId in level.getSongs())
|
||||
{
|
||||
var song:Song = SongRegistry.instance.fetchEntry(songId);
|
||||
|
||||
if (song == null)
|
||||
{
|
||||
trace('[WARN] Could not find song with id (${songId})');
|
||||
continue;
|
||||
}
|
||||
|
||||
// Only display songs which actually have available difficulties for the current character.
|
||||
var displayedVariations = song.getVariationsByCharId(currentCharacter);
|
||||
var availableDifficultiesForSong:Array<String> = song.listDifficulties(displayedVariations, false);
|
||||
|
|
Loading…
Reference in a new issue