From fc799248229028bf460e956418eddb15c1ed36d6 Mon Sep 17 00:00:00 2001 From: MtH Date: Thu, 15 Apr 2021 02:18:59 +0200 Subject: [PATCH] eggnog > winter-horrorland transiton FIX --- source/PlayState.hx | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index d09d83dd1..01f8e0d0a 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2296,6 +2296,12 @@ class PlayState extends MusicBeatState trace('LOADING NEXT SONG'); trace(storyPlaylist[0].toLowerCase() + difficulty); + FlxTransitionableState.skipNextTransIn = true; + FlxTransitionableState.skipNextTransOut = true; + + FlxG.sound.music.stop(); + vocals.stop(); + if (SONG.song.toLowerCase() == 'eggnog') { var blackShit:FlxSprite = new FlxSprite(-FlxG.width * FlxG.camera.zoom, @@ -2303,18 +2309,21 @@ class PlayState extends MusicBeatState blackShit.scrollFactor.set(); add(blackShit); camHUD.visible = false; + inCutscene = true; - FlxG.sound.play(Paths.sound('Lights_Shut_off')); + FlxG.sound.play(Paths.sound('Lights_Shut_off'), function(){ + // no camFollow so it centers on horror tree + SONG = Song.loadFromJson(storyPlaylist[0].toLowerCase() + difficulty, storyPlaylist[0]); + LoadingState.loadAndSwitchState(new PlayState()); + }); } + else + { + prevCamFollow = camFollow; - FlxTransitionableState.skipNextTransIn = true; - FlxTransitionableState.skipNextTransOut = true; - prevCamFollow = camFollow; - - SONG = Song.loadFromJson(storyPlaylist[0].toLowerCase() + difficulty, storyPlaylist[0]); - FlxG.sound.music.stop(); - - LoadingState.loadAndSwitchState(new PlayState()); + SONG = Song.loadFromJson(storyPlaylist[0].toLowerCase() + difficulty, storyPlaylist[0]); + LoadingState.loadAndSwitchState(new PlayState()); + } } } else @@ -2325,8 +2334,6 @@ class PlayState extends MusicBeatState } } - var endingSong:Bool = false; - private function popUpScore(strumtime:Float, daNote:Note):Void { var noteDiff:Float = Math.abs(strumtime - Conductor.songPosition);