From b388fccf0c036ca248f54faa5cac9d6bd0acaf0d Mon Sep 17 00:00:00 2001 From: Spel0 <75626813+Spel0@users.noreply.github.com> Date: Wed, 7 Jul 2021 03:16:14 +0300 Subject: [PATCH] fixed it --- Project.xml | 2 +- source/Paths.hx | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Project.xml b/Project.xml index eeffad6..9516b71 100644 --- a/Project.xml +++ b/Project.xml @@ -123,7 +123,7 @@ - + diff --git a/source/Paths.hx b/source/Paths.hx index 1dfe920..19b16bd 100644 --- a/source/Paths.hx +++ b/source/Paths.hx @@ -131,7 +131,10 @@ class Paths inline static public function getSparrowAtlas(key:String, ?library:String, ?isCharacter:Bool = false) { if (isCharacter) - return FlxAtlasFrames.fromSparrow(imageCached(key), file('images/characters/$key.xml', library)); + if (FlxG.save.data.cacheImages) + return FlxAtlasFrames.fromSparrow(imageCached(key), file('images/characters/$key.xml', library)); + else + return FlxAtlasFrames.fromSparrow(image('characters/'+key), file('images/characters/$key.xml')); return FlxAtlasFrames.fromSparrow(image(key, library), file('images/$key.xml', library)); } @@ -146,7 +149,10 @@ class Paths inline static public function getPackerAtlas(key:String, ?library:String, ?isCharacter:Bool = false) { if (isCharacter) - return FlxAtlasFrames.fromSpriteSheetPacker(imageCached(key), file('images/$key.txt', library)); + if (FlxG.save.data.cacheImages) + return FlxAtlasFrames.fromSpriteSheetPacker(imageCached(key), file('images/$key.txt', library)); + else + return FlxAtlasFrames.fromSpriteSheetPacker(image('characters/'+key), file('images/characters/$key.txt')); return FlxAtlasFrames.fromSpriteSheetPacker(image(key, library), file('images/$key.txt', library)); } }