Skip to content

Commit

Permalink
Update MainMenuState.hx (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
rodney528 authored Aug 17, 2024
1 parent 42cbb45 commit a3d9ddb
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions source/funkin/menus/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ class MainMenuState extends MusicBeatState

var optionShit:Array<String> = CoolUtil.coolTextFile(Paths.txt("config/menuItems"));

var bg:FlxSprite;
var magenta:FlxSprite;
var camFollow:FlxObject;
var versionText:FunkinText;

public var canAccessDebugMenus:Bool = true;

Expand All @@ -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);
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -131,6 +134,7 @@ class MainMenuState extends MusicBeatState

super.update(elapsed);

if (forceCenterX)
menuItems.forEach(function(spr:FlxSprite)
{
spr.screenCenter(X);
Expand Down

0 comments on commit a3d9ddb

Please sign in to comment.