From a3d9ddb74e3e3fd1819ab41511f41c651c493ec6 Mon Sep 17 00:00:00 2001 From: "Rodney, An Imaginative Person" <59747809+RodneyAnImaginativePerson@users.noreply.github.com> Date: Fri, 16 Aug 2024 20:37:51 -0400 Subject: [PATCH] Update MainMenuState.hx (#366) --- source/funkin/menus/MainMenuState.hx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/source/funkin/menus/MainMenuState.hx b/source/funkin/menus/MainMenuState.hx index 31b09402..8015ddb4 100644 --- a/source/funkin/menus/MainMenuState.hx +++ b/source/funkin/menus/MainMenuState.hx @@ -23,8 +23,10 @@ class MainMenuState extends MusicBeatState var optionShit:Array = CoolUtil.coolTextFile(Paths.txt("config/menuItems")); + var bg:FlxSprite; var magenta:FlxSprite; var camFollow:FlxObject; + var versionText:FunkinText; public var canAccessDebugMenus:Bool = true; @@ -36,7 +38,7 @@ class MainMenuState extends MusicBeatState CoolUtil.playMenuSong(); - var bg:FlxSprite = new FlxSprite(-80).loadAnimatedGraphic(Paths.image('menus/menuBG')); + bg = new FlxSprite(-80).loadAnimatedGraphic(Paths.image('menus/menuBG')); add(bg); camFollow = new FlxObject(0, 0, 1, 1); @@ -74,15 +76,16 @@ class MainMenuState extends MusicBeatState FlxG.camera.follow(camFollow, null, 0.06); - var versionShit:FunkinText = new FunkinText(5, FlxG.height - 2, 0, 'Codename Engine v${Application.current.meta.get('version')}\nCommit ${funkin.backend.system.macros.GitCommitMacro.commitNumber} (${funkin.backend.system.macros.GitCommitMacro.commitHash})\n[${controls.getKeyName(SWITCHMOD)}] Open Mods menu\n'); - versionShit.y -= versionShit.height; - versionShit.scrollFactor.set(); - add(versionShit); + versionText = new FunkinText(5, FlxG.height - 2, 0, 'Codename Engine v${Application.current.meta.get('version')}\nCommit ${funkin.backend.system.macros.GitCommitMacro.commitNumber} (${funkin.backend.system.macros.GitCommitMacro.commitHash})\n[${controls.getKeyName(SWITCHMOD)}] Open Mods menu\n'); + versionText.y -= versionText.height; + versionText.scrollFactor.set(); + add(versionText); changeItem(); } var selectedSomethin:Bool = false; + var forceCenterX:Bool = true; override function update(elapsed:Float) { @@ -131,6 +134,7 @@ class MainMenuState extends MusicBeatState super.update(elapsed); + if (forceCenterX) menuItems.forEach(function(spr:FlxSprite) { spr.screenCenter(X);