From 8aaf97b8b37e23f618ba9b87fc1da8bbbbe0e831 Mon Sep 17 00:00:00 2001 From: Yoshman29 <81191621+YoshiCrafter29@users.noreply.github.com> Date: Wed, 8 Feb 2023 22:55:36 +0100 Subject: [PATCH] fixed transition --- assets/data/weeks.xml | 2 +- buildnumber.txt | 2 +- source/funkin/game/PlayState.hx | 9 +++++++-- source/funkin/utils/CoolUtil.hx | 2 ++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/assets/data/weeks.xml b/assets/data/weeks.xml index 77139fc8..96ff136f 100644 --- a/assets/data/weeks.xml +++ b/assets/data/weeks.xml @@ -41,7 +41,7 @@ - + diff --git a/buildnumber.txt b/buildnumber.txt index 2416c2c4..96f3243e 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -2231 \ No newline at end of file +2235 \ No newline at end of file diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 665d525e..5d0d7c8c 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -631,6 +631,7 @@ class PlayState extends MusicBeatState FlxG.camera.scroll.set(smoothTransitionData.camX, smoothTransitionData.camY); FlxG.camera.zoom = smoothTransitionData.camZoom; FlxTransitionableState.skipNextTransIn = true; + camFollow.setPosition(smoothTransitionData.camFollowX, smoothTransitionData.camFollowY); } else { FlxG.camera.focusOn(camFollow.getPosition()); } @@ -1383,15 +1384,17 @@ class PlayState extends MusicBeatState stage: curStage, camX: FlxG.camera.scroll.x, camY: FlxG.camera.scroll.y, + camFollowX: camFollow.x, + camFollowY: camFollow.y, camZoom: FlxG.camera.zoom }; FlxTransitionableState.skipNextTransIn = true; FlxTransitionableState.skipNextTransOut = true; - - PlayState.SONG = Song.loadFromJson(PlayState.storyPlaylist[0].toLowerCase(), difficulty); FlxG.sound.music.stop(); + CoolUtil.__loadSong(PlayState.storyPlaylist[0].toLowerCase(), difficulty); + FlxG.switchState(new PlayState()); } } @@ -1753,5 +1756,7 @@ typedef PlayStateTransitionData = { var stage:String; var camX:Float; var camY:Float; + var camFollowX:Float; + var camFollowY:Float; var camZoom:Float; } \ No newline at end of file diff --git a/source/funkin/utils/CoolUtil.hx b/source/funkin/utils/CoolUtil.hx index 4e9e03fb..3a78b49b 100644 --- a/source/funkin/utils/CoolUtil.hx +++ b/source/funkin/utils/CoolUtil.hx @@ -27,6 +27,7 @@ import flash.geom.ColorTransform; using StringTools; +@:allow(funkin.game.PlayState) class CoolUtil { /* @@ -280,6 +281,7 @@ class CoolUtil PlayState.storyPlaylist = [for(e in weekData.songs) e.name]; PlayState.isStoryMode = true; PlayState.campaignScore = 0; + PlayState.opponentMode = PlayState.coopMode = false; __loadSong(PlayState.storyPlaylist[0], difficulty); } public static function loadSong(name:String, difficulty:String = "normal", opponentMode:Bool = false, coopMode:Bool = false) {