Improve error logging when the game can't find a chart file.

This commit is contained in:
EliteMasterEric 2024-03-26 21:30:08 -04:00
parent 99ea7bbe84
commit 0e93f2ab27

View file

@ -431,7 +431,11 @@ class SongRegistry extends BaseRegistry<Song, SongMetadata>
{ {
variation = variation == null ? Constants.DEFAULT_VARIATION : variation; variation = variation == null ? Constants.DEFAULT_VARIATION : variation;
var entryFilePath:String = Paths.json('$dataFilePath/$id/$id-metadata${variation == Constants.DEFAULT_VARIATION ? '' : '-$variation'}'); var entryFilePath:String = Paths.json('$dataFilePath/$id/$id-metadata${variation == Constants.DEFAULT_VARIATION ? '' : '-$variation'}');
if (!openfl.Assets.exists(entryFilePath)) return null; if (!openfl.Assets.exists(entryFilePath))
{
trace(' [WARN] Could not locate file $entryFilePath');
return null;
}
var rawJson:Null<String> = openfl.Assets.getText(entryFilePath); var rawJson:Null<String> = openfl.Assets.getText(entryFilePath);
if (rawJson == null) return null; if (rawJson == null) return null;
rawJson = rawJson.trim(); rawJson = rawJson.trim();