@@ -252,7 +252,7 @@ class Paths
252
252
253
253
inline static public function sound (key : String , ? library : String ): Null <Sound >
254
254
{
255
- return returnSound (' sounds' , key , library );
255
+ return returnFolderSound (' sounds' , key , library );
256
256
}
257
257
258
258
inline static public function soundRandom (key : String , min : Int , max : Int , ? library : String )
@@ -262,12 +262,12 @@ class Paths
262
262
263
263
inline static public function music (key : String , ? library : String ): Null <Sound >
264
264
{
265
- return returnSound (' music' , key , library );
265
+ return returnFolderSound (' music' , key , library );
266
266
}
267
267
268
268
inline static public function track (song : String , track : String ): Null <Sound >
269
269
{
270
- return returnSound (' songs' , ' ${formatToSongPath (song )}/ $track ' );
270
+ return returnFolderSound (' songs' , ' ${formatToSongPath (song )}/ $track ' );
271
271
}
272
272
273
273
inline static public function voices (song : String ): Null <Sound >
@@ -528,29 +528,30 @@ class Paths
528
528
return getPath (' $path / $key . $SOUND_EXT ' );
529
529
}
530
530
531
- public static function returnSound (path : String , key : String , ? library : String )
532
- {
533
- var gottenPath : String = soundPath (path , key , library );
534
-
535
- if (currentTrackedSounds .exists (gottenPath )) {
536
- if (! localTrackedAssets .contains (gottenPath ))
537
- localTrackedAssets .push (gottenPath );
531
+ inline public static function returnFolderSound (path : String , key : String , ? library : String )
532
+ return returnSound (soundPath (path , key , library ), library );
538
533
539
- return currentTrackedSounds .get (gottenPath );
534
+ public static function returnSound (path : String , ? library : String )
535
+ {
536
+ if (currentTrackedSounds .exists (path )) {
537
+ if (! localTrackedAssets .contains (path ))
538
+ localTrackedAssets .push (path );
539
+
540
+ return currentTrackedSounds .get (path );
540
541
}
541
542
542
- var sound = getSound (gottenPath );
543
+ var sound = getSound (path );
543
544
if (sound != null ) {
544
- currentTrackedSounds .set (gottenPath , sound );
545
+ currentTrackedSounds .set (path , sound );
545
546
546
- if (! localTrackedAssets .contains (gottenPath ))
547
- localTrackedAssets .push (gottenPath );
547
+ if (! localTrackedAssets .contains (path ))
548
+ localTrackedAssets .push (path );
548
549
549
550
return sound ;
550
551
}
551
552
552
553
if (Main .showDebugTraces )
553
- trace (' sound $path , $ key => $ gottenPath returned null' );
554
+ trace (' sound $path returned null' );
554
555
555
556
return null ;
556
557
}
@@ -571,6 +572,9 @@ class Paths
571
572
return null ;
572
573
}
573
574
575
+ public static inline function getFolderPath (folder : String = " " ): String
576
+ return (folder == " " ) ? getPreloadPath () : mods (folder );
577
+
574
578
// //
575
579
public static var currentModDirectory (default , set ): String = ' ' ;
576
580
static function set_currentModDirectory (v : String ){
0 commit comments