Fix an issue where returning to Freeplay from gameplay would let you interact with the menu underneath

This commit is contained in:
EliteMasterEric 2024-04-30 13:58:39 -04:00
parent dae7d71b17
commit e7a09fcee2
2 changed files with 7 additions and 6 deletions

View file

@ -946,16 +946,16 @@ class FreeplayState extends MusicBeatSubState
caps.doJumpOut = true;
}
if (Type.getClass(FlxG.state) == MainMenuState)
if (Type.getClass(_parentState) == MainMenuState)
{
FlxG.state.persistentUpdate = false;
FlxG.state.persistentDraw = true;
_parentState.persistentUpdate = false;
_parentState.persistentDraw = true;
}
new FlxTimer().start(longestTimer, (_) -> {
FlxTransitionableState.skipNextTransIn = true;
FlxTransitionableState.skipNextTransOut = true;
if (Type.getClass(FlxG.state) == MainMenuState)
if (Type.getClass(_parentState) == MainMenuState)
{
FunkinSound.playMusic('freakyMenu',
{

View file

@ -54,8 +54,9 @@ class MainMenuState extends MusicBeatState
playMenuMusic();
persistentUpdate = true;
persistentDraw = true;
// If something else overrides these, we should keep those values.
// persistentUpdate = true;
// persistentDraw = true;
var bg:FlxSprite = new FlxSprite(Paths.image('menuBG'));
bg.scrollFactor.x = 0;