mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-04-04 11:05:18 +00:00
Merge branch 'mainmenu-remember-selection' into rewrite/master
This commit is contained in:
commit
e45e359de7
|
@ -44,11 +44,12 @@ class MainMenuState extends MusicBeatState
|
||||||
|
|
||||||
var overrideMusic:Bool = false;
|
var overrideMusic:Bool = false;
|
||||||
|
|
||||||
|
static var rememberedSelectedIndex:Int = 0;
|
||||||
|
|
||||||
public function new(?_overrideMusic:Bool = false)
|
public function new(?_overrideMusic:Bool = false)
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
overrideMusic = _overrideMusic;
|
overrideMusic = _overrideMusic;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override function create():Void
|
override function create():Void
|
||||||
|
@ -148,6 +149,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 -> {
|
||||||
|
@ -295,6 +298,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