Skip to content

Commit

Permalink
optimized this a bit more
Browse files Browse the repository at this point in the history
  • Loading branch information
moxie-coder authored Aug 5, 2023
1 parent 257bda8 commit 641f246
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions source/Paths.hx
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,15 @@ import openfl.utils.Assets as OpenFlAssets;

class Paths
{
inline public static var SOUND_EXT = #if web "mp3" #else "ogg" #end;
inline public static final SOUND_EXT = #if web "mp3" #else "ogg" #end;

static var currentLevel:String;

static public function isLocale():Bool
{
if (LanguageManager.save.data.language != 'en-US')
{
return true;
}
return false;
}
inline static public function isLocale():Bool
return LanguageManager.save.data.language != 'en-US';

static public function setCurrentLevel(name:String)
{
inline static public function setCurrentLevel(name:String)
currentLevel = name.toLowerCase();
}

static function getPath(file:String, type:AssetType, library:Null<String>)
{
Expand Down Expand Up @@ -132,7 +124,7 @@ class Paths
return getPath('data/charts/$key.json', TEXT, library);
}

static public function sound(key:String, ?library:String)
inline static public function sound(key:String, ?library:String)
{
return getPath('sounds/$key.$SOUND_EXT', SOUND, library);
}
Expand Down Expand Up @@ -215,12 +207,12 @@ class Paths
return getPath('data/scripts/$key.hx', TEXT, 'preload');
}

static public function langaugeFile():String
inline static public function langaugeFile():String
{
return getPath('locale/languages.txt', TEXT, 'preload');
}

static public function offsetFile(character:String):String
inline static public function offsetFile(character:String):String
{
return getPath('offsets/' + character + '.txt', TEXT, 'preload');
}
Expand Down

0 comments on commit 641f246

Please sign in to comment.