mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-23 08:07:54 -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 magenta:FlxSprite;
|
||||||
var camFollow:FlxObject;
|
var camFollow:FlxObject;
|
||||||
|
|
||||||
|
static var rememberedSelectedIndex:Int = 0;
|
||||||
|
|
||||||
override function create():Void
|
override function create():Void
|
||||||
{
|
{
|
||||||
#if discord_rpc
|
#if discord_rpc
|
||||||
|
@ -137,6 +139,8 @@ class MainMenuState extends MusicBeatState
|
||||||
menuItem.scrollFactor.y = 0.4;
|
menuItem.scrollFactor.y = 0.4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
menuItems.selectItem(rememberedSelectedIndex);
|
||||||
|
|
||||||
resetCamStuff();
|
resetCamStuff();
|
||||||
|
|
||||||
subStateOpened.add(sub -> {
|
subStateOpened.add(sub -> {
|
||||||
|
@ -285,6 +289,8 @@ class MainMenuState extends MusicBeatState
|
||||||
function startExitState(state:NextState):Void
|
function startExitState(state:NextState):Void
|
||||||
{
|
{
|
||||||
menuItems.enabled = false; // disable for exit
|
menuItems.enabled = false; // disable for exit
|
||||||
|
rememberedSelectedIndex = menuItems.selectedIndex;
|
||||||
|
|
||||||
var duration = 0.4;
|
var duration = 0.4;
|
||||||
menuItems.forEach(function(item) {
|
menuItems.forEach(function(item) {
|
||||||
if (menuItems.selectedIndex != item.ID)
|
if (menuItems.selectedIndex != item.ID)
|
||||||
|
|
Loading…
Reference in a new issue