diff --git a/source/funkin/backend/assets/AssetSource.hx b/source/funkin/backend/assets/AssetSource.hx index d8ba6b14..cb17af82 100644 --- a/source/funkin/backend/assets/AssetSource.hx +++ b/source/funkin/backend/assets/AssetSource.hx @@ -4,4 +4,25 @@ enum abstract AssetSource(Null) from Bool from Null to Null { var SOURCE = true; var MODS = false; var BOTH = null; + + @:from public static function fromString(string:String):AssetSource + { + return switch (string.trim().toLowerCase()) + { + case "source": SOURCE; + case "mods": MODS; + case "both": BOTH; + default: MODS; + } + } + + @:to public inline function toString():String + { + return switch (this) + { + case SOURCE: "source"; + case MODS: "mods"; + case BOTH: "both"; + } + } } \ No newline at end of file diff --git a/source/funkin/backend/assets/AssetsLibraryList.hx b/source/funkin/backend/assets/AssetsLibraryList.hx index 8d26a900..918804ec 100644 --- a/source/funkin/backend/assets/AssetsLibraryList.hx +++ b/source/funkin/backend/assets/AssetsLibraryList.hx @@ -26,8 +26,10 @@ class AssetsLibraryList extends AssetLibrary { return true; for(k=>e in libraries) { if (shouldSkipLib(e, source)) continue; - if (e.exists(id, type)) + if (e.exists(id, type)) { + trace('$k $e ${e.tag.toString()} $id exists'); return true; + } } return false; } @@ -114,6 +116,11 @@ class AssetsLibraryList extends AssetLibrary { if (e.exists(id, e.types.get(id))) { var asset = e.getAsset(id, type); if (asset != null) { + if(asset.length > 512) { + trace('$k $e ${e.tag.toString()} $id asset of length ${asset.length}'); + } else { + trace('$k $e ${e.tag.toString()} $id returned asset $asset'); + } return asset; } }