From 9d1392399bc51f831c9b37c6824714d1c5f68f34 Mon Sep 17 00:00:00 2001 From: Hero Date: Sat, 5 Jul 2025 03:13:30 +0300 Subject: [PATCH] Add noExtension flag to getFolderContent for cleaner Paths usage (#654) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * yeah * Revert "yeah" This reverts commit 5ab6ab8c7dcef1a1e31731f4543e9f110561ba0a. * idk wtf happend * Fixed Missing Curly Bracket * hi --------- Co-authored-by: Furo Co-authored-by: ⍚~Nex <87421482+NexIsDumb@users.noreply.github.com> --- source/funkin/backend/assets/Paths.hx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/funkin/backend/assets/Paths.hx b/source/funkin/backend/assets/Paths.hx index a29d3909..771568e5 100644 --- a/source/funkin/backend/assets/Paths.hx +++ b/source/funkin/backend/assets/Paths.hx @@ -274,13 +274,13 @@ class Paths } return content; } - static public function getFolderContent(key:String, addPath:Bool = false, source:AssetsLibraryList.AssetSource = BOTH):Array { + static public function getFolderContent(key:String, addPath:Bool = false, source:AssetsLibraryList.AssetSource = BOTH, noExtension:Bool = false):Array { // designed to work both on windows and web if (!key.endsWith("/")) key += "/"; var content = assetsTree.getFiles('assets/$key', source); - if (addPath) { - for(k=>e in content) - content[k] = '$key$e'; + for (k => e in content) { + if (noExtension) e = Path.withoutExtension(e); + content[k] = addPath ? '$key$e' : e; } return content; /* @@ -363,4 +363,4 @@ class ScriptPathInfo { this.file = file; this.library = library; } -} \ No newline at end of file +}