From cc921c946ee46175297bd2c3a9e59ec22285cef2 Mon Sep 17 00:00:00 2001 From: lunarcleint <88809950+lunarcleint@users.noreply.github.com> Date: Sun, 4 Feb 2024 01:41:55 -0700 Subject: [PATCH] paths ext cool sawg --- source/funkin/backend/assets/Paths.hx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/funkin/backend/assets/Paths.hx b/source/funkin/backend/assets/Paths.hx index 211920fa1..6a6efc08d 100644 --- a/source/funkin/backend/assets/Paths.hx +++ b/source/funkin/backend/assets/Paths.hx @@ -36,8 +36,8 @@ class Paths public static inline function getPath(file:String, ?library:String) return library != null ? '$library:assets/$library/$file' : 'assets/$file'; - public static inline function video(key:String) - return getPath('videos/$key.mp4'); + public static inline function video(key:String, ?ext:String = "mp4") + return getPath('videos/$key.$ext'); public static inline function ndll(key:String) return getPath('ndlls/$key.ndll'); @@ -90,15 +90,15 @@ class Paths return OpenFlAssets.exists(diff) ? diff : getPath('songs/${song.toLowerCase()}/song/Inst$prefix.$SOUND_EXT', null); } - static public function image(key:String, ?library:String, checkForAtlas:Bool = false) + static public function image(key:String, ?library:String, checkForAtlas:Bool = false, ?ext:String = "png") { if (checkForAtlas) { - var atlasPath = getPath('images/$key/spritemap.png', library); - var multiplePath = getPath('images/$key/1.png', library); + var atlasPath = getPath('images/$key/spritemap.$ext', library); + var multiplePath = getPath('images/$key/1.$ext', library); if (atlasPath != null && OpenFlAssets.exists(atlasPath)) return atlasPath.substr(0, atlasPath.length - 14); if (multiplePath != null && OpenFlAssets.exists(multiplePath)) return multiplePath.substr(0, multiplePath.length - 6); } - return getPath('images/$key.png', library); + return getPath('images/$key.$ext', library); } inline static public function script(key:String, ?library:String, isAssetsPath:Bool = false) {