From 8fea7eb73427994bda74e04b3193feb11a3d6389 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 19 Dec 2023 01:57:39 -0500 Subject: [PATCH] Fix a bug where the background of the game over screen is pink --- source/funkin/play/GameOverSubState.hx | 16 +++++++++++++--- source/funkin/play/PlayState.hx | 5 ++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/source/funkin/play/GameOverSubState.hx b/source/funkin/play/GameOverSubState.hx index 6eb53e2d5..dce2229e1 100644 --- a/source/funkin/play/GameOverSubState.hx +++ b/source/funkin/play/GameOverSubState.hx @@ -64,9 +64,13 @@ class GameOverSubState extends MusicBeatSubState */ var isEnding:Bool = false; - public function new() + var transparent:Bool; + + public function new(params:GameOverParams) { super(); + + transparent = params.transparent; } /** @@ -87,9 +91,10 @@ class GameOverSubState extends MusicBeatSubState // // Add a black background to the screen. - // We make this transparent so that we can see the stage underneath during debugging. var bg = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK); - bg.alpha = 0.25; + // We make this transparent so that we can see the stage underneath during debugging, + // but it's normally opaque. + bg.alpha = transparent ? 0.25 : 1.0; bg.scrollFactor.set(); add(bg); @@ -307,3 +312,8 @@ class GameOverSubState extends MusicBeatSubState }); } } + +typedef GameOverParams = +{ + var transparent:Bool; +} diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index e0932e756..85f60be4e 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -922,7 +922,10 @@ class PlayState extends MusicBeatSubState } #end - var gameOverSubState = new GameOverSubState(); + var gameOverSubState = new GameOverSubState( + { + transparent: persistentDraw, + }); FlxTransitionableSubState.skipNextTransIn = true; FlxTransitionableSubState.skipNextTransOut = true; openSubState(gameOverSubState);