diff --git a/source/Main.hx b/source/Main.hx index 49cf29a..81fd033 100644 --- a/source/Main.hx +++ b/source/Main.hx @@ -23,8 +23,6 @@ class Main extends openfl.display.Sprite { }; public static var fpsDisplay:FPS; - public static var fpsOnRight(default, set):Bool = false; - public static var toast:ToastCore; public function new() { @@ -184,12 +182,6 @@ class Main extends openfl.display.Sprite { } } - public static function set_fpsOnRight(value:Bool):Bool { - fpsOnRight = value; - fpsDisplay.onRight = value; - return value; - } - public static function updateFramerate(newFramerate:Int) { if (newFramerate > FlxG.updateFramerate) { FlxG.updateFramerate = newFramerate; diff --git a/source/backend/Paths.hx b/source/backend/Paths.hx index 0707125..7b1b1e0 100644 --- a/source/backend/Paths.hx +++ b/source/backend/Paths.hx @@ -133,10 +133,10 @@ class Paths { } inline public static function getTextArray(path:String):Array - return Assets.exists(path) ? [for (i in Assets.getText(path).trim().split('\n')) i.trim()] : []; + return exists(path) ? [for (i in getText(path).trim().split('\n')) i.trim()] : []; static public function getTextFromFile(key:String):String - return (exists(file(key))) ? getText(file(key)) : null; + return exists(file(key)) ? getText(file(key)) : null; inline static public function txt(key:String) return file('$key.txt'); diff --git a/source/debug/FPS.hx b/source/debug/FPS.hx index 0612490..793cc51 100644 --- a/source/debug/FPS.hx +++ b/source/debug/FPS.hx @@ -4,21 +4,11 @@ import openfl.text.*; import openfl.events.Event; class FPS extends TextField { - public var onRight(default, set):Bool = false; public var borderSize:Int = 1; private final borders:Array = new Array(); private var times:Array = []; - var xStart:Float = 10.0; - - public function set_onRight(value:Bool):Bool { - var align:TextFormat = new TextFormat(); - align.align = (value ? "right" : "left"); - setTextFormat(align); - return onRight = value; - } - public function new(x:Float, y:Float, color:Int, ?font:String) { super(); @@ -35,7 +25,6 @@ class FPS extends TextField { text = ""; this.x = x; - xStart = x; this.y = y; width = 1280; height = 720; @@ -53,16 +42,7 @@ class FPS extends TextField { if (mem > memPeak) memPeak = mem; - if (visible) { - if (onRight) { - x = Application.current.window.width - width - xStart; - for (border in borders) - border.x = Application.current.window.width - width - xStart; - } else - x = xStart; - - text = 'FPS: ${times.length}\nMEM: ${FlxStringUtil.formatBytes(mem)} / ${FlxStringUtil.formatBytes(memPeak)}'; - } + text = (visible) ? 'FPS: ${times.length}\nMEM: ${FlxStringUtil.formatBytes(mem)} / ${FlxStringUtil.formatBytes(memPeak)}' : ''; textColor = (times.length < FlxG.drawFramerate * 0.5) ? 0xFFFF0000 : 0xFFFFFFFF; }); diff --git a/source/states/ChartingState.hx b/source/states/ChartingState.hx index 0544f71..afec46e 100644 --- a/source/states/ChartingState.hx +++ b/source/states/ChartingState.hx @@ -68,8 +68,6 @@ class ChartingState extends ExtendableState { override function create() { super.create(); - Main.fpsOnRight = true; - Paths.clearStoredMemory(); Paths.clearUnusedMemory(); diff --git a/source/states/PlayState.hx b/source/states/PlayState.hx index 9edfde5..fc2977c 100644 --- a/source/states/PlayState.hx +++ b/source/states/PlayState.hx @@ -79,8 +79,6 @@ class PlayState extends ExtendableState { override function create() { super.create(); - Main.fpsOnRight = false; - Paths.clearStoredMemory(); if (FlxG.sound.music != null)