using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using Il2CppLIV.SDK.Unity;
using Il2CppRUMBLE.Managers;
using Il2CppRUMBLE.Players;
using Il2CppRUMBLE.Utilities;
using Il2CppTMPro;
using MelonLoader;
using RumbleModUI;
using RumbleModdingAPI;
using StaticLIVCamera;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(StaticCamera), "StaticLIVCamera", "2.3.1", "PeppaStone", null)]
[assembly: MelonGame("Buckethead Entertainment", "RUMBLE")]
[assembly: MelonColor(255, 255, 51, 238)]
[assembly: AssemblyTitle("StaticLIVCamera")]
[assembly: AssemblyDescription("Get an in-game camera that doesn't move using LIV")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("PeppaStone")]
[assembly: AssemblyProduct("StaticLIVCamera")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("0d79be14-00c6-4570-a460-e58f37c30ddb")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace StaticLIVCamera;
internal class AutomaticMode : CameraMode
{
private Transform local;
private Transform opponent;
[Obsolete]
public AutomaticMode(string name, string description, bool isModeEnabled)
: base(name, description, isModeEnabled)
{
}
public override void OnUpdate()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: 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_0034: 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)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: 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_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: 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_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: Unknown result type (might be due to invalid IL or missing references)
//IL_0118: Unknown result type (might be due to invalid IL or missing references)
//IL_011d: Unknown result type (might be due to invalid IL or missing references)
//IL_0166: Unknown result type (might be due to invalid IL or missing references)
//IL_016b: Unknown result type (might be due to invalid IL or missing references)
//IL_0182: Unknown result type (might be due to invalid IL or missing references)
//IL_0146: Unknown result type (might be due to invalid IL or missing references)
if (StaticCamera.isInMatch)
{
Vector3 val = (local.position + opponent.position) / 2f;
Vector3 val2 = opponent.position - local.position;
Vector3 val3 = Vector3.Cross(val2, Vector3.up);
Vector3 normalized = ((Vector3)(ref val3)).normalized;
Vector3 val4 = val + normalized * -8f + new Vector3(0f, 1f, 0f);
if ((float)((ModSetting)StaticCamera.autoPosSpeed).Value == 0f)
{
StaticCamera.LIVCamera.transform.position = val4;
}
else
{
StaticCamera.LIVCamera.transform.position = Vector3.Slerp(StaticCamera.LIVCamera.transform.position, val4, Time.deltaTime * (float)((ModSetting)StaticCamera.autoPosSpeed).Value);
}
Quaternion val5 = Quaternion.LookRotation(val - StaticCamera.LIVCamera.transform.position);
if ((float)((ModSetting)StaticCamera.autoRotSpeed).Value == 0f)
{
StaticCamera.LIVCamera.transform.rotation = val5;
}
else
{
StaticCamera.LIVCamera.transform.rotation = Quaternion.Slerp(StaticCamera.LIVCamera.transform.rotation, val5, (float)((ModSetting)StaticCamera.autoRotSpeed).Value * Time.deltaTime);
}
}
}
public override void OnEnteringMode()
{
if (StaticCamera.isInMatch)
{
local = ((Component)Singleton<PlayerManager>.instance.localPlayer.Controller).transform.GetChild(1).GetChild(0).GetChild(0);
opponent = ((Component)Singleton<PlayerManager>.instance.AllPlayers[1].Controller).transform.GetChild(1).GetChild(0).GetChild(0);
}
}
public override void OnExitingMode()
{
}
}
public abstract class CameraMode
{
public string name;
public string description;
public ModSetting<bool> isModeEnabled;
[Obsolete]
public CameraMode(string name, string description, bool isModeEnabled)
{
this.name = name;
this.description = description;
this.isModeEnabled = StaticCamera.Mod.AddToList(name + " Mode", isModeEnabled, 0, description);
}
public virtual void OnUpdate()
{
}
public virtual void OnEnteringMode()
{
}
public virtual void OnExitingMode()
{
}
}
public static class BuildInfo
{
public const string ModName = "StaticLIVCamera";
public const string ModVersion = "2.3.1";
public const string Description = "Get an in-game camera that doesn't move using LIV";
public const string Author = "PeppaStone";
public const string Company = "PeppaStone";
}
public class Validation : ValidationParameters
{
private int Length;
public Validation(int i)
{
Length = i;
}
public override bool DoValidation(string Input)
{
if (Input.Length == Length)
{
return true;
}
return false;
}
}
public class StaticCamera : MelonMod
{
private GameObject playerLiv;
private Stopwatch stopwatch = new Stopwatch();
private GameObject staticLivCam;
private GameObject modeTextObject;
private TextMeshPro modeText;
private GameObject textTemplate;
private GameObject UECam;
private LIV liv;
private PlayerController playerController;
private string yogev = "Ani Yogev was here";
private bool firstInit = true;
private bool livSetUp = false;
private bool switchingCamera = false;
private bool savingCameraPos = false;
public static bool isInMatch = false;
public static int cameraMode = 1;
public static List<CameraMode> cameraModes = new List<CameraMode>();
private ModSetting<string>[] defaultCameraPos = new ModSetting<string>[4];
private ModSetting<float> fov;
private ModSetting<bool> isStaticByDefault;
private ModSetting<bool> isModeAnnounced;
public static ModSetting<float> orbitSpeed;
public static ModSetting<float> lockedSpeed;
public static ModSetting<float> autoPosSpeed;
public static ModSetting<float> autoRotSpeed;
public static ModSetting<bool> switchProfile;
public static ModSetting<bool> alternateControls;
private Stopwatch textStopwatch;
public static GameObject visualCamera;
public static GameObject cameraOffset;
public static GameObject LIVCamera;
public static Transform head;
private string currentScene = "Loader";
public static Mod Mod = new Mod();
[Obsolete]
public void OnUIInit()
{
Mod.ModName = "StaticLIVCamera";
Mod.ModVersion = "2.3.1";
Mod.SetFolder("StaticLIVCamera");
Mod.AddDescription("Description", "", "Get an in-game camera that doesn't move using LIV", true, false);
AddBasicModes();
fov = Mod.AddToList("FOV", 75f, "The FOV of the LIV Camera (doesn't work in Default Mode)");
orbitSpeed = Mod.AddToList("Orbit Speed", 10f, "The speed at which the camera orbits in Orbit Mode.");
lockedSpeed = Mod.AddToList("Locked Rotation Speed", 10f, "The speed at which the camera rotates to look at the player in Locked Mode.");
autoPosSpeed = Mod.AddToList("Automatic Camera Position Speed", 0.8f, "The speed at which the camera moves in Automatic Mode. Lower is more smooth. You can also set it to 0 to not have any smoothing.");
autoRotSpeed = Mod.AddToList("Automatic Camera Rotation Speed", 3f, "The speed at which the camera rotates in Automatic Mode. Lower is more smooth. You can also set it to 0 to not have any smoothing.");
defaultCameraPos[0] = Mod.AddToList("Default Gym Camera Position", "2.2 6.2 -9.0 30 4.7 0", "The default camera position on the Gym Map. Uses this syntax: XPosition YPosition ZPosition XRotation YRotation ZRotation");
defaultCameraPos[1] = Mod.AddToList("Default Park Camera Position", "-15.2 12.7 -0.6 57.9 90.0 0", "The default camera position on the Park Map. Uses this syntax: XPosition YPosition ZPosition XRotation YRotation ZRotation");
defaultCameraPos[2] = Mod.AddToList("Default Ring Camera Position", "-10.6 11.9 7.8 47.4 133.4 0", "The default camera position on the Ring Map. Uses this syntax: XPosition YPosition ZPosition XRotation YRotation ZRotation");
defaultCameraPos[3] = Mod.AddToList("Default Pit Camera Position", "-2 9 -11.4 33 7.5 0", "The default camera position on the Pit Map. Uses this syntax: XPosition YPosition ZPosition XRotation YRotation ZRotation");
switchProfile = Mod.AddToList("Automatically switch LIV profile", false, 0, "IMPORTANT: This setting makes it so your LIV camera switches from 1st/3rd person to Mixed Reality and vice-versa automatically. For it to work properly, you need to make sure you have 2 LIV camera profiles: The first one is your normal profile that you use for 1st/3rd person, and in the second profile, select the Mixed Reality Camera. (Contact Pep for help if needed)");
isStaticByDefault = Mod.AddToList("Static Mode by default", true, 0, "If this setting is enabled, your camera mode will be Static when you open your game. If set to false, the selected camera mode when opening the game will be Default Mode");
isModeAnnounced = Mod.AddToList("Announce mode when changing", true, 0, "If this setting is enabled, your camera mode will be announced with text in front of you whenever you switch modes");
alternateControls = Mod.AddToList("Alternate Controls", false, 0, "Changes the Mode switching controls to be B and Right Trigger");
Mod.GetFromFile();
Mod.SaveModData("StaticLIVCamera");
UI.instance.AddMod(Mod);
}
public override void OnSceneWasLoaded(int buildIndex, string sceneName)
{
currentScene = sceneName;
if (sceneName == "Map0" || sceneName == "Map1")
{
isInMatch = true;
}
else
{
isInMatch = false;
}
if (sceneName != "Loader")
{
stopwatch = new Stopwatch();
textStopwatch = new Stopwatch();
stopwatch.Stop();
stopwatch.Restart();
stopwatch.Start();
}
}
public override void OnUpdate()
{
//IL_0204: Unknown result type (might be due to invalid IL or missing references)
//IL_0224: Unknown result type (might be due to invalid IL or missing references)
//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
//IL_031d: Unknown result type (might be due to invalid IL or missing references)
//IL_0322: Unknown result type (might be due to invalid IL or missing references)
//IL_0345: Unknown result type (might be due to invalid IL or missing references)
//IL_034a: Unknown result type (might be due to invalid IL or missing references)
//IL_034e: Unknown result type (might be due to invalid IL or missing references)
//IL_0353: Unknown result type (might be due to invalid IL or missing references)
//IL_0376: Unknown result type (might be due to invalid IL or missing references)
//IL_037b: Unknown result type (might be due to invalid IL or missing references)
//IL_037f: Unknown result type (might be due to invalid IL or missing references)
//IL_0384: Unknown result type (might be due to invalid IL or missing references)
//IL_03a9: Unknown result type (might be due to invalid IL or missing references)
//IL_03ae: Unknown result type (might be due to invalid IL or missing references)
//IL_03b2: Unknown result type (might be due to invalid IL or missing references)
//IL_03b7: Unknown result type (might be due to invalid IL or missing references)
//IL_03ed: Unknown result type (might be due to invalid IL or missing references)
//IL_03f2: Unknown result type (might be due to invalid IL or missing references)
//IL_0415: Unknown result type (might be due to invalid IL or missing references)
//IL_041a: Unknown result type (might be due to invalid IL or missing references)
//IL_043d: Unknown result type (might be due to invalid IL or missing references)
//IL_0442: Unknown result type (might be due to invalid IL or missing references)
//IL_0465: Unknown result type (might be due to invalid IL or missing references)
//IL_046a: Unknown result type (might be due to invalid IL or missing references)
//IL_046e: Unknown result type (might be due to invalid IL or missing references)
//IL_0473: Unknown result type (might be due to invalid IL or missing references)
//IL_0496: Unknown result type (might be due to invalid IL or missing references)
//IL_049b: Unknown result type (might be due to invalid IL or missing references)
//IL_049f: Unknown result type (might be due to invalid IL or missing references)
//IL_04a4: Unknown result type (might be due to invalid IL or missing references)
//IL_04c9: Unknown result type (might be due to invalid IL or missing references)
//IL_04ce: Unknown result type (might be due to invalid IL or missing references)
//IL_04d2: Unknown result type (might be due to invalid IL or missing references)
//IL_04d7: Unknown result type (might be due to invalid IL or missing references)
//IL_019e: Unknown result type (might be due to invalid IL or missing references)
//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
if (stopwatch.IsRunning && stopwatch.ElapsedMilliseconds >= 1000)
{
SetupLivCamera();
SetCameraMode(cameraMode);
}
if (!livSetUp)
{
return;
}
if (textStopwatch.IsRunning && textStopwatch.ElapsedMilliseconds >= 1000)
{
modeTextObject.SetActive(false);
textStopwatch.Stop();
}
if ((RightController.GetJoystickClick() == 1f && RightController.GetTrigger() >= 0.9f && !(bool)((ModSetting)alternateControls).Value) || Input.GetKeyDown((KeyCode)117) || (RightController.GetSecondary() == 1f && RightController.GetTrigger() >= 0.9f && (bool)((ModSetting)alternateControls).Value))
{
if (!switchingCamera)
{
switchingCamera = true;
SetCameraMode(cameraMode + 1);
if ((bool)((ModSetting)isModeAnnounced).Value)
{
AnnounceCameraMode();
}
}
}
else
{
switchingCamera = false;
}
if (!(cameraModes[cameraMode].name != "Default"))
{
return;
}
cameraModes[cameraMode].OnUpdate();
try
{
liv.render.SetPose(cameraOffset.transform.position, cameraOffset.transform.rotation, (float)((ModSetting)fov).Value, false);
}
catch
{
}
if (Input.GetKeyDown((KeyCode)105))
{
UECam = GameObject.Find("UE_Freecam");
LIVCamera.transform.position = UECam.transform.position;
LIVCamera.transform.rotation = UECam.transform.rotation;
}
if (Input.GetKeyDown((KeyCode)112))
{
if (!savingCameraPos)
{
int num = 0;
switch (currentScene)
{
case "Gym":
num = 0;
break;
case "Park":
num = 1;
break;
case "Map0":
num = 2;
break;
case "Map1":
num = 3;
break;
}
ModSetting<string> obj2 = defaultCameraPos[num];
string[] obj3 = new string[11]
{
LIVCamera.transform.position.x.ToString(),
" ",
LIVCamera.transform.position.y.ToString(),
" ",
LIVCamera.transform.position.z.ToString(),
" ",
null,
null,
null,
null,
null
};
Quaternion rotation = LIVCamera.transform.rotation;
obj3[6] = ((Quaternion)(ref rotation)).eulerAngles.x.ToString();
obj3[7] = " ";
rotation = LIVCamera.transform.rotation;
obj3[8] = ((Quaternion)(ref rotation)).eulerAngles.y.ToString();
obj3[9] = " ";
rotation = LIVCamera.transform.rotation;
obj3[10] = ((Quaternion)(ref rotation)).eulerAngles.z.ToString();
((ModSetting)obj2).Value = string.Concat(obj3);
ModSetting<string> obj4 = defaultCameraPos[num];
string[] obj5 = new string[11]
{
LIVCamera.transform.position.x.ToString(),
" ",
LIVCamera.transform.position.y.ToString(),
" ",
LIVCamera.transform.position.z.ToString(),
" ",
null,
null,
null,
null,
null
};
rotation = LIVCamera.transform.rotation;
obj5[6] = ((Quaternion)(ref rotation)).eulerAngles.x.ToString();
obj5[7] = " ";
rotation = LIVCamera.transform.rotation;
obj5[8] = ((Quaternion)(ref rotation)).eulerAngles.y.ToString();
obj5[9] = " ";
rotation = LIVCamera.transform.rotation;
obj5[10] = ((Quaternion)(ref rotation)).eulerAngles.z.ToString();
((ModSetting)obj4).SavedValue = string.Concat(obj5);
Mod.SaveModData("StaticLIVCamera");
savingCameraPos = true;
}
}
else
{
savingCameraPos = false;
}
}
public static void SetCameraMode(int mode)
{
int num = 0;
for (int i = 0; i < cameraModes.Count; i++)
{
if ((bool)((ModSetting)cameraModes[i].isModeEnabled).Value)
{
num++;
}
}
if (num == 0)
{
MelonLogger.Msg("No modes are enabled");
return;
}
if (mode >= cameraModes.Count)
{
mode = 0;
}
if (!(bool)((ModSetting)cameraModes[mode].isModeEnabled).Value)
{
SetCameraMode(mode + 1);
return;
}
cameraModes[cameraMode].OnExitingMode();
cameraModes[mode].OnEnteringMode();
cameraMode = mode;
}
public void AnnounceCameraMode()
{
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
textStopwatch = new Stopwatch();
textStopwatch.Stop();
textStopwatch.Restart();
textStopwatch.Start();
modeTextObject.SetActive(true);
modeTextObject.transform.localRotation = Quaternion.Euler(0f, 0f, 0f);
((TMP_Text)modeText).text = cameraModes[cameraMode].name + " Mode";
}
public void SetupLivCamera()
{
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_024a: Unknown result type (might be due to invalid IL or missing references)
//IL_0254: Expected O, but got Unknown
//IL_027f: Unknown result type (might be due to invalid IL or missing references)
//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
//IL_033d: Unknown result type (might be due to invalid IL or missing references)
//IL_0362: Unknown result type (might be due to invalid IL or missing references)
//IL_0367: Unknown result type (might be due to invalid IL or missing references)
//IL_0409: Unknown result type (might be due to invalid IL or missing references)
//IL_042e: Unknown result type (might be due to invalid IL or missing references)
//IL_0439: Unknown result type (might be due to invalid IL or missing references)
//IL_0443: Expected O, but got Unknown
//IL_0486: Unknown result type (might be due to invalid IL or missing references)
//IL_04aa: Unknown result type (might be due to invalid IL or missing references)
//IL_04d0: Unknown result type (might be due to invalid IL or missing references)
//IL_04da: Expected O, but got Unknown
//IL_051d: Unknown result type (might be due to invalid IL or missing references)
//IL_0541: Unknown result type (might be due to invalid IL or missing references)
//IL_0588: Unknown result type (might be due to invalid IL or missing references)
//IL_05be: Unknown result type (might be due to invalid IL or missing references)
//IL_05de: Unknown result type (might be due to invalid IL or missing references)
//IL_05fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0645: Unknown result type (might be due to invalid IL or missing references)
//IL_067b: Unknown result type (might be due to invalid IL or missing references)
//IL_069b: Unknown result type (might be due to invalid IL or missing references)
//IL_06bb: Unknown result type (might be due to invalid IL or missing references)
//IL_01df: Unknown result type (might be due to invalid IL or missing references)
//IL_01e9: Expected O, but got Unknown
//IL_020d: Unknown result type (might be due to invalid IL or missing references)
//IL_022b: Unknown result type (might be due to invalid IL or missing references)
if (firstInit)
{
if (!(bool)((ModSetting)isStaticByDefault).Value)
{
cameraMode = 0;
}
firstInit = false;
}
playerController = Managers.GetPlayerManager().localPlayer.Controller;
playerLiv = ((Component)((Component)playerController).transform.GetChild(8)).gameObject;
playerLiv.transform.localPosition = new Vector3(0f, 0f, 0f);
playerLiv.transform.localRotation = Quaternion.Euler(0f, 0f, 0f);
try
{
RecordingCamera component = GameObject.Find("Game Instance/Initializable/RecordingCamera").GetComponent<RecordingCamera>();
component.OnModernRecordingCameraEnabledChanged(true);
component.SaveConfiguration();
MelonLogger.Msg("F10 Camera Enabled. If this gets spammed, something went wrong with RumbleModUI");
head = ((Component)((Component)((Component)((Component)playerController).transform.GetChild(1)).transform.GetChild(0)).transform.GetChild(0)).transform;
liv = playerLiv.GetComponent<LIV>();
}
catch
{
MelonLogger.Msg("liv camera wasnt found");
return;
}
if (!livSetUp)
{
textTemplate = Object.Instantiate<GameObject>(Nr.GetGameObject());
Object.DontDestroyOnLoad((Object)(object)textTemplate);
textTemplate.SetActive(false);
}
int num = 0;
switch (currentScene)
{
case "Gym":
num = 0;
break;
case "Park":
num = 1;
break;
case "Map0":
num = 2;
break;
case "Map1":
num = 3;
break;
}
float[] array = ParseInputString((string)((ModSetting)defaultCameraPos[num]).Value);
LIVCamera = new GameObject();
((Object)LIVCamera).name = "Static LIV Camera";
try
{
LIVCamera.transform.position = new Vector3(array[0], array[1], array[2]);
LIVCamera.transform.rotation = Quaternion.Euler(array[3], array[4], array[5]);
}
catch
{
MelonLogger.Msg("DEFAULT CAMERA POSITION IS NOT VALID. MAKE SURE TO FOLLOW THIS FORMAT: XPosition YPosition ZPosition XRotation YRotation Zrotation");
}
staticLivCam = new GameObject();
((Object)staticLivCam).name = "LivCam";
staticLivCam.transform.position = new Vector3(0f, 0f, 0f);
staticLivCam.transform.rotation = Quaternion.Euler(0f, 0f, 0f);
staticLivCam.AddComponent<PlayerController>();
staticLivCam.GetComponent<PlayerController>().controllerType = (ControllerType)2;
modeTextObject = Object.Instantiate<GameObject>(textTemplate.gameObject);
((Object)modeTextObject).name = "ModeText";
modeTextObject.SetActive(false);
modeText = modeTextObject.GetComponent<TextMeshPro>();
((TMP_Text)modeText).fontSize = 3f;
((TMP_Text)modeText).color = new Color(1f, 1f, 1f, 1f);
((TMP_Text)modeText).outlineColor = Color32.op_Implicit(new Color(0f, 0f, 0f, 0.5f));
((TMP_Text)modeText).alignment = (TextAlignmentOptions)514;
((TMP_Text)modeText).text = "Debugging mode";
((TMP_Text)modeText).enableWordWrapping = false;
((TMP_Text)modeText).outlineWidth = 0.1f;
modeTextObject.transform.parent = ((Component)((Component)((Component)((Component)playerController).transform.GetChild(1)).transform.GetChild(0)).transform.GetChild(0)).transform;
modeTextObject.transform.localPosition = new Vector3(0f, 0f, 1f);
modeTextObject.transform.localRotation = Quaternion.Euler(0f, 0f, 0f);
cameraOffset = new GameObject();
((Object)cameraOffset).name = "CameraOffset";
cameraOffset.transform.parent = LIVCamera.transform;
cameraOffset.transform.localPosition = new Vector3(0f, 0f, 0f);
cameraOffset.transform.localRotation = Quaternion.Euler(0f, 0f, 0f);
staticLivCam.transform.parent = cameraOffset.transform;
visualCamera = new GameObject();
visualCamera.transform.parent = cameraOffset.transform;
((Object)visualCamera).name = "VisualCamera";
visualCamera.transform.localPosition = new Vector3(0f, 0f, 0f);
visualCamera.transform.localRotation = Quaternion.Euler(0f, 0f, 0f);
GameObject val = GameObject.CreatePrimitive((PrimitiveType)3);
val.GetComponent<Renderer>().material.shader = Shader.Find("Universal Render Pipeline/Lit");
val.GetComponent<Renderer>().material.color = new Color(0.2f, 0.2f, 0.2f);
val.transform.parent = visualCamera.transform;
val.transform.localPosition = new Vector3(0f, 0f, 0f);
val.transform.localRotation = Quaternion.Euler(0f, 0f, 0f);
val.transform.localScale = new Vector3(0.6f, 0.4f, 0.2f);
GameObject val2 = GameObject.CreatePrimitive((PrimitiveType)2);
val2.GetComponent<Renderer>().material.shader = Shader.Find("Universal Render Pipeline/Lit");
val2.GetComponent<Renderer>().material.color = new Color(0.1f, 0.06f, 7f);
val2.transform.parent = visualCamera.transform;
val2.transform.localPosition = new Vector3(0f, 0f, 0.08f);
val2.transform.localRotation = Quaternion.Euler(90f, 0f, 0f);
val2.transform.localScale = new Vector3(0.3f, 0.1f, 0.3f);
stopwatch.Stop();
livSetUp = true;
}
public static void MoveObject(Transform movingObject, Transform endPoint, bool changePos, bool changeRot)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: 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_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: 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_003c: Unknown result type (might be due to invalid IL or missing references)
if (changePos)
{
Vector3 position = endPoint.position;
movingObject.position = position;
}
if (changeRot)
{
Quaternion rotation = endPoint.rotation;
Vector3 eulerAngles = ((Quaternion)(ref rotation)).eulerAngles;
eulerAngles.z = 0f;
movingObject.rotation = Quaternion.Euler(eulerAngles);
}
}
[Obsolete]
public void AddBasicModes()
{
cameraModes.Add(new DefaultMode("Default", "The normal LIV camera.", isModeEnabled: true));
cameraModes.Add(new StaticMode("Static", "A camera that doesn't move. Set its position by pressing both joysticks at once or Y.", isModeEnabled: true));
cameraModes.Add(new LockedMode("Locked", "A static camera that rotates to look at the player. Set its position by pressing both joysticks at once or Y.", isModeEnabled: false));
cameraModes.Add(new OrbitMode("Orbit", "A camera that rotates around a point. Press Left Joystick or Y to set the center point and press Right Joystick or O to set the circle radius.", isModeEnabled: false));
cameraModes.Add(new AutomaticMode("Automatic", "A camera that automatically moves to have both players in view at all times", isModeEnabled: false));
}
public override void OnLateInitializeMelon()
{
((MelonBase)this).OnLateInitializeMelon();
UI.instance.UI_Initialized += OnUIInit;
}
private static float[] ParseInputString(string input)
{
string[] array = input.Split(new char[1] { ' ' });
if (array.Length != 6)
{
return null;
}
float[] array2 = new float[6];
for (int i = 0; i < 6; i++)
{
if (!float.TryParse(array[i], out array2[i]))
{
Console.WriteLine($"Error parsing number at position {i + 1}");
return null;
}
}
return array2;
}
}
public class DefaultMode : CameraMode
{
[Obsolete]
public DefaultMode(string name, string description, bool isModeEnabled)
: base(name, description, isModeEnabled)
{
}
public override void OnEnteringMode()
{
StaticCamera.visualCamera.SetActive(false);
if ((bool)((ModSetting)StaticCamera.switchProfile).Value)
{
Application.OpenURL("liv-app://camera/set/0");
}
}
public override void OnExitingMode()
{
StaticCamera.visualCamera.SetActive(true);
if ((bool)((ModSetting)StaticCamera.switchProfile).Value)
{
Application.OpenURL("liv-app://camera/set/1");
}
}
}
public class LockedMode : CameraMode
{
[Obsolete]
public LockedMode(string name, string description, bool isModeEnabled)
: base(name, description, isModeEnabled)
{
}
public override void OnEnteringMode()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
StaticCamera.cameraOffset.transform.localPosition = new Vector3(0f, 0f, 0f);
StaticCamera.cameraOffset.transform.localRotation = Quaternion.Euler(0f, 0f, 0f);
}
public override void OnExitingMode()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
StaticCamera.cameraOffset.transform.localPosition = new Vector3(0f, 0f, 0f);
StaticCamera.cameraOffset.transform.localRotation = Quaternion.Euler(0f, 0f, 0f);
}
public override void OnUpdate()
{
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: 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_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
if ((RightController.GetJoystickClick() == 1f && LeftController.GetJoystickClick() == 1f) || Input.GetKeyDown((KeyCode)121))
{
StaticCamera.MoveObject(StaticCamera.LIVCamera.transform, StaticCamera.head, changePos: true, changeRot: true);
}
Vector3 val = StaticCamera.head.position - StaticCamera.cameraOffset.transform.position;
Quaternion val2 = Quaternion.LookRotation(((Vector3)(ref val)).normalized);
StaticCamera.cameraOffset.transform.rotation = Quaternion.Slerp(StaticCamera.cameraOffset.transform.rotation, val2, Time.deltaTime * (float)((ModSetting)StaticCamera.lockedSpeed).Value * 10f);
}
}
public class OrbitMode : CameraMode
{
[Obsolete]
public OrbitMode(string name, string description, bool isModeEnabled)
: base(name, description, isModeEnabled)
{
}
public override void OnEnteringMode()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
StaticCamera.cameraOffset.transform.localPosition = new Vector3(-5f, 0f, 0f);
StaticCamera.cameraOffset.transform.localRotation = Quaternion.Euler(0f, 90f, 0f);
StaticCamera.LIVCamera.transform.rotation = Quaternion.Euler(0f, 0f, 0f);
}
public override void OnExitingMode()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
StaticCamera.cameraOffset.transform.localPosition = new Vector3(0f, 0f, 0f);
StaticCamera.cameraOffset.transform.localRotation = Quaternion.Euler(0f, 0f, 0f);
}
public override void OnUpdate()
{
//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: 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_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
//IL_0101: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: Unknown result type (might be due to invalid IL or missing references)
//IL_0117: Unknown result type (might be due to invalid IL or missing references)
//IL_0124: Unknown result type (might be due to invalid IL or missing references)
//IL_013d: Unknown result type (might be due to invalid IL or missing references)
//IL_014e: Unknown result type (might be due to invalid IL or missing references)
//IL_015d: Unknown result type (might be due to invalid IL or missing references)
//IL_0162: Unknown result type (might be due to invalid IL or missing references)
//IL_0167: Unknown result type (might be due to invalid IL or missing references)
//IL_016b: Unknown result type (might be due to invalid IL or missing references)
//IL_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_0175: Unknown result type (might be due to invalid IL or missing references)
//IL_0179: Unknown result type (might be due to invalid IL or missing references)
//IL_017e: Unknown result type (might be due to invalid IL or missing references)
//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
if (LeftController.GetJoystickClick() == 1f || Input.GetKeyDown((KeyCode)121))
{
StaticCamera.MoveObject(StaticCamera.LIVCamera.transform, ((Component)StaticCamera.head).transform, changePos: true, changeRot: false);
}
if (RightController.GetJoystickClick() == 1f || Input.GetKeyDown((KeyCode)111))
{
Vector3 localPosition = StaticCamera.cameraOffset.transform.localPosition;
float num = Vector2.Distance(new Vector2(((Component)StaticCamera.head).transform.position.x, ((Component)StaticCamera.head).transform.position.z), new Vector2(StaticCamera.LIVCamera.transform.position.x, StaticCamera.LIVCamera.transform.position.z));
float num2 = num * (float)((ModSetting)StaticCamera.orbitSpeed).Value;
localPosition.x = -1f * num;
localPosition.z = 0f;
StaticCamera.cameraOffset.transform.localPosition = localPosition;
localPosition = StaticCamera.cameraOffset.transform.position;
localPosition.y = ((Component)StaticCamera.head).transform.position.y;
StaticCamera.cameraOffset.transform.position = localPosition;
Vector3 val = StaticCamera.LIVCamera.transform.position - StaticCamera.cameraOffset.transform.position;
Quaternion val2 = Quaternion.LookRotation(((Vector3)(ref val)).normalized);
Vector3 eulerAngles = ((Quaternion)(ref val2)).eulerAngles;
eulerAngles.y = 90f;
eulerAngles.z = 0f;
StaticCamera.cameraOffset.transform.localRotation = Quaternion.Euler(eulerAngles);
}
Quaternion rotation = StaticCamera.LIVCamera.transform.rotation;
Vector3 eulerAngles2 = ((Quaternion)(ref rotation)).eulerAngles;
eulerAngles2.y += Time.deltaTime * (float)((ModSetting)StaticCamera.orbitSpeed).Value;
StaticCamera.LIVCamera.transform.rotation = Quaternion.Euler(eulerAngles2);
}
}
public class StaticMode : CameraMode
{
[Obsolete]
public StaticMode(string name, string description, bool isModeEnabled)
: base(name, description, isModeEnabled)
{
}
public override void OnUpdate()
{
if ((RightController.GetJoystickClick() == 1f && LeftController.GetJoystickClick() == 1f) || Input.GetKeyDown((KeyCode)121))
{
StaticCamera.MoveObject(StaticCamera.LIVCamera.transform, StaticCamera.head, changePos: true, changeRot: true);
}
}
}