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 7e93679 commit c81482d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
21 changes: 11 additions & 10 deletions CameraPlus/Behaviours/CameraPlusBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public void DestoryVMCProtocolObject()
#endif
Plugin.cameraController.externalSender.RemoveTask(this);

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

Expand All @@ -235,7 +235,7 @@ public void OnEnable()
{
if (Config.vmcProtocol.mode == VMCProtocolMode.Sender)
InitExternalSender();
if (Config.movementScript.movementScript != String.Empty || Config.movementScript.songSpecificScript)
if (string.IsNullOrWhiteSpace(Config.movementScript.movementScript) || Config.movementScript.songSpecificScript)
AddMovementScript();
if (!Config.cameraExtensions.dontDrawDesktop)
Plugin.cameraController.ScreenCamera.RegistrationCamera(this);
Expand Down Expand Up @@ -544,12 +544,11 @@ 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 (SongScriptBeatmapPatch.customLevelPath != String.Empty && Config.movementScript.songSpecificScript)
if (string.IsNullOrWhiteSpace( SongScriptBeatmapPatch.customLevelPath) && Config.movementScript.songSpecificScript)
songScriptPath = SongScriptBeatmapPatch.customLevelPath;
else if (File.Exists(Path.Combine(CameraUtilities.ScriptPath, Path.GetFileName(Config.movementScript.movementScript))))
songScriptPath = Path.Combine(CameraUtilities.ScriptPath, Path.GetFileName(Config.movementScript.movementScript));
Expand All @@ -573,11 +572,13 @@ public string AddMovementScript()
public void ClearMovementScript()
{
if (_cameraMovement)
{
_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
5 changes: 4 additions & 1 deletion CameraPlus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# V7.2.1 Changes
# v7.2.2 Changes
- Fixed a mistake in the script reset process.

# v7.2.1 Changes
- Lighter rendering.
-
# v7.2.0 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.2.1")]
[assembly: AssemblyFileVersion("7.2.1")]
[assembly: AssemblyVersion("7.2.2")]
[assembly: AssemblyFileVersion("7.2.2")]
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.2.1",
"version": "7.2.2",
"description": "CameraPlus is a Beat Saber mod that allows for multiple wide FOV cameras with smoothed movement.",
"gameVersion": "1.34.5",
"dependsOn": {
Expand Down

0 comments on commit c81482d

Please sign in to comment.