mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-22 23:57:50 -05:00
Add Remember Selection to MainMenuState
This commit is contained in:
parent
28bee8397e
commit
bc1c15e91c
1 changed files with 6 additions and 0 deletions
|
@ -42,6 +42,8 @@ class MainMenuState extends MusicBeatState
|
|||
var magenta:FlxSprite;
|
||||
var camFollow:FlxObject;
|
||||
|
||||
static var rememberedSelectedIndex:Int = 0;
|
||||
|
||||
override function create():Void
|
||||
{
|
||||
#if discord_rpc
|
||||
|
@ -137,6 +139,8 @@ class MainMenuState extends MusicBeatState
|
|||
menuItem.scrollFactor.y = 0.4;
|
||||
}
|
||||
|
||||
menuItems.selectItem(rememberedSelectedIndex);
|
||||
|
||||
resetCamStuff();
|
||||
|
||||
subStateOpened.add(sub -> {
|
||||
|
@ -285,6 +289,8 @@ class MainMenuState extends MusicBeatState
|
|||
function startExitState(state:NextState):Void
|
||||
{
|
||||
menuItems.enabled = false; // disable for exit
|
||||
rememberedSelectedIndex = menuItems.selectedIndex;
|
||||
|
||||
var duration = 0.4;
|
||||
menuItems.forEach(function(item) {
|
||||
if (menuItems.selectedIndex != item.ID)
|
||||
|
|
Loading…
Reference in a new issue