From 92b84168e1007342997bf0f7ee4619c4ad09e25f Mon Sep 17 00:00:00 2001 From: gamerbross <55158797+gamerbross@users.noreply.github.com> Date: Mon, 20 May 2024 02:56:57 +0200 Subject: [PATCH 1/3] Add camOther to fix zooms on pause and stickers --- source/funkin/play/PlayState.hx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index 43dd485cf9..20b9d3661a 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -491,9 +491,9 @@ class PlayState extends MusicBeatSubState public var camGame:FlxCamera; /** - * The camera which contains, and controls visibility of, a video cutscene. + * The camera which contains, and controls visibility of, a video cutscene, dialogue, pause menu and sticker transition. */ - public var camCutscene:FlxCamera; + public var camOther:FlxCamera; /** * The combo popups. Includes the real-time combo counter and the rating. @@ -960,7 +960,7 @@ class PlayState extends MusicBeatSubState FlxTransitionableState.skipNextTransIn = true; FlxTransitionableState.skipNextTransOut = true; - pauseSubState.camera = camHUD; + pauseSubState.camera = camOther; openSubState(pauseSubState); // boyfriendPos.put(); // TODO: Why is this here? } @@ -1501,12 +1501,12 @@ class PlayState extends MusicBeatSubState camGame.bgColor = BACKGROUND_COLOR; // Show a pink background behind the stage. camHUD = new FlxCamera(); camHUD.bgColor.alpha = 0; // Show the game scene behind the camera. - camCutscene = new FlxCamera(); - camCutscene.bgColor.alpha = 0; // Show the game scene behind the camera. + camOther = new FlxCamera(); + camOther.bgColor.alpha = 0; // Show the game scene behind the camera. FlxG.cameras.reset(camGame); FlxG.cameras.add(camHUD, false); - FlxG.cameras.add(camCutscene, false); + FlxG.cameras.add(camOther, false); // Configure camera follow point. if (previousCameraFollowPoint != null) @@ -1900,7 +1900,6 @@ class PlayState extends MusicBeatSubState if (!result) return; isInCutscene = false; - camCutscene.visible = false; // TODO: Maybe tween in the camera after any cutscenes. camHUD.visible = true; @@ -1919,7 +1918,7 @@ class PlayState extends MusicBeatSubState if (!currentConversation.alive) currentConversation.revive(); currentConversation.completeCallback = onConversationComplete; - currentConversation.cameras = [camCutscene]; + currentConversation.cameras = [camOther]; currentConversation.zIndex = 1000; add(currentConversation); refresh(); @@ -2751,7 +2750,7 @@ class PlayState extends MusicBeatSubState persistentUpdate = false; FlxTransitionableState.skipNextTransIn = true; FlxTransitionableState.skipNextTransOut = true; - pauseSubState.camera = camCutscene; + pauseSubState.camera = camOther; openSubState(pauseSubState); } } @@ -2767,7 +2766,7 @@ class PlayState extends MusicBeatSubState persistentUpdate = false; FlxTransitionableState.skipNextTransIn = true; FlxTransitionableState.skipNextTransOut = true; - pauseSubState.camera = camCutscene; + pauseSubState.camera = camOther; openSubState(pauseSubState); } } From 0a6f1abd33d8cb474dcd8efe81380e5736538fc8 Mon Sep 17 00:00:00 2001 From: gamerbross <55158797+gamerbross@users.noreply.github.com> Date: Mon, 20 May 2024 23:52:45 +0200 Subject: [PATCH 2/3] Fix references to camCutscene --- source/funkin/play/cutscene/VideoCutscene.hx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/source/funkin/play/cutscene/VideoCutscene.hx b/source/funkin/play/cutscene/VideoCutscene.hx index 01a492a77a..2177114aad 100644 --- a/source/funkin/play/cutscene/VideoCutscene.hx +++ b/source/funkin/play/cutscene/VideoCutscene.hx @@ -81,12 +81,11 @@ class VideoCutscene // Trigger the cutscene. Don't play the song in the background. PlayState.instance.isInCutscene = true; PlayState.instance.camHUD.visible = false; - PlayState.instance.camCutscene.visible = true; // Display a black screen to hide the game while the video is playing. blackScreen = new FlxSprite(-200, -200).makeGraphic(FlxG.width * 2, FlxG.height * 2, FlxColor.BLACK); blackScreen.scrollFactor.set(0, 0); - blackScreen.cameras = [PlayState.instance.camCutscene]; + blackScreen.cameras = [PlayState.instance.camOther]; PlayState.instance.add(blackScreen); VideoCutscene.cutsceneType = cutsceneType; @@ -120,7 +119,7 @@ class VideoCutscene vid.finishCallback = finishVideo.bind(0.5); - vid.cameras = [PlayState.instance.camCutscene]; + vid.cameras = [PlayState.instance.camOther]; PlayState.instance.add(vid); @@ -147,7 +146,7 @@ class VideoCutscene vid.bitmap.onEndReached.add(finishVideo.bind(0.5)); vid.autoPause = false; - vid.cameras = [PlayState.instance.camCutscene]; + vid.cameras = [PlayState.instance.camOther]; PlayState.instance.add(vid); @@ -305,7 +304,6 @@ class VideoCutscene vid = null; #end - PlayState.instance.camCutscene.visible = true; PlayState.instance.camHUD.visible = true; FlxTween.tween(blackScreen, {alpha: 0}, transitionTime, From b7eaa238e01ba0003ebd53cf71ecb2930c6c7b76 Mon Sep 17 00:00:00 2001 From: gamerbross <55158797+gamerbross@users.noreply.github.com> Date: Wed, 12 Jun 2024 00:34:04 +0200 Subject: [PATCH 3/3] Revert camCutscene rename --- source/funkin/play/PlayState.hx | 16 ++++++++-------- source/funkin/play/cutscene/VideoCutscene.hx | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index 20b9d3661a..b88fef1887 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -493,7 +493,7 @@ class PlayState extends MusicBeatSubState /** * The camera which contains, and controls visibility of, a video cutscene, dialogue, pause menu and sticker transition. */ - public var camOther:FlxCamera; + public var camCutscene:FlxCamera; /** * The combo popups. Includes the real-time combo counter and the rating. @@ -960,7 +960,7 @@ class PlayState extends MusicBeatSubState FlxTransitionableState.skipNextTransIn = true; FlxTransitionableState.skipNextTransOut = true; - pauseSubState.camera = camOther; + pauseSubState.camera = camCutscene; openSubState(pauseSubState); // boyfriendPos.put(); // TODO: Why is this here? } @@ -1501,12 +1501,12 @@ class PlayState extends MusicBeatSubState camGame.bgColor = BACKGROUND_COLOR; // Show a pink background behind the stage. camHUD = new FlxCamera(); camHUD.bgColor.alpha = 0; // Show the game scene behind the camera. - camOther = new FlxCamera(); - camOther.bgColor.alpha = 0; // Show the game scene behind the camera. + camCutscene = new FlxCamera(); + camCutscene.bgColor.alpha = 0; // Show the game scene behind the camera. FlxG.cameras.reset(camGame); FlxG.cameras.add(camHUD, false); - FlxG.cameras.add(camOther, false); + FlxG.cameras.add(camCutscene, false); // Configure camera follow point. if (previousCameraFollowPoint != null) @@ -1918,7 +1918,7 @@ class PlayState extends MusicBeatSubState if (!currentConversation.alive) currentConversation.revive(); currentConversation.completeCallback = onConversationComplete; - currentConversation.cameras = [camOther]; + currentConversation.cameras = [camCutscene]; currentConversation.zIndex = 1000; add(currentConversation); refresh(); @@ -2750,7 +2750,7 @@ class PlayState extends MusicBeatSubState persistentUpdate = false; FlxTransitionableState.skipNextTransIn = true; FlxTransitionableState.skipNextTransOut = true; - pauseSubState.camera = camOther; + pauseSubState.camera = camCutscene; openSubState(pauseSubState); } } @@ -2766,7 +2766,7 @@ class PlayState extends MusicBeatSubState persistentUpdate = false; FlxTransitionableState.skipNextTransIn = true; FlxTransitionableState.skipNextTransOut = true; - pauseSubState.camera = camOther; + pauseSubState.camera = camCutscene; openSubState(pauseSubState); } } diff --git a/source/funkin/play/cutscene/VideoCutscene.hx b/source/funkin/play/cutscene/VideoCutscene.hx index 2177114aad..7612c3ab6c 100644 --- a/source/funkin/play/cutscene/VideoCutscene.hx +++ b/source/funkin/play/cutscene/VideoCutscene.hx @@ -85,7 +85,7 @@ class VideoCutscene // Display a black screen to hide the game while the video is playing. blackScreen = new FlxSprite(-200, -200).makeGraphic(FlxG.width * 2, FlxG.height * 2, FlxColor.BLACK); blackScreen.scrollFactor.set(0, 0); - blackScreen.cameras = [PlayState.instance.camOther]; + blackScreen.cameras = [PlayState.instance.camCutscene]; PlayState.instance.add(blackScreen); VideoCutscene.cutsceneType = cutsceneType; @@ -119,7 +119,7 @@ class VideoCutscene vid.finishCallback = finishVideo.bind(0.5); - vid.cameras = [PlayState.instance.camOther]; + vid.cameras = [PlayState.instance.camCutscene]; PlayState.instance.add(vid); @@ -146,7 +146,7 @@ class VideoCutscene vid.bitmap.onEndReached.add(finishVideo.bind(0.5)); vid.autoPause = false; - vid.cameras = [PlayState.instance.camOther]; + vid.cameras = [PlayState.instance.camCutscene]; PlayState.instance.add(vid);