Skip to content

Commit 8296351

Browse files
committed
im so dumb
1 parent 3d22cc6 commit 8296351

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

‎source/funkin/editors/ui/UIImageExplorer.hx‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,12 @@ class UIImageExplorer extends UIFileExplorer {
6464
directoryBG.members.push(directoryTextBox);
6565

6666
if (image != null) {
67-
var fullImagePath:String = '${Path.normalize(Sys.getCwd())}/${Paths.image(image)}'.replace('/', '\\');
68-
if (!FileSystem.exists(fullImagePath))
69-
fullImagePath = fullImagePath.replace('assets', '${ModsFolder.modsPath}\\${ModsFolder.currentModFolder}');
70-
71-
var noExt = Path.withoutExtension(fullImagePath);
72-
if (FileSystem.exists('$noExt\\spritemap1.png'))
73-
fullImagePath = '$noExt\\spritemap1.png';
74-
67+
var imagePath:String = Paths.image(image);
68+
var noExt = Path.withoutExtension(imagePath);
69+
if (Paths.assetsTree.getPath('$noExt\\spritemap1.png') != null)
70+
imagePath = '$noExt\\spritemap1.png';
71+
72+
var fullImagePath:String = '${Path.normalize(Sys.getCwd())}/${Paths.assetsTree.getPath(imagePath)}'.replace('/', '\\');
7573
if (FileSystem.exists(fullImagePath))
7674
loadFile(fullImagePath);
7775

0 commit comments

Comments
 (0)