diff --git a/source/funkin/backend/system/framerate/FramerateCounter.hx b/source/funkin/backend/system/framerate/FramerateCounter.hx index 55cc0f97..f5270051 100644 --- a/source/funkin/backend/system/framerate/FramerateCounter.hx +++ b/source/funkin/backend/system/framerate/FramerateCounter.hx @@ -35,4 +35,4 @@ class FramerateCounter extends Sprite { fpsLabel.x = fpsNum.x + fpsNum.width; fpsLabel.y = (fpsNum.y + fpsNum.height) - fpsLabel.height; } -} \ No newline at end of file +} diff --git a/source/funkin/menus/ui/Alphabet.hx b/source/funkin/menus/ui/Alphabet.hx index c885898e..f147d240 100644 --- a/source/funkin/menus/ui/Alphabet.hx +++ b/source/funkin/menus/ui/Alphabet.hx @@ -23,7 +23,7 @@ class Alphabet extends FlxSpriteGroup public var targetY:Float = 0; public var isMenuItem:Bool = false; - public var text:String = ""; + public var text(default, set):String = ""; var _finalText:String = ""; var _curText:String = ""; @@ -51,6 +51,24 @@ class Alphabet extends FlxSpriteGroup return super.set_color(c); } + private function set_text(v:String):String { + text = v; + + while (members.length > 0) { + var character = members[0]; + remove(character, true); + character.destroy(); + } + + if (text != "") { + if (typed) + startTypedText(); + else + addText(); + } + return v; + } + // TODO: fix this shit refreshing public function refreshAlphabetXML(path:String) { AlphaCharacter.__alphaPath = path; @@ -84,7 +102,6 @@ class Alphabet extends FlxSpriteGroup { super(x, y); - _finalText = this.text = text; isBold = bold; var alphabetPath = Paths.xml("alphabet"); @@ -111,17 +128,7 @@ class Alphabet extends FlxSpriteGroup } #end - if (text != "") - { - if (typed) - { - startTypedText(); - } - else - { - addText(); - } - } + _finalText = this.text = text; } public function addText()