1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-09-19 16:41:39 +00:00

optimization when opening from pause menu

This commit is contained in:
Cameron Taylor 2024-02-15 04:10:48 -05:00
parent 18a926e108
commit 638c166663

View file

@ -51,10 +51,21 @@ class LatencyState extends MusicBeatSubState
*/
var localConductor:Conductor;
// stores values of what the previous persistent draw/update stuff was, example if opened
// from pause menu, we want to NOT draw persistently, but then resume drawing once closed
var prevPersistentDraw:Bool;
var prevPersistentUpdate:Bool;
override function create()
{
super.create();
prevPersistentDraw = FlxG.state.persistentDraw;
prevPersistentUpdate = FlxG.state.persistentUpdate;
FlxG.state.persistentDraw = false;
FlxG.state.persistentUpdate = false;
localConductor = new Conductor();
conductorInUse = localConductor;
@ -179,7 +190,6 @@ class LatencyState extends MusicBeatSubState
override public function close():Void
{
PreciseInputManager.instance.onInputPressed.remove(preciseInputPressed);
PreciseInputManager.instance.onInputReleased.remove(preciseInputReleased);
FlxG.sound.music.volume = previousVolume;
@ -188,6 +198,8 @@ class LatencyState extends MusicBeatSubState
FlxG.cameras.remove(stateCamera);
FlxG.state.persistentDraw = prevPersistentDraw;
FlxG.state.persistentUpdate = prevPersistentUpdate;
super.close();
}