From 641f246fb6eb826e40ebf9dd88e99d73532e7573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=9EHoovy=E2=9C=9E?= <124418090+MemeHovy@users.noreply.github.com> Date: Sat, 5 Aug 2023 04:16:50 -0400 Subject: [PATCH] optimized this a bit more --- source/Paths.hx | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/source/Paths.hx b/source/Paths.hx index fb628e0..0472811 100644 --- a/source/Paths.hx +++ b/source/Paths.hx @@ -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) { @@ -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); } @@ -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'); }