diff --git a/buildnumber.txt b/buildnumber.txt index 04602d5d..6f6edaee 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -1296 \ No newline at end of file +1307 \ No newline at end of file diff --git a/latest/windows/bin/CodenameEngine.exe b/latest/windows/bin/CodenameEngine.exe index a332f71c..675fb820 100644 Binary files a/latest/windows/bin/CodenameEngine.exe and b/latest/windows/bin/CodenameEngine.exe differ diff --git a/source/funkin/system/CoolUtil.hx b/source/funkin/system/CoolUtil.hx index 15fde62e..6d2f3153 100644 --- a/source/funkin/system/CoolUtil.hx +++ b/source/funkin/system/CoolUtil.hx @@ -269,7 +269,31 @@ class CoolUtil public static function loadFrames(path:String, Unique:Bool = false, Key:String = null):FlxFramesCollection { var noExt = Path.withoutExtension(path); - if (Assets.exists('$noExt/Animation.json') + if (Assets.exists('$noExt/1.png')) { + // MULTIPLE SPRITESHEETS!! + + var graphic = FlxG.bitmap.add("flixel/images/logo/default.png", false, '$noExt/mult'); + var frames = FlxAtlasFrames.findFrame(graphic); + if (frames != null) + return frames; + + trace("no frames yet for multiple atlases!!"); + var spritesheets = []; + var cur = 1; + var finalFrames = new FlxFramesCollection(graphic, ATLAS); + while(Assets.exists('$noExt/$cur.png')) { + spritesheets.push(loadFrames('$noExt/$cur.png')); + cur++; + } + for(frames in spritesheets) + if (frames != null && frames.frames != null) + for(f in frames.frames) + if (f != null) { + finalFrames.frames.push(f); + f.parent = frames.parent; + } + return finalFrames; + } else if (Assets.exists('$noExt/Animation.json') && Assets.exists('$noExt/spritemap.json') && Assets.exists('$noExt/spritemap.png')) { // TODO: Credit Smokey555!! diff --git a/source/funkin/system/Paths.hx b/source/funkin/system/Paths.hx index 41df4535..9da1e09f 100644 --- a/source/funkin/system/Paths.hx +++ b/source/funkin/system/Paths.hx @@ -115,7 +115,10 @@ class Paths inline static public function image(key:String, ?library:String, checkForAtlas:Bool = false) { var atlasPath = checkForAtlas ? getPath('images/$key/spritemap.png', IMAGE, library) : null; - return (checkForAtlas && OpenFlAssets.exists(atlasPath)) ? atlasPath.substr(0, atlasPath.length - 14) : getPath('images/$key.png', IMAGE, library); + var multiplePath = checkForAtlas ? getPath('images/$key/1.png', IMAGE, library) : null; + 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', IMAGE, library); } inline static public function script(key:String, ?library:String, isAssetsPath:Bool = false) {