mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-03-21 12:29:49 -04:00
fix the camera not panning when opening then closing the debug menu during transition
This commit is contained in:
parent
47b7aa702a
commit
bdbc136497
1 changed files with 6 additions and 4 deletions
|
@ -153,6 +153,9 @@ class MainMenuState extends MusicBeatState
|
||||||
|
|
||||||
resetCamStuff();
|
resetCamStuff();
|
||||||
|
|
||||||
|
// reset camera when debug menu is closed
|
||||||
|
subStateClosed.add(_ -> resetCamStuff(false));
|
||||||
|
|
||||||
subStateOpened.add(sub -> {
|
subStateOpened.add(sub -> {
|
||||||
if (Type.getClass(sub) == FreeplayState)
|
if (Type.getClass(sub) == FreeplayState)
|
||||||
{
|
{
|
||||||
|
@ -182,10 +185,11 @@ class MainMenuState extends MusicBeatState
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetCamStuff():Void
|
function resetCamStuff(?snap:Bool = true):Void
|
||||||
{
|
{
|
||||||
FlxG.camera.follow(camFollow, null, 0.06);
|
FlxG.camera.follow(camFollow, null, 0.06);
|
||||||
FlxG.camera.snapToTarget();
|
|
||||||
|
if (snap) FlxG.camera.snapToTarget();
|
||||||
}
|
}
|
||||||
|
|
||||||
function createMenuItem(name:String, atlas:String, callback:Void->Void, fireInstantly:Bool = false):Void
|
function createMenuItem(name:String, atlas:String, callback:Void->Void, fireInstantly:Bool = false):Void
|
||||||
|
@ -344,8 +348,6 @@ class MainMenuState extends MusicBeatState
|
||||||
persistentUpdate = false;
|
persistentUpdate = false;
|
||||||
|
|
||||||
FlxG.state.openSubState(new DebugMenuSubState());
|
FlxG.state.openSubState(new DebugMenuSubState());
|
||||||
// reset camera when debug menu is closed
|
|
||||||
subStateClosed.addOnce(_ -> resetCamStuff());
|
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue