Decompiled source of RockCamEssentials v1.6.0

Mods/Rock Cam Essentials.dll

Decompiled 3 days ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppLiv.Lck;
using Il2CppLiv.Lck.Recorder;
using Il2CppLiv.Lck.UI;
using Il2CppRUMBLE.Interactions.InteractionBase.Extensions;
using Il2CppRUMBLE.Managers;
using Il2CppRUMBLE.Players.Subsystems;
using Il2CppRUMBLE.Recording.LCK;
using Il2CppRUMBLE.Recording.LCK.Extensions;
using Il2CppRUMBLE.Utilities;
using Il2CppTMPro;
using MelonLoader;
using Rock_Cam_Essentials;
using RumbleModdingAPI;
using UnityEngine;
using UnityEngine.Rendering.Universal;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Main), "RockCamEssentials", "1.6.0", "Deterraleon", null)]
[assembly: MelonGame("Buckethead Entertainment", "RUMBLE")]
[assembly: MelonColor(255, 200, 0, 200)]
[assembly: MelonAuthorColor(255, 255, 119, 255)]
[assembly: VerifyLoaderVersion(0, 6, 6, true)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("Rock Cam Essentials")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+8c2149a3d4b4d1d489d0a7a5cba86454e30255d1")]
[assembly: AssemblyProduct("Rock Cam Essentials")]
[assembly: AssemblyTitle("Rock Cam Essentials")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Rock_Cam_Essentials;

public static class BuildInfo
{
	public const string ModName = "RockCamEssentials";

	public const string ModVersion = "1.6.0";

	public const string Author = "Deterraleon";
}
public class Main : MelonMod
{
	private string currentScene = "Loader";

	private bool enabled = true;

	public override void OnSceneWasLoaded(int buildIndex, string sceneName)
	{
		currentScene = sceneName;
	}

	public override void OnLateInitializeMelon()
	{
		Calls.onMapInitialized += mapLoaded;
	}

	public void mapLoaded()
	{
	}
}
public class Rock_Cam
{
	public struct POVNames
	{
		public string ThirdPerson;

		public string FirstPerson;

		public string Handheld;
	}

	public struct RecordingSettings
	{
		public uint width;

		public uint height;

		public uint audioBitrate;

		public uint Bitrate;

		public uint framerate;

		public static bool operator ==(RecordingSettings a, RecordingSettings b)
		{
			return a.width == b.width && a.height == b.height && a.audioBitrate == b.audioBitrate && a.Bitrate == b.Bitrate && a.framerate == b.framerate;
		}

		public static bool operator !=(RecordingSettings a, RecordingSettings b)
		{
			return !(a == b);
		}
	}

	public class ThirdPerson
	{
		public LCKCameraController _CameraController;

		public LckDoubleButton _FOVSetter;

		public int MaxFOV = 100;

		public int MinFOV = 30;

		public int FOVStep = 10;

		public bool isFlipped = false;

		public float Distance = 1f;

		public float Angle = 15f;

		public UniversalAdditionalCameraData _CameraSettings;

		public LckCamera _Camera;

		public float PositionalSmoothing = 0f;

		public float RotationalSmoothing = 0f;

		public LCKSettingsButtonsController _POVController;

		public Rock_Cam _rockcam;

		public ThirdPerson(Rock_Cam rockcam)
		{
			_rockcam = rockcam;
			_CameraController = rockcam._CameraController;
			_Camera = rockcam._Tablet.thirdPersonCamera;
			Distance = _CameraController._thirdPersonDistance;
			Angle = _CameraController._thirdPersonHeightAngle;
			_FOVSetter = _CameraController.ThirdPersonFOVDoubleButton;
			MaxFOV = _FOVSetter._maxValue;
			MinFOV = _FOVSetter._minValue;
			FOVStep = _FOVSetter._increment;
			PositionalSmoothing = _CameraController._thirdPersonStabilizer.PositionalSmoothing;
			RotationalSmoothing = _CameraController._thirdPersonStabilizer.RotationalSmoothing;
			_CameraSettings = ((Component)rockcam._Tablet.thirdPersonCamera).gameObject.GetComponent<UniversalAdditionalCameraData>();
			_POVController = rockcam._POVController;
		}

		public bool SetPOV()
		{
			try
			{
				_POVController.SwitchToTPMode();
				_rockcam.POV = "TP";
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
			return true;
		}

		public bool SetAngle(float angle)
		{
			try
			{
				_CameraController._thirdPersonHeightAngle = angle;
				Angle = angle;
				return true;
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
		}

		public bool SetDistance(float distance)
		{
			try
			{
				_CameraController._thirdPersonDistance = distance;
				Distance = distance;
				return true;
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
		}

		public bool SetDistanceMultiplier(float distanceMultiplier)
		{
			try
			{
				_CameraController._thirdPersonDistanceMultiplier = distanceMultiplier;
				return true;
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
		}

		public bool FlipCamera(bool flip)
		{
			if (isFlipped != _CameraController.IsThirdPersonFront)
			{
				MelonLogger.Msg("isFlippedTP variable desynched");
				isFlipped = _CameraController.IsThirdPersonFront;
			}
			if (flip == isFlipped)
			{
				MelonLogger.Msg("TP camera already flipped correct way");
				return true;
			}
			try
			{
				isFlipped = flip;
				_CameraController.IsThirdPersonFront = !_CameraController.IsThirdPersonFront;
				return true;
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
		}

		public bool SetPositionalSmooting(float smooth)
		{
			if (smooth >= 1f && smooth != 99f)
			{
				MelonLogger.Warning("Smoothing of 1 or greater will result in no movement at all, you can set smoothing to 99 to avoid this message");
			}
			try
			{
				_CameraController._thirdPersonStabilizer.PositionalSmoothing = smooth;
				PositionalSmoothing = smooth;
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
			return true;
		}

		public bool SetRotationalSmooting(float smooth)
		{
			if (smooth >= 1f && smooth != 99f)
			{
				MelonLogger.Warning("Smoothing of 1 or greater will result in no movement at all, you can set smoothing to 99 to avoid this message");
			}
			try
			{
				_CameraController._thirdPersonStabilizer.RotationalSmoothing = smooth;
				RotationalSmoothing = smooth;
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
			return true;
		}

		public bool SetFOV(int fov)
		{
			if (_FOVSetter._currentValue != _rockcam.FOV)
			{
				MelonLogger.Msg("FOV value desynched");
				_rockcam.FOV = _FOVSetter._currentValue;
			}
			try
			{
				_FOVSetter._maxValue = 999999;
				_FOVSetter._increment = fov - _rockcam.FOV;
				_FOVSetter.OnPressDownIncrease();
				_FOVSetter.OnPressUpIncrease();
				_FOVSetter._maxValue = MaxFOV;
				_FOVSetter._increment = FOVStep;
				_rockcam.FOV = fov;
				if (_rockcam.FOV != _FOVSetter._currentValue)
				{
					MelonLogger.Msg(_rockcam.FOV + " " + _FOVSetter._currentValue);
				}
				return true;
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
		}

		public bool SetFOVSettingsSettings(int maxFOV, int minFOV, int step)
		{
			try
			{
				_FOVSetter._maxValue = maxFOV;
				_FOVSetter._increment = step;
				_FOVSetter._minValue = minFOV;
				MaxFOV = maxFOV;
				MinFOV = minFOV;
				FOVStep = step;
				return true;
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
		}

		public bool DoPostProcessing(bool value)
		{
			try
			{
				_CameraSettings.renderPostProcessing = value;
				return true;
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
		}
	}

	public class FirstPerson
	{
		public LCKCameraController _CameraController;

		public LckDoubleButton _FOVSetter;

		public int MaxFOV = 100;

		public int MinFOV = 30;

		public int FOVStep = 10;

		public UniversalAdditionalCameraData _CameraSettings;

		public LckCamera _Camera;

		public float PositionalSmoothing = 0f;

		public float RotationalSmoothing = 0f;

		public LCKSettingsButtonsController _POVController;

		public Rock_Cam _rockcam;

		public FirstPerson(Rock_Cam rockcam)
		{
			_rockcam = rockcam;
			_CameraController = rockcam._CameraController;
			_Camera = rockcam._Tablet.firstPersonCamera;
			_FOVSetter = _CameraController.FirstPersonFOVDoubleButton;
			MaxFOV = _FOVSetter._maxValue;
			MinFOV = _FOVSetter._minValue;
			FOVStep = _FOVSetter._increment;
			PositionalSmoothing = _CameraController._firstPersonStabilizer.PositionalSmoothing;
			RotationalSmoothing = _CameraController._firstPersonStabilizer.RotationalSmoothing;
			_CameraSettings = ((Component)rockcam._Tablet.firstPersonCamera).gameObject.GetComponent<UniversalAdditionalCameraData>();
			_POVController = rockcam._POVController;
		}

		public bool SetPOV()
		{
			try
			{
				_POVController.SwitchToFPMode();
				_rockcam.POV = "FP";
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
			return true;
		}

		public bool SetPositionalSmooting(float smooth)
		{
			if (smooth >= 1f && smooth != 99f)
			{
				MelonLogger.Warning("Smoothing of 1 or greater will result in no movement at all, you can set smoothing to 99 to avoid this message");
			}
			try
			{
				_CameraController._firstPersonStabilizer.PositionalSmoothing = smooth;
				PositionalSmoothing = smooth;
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
			return true;
		}

		public bool SetRotationalSmooting(float smooth)
		{
			if (smooth >= 1f && smooth != 99f)
			{
				MelonLogger.Warning("Smoothing of 1 or greater will result in no movement at all, you can set smoothing to 99 to avoid this message");
			}
			try
			{
				_CameraController._firstPersonStabilizer.RotationalSmoothing = smooth;
				RotationalSmoothing = smooth;
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
			return true;
		}

		public bool SetFOV(int fov)
		{
			if (_FOVSetter._currentValue != _rockcam.FOV)
			{
				MelonLogger.Msg("FOV value desynched");
				_rockcam.FOV = _FOVSetter._currentValue;
			}
			try
			{
				_FOVSetter._maxValue = 999999;
				_FOVSetter._increment = fov - _rockcam.FOV;
				_FOVSetter.OnPressDownIncrease();
				_FOVSetter.OnPressUpIncrease();
				_FOVSetter._maxValue = MaxFOV;
				_FOVSetter._increment = FOVStep;
				_rockcam.FOV = fov;
				if (_rockcam.FOV != _FOVSetter._currentValue)
				{
					MelonLogger.Msg(_rockcam.FOV + " " + _FOVSetter._currentValue);
				}
				return true;
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
		}

		public bool SetFOVSettingsSettings(int maxFOV, int minFOV, int step)
		{
			try
			{
				_FOVSetter._maxValue = maxFOV;
				_FOVSetter._increment = step;
				_FOVSetter._minValue = minFOV;
				MaxFOV = maxFOV;
				MinFOV = minFOV;
				FOVStep = step;
				return true;
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
		}

		public bool DoPostProcessing(bool value)
		{
			try
			{
				_CameraSettings.renderPostProcessing = value;
				return true;
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
		}
	}

	public class Handheld
	{
		public LCKCameraController _CameraController;

		public LckDoubleButton _FOVSetter;

		public int MaxFOV = 100;

		public int MinFOV = 30;

		public int FOVStep = 10;

		public UniversalAdditionalCameraData _CameraSettings;

		public LckCamera _Camera;

		public float PositionalSmoothing = 0f;

		public float RotationalSmoothing = 0f;

		public LCKSettingsButtonsController _POVController;

		public Rock_Cam _rockcam;

		public bool isFlipped = false;

		public Handheld(Rock_Cam rockcam)
		{
			_rockcam = rockcam;
			_CameraController = rockcam._CameraController;
			_Camera = rockcam._Tablet.selfieCamera;
			_FOVSetter = _CameraController.SelfieFOVDoubleButton;
			MaxFOV = _FOVSetter._maxValue;
			MinFOV = _FOVSetter._minValue;
			FOVStep = _FOVSetter._increment;
			PositionalSmoothing = _CameraController._selfieStabilizer.PositionalSmoothing;
			RotationalSmoothing = _CameraController._selfieStabilizer.RotationalSmoothing;
			_CameraSettings = ((Component)rockcam._Tablet.selfieCamera).gameObject.GetComponent<UniversalAdditionalCameraData>();
			_POVController = rockcam._POVController;
		}

		public bool SetPOV()
		{
			try
			{
				_POVController.SwitchToSelfieMode();
				_rockcam.POV = "HH";
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
			return true;
		}

		public bool SetPositionalSmooting(float smooth)
		{
			if (smooth >= 1f && smooth != 99f)
			{
				MelonLogger.Warning("Smoothing of 1 or greater will result in no movement at all, you can set smoothing to 99 to avoid this message");
			}
			try
			{
				_CameraController._selfieStabilizer.PositionalSmoothing = smooth;
				PositionalSmoothing = smooth;
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
			return true;
		}

		public bool SetRotationalSmooting(float smooth)
		{
			if (smooth >= 1f && smooth != 99f)
			{
				MelonLogger.Warning("Smoothing of 1 or greater will result in no movement at all, you can set smoothing to 99 to avoid this message");
			}
			try
			{
				_CameraController._selfieStabilizer.RotationalSmoothing = smooth;
				RotationalSmoothing = smooth;
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
			return true;
		}

		public bool SetFOV(int fov)
		{
			if (_FOVSetter._currentValue != _rockcam.FOV)
			{
				MelonLogger.Msg("FOV value desynched");
				_rockcam.FOV = _FOVSetter._currentValue;
			}
			try
			{
				_FOVSetter._maxValue = 999999;
				_FOVSetter._increment = fov - _rockcam.FOV;
				_FOVSetter.OnPressDownIncrease();
				_FOVSetter.OnPressUpIncrease();
				_FOVSetter._maxValue = MaxFOV;
				_FOVSetter._increment = FOVStep;
				_rockcam.FOV = fov;
				if (_rockcam.FOV != _FOVSetter._currentValue)
				{
					MelonLogger.Msg(_rockcam.FOV + " " + _FOVSetter._currentValue);
				}
				return true;
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
		}

		public bool SetFOVSettingsSettings(int maxFOV, int minFOV, int step)
		{
			try
			{
				_FOVSetter._maxValue = maxFOV;
				_FOVSetter._increment = step;
				_FOVSetter._minValue = minFOV;
				MaxFOV = maxFOV;
				MinFOV = minFOV;
				FOVStep = step;
				return true;
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
		}

		public bool FlipCamera(bool flip)
		{
			if (isFlipped == flip)
			{
				MelonLogger.Msg("HH camera already flipped the right way");
				return true;
			}
			try
			{
				_CameraController.ProcessSelfieFlip();
				isFlipped = flip;
				return true;
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
		}

		public bool SetRelativeCameraPosition(Vector3 position, Vector3 rotation)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				_CameraController.SetSelfieCameraOrientation(position, rotation);
				return true;
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
		}

		public bool SetGlobalCameraPosition(Vector3 position, Quaternion rotation)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				Vector3 val = _rockcam.RockCamTransform.InverseTransformPoint(position);
				Quaternion val2 = Quaternion.Inverse(_rockcam.RockCamTransform.rotation) * rotation;
				_CameraController.SetSelfieCameraOrientation(val, ((Quaternion)(ref val2)).eulerAngles);
				return true;
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
		}

		public bool DoPostProcessing(bool value)
		{
			try
			{
				_CameraSettings.renderPostProcessing = value;
				return true;
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
		}
	}

	public class HandleBars
	{
		public InteractionHoldableGroup _Handles;

		public int isHeld = 0;

		public int isDoubleHeld = 0;

		public HandleBars(Rock_Cam rockcam)
		{
			_Handles = rockcam._Tablet.InteractionHoldableGroup;
		}

		public int isHeldUpdate()
		{
			try
			{
				if (_Handles.GroupIsBeingHeld() != (isHeld % 2 == 1))
				{
					isHeld = 2;
				}
				else
				{
					isHeld = 0;
				}
				if (_Handles.GroupIsBeingHeld())
				{
					isHeld++;
				}
				return isHeld;
			}
			catch (Exception ex)
			{
				MelonLogger.Msg("Hai");
				MelonLogger.Error((object)ex);
				return isHeld;
			}
		}

		public int isDoubleHeldUpdate()
		{
			try
			{
				if (_Handles.DualHoldingObject != (isDoubleHeld % 2 == 1))
				{
					isDoubleHeld = 2;
				}
				else
				{
					isDoubleHeld = 0;
				}
				if (_Handles.DualHoldingObject)
				{
					isDoubleHeld++;
				}
				return isDoubleHeld;
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return isDoubleHeld;
			}
		}
	}

	public int FOV = 50;

	public ThirdPerson thirdPerson;

	public FirstPerson firstPerson;

	public Handheld handheld;

	public HandleBars handleBars;

	public string POV = "HH";

	public bool isHorizontal = true;

	public int PhotoTimer = 0;

	public int PhotoTimerIncrement = 2;

	public int PhotoTimerMaxValue = 8;

	public bool isRecording = false;

	public int DetachedPreview = 0;

	public bool DetachedPreviewChanged = false;

	public int MaxDespawnDistance = 2;

	public float SpawnYOffset = -0.1f;

	public float TabletSpawnDelay = 0.3f;

	public float MaximumRenderDistance = 2f;

	public PlayerLIV _Camera;

	public LCKTabletUtility _Tablet;

	public LCKCameraController _CameraController;

	public LCKSettingsButtonsController _POVController;

	public Il2CppReferenceArray<Transform> DetachedMonitors;

	public Transform RockCamTransform;

	public LckService _LckService;

	public int isShown = 1;

	public bool POVChanged = false;

	public LCKTabletDetachedPreview _DetachedPreviewManager;

	public TMP_Text Nameplate;

	public LckQualitySelector _QualitySelector;

	public POVNames POVs;

	public Rock_Cam()
	{
		POVs.ThirdPerson = "TP";
		POVs.FirstPerson = "FP";
		POVs.Handheld = "HH";
		Fix();
	}

	public bool Fix()
	{
		try
		{
			_Camera = ((Component)Singleton<PlayerManager>.instance.localPlayer.Controller).GetComponentInChildren<PlayerLIV>();
			MaxDespawnDistance = _Camera.maxDespawnDistance;
			SpawnYOffset = _Camera.spawnYOffset;
			TabletSpawnDelay = _Camera.tabletSpawnDelay;
			_Tablet = _Camera.LckTablet;
			MaximumRenderDistance = _Tablet.maximumRenderDistance;
			isRecording = _Tablet.isRecording;
			_CameraController = _Tablet.LckCameraController;
			isHorizontal = _CameraController.IsHorizontalMode;
			_POVController = _CameraController._settingsButtonsController;
			thirdPerson = new ThirdPerson(this);
			firstPerson = new FirstPerson(this);
			handheld = new Handheld(this);
			handleBars = new HandleBars(this);
			DetachedMonitors = _CameraController._monitorTransforms;
			FOV = thirdPerson._FOVSetter._currentValue;
			PhotoTimer = _Tablet.photoTimerCurrentValue;
			PhotoTimerIncrement = _Tablet.photoTimerIncrementValue;
			PhotoTimerMaxValue = _Tablet.photoTimerMaxValue;
			RockCamTransform = ((Component)_Tablet).transform;
			if (_Camera.TabletVisualsAreActive)
			{
				isShown = 1;
			}
			else
			{
				isShown = 0;
			}
			POVUpdate();
			POVChanged = false;
			_LckService = _Camera.lckService;
			_DetachedPreviewManager = _Tablet.lckDetachedPreview;
			Nameplate = ((Component)_Tablet).gameObject.GetComponent<LCKTabletNameplate>().nameplateTextComponent.textObject;
			_QualitySelector = _CameraController._qualitySelector;
			return true;
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
	}

	public bool TakePhoto()
	{
		try
		{
			_Tablet.TakePhoto();
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
		return true;
	}

	public bool HideTablet()
	{
		try
		{
			_Camera.HideTablet();
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
		return true;
	}

	public bool ShowTablet()
	{
		try
		{
			_Camera.ShowTablet();
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
		return true;
	}

	public bool StartRecording()
	{
		if (isRecording != _Camera.LckTablet.isRecording)
		{
			MelonLogger.Msg("isRecording variable is desynched");
			isRecording = _Camera.LckTablet.isRecording;
		}
		if (!isRecording)
		{
			isRecording = true;
			try
			{
				_Tablet.ToggleRecordingAndUpdateRecordStatus();
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
			return true;
		}
		MelonLogger.Msg("Already recording");
		return true;
	}

	public bool EndRecording()
	{
		if (isRecording != _Camera.LckTablet.isRecording)
		{
			MelonLogger.Msg("isRecording variable is desynched");
			isRecording = _Camera.LckTablet.isRecording;
		}
		if (isRecording)
		{
			isRecording = false;
			try
			{
				_Tablet.ToggleRecordingAndUpdateRecordStatus();
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				return false;
			}
		}
		return true;
	}

	public bool SetGlobalRotationalSmoothing(float smooth)
	{
		return thirdPerson.SetRotationalSmooting(smooth) && firstPerson.SetRotationalSmooting(smooth) && handheld.SetRotationalSmooting(smooth);
	}

	public bool SetGlobalPositionalSmoothing(float smooth)
	{
		return thirdPerson.SetPositionalSmooting(smooth) && firstPerson.SetPositionalSmooting(smooth) && handheld.SetPositionalSmooting(smooth);
	}

	public bool ResetCameraPosition()
	{
		try
		{
			if (POV == "TP")
			{
				_CameraController._thirdPersonStabilizer.ReachTargetInstantly();
			}
			if (POV == "FP")
			{
				_CameraController._firstPersonStabilizer.ReachTargetInstantly();
			}
			if (POV == "HH")
			{
				_CameraController._selfieStabilizer.ReachTargetInstantly();
			}
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
		return true;
	}

	public bool SetMaximumRenderDistance(float distance)
	{
		try
		{
			_Tablet.maximumRenderDistance = distance;
			MaximumRenderDistance = distance;
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
		return true;
	}

	public bool SetDetachedPreview(int index)
	{
		try
		{
			_Tablet.lckDetachedPreview.SwitchPreview(index);
			UpdateDetachedPreview();
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
		return true;
	}

	public bool SetPhotoTimerValue(int time)
	{
		try
		{
			_Tablet.photoTimerMaxValue = 999999;
			_Tablet.photoTimerIncrementValue = time - PhotoTimer;
			_Tablet.SwapPhotoTimerDelay();
			_Tablet.photoTimerMaxValue = PhotoTimerMaxValue;
			_Tablet.photoTimerIncrementValue = PhotoTimerIncrement;
			return true;
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
	}

	public bool SetPhotoTimerIncrement(int increment)
	{
		try
		{
			_Tablet.photoTimerIncrementValue = increment;
			PhotoTimerIncrement = increment;
			return true;
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
	}

	public bool SetPhotoTimerMaxValue(int maxValue)
	{
		try
		{
			_Tablet.photoTimerMaxValue = maxValue;
			PhotoTimerMaxValue = maxValue;
			return true;
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
	}

	public bool SetRockCamPosition(Vector3 position, Quaternion rotation)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			((Component)_Tablet).transform.position = position;
			((Component)_Tablet).transform.rotation = rotation;
			return true;
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
	}

	public bool SetSpawnYOffset(float offset)
	{
		try
		{
			_Camera.spawnYOffset = offset;
			SpawnYOffset = offset;
			return true;
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
	}

	public bool SetRockCamSpawnDelay(float delay)
	{
		try
		{
			_Camera.tabletSpawnDelay = delay;
			TabletSpawnDelay = delay;
			return true;
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
	}

	public bool SnapCameraStabilizerToTarget()
	{
		try
		{
			_CameraController._thirdPersonStabilizer.ReachTargetInstantly();
			_CameraController._firstPersonStabilizer.ReachTargetInstantly();
			_CameraController._selfieStabilizer.ReachTargetInstantly();
			return true;
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
	}

	public bool FullCameraSetup(string pov = "Null", float positional_smoothing = -1f, float rotational_smoothing = -1f, int fov = -1, float TPCameraDistance = -1f, float TPCameraAngle = -1f)
	{
		try
		{
			if (pov == "Null")
			{
				pov = POV;
			}
			if (fov == -1)
			{
				fov = FOV;
			}
			switch (pov)
			{
			case "TP":
				thirdPerson.SetPOV();
				thirdPerson.SetFOV(fov);
				if (TPCameraDistance == -1f)
				{
					TPCameraDistance = thirdPerson.Distance;
				}
				thirdPerson.SetDistance(TPCameraDistance);
				if (TPCameraAngle != -1f)
				{
					thirdPerson.SetAngle(TPCameraAngle);
				}
				if (positional_smoothing != -1f)
				{
					thirdPerson.SetPositionalSmooting(positional_smoothing);
				}
				if (rotational_smoothing != -1f)
				{
					thirdPerson.SetRotationalSmooting(rotational_smoothing);
				}
				break;
			case "FP":
				firstPerson.SetPOV();
				firstPerson.SetFOV(fov);
				if (positional_smoothing != -1f)
				{
					firstPerson.SetPositionalSmooting(positional_smoothing);
				}
				if (rotational_smoothing != -1f)
				{
					firstPerson.SetRotationalSmooting(rotational_smoothing);
				}
				break;
			case "HH":
				handheld.SetPOV();
				handheld.SetFOV(fov);
				if (positional_smoothing != -1f)
				{
					handheld.SetPositionalSmooting(positional_smoothing);
				}
				if (rotational_smoothing != -1f)
				{
					handheld.SetRotationalSmooting(rotational_smoothing);
				}
				break;
			default:
				MelonLogger.Error("Failed to find correct pov");
				return false;
			}
			return true;
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
	}

	public int IsShownUpdate()
	{
		try
		{
			int num = 0;
			if (isShown % 2 == 1 != _Camera.TabletVisualsAreActive)
			{
				num += 2;
			}
			if (_Camera.TabletVisualsAreActive)
			{
				num++;
			}
			isShown = num;
			return num;
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return -1;
		}
	}

	public bool IsRecording()
	{
		try
		{
			isRecording = _Tablet.isRecording;
			return isRecording;
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
	}

	public bool POVUpdate()
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Invalid comparison between Unknown and I4
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Invalid comparison between Unknown and I4
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Invalid comparison between Unknown and I4
		try
		{
			bool pOVChanged = false;
			if ((int)_CameraController.CurrentCameraMode == 2)
			{
				if (POV != "TP")
				{
					pOVChanged = true;
				}
				POV = "TP";
			}
			else if ((int)_CameraController.CurrentCameraMode == 1)
			{
				if (POV != "FP")
				{
					pOVChanged = true;
				}
				POV = "FP";
			}
			else
			{
				if ((int)_CameraController.CurrentCameraMode != 0)
				{
					MelonLogger.Error("Error determining the POV");
					return false;
				}
				if (POV != "HH")
				{
					pOVChanged = true;
				}
				POV = "HH";
			}
			POVChanged = pOVChanged;
			return true;
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
	}

	public bool FOVUpdate()
	{
		try
		{
			FOV = (int)_CameraController.GetCurrentModeFOV();
			return true;
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
	}

	public Vector3 GetSpawnPosition()
	{
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			Transform child = ((Component)Singleton<PlayerManager>.Instance.localPlayer.Controller).transform.GetChild(2).GetChild(0).GetChild(0);
			Vector3 position = child.position;
			Vector3 val = new Vector3(child.forward.x, 0f, child.forward.z);
			return position + ((Vector3)(ref val)).normalized + new Vector3(0f, SpawnYOffset, 0f);
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return Vector3.zero;
		}
	}

	public Quaternion GetSpawnRotation()
	{
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			Transform child = ((Component)Singleton<PlayerManager>.Instance.localPlayer.Controller).transform.GetChild(2).GetChild(0).GetChild(0);
			Vector3 val = new Vector3(child.forward.x, 0f, child.forward.z);
			return Quaternion.LookRotation(-((Vector3)(ref val)).normalized - new Vector3(0f, SpawnYOffset, 0f));
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return Quaternion.identity;
		}
	}

	public bool SetResolution(uint width, uint height)
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			CameraResolutionDescriptor trackResolution = default(CameraResolutionDescriptor);
			((CameraResolutionDescriptor)(ref trackResolution))..ctor(width, height);
			_LckService.SetTrackResolution(trackResolution);
			return true;
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
	}

	public bool SetVideoBitrate(uint bitrate)
	{
		try
		{
			_LckService.SetTrackBitrate(bitrate);
			return true;
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
	}

	public bool SetAudioBitrate(uint bitrate)
	{
		try
		{
			_LckService.SetTrackAudioBitrate(bitrate);
			return true;
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
	}

	public bool SetFramerate(uint framerate)
	{
		try
		{
			_LckService.SetTrackFramerate(framerate);
			return true;
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
	}

	public bool SetMicrophoneGainUntested(float gain)
	{
		try
		{
			_LckService.SetMicrophoneGain(gain);
			return true;
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
	}

	public bool FullRecordingSetupTemp(uint width = 1920u, uint height = 1080u, uint framerate = 60u, uint videoBitrate = 10485760u, uint audioBitrate = 1048576u)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			CameraResolutionDescriptor val = default(CameraResolutionDescriptor);
			((CameraResolutionDescriptor)(ref val))..ctor(width, height);
			CameraTrackDescriptor trackDescriptor = default(CameraTrackDescriptor);
			((CameraTrackDescriptor)(ref trackDescriptor))..ctor(val, videoBitrate, framerate, audioBitrate);
			_LckService.SetTrackDescriptor(trackDescriptor);
			return true;
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
	}

	public bool FullRecordingSetupTemp(RecordingSettings recordingSettings)
	{
		try
		{
			return FullRecordingSetupTemp(recordingSettings.width, recordingSettings.height, recordingSettings.framerate, recordingSettings.Bitrate, recordingSettings.audioBitrate);
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
	}

	public bool FullRecordingSetup(uint width = 1920u, uint height = 1080u, uint framerate = 60u, uint videoBitrate = 10485760u, uint audioBitrate = 1048576u)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Expected O, but got Unknown
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			CameraResolutionDescriptor val = default(CameraResolutionDescriptor);
			((CameraResolutionDescriptor)(ref val))..ctor(width, height);
			CameraTrackDescriptor cameraTrackDescriptor = default(CameraTrackDescriptor);
			((CameraTrackDescriptor)(ref cameraTrackDescriptor))..ctor(val, videoBitrate, framerate, audioBitrate);
			QualityOption val2 = new QualityOption();
			val2.CameraTrackDescriptor = cameraTrackDescriptor;
			val2.IsDefault = true;
			_QualitySelector._qualityOptions[1] = val2;
			_QualitySelector.UpdateCurrentTrackDescriptor(1);
			return true;
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
	}

	public bool FullRecordingSetup(RecordingSettings recordingSettings)
	{
		try
		{
			return FullRecordingSetup(recordingSettings.width, recordingSettings.height, recordingSettings.framerate, recordingSettings.Bitrate, recordingSettings.audioBitrate);
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
	}

	public bool RecordMicUntested(bool record)
	{
		try
		{
			_LckService.SetMicrophoneCaptureActive(record);
			return true;
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
	}

	public bool SetPOVBypassUntested(string pov = "Null", int detachedpreview = -1)
	{
		try
		{
			string text = "";
			text = ((detachedpreview != -1) ? ((Il2CppArrayBase<Preview>)(object)_DetachedPreviewManager.availablePreviews)[detachedpreview].AttachingMonitor.MonitorId : null);
			if (pov == "Null")
			{
				pov = POV;
			}
			switch (pov)
			{
			case "TP":
				_LckService.SetActiveCamera(thirdPerson._Camera.CameraId, text);
				break;
			case "FP":
				_LckService.SetActiveCamera(firstPerson._Camera.CameraId, text);
				break;
			case "HH":
				_LckService.SetActiveCamera(handheld._Camera.CameraId, text);
				break;
			default:
				MelonLogger.Error("pov variable must either be TP, FP or HH, you can use the POVs variable for readability if needed.");
				return false;
			}
			UpdateDetachedPreview();
			return true;
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
	}

	public bool UpdateDetachedPreview()
	{
		try
		{
			if (DetachedPreview != _DetachedPreviewManager.ActivePreviewNo)
			{
				DetachedPreviewChanged = true;
			}
			else
			{
				DetachedPreviewChanged = false;
			}
			DetachedPreview = _DetachedPreviewManager.ActivePreviewNo;
			return true;
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return false;
		}
	}

	public RecordingSettings GetRecordingSettings()
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			return CameraTrackDescriptorToRecordingSettings(_LckService.GetDescriptor().Result.cameraTrackDescriptor);
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return default(RecordingSettings);
		}
	}

	public RecordingSettings GetVerticalRecordingSettings()
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			return CameraTrackDescriptorToRecordingSettings(_CameraController._verticalCameraTrackDescriptor);
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return default(RecordingSettings);
		}
	}

	public RecordingSettings GetHorizontalSettings()
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			return CameraTrackDescriptorToRecordingSettings(_CameraController._horizontalCameraTrackDescriptor);
		}
		catch (Exception ex)
		{
			MelonLogger.Error((object)ex);
			return default(RecordingSettings);
		}
	}

	public RecordingSettings CameraTrackDescriptorToRecordingSettings(CameraTrackDescriptor descriptor)
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		RecordingSettings result = default(RecordingSettings);
		result.width = descriptor.CameraResolutionDescriptor.Width;
		result.height = descriptor.CameraResolutionDescriptor.Height;
		result.framerate = descriptor.Framerate;
		result.audioBitrate = descriptor.AudioBitrate;
		result.Bitrate = descriptor.Bitrate;
		return result;
	}
}