From 9928d322d9b6616aa0771be988913ef3669fe7cb Mon Sep 17 00:00:00 2001 From: Snow1226 Date: Sat, 23 Mar 2024 01:16:47 +0900 Subject: [PATCH] Fixed a mistake in the script reset process --- CameraPlus/Behaviours/CameraPlusBehaviour.cs | 21 ++++++++++---------- CameraPlus/CHANGELOG.md | 7 +++++-- CameraPlus/Properties/AssemblyInfo.cs | 4 ++-- CameraPlus/manifest.json | 2 +- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/CameraPlus/Behaviours/CameraPlusBehaviour.cs b/CameraPlus/Behaviours/CameraPlusBehaviour.cs index 62ac09a..0ab803c 100644 --- a/CameraPlus/Behaviours/CameraPlusBehaviour.cs +++ b/CameraPlus/Behaviours/CameraPlusBehaviour.cs @@ -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(); } @@ -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); @@ -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; @@ -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() diff --git a/CameraPlus/CHANGELOG.md b/CameraPlus/CHANGELOG.md index 1c567d6..37cd21d 100644 --- a/CameraPlus/CHANGELOG.md +++ b/CameraPlus/CHANGELOG.md @@ -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 diff --git a/CameraPlus/Properties/AssemblyInfo.cs b/CameraPlus/Properties/AssemblyInfo.cs index 526027b..8ed8e4b 100644 --- a/CameraPlus/Properties/AssemblyInfo.cs +++ b/CameraPlus/Properties/AssemblyInfo.cs @@ -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")] diff --git a/CameraPlus/manifest.json b/CameraPlus/manifest.json index 11befee..8e0355e 100644 --- a/CameraPlus/manifest.json +++ b/CameraPlus/manifest.json @@ -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": {