1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-03-22 09:59:25 +00:00

Merge pull request #795 from FunkinCrew/nebulazorua/classic-camera-fix

[PUBLIC PR] Fix an issue where the Classic FocusCamera event would cause the camera to snap in place
This commit is contained in:
Cameron Taylor 2024-09-25 19:25:45 -04:00 committed by GitHub
commit 4669ac03a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View file

@ -3189,7 +3189,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)
@ -3206,7 +3206,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());
}
/**

View file

@ -127,7 +127,8 @@ class FocusCameraSongEvent extends SongEvent
switch (ease)
{
case 'CLASSIC': // Old-school. No ease. Just set follow point.
PlayState.instance.resetCamera(false, true);
PlayState.instance.resetCamera(false, false, false);
PlayState.instance.cancelCameraFollowTween();
PlayState.instance.cameraFollowPoint.setPosition(targetX, targetY);
case 'INSTANT': // Instant ease. Duration is automatically 0.
PlayState.instance.tweenCameraToPosition(targetX, targetY, 0);