Skip to content

Commit

Permalink
Fixed a mistake in the script reset process
Browse files Browse the repository at this point in the history
  • Loading branch information
Snow1226 committed Mar 22, 2024
1 parent 427be11 commit 9928d32
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
21 changes: 11 additions & 10 deletions CameraPlus/Behaviours/CameraPlusBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public void DestoryVMCProtocolObject()
#endif
Plugin.cameraController.externalSender.RemoveTask(this);

if (Config.movementScript.movementScript != String.Empty || Config.movementScript.songSpecificScript)
if (string.IsNullOrEmpty(Config.movementScript.movementScript) || Config.movementScript.songSpecificScript)
AddMovementScript();
}

Expand All @@ -231,7 +231,7 @@ public void OnEnable()
{
if (Config.vmcProtocol.mode == VMCProtocolMode.Sender)
InitExternalSender();
if (Config.movementScript.movementScript != String.Empty || Config.movementScript.songSpecificScript)
if (string.IsNullOrEmpty(Config.movementScript.movementScript) || Config.movementScript.songSpecificScript)
AddMovementScript();
if (!Config.cameraExtensions.dontDrawDesktop)
Plugin.cameraController.ScreenCamera.RegistrationCamera(this);
Expand Down Expand Up @@ -541,10 +541,9 @@ public string AddMovementScript()
if (Config.vmcProtocol.mode == VMCProtocolMode.Receiver) return "ExternalReceiver Enabled";
if (!ThirdPerson) return "Camera Mode is First Person";

if (Config.movementScript.movementScript != String.Empty || Config.movementScript.songSpecificScript)
if (!string.IsNullOrWhiteSpace(Config.movementScript.movementScript) || Config.movementScript.songSpecificScript)
{
if (_cameraMovement)
_cameraMovement.Shutdown();
ClearMovementScript();

if (CustomPreviewBeatmapLevelPatch.customLevelPath != String.Empty && Config.movementScript.songSpecificScript)
songScriptPath = CustomPreviewBeatmapLevelPatch.customLevelPath;
Expand All @@ -569,12 +568,14 @@ public string AddMovementScript()
}
public void ClearMovementScript()
{
if (_cameraMovement)
if (_cameraMovement != null)
{
_cameraMovement.Shutdown();
_cameraMovement = null;
ThirdPersonPos = Config.Position;
ThirdPersonRot = Config.Rotation;
_cam.fieldOfView = Config.fov;
_cameraMovement = null;
ThirdPersonPos = Config.Position;
ThirdPersonRot = Config.Rotation;
_cam.fieldOfView = Config.fov;
}
}

protected IEnumerator GetMainCamera()
Expand Down
7 changes: 5 additions & 2 deletions CameraPlus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# V7.0.12 Changes
# v7.0.13 Changes
- Fixed a mistake in the script reset process.
-
# v7.0.12 Changes
- If you grab the camera and move it with the stick, Fixed an issue where the movement would be the opposite of what was expected.

# V7.0.11 Changes
# v7.0.11 Changes
- Lighter rendering.

# v7.0.10 Changes
Expand Down
4 changes: 2 additions & 2 deletions CameraPlus/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("7.0.12")]
[assembly: AssemblyFileVersion("7.0.12")]
[assembly: AssemblyVersion("7.0.13")]
[assembly: AssemblyFileVersion("7.0.13")]
2 changes: 1 addition & 1 deletion CameraPlus/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"id": "CameraPlus",
"name": "CameraPlus",
"author": "Various Modders",
"version": "7.0.12-backport",
"version": "7.0.13-backport",
"description": "CameraPlus is a Beat Saber mod that allows for multiple wide FOV cameras with smoothed movement.",
"gameVersion": "1.22.1",
"dependsOn": {
Expand Down

0 comments on commit 9928d32

Please sign in to comment.