Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions source/NoteskinHelpers.hx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#if FEATURE_FILESYSTEM

import sys.FileSystem;
import sys.io.File;
#end
import openfl.display.BitmapData;
import flixel.FlxSprite;
import flixel.graphics.FlxGraphic;
Expand All @@ -19,7 +18,6 @@ class NoteskinHelpers
{
noteskinArray = [];
xmlData = [];
#if FEATURE_FILESYSTEM
var count:Int = 0;
for (i in FileSystem.readDirectory(FileSystem.absolutePath("assets/shared/images/noteskins")))
{
Expand All @@ -35,9 +33,9 @@ class NoteskinHelpers
continue;
noteskinArray.push(i.replace(".png", ""));
}
#else

noteskinArray = ["Arrows", "Circles"];
#end


return noteskinArray;
}
Expand All @@ -54,7 +52,7 @@ class NoteskinHelpers

static public function generateNoteskinSprite(id:Int)
{
#if FEATURE_FILESYSTEM

// TODO: Make this use OpenFlAssets.

Debug.logTrace("bruh momento");
Expand All @@ -65,14 +63,14 @@ class NoteskinHelpers
return FlxAtlasFrames.fromSparrow(FlxGraphic.fromBitmapData(data), xmlData[id]);

// return Paths.getSparrowAtlas('noteskins/' + NoteskinHelpers.getNoteskinByID(FlxG.save.data.noteskin), "shared");
#else

return Paths.getSparrowAtlas('noteskins/Arrows', "shared");
#end

}

static public function generatePixelSprite(id:Int, ends:Bool = false)
{
#if FEATURE_FILESYSTEM

// TODO: Make this use OpenFlAssets.

Debug.logTrace("bruh momento");
Expand All @@ -86,8 +84,7 @@ class NoteskinHelpers
return BitmapData.fromFile(path + ".png");

// return Paths.getSparrowAtlas('noteskins/' + NoteskinHelpers.getNoteskinByID(FlxG.save.data.noteskin), "shared");
#else
return BitmapData.fromFile(Paths.image('noteskins/Arrows-pixel', "shared"));
#end

}
}