From 050086fb36278726ea89bee64dea269386bcaf29 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Thu, 3 Aug 2023 11:40:19 -0400 Subject: [PATCH] Fixed camera focus on game over. --- .github/actions/setup-haxeshit/action.yml | 2 +- source/funkin/play/PlayState.hx | 4 ++++ source/funkin/play/stage/Stage.hx | 21 +++++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-haxeshit/action.yml b/.github/actions/setup-haxeshit/action.yml index 6b565bfa2..ec8ed52d8 100644 --- a/.github/actions/setup-haxeshit/action.yml +++ b/.github/actions/setup-haxeshit/action.yml @@ -21,7 +21,7 @@ runs: - name: Installing Haxe lol run: | haxe -version - haxelib git haxelib https://github.com/HaxeFoundation/haxelib.git + haxelib git haxelib https://github.com/HaxeFoundation/haxelib.git development haxelib version haxelib --global install hmm haxelib --global run hmm install --quiet diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index 5e8f964d1..297f14d69 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -1107,6 +1107,8 @@ class PlayState extends MusicBeatSubState // super.stepHit() returns false if a module cancelled the event. if (!super.stepHit()) return false; + if (isGamePaused) return false; + if (!startingSong && FlxG.sound.music != null && (Math.abs(FlxG.sound.music.time - (Conductor.songPosition - Conductor.offset)) > 200 @@ -1131,6 +1133,8 @@ class PlayState extends MusicBeatSubState // super.beatHit() returns false if a module cancelled the event. if (!super.beatHit()) return false; + if (isGamePaused) return false; + if (generatedMusic) { // TODO: Sort more efficiently, or less often, to improve performance. diff --git a/source/funkin/play/stage/Stage.hx b/source/funkin/play/stage/Stage.hx index dafba1c06..d2b157acd 100644 --- a/source/funkin/play/stage/Stage.hx +++ b/source/funkin/play/stage/Stage.hx @@ -694,6 +694,27 @@ class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass } } + public override function kill() + { + _skipTransformChildren = true; + alive = false; + exists = false; + _skipTransformChildren = false; + if (group != null) group.kill(); + } + + public override function remove(Sprite:FlxSprite, Splice:Bool = false):FlxSprite + { + var sprite:FlxSprite = cast Sprite; + sprite.x -= x; + sprite.y -= y; + // alpha + sprite.cameras = null; + + if (group != null) group.remove(Sprite, Splice); + return Sprite; + } + public function onScriptEvent(event:ScriptEvent) {} public function onPause(event:PauseScriptEvent) {}