last commit, if merged, would've likely caused issues if going from tween to classic

should be fixed now?
This commit is contained in:
nebulazorua
2024-05-15 20:42:11 +08:00
parent 3cc7f7407d
commit fae625a795
2 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -3128,7 +3128,7 @@ class PlayState extends MusicBeatSubState
/**
* Resets the camera's zoom level and focus point.
*/
public function resetCamera(?resetZoom:Bool = true, ?cancelTweens:Bool = true):Void
public function resetCamera(?resetZoom:Bool = true, ?cancelTweens:Bool = true, ?snap:Bool = true):Void
{
// Cancel camera tweens if any are active.
if (cancelTweens)
@@ -3145,7 +3145,7 @@ class PlayState extends MusicBeatSubState
}
// Snap the camera to the follow point immediately.
FlxG.camera.focusOn(cameraFollowPoint.getPosition());
if (snap) FlxG.camera.focusOn(cameraFollowPoint.getPosition());
}
/**
@@ -127,6 +127,7 @@ class FocusCameraSongEvent extends SongEvent
switch (ease)
{
case 'CLASSIC': // Old-school. No ease. Just set follow point.
PlayState.instance.resetCamera(false, false, false);
PlayState.instance.cancelCameraFollowTween();
PlayState.instance.cameraFollowPoint.setPosition(targetX, targetY);
case 'INSTANT': // Instant ease. Duration is automatically 0.