From 2d8e686b331c69de1bf597edc271226624b66795 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Mon, 12 Feb 2024 16:50:40 -0500 Subject: [PATCH] Attempt to fix StickerState bug --- .../funkin/ui/transition/StickerSubState.hx | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/source/funkin/ui/transition/StickerSubState.hx b/source/funkin/ui/transition/StickerSubState.hx index fa36cfd50..7b5a88491 100644 --- a/source/funkin/ui/transition/StickerSubState.hx +++ b/source/funkin/ui/transition/StickerSubState.hx @@ -116,10 +116,19 @@ class StickerSubState extends MusicBeatSubState { grpStickers.cameras = FlxG.cameras.list; - if (dipshit != null) + /* + if (dipshit != null) + { + FlxG.removeChild(dipshit); + dipshit = null; + } + */ + + if (grpStickers.members == null || grpStickers.members.length == 0) { - FlxG.removeChild(dipshit); - dipshit = null; + switchingState = false; + close(); + return; } for (ind => sticker in grpStickers.members) @@ -235,15 +244,19 @@ class StickerSubState extends MusicBeatSubState FlxTransitionableState.skipNextTransIn = true; FlxTransitionableState.skipNextTransOut = true; - dipshit = new Sprite(); - var scrn:BitmapData = new BitmapData(FlxG.width, FlxG.height, true, 0x00000000); - var mat:Matrix = new Matrix(); - scrn.draw(grpStickers.cameras[0].canvas, mat); + // I think this grabs the screen and puts it under the stickers? + // Leaving this commented out rather than stripping it out because it's cool... + /* + dipshit = new Sprite(); + var scrn:BitmapData = new BitmapData(FlxG.width, FlxG.height, true, 0x00000000); + var mat:Matrix = new Matrix(); + scrn.draw(grpStickers.cameras[0].canvas, mat); - var bitmap:Bitmap = new Bitmap(scrn); + var bitmap:Bitmap = new Bitmap(scrn); - dipshit.addChild(bitmap); - FlxG.addChildBelowMouse(dipshit); + dipshit.addChild(bitmap); + // FlxG.addChildBelowMouse(dipshit); + */ FlxG.switchState(() -> targetState(this)); }