Decompiled source of LobbyAppearanceImprovements v1.3.0

LobbyAppearanceImprovements.dll

Decompiled 2 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using HG;
using HG.Reflection;
using InLobbyConfig;
using InLobbyConfig.Fields;
using LeTai.Asset.TranslucentImage;
using LobbyAppearanceImprovements.Layouts;
using LobbyAppearanceImprovements.MannequinLayouts;
using LobbyAppearanceImprovements.Scenes;
using Microsoft.CodeAnalysis;
using On.RoR2;
using On.RoR2.SurvivorMannequins;
using On.RoR2.UI;
using PaladinMod.Misc;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.SurvivorMannequins;
using RoR2.UI;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.EventSystems;
using UnityEngine.Networking;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: OptIn]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LobbyAppearanceImprovements")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Mod for Risk of Rain 2")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+0bbddb2ef69a402e092c2c6d4079eb8d59e3819f")]
[assembly: AssemblyProduct("LobbyAppearanceImprovements")]
[assembly: AssemblyTitle("LobbyAppearanceImprovements")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
public static class QuaternionUtil
{
	public static Quaternion AngVelToDeriv(Quaternion Current, Vector3 AngVel)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: 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_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: 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_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: 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_0040: 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_0053: Unknown result type (might be due to invalid IL or missing references)
		Quaternion val = new Quaternion(AngVel.x, AngVel.y, AngVel.z, 0f) * Current;
		return new Quaternion(0.5f * val.x, 0.5f * val.y, 0.5f * val.z, 0.5f * val.w);
	}

	public static Vector3 DerivToAngVel(Quaternion Current, Quaternion Deriv)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: 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_0012: 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_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		Quaternion val = Deriv * Quaternion.Inverse(Current);
		return new Vector3(2f * val.x, 2f * val.y, 2f * val.z);
	}

	public static Quaternion IntegrateRotation(Quaternion Rotation, Vector3 AngularVelocity, float DeltaTime)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//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_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: 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_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: 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_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: 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_005b: 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_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		if (DeltaTime < Mathf.Epsilon)
		{
			return Rotation;
		}
		Quaternion val = AngVelToDeriv(Rotation, AngularVelocity);
		Vector4 val2 = new Vector4(Rotation.x + val.x * DeltaTime, Rotation.y + val.y * DeltaTime, Rotation.z + val.z * DeltaTime, Rotation.w + val.w * DeltaTime);
		Vector4 normalized = ((Vector4)(ref val2)).normalized;
		return new Quaternion(normalized.x, normalized.y, normalized.z, normalized.w);
	}

	public static Quaternion SmoothDamp(Quaternion rot, Quaternion target, ref Quaternion deriv, float time)
	{
		//IL_000e: 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_000c: 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_005f: 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_0077: 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)
		//IL_008f: 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)
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f3: 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_0113: Unknown result type (might be due to invalid IL or missing references)
		//IL_0123: Unknown result type (might be due to invalid IL or missing references)
		//IL_012b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0131: Unknown result type (might be due to invalid IL or missing references)
		//IL_0137: 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_0143: Unknown result type (might be due to invalid IL or missing references)
		if (Time.deltaTime < Mathf.Epsilon)
		{
			return rot;
		}
		float num = ((Quaternion.Dot(rot, target) > 0f) ? 1f : (-1f));
		target.x *= num;
		target.y *= num;
		target.z *= num;
		target.w *= num;
		Vector4 val = new Vector4(Mathf.SmoothDamp(rot.x, target.x, ref deriv.x, time), Mathf.SmoothDamp(rot.y, target.y, ref deriv.y, time), Mathf.SmoothDamp(rot.z, target.z, ref deriv.z, time), Mathf.SmoothDamp(rot.w, target.w, ref deriv.w, time));
		Vector4 normalized = ((Vector4)(ref val)).normalized;
		Vector4 val2 = Vector4.Project(new Vector4(deriv.x, deriv.y, deriv.z, deriv.w), normalized);
		deriv.x -= val2.x;
		deriv.y -= val2.y;
		deriv.z -= val2.z;
		deriv.w -= val2.w;
		return new Quaternion(normalized.x, normalized.y, normalized.z, normalized.w);
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	[ExcludeFromCodeCoverage]
	[DebuggerNonUserCode]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	[ExcludeFromCodeCoverage]
	[DebuggerNonUserCode]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
}
namespace LobbyAppearanceImprovements
{
	public static class Commands
	{
		[ConCommand(/*Could not decode attribute arguments.*/)]
		public static void CMD_ListScene(ConCommandArgs args)
		{
			foreach (KeyValuePair<string, Type> item in LAISceneManager.scenesDict)
			{
				Debug.Log((object)item.Key);
			}
		}

		[ConCommand(/*Could not decode attribute arguments.*/)]
		public static void CMD_SetScene(ConCommandArgs args)
		{
			if (((ConCommandArgs)(ref args)).Count == 1)
			{
				Methods.SelectScene(((ConCommandArgs)(ref args)).GetArgString(0));
			}
			else
			{
				Methods.LoadSceneAndLayout(((ConCommandArgs)(ref args)).GetArgString(0), ((ConCommandArgs)(ref args)).GetArgString(1));
			}
		}

		[ConCommand(/*Could not decode attribute arguments.*/)]
		public static void CMD_ListLayouts(ConCommandArgs args)
		{
			if (((ConCommandArgs)(ref args)).Count == 1)
			{
				string argString = ((ConCommandArgs)(ref args)).GetArgString(0);
				{
					foreach (KeyValuePair<string, Type> item in LAILayoutManager.layoutsDict)
					{
						if (((LAILayout)Activator.CreateInstance(item.Value)).SceneName == argString)
						{
							Debug.Log((object)item.Key);
						}
					}
					return;
				}
			}
			foreach (KeyValuePair<string, Type> item2 in LAILayoutManager.layoutsDict)
			{
				Debug.Log((object)item2.Key);
			}
		}

		[ConCommand(/*Could not decode attribute arguments.*/)]
		public static void CMD_SetLayout(ConCommandArgs args)
		{
			Methods.SelectLayout(((ConCommandArgs)(ref args)).GetArgString(0));
		}

		[ConCommand(/*Could not decode attribute arguments.*/)]
		public static void CMD_GetPos(ConCommandArgs args)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: 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)
			string name = ((Object)((ConCommandArgs)(ref args)).senderBody).name;
			name = name.Remove(name.Length - 7);
			Vector3 footPosition = ((ConCommandArgs)(ref args)).senderBody.footPosition;
			Quaternion rotation = ((ConCommandArgs)(ref args)).senderBody.transform.rotation;
			Debug.Log((object)("{ \"" + name + "\", new [] {new Vector3(" + footPosition.x + "f, " + footPosition.y + "f, " + footPosition.z + "f), new Vector3(" + rotation.x + ", " + rotation.y + "f, " + rotation.z + "f) } },"));
		}
	}
	public static class ConfigSetup
	{
		public enum LoggingStyle
		{
			None,
			UserShouldSee,
			ObscureSoOnlyDevSees
		}

		public static float UI_Scale_Min = 0.5f;

		public static float UI_Scale_Max = 1.75f;

		private static ModConfigEntry inLobbyConfigEntry;

		public static string tempSceneName;

		public static string tempLayoutName;

		public static bool tempConfirmChoice;

		public static Action<string> tempSelectSceneAction;

		public static Action<string> tempSelectLayoutAction;

		public static ConfigEntry<bool> UI_ShowFade { get; set; }

		public static ConfigEntry<int> UI_BlurOpacity { get; set; }

		public static ConfigEntry<float> UI_Scale { get; set; }

		public static ConfigEntry<string> MusicChoice { get; set; }

		public static ConfigEntry<bool> PostProcessing { get; set; }

		public static ConfigEntry<bool> Parallax { get; set; }

		public static ConfigEntry<Color> Light_Color { get; set; }

		public static ConfigEntry<bool> Light_Flicker { get; set; }

		public static ConfigEntry<float> Light_Intensity { get; set; }

		public static ConfigEntry<float> MannequinScale { get; set; }

		public static ConfigEntry<bool> MannequinEnableLocalTurn { get; set; }

		public static ConfigEntry<float> MannequinEnableLocalTurnMultiplier { get; set; }

		public static ConfigEntry<bool> MeshProps { get; set; }

		public static ConfigEntry<bool> PhysicsProps { get; set; }

		public static ConfigEntry<bool> Lobby_Shaking { get; set; }

		public static ConfigEntry<string> Scene_Selection { get; set; }

		public static ConfigEntry<bool> Scene_Header { get; set; }

		public static ConfigEntry<bool> Scene_Seer { get; set; }

		public static ConfigEntry<bool> SIL_LockedCharactersBlack { get; set; }

		public static ConfigEntry<string> SIL_SelectedLayout { get; set; }

		public static ConfigEntry<bool> SIL_ZoomEnable { get; set; }

		public static ConfigEntry<KeyCode> SIL_ResetCameraKey { get; set; }

		public static ConfigEntry<bool> SIL_ClickOnCharacterToSwap { get; set; }

		public static ConfigEntry<LoggingStyle> ShowLoggingText { get; set; }

		public static void Initialize(ConfigFile configFile)
		{
			Bind(configFile);
			InLobbyBind();
		}

		public static void Bind(ConfigFile config)
		{
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			string text = "Sound";
			MusicChoice = config.Bind<string>(text, "Music", "auto", "Adjust: Sets the current musictrack of the lobby.\n\"default\" = Will play the default lobby music or, if the scene has one, the overrided music\n\"auto\" = Will auto choose the scene's track.For the rest, see the readme for valid tracks.");
			text = "UI";
			UI_ShowFade = config.Bind<bool>(text, "Show Fade", true, "Toggle: Dark fade bars at the top and bottom of the lobby.");
			UI_BlurOpacity = config.Bind<int>(text, "Blur Opacity", 100, "Adjust: Blur opacity behind the UI.\n0:fully transparent - 100:default");
			UI_Scale = config.Bind<float>(text, "UI Scale", 1f, "Adjust: Resizes the UIs on the left and right.");
			UI_Scale.Value = Mathf.Clamp(UI_Scale.Value, UI_Scale_Min, UI_Scale_Max);
			text = "Overlay";
			PostProcessing = config.Bind<bool>(text, "Post Processing", true, "Toggle: Post processing.");
			Parallax = config.Bind<bool>(text, "Parallax", true, "Toggle: Parallax effect on the camera controlled by the position of the cursor.");
			text = "Lights";
			Light_Color = config.Bind<Color>(text, "Color", new Color(0.9811f, 0.3564f, 0.3564f, 1f), "Adjust: The color of the lobby's light, include # for hex values");
			Light_Flicker = config.Bind<bool>(text, "Flickering", true, "Toggle: Flickering of the Light.");
			Light_Intensity = config.Bind<float>(text, "Intensity", 0.4873f, "Adjust: Change the intensity of the light.");
			text = "Character Display";
			MannequinScale = config.Bind<float>(text, "Character Display Scale", 1f, "Adjust: Resizes character displays.");
			MannequinEnableLocalTurn = config.Bind<bool>(text, "Character Rotate", true, "Toggle: Click and drag to rotate your character in the lobby.");
			MannequinEnableLocalTurnMultiplier = config.Bind<float>(text, "Character Rotate Speed", 2f, "Adjust: Sets the speed of character rotation.");
			text = "Background";
			MeshProps = config.Bind<bool>(text, "LobbyScene: Show Static MeshProps", false, "Toggle: all the stationary meshprops.");
			PhysicsProps = config.Bind<bool>(text, "LobbyScene: Show Physics Props", false, "Toggle: all the physics props like the Chair.");
			Lobby_Shaking = config.Bind<bool>(text, "LobbyScene: Shaking", false, "Toggle: whether the physics objects are shaken periodically");
			Scene_Selection = config.Bind<string>(text, "Select Scene", "lobby", "Adjust: Sets the current scene of the lobby.");
			Scene_Header = config.Bind<bool>(text, "Scene Header", true, "Toggle: Shows the scene's title and subtitle.");
			Scene_Seer = config.Bind<bool>(text, "Scene Seer", true, "Toggle: Shows the stage's seer text at the bottom.");
			SIL_LockedCharactersBlack = config.Bind<bool>(text, "Enable Unavailable Shadow Survivors", true, "Toggle: Any survivors in a character layout that you don't have unlocked become shadowy.");
			SIL_SelectedLayout = config.Bind<string>(text, "Character Layout Name", "any_empty", "Adjust: Shows background elements in certain orientations. Set to Any_Empty to disable.");
			SIL_ZoomEnable = config.Bind<bool>(text, "Zoom On Character Select", true, "Toggle: Selecting a character will zoom the camera onto that character.");
			SIL_ResetCameraKey = config.Bind<KeyCode>(text, "Reset Camera", (KeyCode)61, "Adjust: Sets keybind for resetting the ");
			SIL_ClickOnCharacterToSwap = config.Bind<bool>(text, "Click on bg char to select (EXPERIMENTAL)", true, "Allows clicking on a character to select them.\nExperimental: Clicking on the character might be unavailable, or offset.");
			ShowLoggingText = config.Bind<LoggingStyle>("zDebugging", "Print logging text to console", LoggingStyle.UserShouldSee, "If true, then some logging messages are sent to the console. Error and warning messages will still display.");
			tempSelectSceneAction = (Action<string>)Delegate.Combine(tempSelectSceneAction, new Action<string>(SetNewScene));
			tempSelectLayoutAction = (Action<string>)Delegate.Combine(tempSelectLayoutAction, new Action<string>(SetNewLayout));
			tempSceneName = Scene_Selection.Value;
			tempLayoutName = SIL_SelectedLayout.Value;
		}

		public static void InLobbyBind()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Expected O, but got Unknown
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Expected O, but got Unknown
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Expected O, but got Unknown
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Expected O, but got Unknown
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Expected O, but got Unknown
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Expected O, but got Unknown
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Expected O, but got Unknown
			//IL_02be: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c8: Expected O, but got Unknown
			//IL_0312: Unknown result type (might be due to invalid IL or missing references)
			//IL_031c: Expected O, but got Unknown
			//IL_0379: Unknown result type (might be due to invalid IL or missing references)
			//IL_0383: Expected O, but got Unknown
			//IL_03f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0403: Expected O, but got Unknown
			//IL_044d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0457: Expected O, but got Unknown
			//IL_04b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04be: Expected O, but got Unknown
			//IL_0521: Unknown result type (might be due to invalid IL or missing references)
			//IL_052b: Expected O, but got Unknown
			//IL_0575: Unknown result type (might be due to invalid IL or missing references)
			//IL_057f: Expected O, but got Unknown
			//IL_05c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cd: Expected O, but got Unknown
			//IL_0611: Unknown result type (might be due to invalid IL or missing references)
			//IL_061b: Expected O, but got Unknown
			//IL_0651: Unknown result type (might be due to invalid IL or missing references)
			//IL_065b: Expected O, but got Unknown
			//IL_06a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_06af: Expected O, but got Unknown
			//IL_0742: Unknown result type (might be due to invalid IL or missing references)
			//IL_074c: Expected O, but got Unknown
			//IL_07af: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b9: Expected O, but got Unknown
			//IL_0803: Unknown result type (might be due to invalid IL or missing references)
			//IL_080d: Expected O, but got Unknown
			//IL_0857: Unknown result type (might be due to invalid IL or missing references)
			//IL_0861: Expected O, but got Unknown
			inLobbyConfigEntry = new ModConfigEntry
			{
				DisplayName = "Lobby Appearance Improvements"
			};
			inLobbyConfigEntry.SectionFields["Sound"] = new List<IConfigField> { (IConfigField)new StringConfigField(((ConfigEntryBase)MusicChoice).Definition.Key, ((ConfigEntryBase)MusicChoice).Description.Description, (Func<string>)(() => MusicChoice.Value), (Action<string>)null, (Action<string>)HookMethods.Hook_MusicChoice) };
			inLobbyConfigEntry.SectionFields["UI"] = new List<IConfigField>
			{
				(IConfigField)new BooleanConfigField(((ConfigEntryBase)UI_ShowFade).Definition.Key, ((ConfigEntryBase)UI_ShowFade).Description.Description, (Func<bool>)(() => UI_ShowFade.Value), (Action<bool>)HookMethods.Hook_UI_ShowFade),
				(IConfigField)new IntConfigField(((ConfigEntryBase)UI_BlurOpacity).Definition.Key, (Func<int>)(() => UI_BlurOpacity.Value), (Action<int>)HookMethods.Hook_UI_BlurOpacity, (Action<int>)null, (int?)0, (int?)100),
				(IConfigField)new FloatConfigField(((ConfigEntryBase)UI_Scale).Definition.Key, (Func<float>)(() => UI_Scale.Value), (Action<float>)null, (Action<float>)HookMethods.Hook_UIScale, (float?)UI_Scale_Min, (float?)UI_Scale_Max)
			};
			inLobbyConfigEntry.SectionFields["Overlay"] = new List<IConfigField>
			{
				(IConfigField)new BooleanConfigField(((ConfigEntryBase)PostProcessing).Definition.Key, ((ConfigEntryBase)PostProcessing).Description.Description, (Func<bool>)(() => PostProcessing.Value), (Action<bool>)HookMethods.Hook_Overlay_ShowPostProcessing),
				(IConfigField)new BooleanConfigField(((ConfigEntryBase)Parallax).Definition.Key, ((ConfigEntryBase)Parallax).Description.Description, (Func<bool>)(() => Parallax.Value), (Action<bool>)HookMethods.Hook_Overlay_Parallax)
			};
			inLobbyConfigEntry.SectionFields["Lights"] = new List<IConfigField>
			{
				(IConfigField)new ColorConfigField(((ConfigEntryBase)Light_Color).Definition.Key, ((ConfigEntryBase)Light_Color).Description.Description, (Func<Color>)(() => Light_Color.Value), (Action<Color>)HookMethods.Hook_LightUpdate_Color, (Action<Color>)null, false),
				(IConfigField)new BooleanConfigField(((ConfigEntryBase)Light_Flicker).Definition.Key, ((ConfigEntryBase)Light_Flicker).Description.Description, (Func<bool>)(() => Light_Flicker.Value), (Action<bool>)HookMethods.Hook_LightUpdate_Flicker),
				(IConfigField)new FloatConfigField(((ConfigEntryBase)Light_Intensity).Definition.Key, ((ConfigEntryBase)Light_Intensity).Description.Description, (Func<float>)(() => Light_Intensity.Value), (Action<float>)HookMethods.Hook_LightUpdate_Intensity, (Action<float>)null, (float?)null, (float?)null)
			};
			inLobbyConfigEntry.SectionFields["Mannequins"] = new List<IConfigField>
			{
				(IConfigField)new FloatConfigField(((ConfigEntryBase)MannequinScale).Definition.Key, ((ConfigEntryBase)MannequinScale).Description.Description, (Func<float>)(() => MannequinScale.Value), (Action<float>)HookMethods.Hook_RescalePads, (Action<float>)null, (float?)null, (float?)null),
				(IConfigField)new BooleanConfigField(((ConfigEntryBase)MannequinEnableLocalTurn).Definition.Key, ((ConfigEntryBase)MannequinEnableLocalTurn).Description.Description, (Func<bool>)(() => MannequinEnableLocalTurn.Value), (Action<bool>)HookMethods.Hook_Rotate_Toggle),
				(IConfigField)new FloatConfigField(((ConfigEntryBase)MannequinEnableLocalTurnMultiplier).Definition.Key, ((ConfigEntryBase)MannequinEnableLocalTurnMultiplier).Description.Description, (Func<float>)(() => MannequinEnableLocalTurnMultiplier.Value), (Action<float>)HookMethods.Hook_Rotate_Speed, (Action<float>)null, (float?)null, (float?)null)
			};
			inLobbyConfigEntry.SectionFields["Scenes+Layouts"] = new List<IConfigField>
			{
				(IConfigField)new BooleanConfigField(((ConfigEntryBase)Scene_Header).Definition.Key, ((ConfigEntryBase)Scene_Header).Description.Description, (Func<bool>)(() => Scene_Header.Value), (Action<bool>)HookMethods.Hook_ToggleSceneHeaderVisibility),
				(IConfigField)new BooleanConfigField(((ConfigEntryBase)Scene_Seer).Definition.Key, ((ConfigEntryBase)Scene_Seer).Description.Description, (Func<bool>)(() => Scene_Seer.Value), (Action<bool>)HookMethods.Hook_ToggleSceneSeerVisibility),
				(IConfigField)new StringConfigField(((ConfigEntryBase)Scene_Selection).Definition.Key, ((ConfigEntryBase)Scene_Selection).Description.Description, (Func<string>)(() => Scene_Selection.Value), (Action<string>)null, tempSelectSceneAction),
				(IConfigField)new StringConfigField(((ConfigEntryBase)SIL_SelectedLayout).Definition.Key, ((ConfigEntryBase)SIL_SelectedLayout).Description.Description, (Func<string>)(() => SIL_SelectedLayout.Value), (Action<string>)null, tempSelectLayoutAction),
				(IConfigField)new BooleanConfigField("Confirm Choice", "Click to confirm choice for scene.", (Func<bool>)(() => tempConfirmChoice), (Action<bool>)SetSceneLayoutFromLobby),
				(IConfigField)new BooleanConfigField(((ConfigEntryBase)SIL_ZoomEnable).Definition.Key, ((ConfigEntryBase)SIL_ZoomEnable).Description.Description, (Func<bool>)(() => SIL_ZoomEnable.Value), (Action<bool>)HookMethods.Hook_ToggleZooming),
				(IConfigField)(object)new EnumConfigField<KeyCode>(((ConfigEntryBase)SIL_ResetCameraKey).Definition.Key, ((ConfigEntryBase)SIL_ResetCameraKey).Description.Description, (Func<KeyCode>)(() => SIL_ResetCameraKey.Value), (Action<KeyCode>)null),
				(IConfigField)new BooleanConfigField(((ConfigEntryBase)SIL_LockedCharactersBlack).Definition.Key, ((ConfigEntryBase)SIL_LockedCharactersBlack).Description.Description, (Func<bool>)(() => SIL_LockedCharactersBlack.Value), (Action<bool>)HookMethods.Hook_BlackenSurvivors)
			};
			inLobbyConfigEntry.SectionFields["Scene: Lobby"] = new List<IConfigField>
			{
				(IConfigField)new BooleanConfigField(((ConfigEntryBase)MeshProps).Definition.Key, ((ConfigEntryBase)MeshProps).Description.Description, (Func<bool>)(() => MeshProps.Value), (Action<bool>)HookMethods.Hook_Lobby_HideProps),
				(IConfigField)new BooleanConfigField(((ConfigEntryBase)PhysicsProps).Definition.Key, ((ConfigEntryBase)PhysicsProps).Description.Description, (Func<bool>)(() => PhysicsProps.Value), (Action<bool>)HookMethods.Hook_Lobby_HidePhysicsProps),
				(IConfigField)new BooleanConfigField(((ConfigEntryBase)Lobby_Shaking).Definition.Key, ((ConfigEntryBase)Lobby_Shaking).Description.Description, (Func<bool>)(() => Lobby_Shaking.Value), (Action<bool>)HookMethods.Hook_Lobby_DisableShaking)
			};
			ModConfigCatalog.Add(inLobbyConfigEntry);
		}

		public static void SetNewScene(string value)
		{
			tempSceneName = value;
		}

		public static void SetNewLayout(string value)
		{
			tempLayoutName = value;
		}

		public static void SetNewMannequin(string value)
		{
		}

		public static void SetSceneLayoutFromLobby(bool value)
		{
			if (value)
			{
				Methods.LoadSceneAndLayoutResult loadSceneAndLayoutResult = Methods.LoadSceneAndLayout(tempSceneName, tempLayoutName);
				tempConfirmChoice = false;
				switch (loadSceneAndLayoutResult)
				{
				case Methods.LoadSceneAndLayoutResult.NoScene:
					SIL_SelectedLayout.Value = tempLayoutName;
					break;
				case Methods.LoadSceneAndLayoutResult.NoLayout:
					Scene_Selection.Value = tempSceneName;
					break;
				default:
					Scene_Selection.Value = tempSceneName;
					SIL_SelectedLayout.Value = tempLayoutName;
					break;
				case Methods.LoadSceneAndLayoutResult.NoSceneNoLayout:
					break;
				}
			}
		}
	}
	public static class LAIAssets
	{
		public static GameObject bombardierTextObject;

		public static async Task Init()
		{
			await Test().ConfigureAwait(continueOnCapturedContext: false);
			static async Task Test()
			{
				AsyncOperationHandle<GameObject> val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/UI/HGCreditNameLabel.prefab");
				AsyncOperationHandle<TMP_FontAsset> task2 = Addressables.LoadAssetAsync<TMP_FontAsset>((object)"RoR2/Base/Common/Fonts/Bombardier/tmpBombDropshadow.asset");
				AsyncOperationHandle<Material> task3 = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/Fonts/Bombardier/tmpBombPlain.mat");
				bombardierTextObject = PrefabAPI.InstantiateClone(await val.Task, "LAI_BombardierTextObject", false);
				HGTextMeshProUGUI textmesh = bombardierTextObject.GetComponent<HGTextMeshProUGUI>();
				HGTextMeshProUGUI val2 = textmesh;
				((TMP_Text)val2).font = await task2.Task;
				val2 = textmesh;
				((Graphic)val2).material = await task3.Task;
				((TMP_Text)textmesh).enableKerning = true;
				((TMP_Text)textmesh).enableAutoSizing = true;
				((TMP_Text)textmesh).fontSize = 38.5f;
				Object.Destroy((Object)(object)bombardierTextObject.GetComponent<ContentSizeFitter>());
			}
		}
	}
	internal static class LAICameraManager
	{
		public class CameraController : MonoBehaviour
		{
			public float fov = 60f;

			public float pitch;

			public float yaw;

			public bool restart;

			public bool logit;

			private CameraRigController cam;

			public void SetCam(CameraRigController newCam)
			{
				cam = newCam;
			}

			public void FixedUpdate()
			{
				if (restart)
				{
					fov = 60f;
					pitch = 0f;
					yaw = 0f;
					restart = false;
					return;
				}
				cam.baseFov = fov;
				if (logit)
				{
					Debug.Log((object)$"new CameraSetting( {fov}, {pitch}, {yaw} )");
					logit = false;
				}
			}
		}

		public static Dictionary<string, LAILayout.CameraSetting> currentCameraSettings = new Dictionary<string, LAILayout.CameraSetting>();

		public static Methods.LAICameraController CurrentCameraController;

		private static CameraRigController _mainCameraRigController;

		public static CameraRigController MainCameraRigController
		{
			get
			{
				if (!Object.op_Implicit((Object)(object)_mainCameraRigController))
				{
					_mainCameraRigController = GameObject.Find("Main Camera").GetComponent<CameraRigController>();
				}
				return _mainCameraRigController;
			}
			set
			{
				_mainCameraRigController = value;
			}
		}

		public static void Init()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			CameraRigController.Start += new hook_Start(CameraRigController_Start);
		}

		public static void CameraRigController_Start(orig_Start orig, CameraRigController self)
		{
			orig.Invoke(self);
			CameraController cameraController = ((Component)self).gameObject.AddComponent<CameraController>();
			cameraController.SetCam(self);
			((Behaviour)cameraController).enabled = false;
		}
	}
	internal static class LAILayoutManager
	{
		public static LAILayout chosenLayout = null;

		public static Dictionary<string, Type> layoutsDict = new Dictionary<string, Type>();

		public static List<string> layoutNameList = new List<string>();

		public static GameObject layoutInstance;

		public static string GetLayoutTitleToken()
		{
			if (chosenLayout == null)
			{
				return string.Empty;
			}
			return chosenLayout.LayoutTitleToken;
		}
	}
	internal static class LAILogging
	{
		internal static ManualLogSource _logger;

		public static void Init(ManualLogSource manualLogSource)
		{
			_logger = manualLogSource;
		}

		public static void LogError(string message, ConfigSetup.LoggingStyle loggingStyle)
		{
			if (ConfigSetup.ShowLoggingText.Value >= loggingStyle)
			{
				_logger.LogError((object)message);
			}
		}

		public static void LogMessage(string message, ConfigSetup.LoggingStyle loggingStyle)
		{
			if (ConfigSetup.ShowLoggingText.Value >= loggingStyle)
			{
				_logger.LogMessage((object)message);
			}
		}

		public static void LogWarning(string message, ConfigSetup.LoggingStyle loggingStyle)
		{
			if (ConfigSetup.ShowLoggingText.Value >= loggingStyle)
			{
				_logger.LogWarning((object)message);
			}
		}
	}
	internal static class LAIMannequinManager
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_OnEnable <>9__4_0;

			internal void <Init>b__4_0(orig_OnEnable orig, SurvivorMannequinDioramaController self)
			{
				mannequinDioramaController = self;
				orig.Invoke(self);
			}
		}

		public static SurvivorMannequinDioramaController mannequinDioramaController = null;

		public static BaseMannequinLayout chosenMannequinLayout = null;

		public static Dictionary<string, Type> mannequinLayoutsDict = new Dictionary<string, Type>();

		public static List<string> mannequinLayoutNameList = new List<string>();

		public static void Init()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			object obj = <>c.<>9__4_0;
			if (obj == null)
			{
				hook_OnEnable val = delegate(orig_OnEnable orig, SurvivorMannequinDioramaController self)
				{
					mannequinDioramaController = self;
					orig.Invoke(self);
				};
				<>c.<>9__4_0 = val;
				obj = (object)val;
			}
			SurvivorMannequinDioramaController.OnEnable += (hook_OnEnable)obj;
		}
	}
	internal static class LAIMusicManager
	{
		public static MusicTrackOverride musicTrackOverride;

		public static void Init()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			CharacterSelectController.Awake += new hook_Awake(CharacterSelectController_Awake);
		}

		private static void CharacterSelectController_Awake(orig_Awake orig, CharacterSelectController self)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			musicTrackOverride = ((Component)self).gameObject.AddComponent<MusicTrackOverride>();
			musicTrackOverride.priority = 99999;
			musicTrackOverride.track = Addressables.LoadAssetAsync<MusicTrackDef>((object)"RoR2/Base/Common/muLogbook").WaitForCompletion();
			((Behaviour)musicTrackOverride).enabled = false;
			orig.Invoke(self);
		}

		public static void OnSceneLoaded(LAIScene scene = null)
		{
			string value = ConfigSetup.MusicChoice.Value;
			if (scene == null)
			{
				scene = LAISceneManager.chosenScene;
			}
			LAILogging.LogMessage("Changing music track to \"" + value + "\"", ConfigSetup.LoggingStyle.ObscureSoOnlyDevSees);
			if (value.ToLower() == "default")
			{
				((Behaviour)musicTrackOverride).enabled = false;
			}
			else if (value.ToLower() == "auto")
			{
				((Behaviour)musicTrackOverride).enabled = true;
				LAILogging.LogMessage($"Changing music track to {scene}'s \"{scene.MusicTrackName}\"", ConfigSetup.LoggingStyle.ObscureSoOnlyDevSees);
				MusicTrackDef val = MusicTrackCatalog.FindMusicTrackDef(scene.MusicTrackName);
				if ((Object)(object)val == (Object)null)
				{
					((Behaviour)musicTrackOverride).enabled = false;
				}
				musicTrackOverride.track = val;
			}
			else
			{
				((Behaviour)musicTrackOverride).enabled = true;
				MusicTrackDef val2 = MusicTrackCatalog.FindMusicTrackDef(value);
				if ((Object)(object)val2 == (Object)null)
				{
					LAILogging.LogWarning("Couldn't find music choice \"{choice}\", defaulting...", ConfigSetup.LoggingStyle.ObscureSoOnlyDevSees);
					((Behaviour)musicTrackOverride).enabled = false;
				}
				else
				{
					musicTrackOverride.track = val2;
				}
			}
		}
	}
	internal class LAIPatches
	{
		public static void Init()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			CharacterSelectController.OnEnable += new hook_OnEnable(CharacterSelectController_OnEnable);
			CharacterSelectController.OnDisable += new hook_OnDisable(CharacterSelectController_OnDisable);
		}

		private static void CharacterSelectController_OnEnable(orig_OnEnable orig, CharacterSelectController self)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			orig.Invoke(self);
			ShakeEmitter.ComputeTotalShakeAtPoint += new hook_ComputeTotalShakeAtPoint(ShakeEmitter_ComputeTotalShakeAtPoint);
		}

		private static Vector3 ShakeEmitter_ComputeTotalShakeAtPoint(orig_ComputeTotalShakeAtPoint orig, Vector3 position)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			return orig.Invoke(position) * (Object.op_Implicit((Object)(object)LAIPlugin.CharacterSelectController) ? LAIPlugin.CharacterSelectController.localUser.userProfile.screenShakeScale : 1f);
		}

		private static void CharacterSelectController_OnDisable(orig_OnDisable orig, CharacterSelectController self)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			ShakeEmitter.ComputeTotalShakeAtPoint -= new hook_ComputeTotalShakeAtPoint(ShakeEmitter_ComputeTotalShakeAtPoint);
			orig.Invoke(self);
		}
	}
	[BepInDependency("com.bepis.r2api", "5.0.10")]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.DestroyedClone.LobbyAppearanceImprovements", "LobbyAppearanceImprovements", "1.3.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class LAIPlugin : BaseUnityPlugin
	{
		public const string ModVer = "1.3.0";

		public const string ModName = "LobbyAppearanceImprovements";

		public const string ModGuid = "com.DestroyedClone.LobbyAppearanceImprovements";

		public static Transform CharSelUITransform;

		public static Transform LAITitleRef;

		public static GameObject LAITextHolder;

		private static CharacterSelectController _characterSelectController;

		public static CharacterSelectController CharacterSelectController
		{
			get
			{
				if (!Object.op_Implicit((Object)(object)_characterSelectController))
				{
					_characterSelectController = Object.FindObjectOfType<CharacterSelectController>();
				}
				return _characterSelectController;
			}
			set
			{
				_characterSelectController = value;
			}
		}

		public void Awake()
		{
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Expected O, but got Unknown
			LAILogging.Init(((BaseUnityPlugin)this).Logger);
			((MonoBehaviour)this).StartCoroutine(CallInit());
			ConfigSetup.Initialize(((BaseUnityPlugin)this).Config);
			LAIMannequinManager.Init();
			LAICameraManager.Init();
			LAIMusicManager.Init();
			LAIPatches.Init();
			CharacterSelectController.Awake += new hook_Awake(CharacterSelectController_Awake);
			LAISceneManager.Initialize();
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(AssemblySetup));
			PreGameShakeController.Awake += new hook_Awake(PreGameShakeController_Awake);
		}

		private IEnumerator CallInit()
		{
			Task initTask = LAIAssets.Init();
			while (!initTask.IsCompleted)
			{
				yield return null;
			}
			if (initTask.Exception != null)
			{
				Debug.LogError((object)("Exception in LAIAssets.Init: " + initTask.Exception));
			}
		}

		private void PreGameShakeController_Awake(orig_Awake orig, PreGameShakeController self)
		{
			InstanceTracker.Add<LAIPlugin>(this);
			((Component)self).gameObject.SetActive(ConfigSetup.Lobby_Shaking.Value);
			orig.Invoke(self);
		}

		private void CharacterSelectController_Awake(orig_Awake orig, CharacterSelectController self)
		{
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Expected O, but got Unknown
			orig.Invoke(self);
			if (!Object.op_Implicit((Object)(object)Run.instance) && SceneManager.sceneCount == 1)
			{
				CharacterSelectController = self;
				if (!Object.op_Implicit((Object)(object)((Component)self).gameObject.GetComponent<Methods.LAICameraController>()))
				{
					((Component)self).gameObject.AddComponent<Methods.LAICameraController>();
				}
				CharSelUITransform = ((Component)self).transform;
				if (!Object.op_Implicit((Object)(object)LAITextHolder))
				{
					LAITextHolder = new GameObject("LAI_TextHolder");
				}
				LAITextHolder.transform.parent = ((Component)self).transform.Find("SafeArea");
				LAITextHolder.transform.localPosition = new Vector3(100f, 0f, 0f);
				LAITitleRef = self.activeSurvivorInfoPanel.transform.Find("SurvivorNamePanel/SurvivorName");
				ValidateConfig();
				Methods.LoadSceneAndLayout(ConfigSetup.Scene_Selection.Value, ConfigSetup.SIL_SelectedLayout.Value);
				HookMethods.Hook_UI_ShowFade(ConfigSetup.UI_ShowFade.Value);
				HookMethods.Hook_UI_BlurOpacity(ConfigSetup.UI_BlurOpacity.Value);
				HookMethods.Hook_UIScale(ConfigSetup.UI_Scale.Value);
				HookMethods.Hook_Overlay_Parallax(ConfigSetup.Parallax.Value);
				HookMethods.Hook_RescalePads(ConfigSetup.MannequinScale.Value);
				HookMethods.Hook_Rotate_Toggle(ConfigSetup.MannequinEnableLocalTurn.Value);
				HookMethods.Hook_Rotate_Speed(ConfigSetup.MannequinEnableLocalTurnMultiplier.Value);
				HookMethods.Hook_ToggleZooming(ConfigSetup.SIL_ZoomEnable.Value);
				HookMethods.Hook_Lobby_DisableShaking(ConfigSetup.Lobby_Shaking.Value);
			}
		}

		private void ValidateConfig()
		{
			if (!LAISceneManager.sceneNameList.Contains(ConfigSetup.Scene_Selection.Value))
			{
				LAILogging.LogWarning($"Invalid scene name: {ConfigSetup.Scene_Selection.Value}, switching to {((ConfigEntryBase)ConfigSetup.Scene_Selection).DefaultValue}", ConfigSetup.LoggingStyle.UserShouldSee);
				ConfigSetup.Scene_Selection.Value = (string)((ConfigEntryBase)ConfigSetup.Scene_Selection).DefaultValue;
			}
			if (!LAILayoutManager.layoutNameList.Contains(ConfigSetup.SIL_SelectedLayout.Value))
			{
				LAILogging.LogWarning($"Invalid layout name: {ConfigSetup.SIL_SelectedLayout.Value}, switching to {((ConfigEntryBase)ConfigSetup.SIL_SelectedLayout).DefaultValue}", ConfigSetup.LoggingStyle.UserShouldSee);
				ConfigSetup.SIL_SelectedLayout.Value = (string)((ConfigEntryBase)ConfigSetup.SIL_SelectedLayout).DefaultValue;
			}
		}

		public void AssemblySetup()
		{
			Type typeFromHandle = typeof(LAIScene);
			Type typeFromHandle2 = typeof(LAILayout);
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			foreach (Type type in types)
			{
				if (type.IsAbstract)
				{
					continue;
				}
				if (typeFromHandle.IsAssignableFrom(type))
				{
					LAIScene lAIScene = (LAIScene)Activator.CreateInstance(type);
					if (lAIScene.CanLoadScene())
					{
						string text = type.Name.ToLower();
						LAISceneManager.scenesDict[text] = type;
						LAISceneManager.scenesReverseDict[type] = ((Object)this).name;
						LAISceneManager.sceneNameList.Add(text);
						lAIScene.Init();
					}
				}
				else if (typeFromHandle2.IsAssignableFrom(type))
				{
					LAILayout lAILayout = (LAILayout)Activator.CreateInstance(type);
					if (lAILayout.CanLoadLayout())
					{
						string text2 = type.Name.ToLower();
						LAILayoutManager.layoutsDict[text2] = type;
						LAILayoutManager.layoutNameList.Add(text2);
						LAILogging.LogMessage("Initializing Scene: " + type, ConfigSetup.LoggingStyle.ObscureSoOnlyDevSees);
						lAILayout.Init();
					}
				}
			}
		}
	}
	internal static class LAISceneManager
	{
		public class VoteStartedEventController : MonoBehaviour
		{
			public VoteController voteController;

			public float stopwatch;

			public float duration = 1f;

			public void Start()
			{
				voteController = ((Component)PreGameController.instance).GetComponent<VoteController>();
			}

			public void FixedUpdate()
			{
				stopwatch -= Time.fixedDeltaTime;
				if (!(stopwatch > 0f))
				{
					stopwatch = duration;
					if (!VoteHasStarted && voteController.NetworktimerIsActive)
					{
						onVoteStarted(chosenScene);
					}
					VoteHasStarted = voteController.NetworktimerIsActive;
				}
			}
		}

		public static LAIScene chosenScene = null;

		public static string chosenSceneAsString = "None";

		public static Dictionary<string, Type> scenesDict = new Dictionary<string, Type>();

		public static Dictionary<Type, string> scenesReverseDict = new Dictionary<Type, string>();

		public static List<string> sceneNameList = new List<string>();

		public static GameObject sceneInstance;

		public static GameObject TitleInstance;

		public static GameObject SubTitleInstance;

		public static GameObject LayoutTitleInstance;

		public static GameObject SeerTextInstance;

		public static Action<LAIScene> onVoteStarted;

		public static bool VoteHasStarted = false;

		public static void Initialize()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Expected O, but got Unknown
			SceneSetup.Init();
			PreGameController.RefreshLobbyBackground += new hook_RefreshLobbyBackground(RemoveDefaultLobby);
			LAIScene.onSceneLoaded = (Action<LAIScene>)Delegate.Combine(LAIScene.onSceneLoaded, new Action<LAIScene>(CreateHeaderIfMissing));
			LAIScene.onSceneLoaded = (Action<LAIScene>)Delegate.Combine(LAIScene.onSceneLoaded, new Action<LAIScene>(OnSceneLoaded));
			LAILayout.onLayoutLoaded = (Action<LAILayout>)Delegate.Combine(LAILayout.onLayoutLoaded, new Action<LAILayout>(OnLayoutLoaded));
			PreGameController.Start += new hook_Start(PreGameController_Start);
			LAIScene.onSceneLoaded = (Action<LAIScene>)Delegate.Combine(LAIScene.onSceneLoaded, new Action<LAIScene>(ActivateVoteStartEffectIfNewSceneLoaded));
			LAIScene.onSceneUnloaded = (Action<LAIScene>)Delegate.Combine(LAIScene.onSceneUnloaded, new Action<LAIScene>(DestroySeerText));
		}

		private static void DestroySeerText(LAIScene scene)
		{
			Object.op_Implicit((Object)(object)SeerTextInstance);
		}

		private static void CreateSeerTextOnLoad(LAIScene scene)
		{
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)SeerTextInstance))
			{
				SeerTextInstance = Object.Instantiate<GameObject>(LAIAssets.bombardierTextObject, LAIPlugin.LAITextHolder.transform);
				((Object)SeerTextInstance).name = "LobbyAppearanceImprovements_Seer_Text";
				SeerTextInstance.transform.localPosition = new Vector3(0f, -480f, 0f);
				((TMP_Text)SeerTextInstance.GetComponent<HGTextMeshProUGUI>()).fontSizeMin = 50f;
			}
			((TMP_Text)SeerTextInstance.GetComponent<HGTextMeshProUGUI>()).text = Language.GetStringFormatted("LAI_MAP_LAYOUT_FORMAT", new object[1] { Language.GetString(chosenScene.SeerToken) });
			HookMethods.Hook_ToggleSceneSeerVisibility(ConfigSetup.Scene_Seer.Value);
		}

		private static void ActivateVoteStartEffectIfNewSceneLoaded(LAIScene scene)
		{
			if (VoteHasStarted)
			{
				onVoteStarted(scene);
			}
		}

		private static void PreGameController_Start(orig_Start orig, PreGameController self)
		{
			orig.Invoke(self);
			VoteHasStarted = false;
			((Component)self).gameObject.AddComponent<VoteStartedEventController>();
		}

		private static void OnSceneLoaded(LAIScene scene)
		{
			HookMethods.Hook_MusicChoice(ConfigSetup.MusicChoice.Value);
			HookMethods.Hook_Lobby_DisableShaking(ConfigSetup.Lobby_Shaking.Value);
			RenderSettings.skybox = scene.SkyboxOverride;
		}

		private static void OnLayoutLoaded(LAILayout layout)
		{
			CreateOrUpdateHeaderText();
		}

		private static void RemoveDefaultLobby(orig_RefreshLobbyBackground orig, PreGameController self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self.lobbyBackground))
			{
				self.lobbyBackground.SetActive(false);
			}
		}

		private static void CreateHeaderIfMissing(LAIScene scene)
		{
			if (scene != null)
			{
				CreateOrUpdateHeaderText();
			}
		}

		public static void CreateOrUpdateHeaderText()
		{
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)TitleInstance))
			{
				TitleInstance = Object.Instantiate<GameObject>(LAIAssets.bombardierTextObject, LAIPlugin.LAITextHolder.transform);
				((Object)TitleInstance).name = "LobbyAppearanceImprovements_Scene_Title";
				TitleInstance.transform.localPosition = new Vector3(0f, 450f, 0f);
				((TMP_Text)TitleInstance.GetComponent<HGTextMeshProUGUI>()).fontSizeMin = 80f;
			}
			((TMP_Text)TitleInstance.GetComponent<HGTextMeshProUGUI>()).text = Language.GetString(chosenScene.SceneTitleToken);
			if (!Object.op_Implicit((Object)(object)SubTitleInstance))
			{
				SubTitleInstance = Object.Instantiate<GameObject>(LAIAssets.bombardierTextObject, LAIPlugin.LAITextHolder.transform);
				((Object)SubTitleInstance).name = "LobbyAppearanceImprovements_Scene_Subtitle";
				SubTitleInstance.transform.localPosition = new Vector3(0f, 400f, 0f);
				((TMP_Text)SubTitleInstance.GetComponent<HGTextMeshProUGUI>()).fontSizeMin = 50f;
			}
			((TMP_Text)SubTitleInstance.GetComponent<HGTextMeshProUGUI>()).text = Language.GetStringFormatted("LAI_MAP_SUBTTILE_FORMAT", new object[1] { Language.GetString(chosenScene.SceneSubtitleToken) });
			if (!Object.op_Implicit((Object)(object)LayoutTitleInstance))
			{
				LayoutTitleInstance = Object.Instantiate<GameObject>(LAIAssets.bombardierTextObject, LAIPlugin.LAITextHolder.transform);
				((Object)LayoutTitleInstance).name = "LobbyAppearanceImprovements_Layout_Title";
				LayoutTitleInstance.transform.localPosition = new Vector3(0f, 360f, 0f);
				((TMP_Text)LayoutTitleInstance.GetComponent<HGTextMeshProUGUI>()).fontSizeMin = 40f;
			}
			((TMP_Text)LayoutTitleInstance.GetComponent<HGTextMeshProUGUI>()).text = Language.GetStringFormatted("LAI_MAP_LAYOUT_FORMAT", new object[1] { Language.GetString(LAILayoutManager.GetLayoutTitleToken()) });
			HookMethods.Hook_ToggleSceneHeaderVisibility(ConfigSetup.Scene_Header.Value);
			CreateSeerTextOnLoad(chosenScene);
		}
	}
	public static class Methods
	{
		public class LAI_CharDisplayTracker : MonoBehaviour
		{
			public CharacterModel characterModel;

			public bool hasUnlocked;

			public void Awake()
			{
				InstanceTracker.Add<LAI_CharDisplayTracker>(this);
			}

			public void OnDestroy()
			{
				InstanceTracker.Remove<LAI_CharDisplayTracker>(this);
			}

			public void ToggleShadow(bool value)
			{
				if (Object.op_Implicit((Object)(object)characterModel))
				{
					characterModel.isDoppelganger = value && !hasUnlocked;
				}
			}
		}

		public enum LoadSceneAndLayoutResult
		{
			NoSceneNoLayout,
			NoScene,
			NoLayout,
			Loaded
		}

		public class ClickToSelectCharacter : MonoBehaviour
		{
			private BoxCollider boxCollider;

			public SurvivorDef survivorDef;

			public Highlight highlight;

			public bool survivorUnlocked;

			public LocalUser localUser;

			private CharacterSelectController characterSelectController;

			private bool screenIsFocused = true;

			public void Start()
			{
				//IL_001b: 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_0070: Unknown result type (might be due to invalid IL or missing references)
				characterSelectController = GameObject.Find("CharacterSelectUI").GetComponent<CharacterSelectController>();
				localUser = ((MPEventSystem)EventSystem.current).localUser;
				if (Object.op_Implicit((Object)(object)survivorDef))
				{
					survivorUnlocked = SurvivorCatalog.SurvivorIsUnlockedOnThisClient(survivorDef.survivorIndex);
					highlight = ((Component)this).gameObject.AddComponent<Highlight>();
					highlight.highlightColor = (HighlightColor)((!survivorUnlocked) ? 4 : 0);
					highlight.isOn = false;
					highlight.targetRenderer = (Renderer)(object)GetTargetRenderer(survivorDef.cachedName);
				}
				else
				{
					LAILogging.LogWarning("ClickToSelectCharacter :: No SurvivorDef found for " + ((Object)((Component)this).gameObject).name, ConfigSetup.LoggingStyle.UserShouldSee);
				}
				SetupBoxColliderOld();
			}

			public void SetupBoxCollider()
			{
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0021: 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_002c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0031: Unknown result type (might be due to invalid IL or missing references)
				//IL_0038: 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)
				boxCollider = ((Component)this).gameObject.AddComponent<BoxCollider>();
				Bounds bounds = highlight.targetRenderer.bounds;
				Vector3 size = ((Bounds)(ref bounds)).size;
				Vector3 center = ((Bounds)(ref bounds)).center;
				boxCollider.size = size;
				boxCollider.center = center;
			}

			public void SetupBoxColliderOld()
			{
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0021: 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_002c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0031: Unknown result type (might be due to invalid IL or missing references)
				//IL_003d: 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_0043: 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_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_005c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0068: Unknown result type (might be due to invalid IL or missing references)
				boxCollider = ((Component)this).gameObject.AddComponent<BoxCollider>();
				Bounds bounds = highlight.targetRenderer.bounds;
				Vector3 size = ((Bounds)(ref bounds)).size;
				Vector3 center = ((Bounds)(ref bounds)).center;
				size = ((Component)boxCollider).transform.InverseTransformVector(size);
				center = ((Component)boxCollider).transform.InverseTransformPoint(center);
				boxCollider.size = size;
				boxCollider.center = center;
			}

			public SkinnedMeshRenderer GetTargetRenderer(string cachedName)
			{
				LAILogging.LogMessage("ClickToSelectCharacter.GetTargetRenderer :: Checking cached name " + cachedName + ".", ConfigSetup.LoggingStyle.ObscureSoOnlyDevSees);
				string text = "";
				switch (cachedName)
				{
				case "Commando":
					text = "mdlCommandoDualies/CommandoMesh";
					break;
				case "Huntress":
					text = "mdlHuntress (1)/HuntressMesh";
					break;
				case "Merc":
				case "Engi":
				case "Mage":
				case "Croco":
					text = "mdl" + cachedName + "/" + cachedName + "Mesh";
					break;
				case "Toolbot":
					text = "Base/mdlToolbot/ToolbotMesh";
					break;
				case "Treebot":
					text = "";
					break;
				case "Enforcer":
					text = "meshEnforcer";
					break;
				case "Nemforcer":
					text = "Nemforcer";
					break;
				case "SniperClassic":
					text = "SniperMesh";
					break;
				case "HAND":
				case "HAN-D":
					text = "HAN-DMesh";
					break;
				case "Miner":
					text = "MinerDisplay/MinerBody";
					break;
				case "RobPaladin":
					text = "meshPaladin";
					break;
				case "Chef":
				case "CHEF":
					text = "Chef";
					break;
				}
				Transform val = ((Component)this).gameObject.transform.Find(text);
				if (!(text != "") || !Object.op_Implicit((Object)(object)val))
				{
					return null;
				}
				return ((Component)val).GetComponent<SkinnedMeshRenderer>();
			}

			public SkinnedMeshRenderer GetTargetRendererFallback()
			{
				Transform[] componentsInChildren = ((Component)this).GetComponentsInChildren<Transform>();
				string value = Language.GetString(survivorDef.displayNameToken).ToLower();
				Transform[] array = componentsInChildren;
				foreach (Transform val in array)
				{
					string text = ((Object)val).name.ToLower();
					if (text.Contains(value) && text.Contains("mesh"))
					{
						SkinnedMeshRenderer component = ((Component)val).gameObject.GetComponent<SkinnedMeshRenderer>();
						if (Object.op_Implicit((Object)(object)component))
						{
							return component;
						}
					}
				}
				return null;
			}

			public void OnMouseOver()
			{
				//IL_0066: Unknown result type (might be due to invalid IL or missing references)
				if (screenIsFocused && Input.GetKey((KeyCode)323) && survivorUnlocked)
				{
					LocalUserManager.GetFirstLocalUser().userProfile.SetSurvivorPreference(survivorDef);
					characterSelectController.SetSurvivorInfoPanelActive(true);
					if (Object.op_Implicit((Object)(object)localUser.currentNetworkUser))
					{
						localUser.currentNetworkUser.CallCmdSetBodyPreference(BodyCatalog.FindBodyIndex(survivorDef.bodyPrefab));
					}
				}
			}

			public void OnApplicationFocus(bool hasFocus)
			{
				screenIsFocused = hasFocus;
			}

			public void OnMouseEnter()
			{
				if (Object.op_Implicit((Object)(object)highlight))
				{
					highlight.isOn = true;
				}
			}

			public void OnMouseExit()
			{
				if (Object.op_Implicit((Object)(object)highlight))
				{
					highlight.isOn = false;
				}
			}
		}

		public class LAICameraController : MonoBehaviour
		{
			public static LAICameraController instance;

			public GameObject sceneCamera;

			public static readonly Vector3 _defaultCameraPosition = new Vector3(0f, 1.24f, 0f);

			public readonly Quaternion DefaultCameraRotation = Quaternion.identity;

			private Vector3 desiredPosition;

			private Vector3 _desiredCenterPosition;

			private Vector3 lastDesiredCenterPosition;

			public Quaternion desiredRotation;

			private Vector3 dampPositionVelocity;

			private Quaternion dampRotationVelocity;

			private readonly float screenLimitDistance = 0.25f;

			private readonly float forwardLimit = 5f;

			private readonly float forwardMult = 0.25f;

			public Vector3 rotate_initialPosition;

			public Vector3 rotate_currentPosition;

			public float rotate_multiplier = 2f;

			public Vector3 rotate_defaultRotationChar;

			private bool screenIsFocused = true;

			private Vector3 MousePosition;

			private bool mouse0Click;

			public CharacterSelectController characterSelectController;

			public SurvivorMannequinDioramaController survivorMannequinDioramaController;

			public static bool isFreeCam = false;

			public float freeCamMultiplier = 1f;

			public Vector3 DefaultCameraPosition
			{
				get
				{
					//IL_002c: 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_0013: Unknown result type (might be due to invalid IL or missing references)
					//IL_0019: 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)
					if (LAISceneManager.chosenScene != null && LAISceneManager.chosenScene.cameraPosition != default(Vector3))
					{
						return LAISceneManager.chosenScene.cameraPosition;
					}
					return _defaultCameraPosition;
				}
			}

			public Vector3 DesiredCenterPosition
			{
				get
				{
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					return _desiredCenterPosition;
				}
				set
				{
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					//IL_0007: 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_000e: Unknown result type (might be due to invalid IL or missing references)
					lastDesiredCenterPosition = DesiredCenterPosition;
					_desiredCenterPosition = value;
				}
			}

			public SurvivorMannequinSlotController[] survivorMannequinSlotControllers { get; set; }

			public void Awake()
			{
				//IL_007f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0084: 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_0097: Unknown result type (might be due to invalid IL or missing references)
				//IL_009c: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
				//IL_0073: Unknown result type (might be due to invalid IL or missing references)
				//IL_0078: Unknown result type (might be due to invalid IL or missing references)
				if (!Object.op_Implicit((Object)(object)instance))
				{
					instance = this;
				}
				else
				{
					LAILogging.LogWarning("Two instances of LAICameraController were spawned?", ConfigSetup.LoggingStyle.ObscureSoOnlyDevSees);
				}
				sceneCamera = GameObject.Find("Main Camera/Scene Camera");
				if (!Object.op_Implicit((Object)(object)characterSelectController))
				{
					characterSelectController = Object.FindObjectOfType<CharacterSelectController>();
					survivorMannequinDioramaController = Object.FindObjectOfType<SurvivorMannequinDioramaController>();
					survivorMannequinSlotControllers = survivorMannequinDioramaController.mannequinSlots;
					rotate_defaultRotationChar = new Vector3(0f, 219.0844f, 0f);
				}
				lastDesiredCenterPosition = DefaultCameraPosition;
				DesiredCenterPosition = DefaultCameraPosition;
				desiredPosition = DefaultCameraPosition;
				desiredRotation = DefaultCameraRotation;
				if ((Object)(object)LAICameraManager.CurrentCameraController != (Object)null && (Object)(object)LAICameraManager.CurrentCameraController != (Object)(object)this)
				{
					LAILogging.LogWarning("Somehow there are two camera parallaxes?", ConfigSetup.LoggingStyle.ObscureSoOnlyDevSees);
				}
				LAICameraManager.CurrentCameraController = this;
			}

			public void AdjustRotateSpeed(float speed)
			{
				rotate_multiplier = speed;
			}

			public void OnDestroy()
			{
				LAICameraManager.CurrentCameraController = null;
			}

			public void Update()
			{
				//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_0045: 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_0037: 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_0067: Unknown result type (might be due to invalid IL or missing references)
				//IL_0074: Unknown result type (might be due to invalid IL or missing references)
				//IL_007a: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00af: 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_00b8: 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)
				if (screenIsFocused)
				{
					if (isFreeCam)
					{
						FreeCamPostion();
					}
					else
					{
						MousePosition = Input.mousePosition;
						if (ConfigSetup.Parallax.Value)
						{
							desiredPosition = GetDesiredPositionFromScreenFraction();
						}
						else
						{
							desiredPosition = DesiredCenterPosition;
						}
						if (ConfigSetup.MannequinEnableLocalTurn.Value)
						{
							RotateCamera();
						}
						if (Input.GetKeyDown(ConfigSetup.SIL_ResetCameraKey.Value))
						{
							if (DesiredCenterPosition == DefaultCameraPosition)
							{
								HookMethods.SetCameraFromSurvivor(LocalUserManager.GetFirstLocalUser().userProfile.GetSurvivorPreference().survivorIndex);
							}
							else
							{
								SetCamera();
							}
						}
					}
				}
				DampPosition();
				DampRotation();
			}

			private void DampRotation()
			{
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				//IL_002c: Unknown result type (might be due to invalid IL or missing references)
				sceneCamera.transform.rotation = QuaternionUtil.SmoothDamp(sceneCamera.transform.rotation, desiredRotation, ref dampRotationVelocity, 0.4f);
			}

			public void FreeCamPostion()
			{
				//IL_000e: 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_0028: Unknown result type (might be due to invalid IL or missing references)
				//IL_002d: 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_0056: Unknown result type (might be due to invalid IL or missing references)
				//IL_005b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0060: Unknown result type (might be due to invalid IL or missing references)
				//IL_0073: 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)
				//IL_008e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0093: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f2: 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_010a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0120: Unknown result type (might be due to invalid IL or missing references)
				//IL_0125: Unknown result type (might be due to invalid IL or missing references)
				//IL_012a: Unknown result type (might be due to invalid IL or missing references)
				//IL_013a: Unknown result type (might be due to invalid IL or missing references)
				//IL_013f: Unknown result type (might be due to invalid IL or missing references)
				if (Input.GetKeyDown((KeyCode)273))
				{
					desiredPosition += new Vector3(0f, 0f, freeCamMultiplier);
				}
				if (Input.GetKeyDown((KeyCode)274))
				{
					desiredPosition += new Vector3(0f, 0f, 0f - freeCamMultiplier);
				}
				if (Input.GetKeyDown((KeyCode)276))
				{
					desiredPosition += new Vector3(0f - freeCamMultiplier, 0f, 0f);
				}
				if (Input.GetKeyDown((KeyCode)275))
				{
					desiredPosition += new Vector3(freeCamMultiplier, 0f, 0f);
				}
				if (Input.GetKeyDown((KeyCode)304))
				{
					desiredPosition += new Vector3(0f, freeCamMultiplier, 0f);
				}
				if (Input.GetKeyDown((KeyCode)306))
				{
					desiredPosition += new Vector3(0f, 0f - freeCamMultiplier, 0f);
				}
				if (Input.GetKeyDown((KeyCode)32))
				{
					desiredPosition = DefaultCameraPosition;
				}
				if (Input.GetKeyDown((KeyCode)112))
				{
					LAILogging.LogMessage($"position = new Vector3({desiredPosition.x}f, {desiredPosition.y}f, {desiredPosition.z}f)", ConfigSetup.LoggingStyle.None);
				}
			}

			public void RotateCamera(bool reset = false)
			{
				//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_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				//IL_0091: Unknown result type (might be due to invalid IL or missing references)
				//IL_0096: 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_00aa: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00be: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
				//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
				//IL_007d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0140: 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)
				//IL_014b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0150: Unknown result type (might be due to invalid IL or missing references)
				if (reset)
				{
					rotate_initialPosition = DefaultCameraPosition;
					rotate_currentPosition = DefaultCameraPosition;
					if (survivorMannequinSlotControllers == null)
					{
						LAILogging.LogError("survivorMannequinSlotControllers is missing!", ConfigSetup.LoggingStyle.ObscureSoOnlyDevSees);
						return;
					}
					if ((Object)(object)survivorMannequinSlotControllers[0] == (Object)null)
					{
						LAILogging.LogError("survivorMannequinSlotControllers[0] is missing!", ConfigSetup.LoggingStyle.UserShouldSee);
						return;
					}
					if ((Object)(object)survivorMannequinSlotControllers[0].mannequinInstanceTransform == (Object)null)
					{
						LAILogging.LogError("survivorMannequinSlotControllers[0].mannequinInstanceTransform is missing!", ConfigSetup.LoggingStyle.ObscureSoOnlyDevSees);
						return;
					}
					survivorMannequinSlotControllers[0].mannequinInstanceTransform.eulerAngles = rotate_initialPosition;
				}
				if (Input.GetMouseButtonDown(0))
				{
					rotate_initialPosition = MousePosition;
				}
				if (Input.GetMouseButton(0))
				{
					rotate_currentPosition = MousePosition;
				}
				if (Input.GetMouseButtonUp(0))
				{
					rotate_initialPosition = DefaultCameraPosition;
					rotate_currentPosition = DefaultCameraPosition;
					survivorMannequinSlotControllers[0].mannequinInstanceTransform.eulerAngles = rotate_defaultRotationChar;
				}
				if (survivorMannequinSlotControllers != null && (Object)(object)survivorMannequinSlotControllers[0] != (Object)null && Object.op_Implicit((Object)(object)survivorMannequinSlotControllers[0].mannequinInstanceTransform))
				{
					float num = (rotate_initialPosition.x - rotate_currentPosition.x) * rotate_multiplier;
					survivorMannequinSlotControllers[0].mannequinInstanceTransform.eulerAngles = rotate_defaultRotationChar + num * Vector3.up;
				}
			}

			private void OnApplicationFocus(bool hasFocus)
			{
				screenIsFocused = hasFocus;
			}

			public void DampPosition()
			{
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: 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)
				sceneCamera.transform.position = Vector3.SmoothDamp(sceneCamera.transform.position, desiredPosition, ref dampPositionVelocity, 0.4f, float.PositiveInfinity, Time.deltaTime);
			}

			public Vector3 GetDesiredPositionFromScreenFraction(bool reset = false)
			{
				//IL_0015: 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_0064: Unknown result type (might be due to invalid IL or missing references)
				//IL_0083: 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_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_00d3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
				//IL_0100: Unknown result type (might be due to invalid IL or missing references)
				//IL_0003: 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)
				if (reset)
				{
					return Vector3.one * 0.5f;
				}
				Vector3 result = default(Vector3);
				float num = ((float)Screen.width - MousePosition.x) / (float)Screen.width;
				float num2 = ((float)Screen.height - MousePosition.y) / (float)Screen.height;
				result.x = Mathf.Lerp(DesiredCenterPosition.x + screenLimitDistance, DesiredCenterPosition.x - screenLimitDistance, num);
				result.y = Mathf.Lerp(DesiredCenterPosition.y + screenLimitDistance, DesiredCenterPosition.y - screenLimitDistance, num2);
				float num3 = DesiredCenterPosition.z + Input.mouseScrollDelta.y * forwardMult;
				result.z = Mathf.Clamp(num3, DesiredCenterPosition.z - forwardLimit, DesiredCenterPosition.z + forwardLimit);
				return result;
			}

			public void OnDisable()
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				desiredPosition = DefaultCameraPosition;
			}
		}

		public class DelaySetupMeshCollider : MonoBehaviour
		{
			public float delayInSeconds;

			public MeshCollider meshCollider;

			public Mesh meshToBind;

			private float stopwatch;

			public void Update()
			{
				stopwatch += Time.deltaTime;
				if (stopwatch >= delayInSeconds)
				{
					meshCollider.sharedMesh = meshToBind;
					((Behaviour)this).enabled = false;
				}
			}
		}

		public static void SetCamera(CameraRigController cameraRig, LAILayout.CameraSetting cameraSetting)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			SetCamera(cameraRig, cameraSetting.fov, cameraSetting.position, cameraSetting.rotation);
		}

		public static void SetCamera(CameraRigController cameraRig = null, float fov = 60f, Vector3 position = default(Vector3), Vector3 rotation = default(Vector3))
		{
			//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_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: 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_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: 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_009a: 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_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: 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_00ff: 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_0103: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)cameraRig))
			{
				cameraRig = LAICameraManager.MainCameraRigController;
			}
			float num = 0f;
			if (fov != 60f)
			{
				float num2 = 5f;
				float num3 = fov - num2;
				float num4 = fov + num2;
				float num5 = 3f;
				if (num3 <= cameraRig.baseFov && cameraRig.baseFov <= num4)
				{
					num = Random.Range(0f - num5, num5);
				}
			}
			cameraRig.baseFov = fov + num;
			LAICameraController currentCameraController = LAICameraManager.CurrentCameraController;
			Vector3 val = currentCameraController.DefaultCameraPosition;
			Quaternion val2 = currentCameraController.DefaultCameraRotation;
			if (LAISceneManager.chosenScene != null)
			{
				if (LAISceneManager.chosenScene.cameraPosition != default(Vector3))
				{
					val = LAISceneManager.chosenScene.cameraPosition;
				}
				if (LAISceneManager.chosenScene.cameraRotation != default(Vector3))
				{
					val2 = Quaternion.Euler(LAISceneManager.chosenScene.cameraRotation);
				}
			}
			Vector3 desiredCenterPosition = ((position == default(Vector3)) ? val : position);
			currentCameraController.DesiredCenterPosition = desiredCenterPosition;
			Quaternion desiredRotation = ((rotation == default(Vector3)) ? val2 : Quaternion.Euler(rotation));
			currentCameraController.desiredRotation = desiredRotation;
		}

		public static GameObject CreateDisplay(string bodyPrefabName, Vector3 position, Vector3 rotation, Transform parent = null, bool addCollider = false)
		{
			//IL_0065: 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_0067: Unknown result type (might be due to invalid IL or missing references)
			bool strict = false;
			if (bodyPrefabName.StartsWith("!"))
			{
				strict = true;
				bodyPrefabName = bodyPrefabName.Substring(1);
			}
			GameObject bodyPrefab = GetBodyPrefab(bodyPrefabName, strict);
			if (!Object.op_Implicit((Object)(object)bodyPrefab))
			{
				LAILogging.LogMessage("CreateDisplay :: Aborted, no body prefab found for " + bodyPrefabName, ConfigSetup.LoggingStyle.ObscureSoOnlyDevSees);
				return null;
			}
			SurvivorDef val = SurvivorCatalog.FindSurvivorDefFromBody(bodyPrefab);
			if (!Object.op_Implicit((Object)(object)val))
			{
				LAILogging.LogMessage("CreateDisplay :: Aborted, no SurvivorDef found for " + bodyPrefabName, ConfigSetup.LoggingStyle.ObscureSoOnlyDevSees);
				return null;
			}
			GameObject val2 = Object.Instantiate<GameObject>(val.displayPrefab, position, Quaternion.Euler(rotation), parent);
			LAI_CharDisplayTracker lAI_CharDisplayTracker = val2.AddComponent<LAI_CharDisplayTracker>();
			if (addCollider && ConfigSetup.SIL_ClickOnCharacterToSwap.Value)
			{
				val2.AddComponent<CapsuleCollider>().radius = 1f;
				val2.AddComponent<ClickToSelectCharacter>().survivorDef = val;
			}
			bool hasUnlocked = LocalUserManager.GetFirstLocalUser().userProfile.HasUnlockable(val.unlockableDef);
			lAI_CharDisplayTracker.hasUnlocked = hasUnlocked;
			CharacterModel[] componentsInChildren = ((Component)val2.transform).GetComponentsInChildren<CharacterModel>();
			if (componentsInChildren.Length != 0)
			{
				lAI_CharDisplayTracker.characterModel = componentsInChildren[0];
				lAI_CharDisplayTracker.ToggleShadow(ConfigSetup.SIL_LockedCharactersBlack.Value);
			}
			switch (bodyPrefabName)
			{
			case "Croco":
				((Component)((Component)((Component)val2.transform.Find("mdlCroco")).transform.Find("Spawn")).transform.Find("FloorMesh")).gameObject.SetActive(false);
				break;
			case "Treebot":
				((Behaviour)((Component)val2.transform.Find("ModelBase/mdlTreebot")).gameObject.GetComponent<CharacterModel>()).enabled = false;
				break;
			case "Toolbot":
				((Behaviour)((Component)val2.transform.Find("Base/mdlToolbot")).gameObject.GetComponent<CharacterModel>()).enabled = false;
				break;
			case "HANDOverclocked":
			{
				Transform val3 = LAISceneManager.sceneInstance.transform.Find("HANDTeaser");
				if (Object.op_Implicit((Object)(object)val3))
				{
					((Component)val3).gameObject.SetActive(false);
				}
				break;
			}
			case "RobPaladin":
				if (Chainloader.PluginInfos.ContainsKey("com.rob.Paladin"))
				{
					SetupPaladinDisplay(val2);
				}
				break;
			case "Chef":
				((Behaviour)((Component)val2.transform.Find("mdlChef")).gameObject.GetComponent<CharacterModel>()).enabled = false;
				break;
			}
			LAILayout.LAI_CharacterDisplay lAI_CharacterDisplay = val2.AddComponent<LAILayout.LAI_CharacterDisplay>();
			lAI_CharacterDisplay.bodyName = bodyPrefabName;
			lAI_CharacterDisplay.survivorDef = val;
			return val2;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void SetupPaladinDisplay(GameObject gameObject)
		{
			MenuSound val = default(MenuSound);
			if (gameObject.TryGetComponent<MenuSound>(ref val))
			{
				Object.Destroy((Object)(object)gameObject.GetComponent<MenuSound>());
			}
		}

		public static GameObject GetBodyPrefab(string bodyPrefabName, bool strict = false)
		{
			if (!strict)
			{
				bodyPrefabName += "Body";
			}
			GameObject val = BodyCatalog.FindBodyPrefab(bodyPrefabName);
			if (!Object.op_Implicit((Object)(object)val))
			{
				return null;
			}
			return val;
		}

		public static void SelectScene(string sceneName)
		{
			string text = sceneName.ToLower();
			if (!LAISceneManager.scenesDict.TryGetValue(text, out var value))
			{
				LAILogging.LogWarning("SelectScene :: " + sceneName + " (parsed as '" + text + ")' not found!", ConfigSetup.LoggingStyle.UserShouldSee);
				return;
			}
			if (Object.op_Implicit((Object)(object)LAISceneManager.sceneInstance))
			{
				LAISceneManager.chosenScene.OnDestroy();
				Object.Destroy((Object)(object)LAISceneManager.sceneInstance);
			}
			if (Object.op_Implicit((Object)(object)PreGameController.instance) && Object.op_Implicit((Object)(object)PreGameController.instance.lobbyBackground))
			{
				PreGameController.instance.lobbyBackground.SetActive(false);
			}
			LAIScene lAIScene = (LAISceneManager.chosenScene = (LAIScene)Activator.CreateInstance(value));
			LAISceneManager.chosenSceneAsString = text;
			lAIScene.CreateScene(selectScene: true);
			ConfigSetup.Scene_Selection.Value = text;
		}

		public static void SelectLayout(string layoutName, bool saveChanges = true)
		{
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			string text = layoutName.ToLower();
			if (!LAILayoutManager.layoutsDict.TryGetValue(text, out var value))
			{
				LAILogging.LogWarning("SelectLayout :: " + layoutName + " '(parsed as " + text + ")' not found!", ConfigSetup.LoggingStyle.UserShouldSee);
				return;
			}
			if (Object.op_Implicit((Object)(object)LAILayoutManager.layoutInstance))
			{
				if (ConfigSetup.SIL_SelectedLayout.Value.ToLower() == text)
				{
					return;
				}
				LAILayoutManager.chosenLayout.OnDestroy();
				Object.Destroy((Object)(object)LAILayoutManager.layoutInstance);
			}
			LAILayoutManager.layoutInstance = (LAILayoutManager.chosenLayout = (LAILayout)Activator.CreateInstance(value)).CreateLayout();
			if (saveChanges)
			{
				ConfigSetup.SIL_SelectedLayout.Value = text;
			}
			SetCamera();
		}

		public static string GetDefaultLayoutNameForScene(string sceneName)
		{
			using (Dictionary<string, Type>.Enumerator enumerator = LAILayoutManager.layoutsDict.GetEnumerator())
			{
				if (enumerator.MoveNext())
				{
					KeyValuePair<string, Type> current = enumerator.Current;
					if (current.Key.ToLower().Contains(sceneName.ToLower()) && current.Key.ToLower().Contains("default"))
					{
						return current.Key;
					}
					return "Any_Empty";
				}
			}
			return null;
		}

		public static LoadSceneAndLayoutResult LoadSceneAndLayout(string sceneName, string layoutName = null, bool saveChanges = true)
		{
			bool resultScene = false;
			bool flag = false;
			if (sceneName != null)
			{
				if (!LAISceneManager.scenesDict.ContainsKey(sceneName))
				{
					LAILogging.LogWarning("LoadSceneAndLayout :: Could not find scene \"" + sceneName + "\"!", ConfigSetup.LoggingStyle.UserShouldSee);
				}
				else
				{
					SelectScene(sceneName);
					resultScene = true;
				}
			}
			if (Utility.IsNullOrWhiteSpace(layoutName))
			{
				layoutName = ((LAISceneManager.chosenScene.PreferredLayout != null) ? LAISceneManager.chosenScene.PreferredLayout : "Any_Empty");
			}
			SelectLayout(layoutName, saveChanges);
			flag = true;
			return UnderstandConceptOfLove(resultScene, flag);
		}

		public static LoadSceneAndLayoutResult UnderstandConceptOfLove(bool resultScene, bool resultLayout)
		{
			if (resultScene && resultLayout)
			{
				return LoadSceneAndLayoutResult.Loaded;
			}
			if (resultScene && !resultLayout)
			{
				return LoadSceneAndLayoutResult.NoLayout;
			}
			if (!resultScene && resultLayout)
			{
				return LoadSceneAndLayoutResult.NoScene;
			}
			return LoadSceneAndLayoutResult.NoSceneNoLayout;
		}
	}
	public static class SceneMethods
	{
		public static List<string> GetScenes()
		{
			return LAISceneManager.sceneNameList;
		}
	}
	public static class HookMethods
	{
		public static void Hook_MusicChoice(string value)
		{
			ConfigSetup.MusicChoice.Value = value;
			LAIMusicManager.OnSceneLoaded();
		}

		public static void Hook_UI_ShowFade(bool value)
		{
			ConfigSetup.UI_ShowFade.Value = value;
			((Component)LAIPlugin.CharSelUITransform.Find("BottomSideFade")).gameObject.SetActive(value);
			((Component)LAIPlugin.CharSelUITransform.Find("TopSideFade")).gameObject.SetActive(value);
		}

		public static void Hook_Lobby_DisableShaking(bool value)
		{
			ConfigSetup.Lobby_Shaking.Value = value;
			List<PreGameShakeController> instancesList = InstanceTracker.GetInstancesList<PreGameShakeController>();
			if (instancesList.Count > 0 && Object.op_Implicit((Object)(object)instancesList[0]))
			{
				((Component)instancesList[0]).gameObject.SetActive(ConfigSetup.Lobby_Shaking.Value);
			}
			foreach (LAIScene.ShakingMarker instances in InstanceTracker.GetInstancesList<LAIScene.ShakingMarker>())
			{
				foreach (GameObject shakingObject in instances.shakingObjects)
				{
					shakingObject.SetActive(value);
				}
				foreach (ShakeEmitter shakeEmitter in instances.shakeEmitters)
				{
					((Behaviour)shakeEmitter).enabled = value;
				}
			}
		}

		public static void Hook_UI_BlurOpacity(int value)
		{
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: 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_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			float num = Mathf.Clamp((float)value, 0f, 100f);
			ConfigSetup.UI_BlurOpacity.Value = Mathf.CeilToInt(num);
			Transform transform = ((Component)LAIPlugin.CharSelUITransform.Find("SafeArea")).transform;
			Transform val = transform.Find("LeftHandPanel (Layer: Main)");
			Transform obj = transform.Find("RightHandPanel");
			float num2 = (float)ConfigSetup.UI_BlurOpacity.Value / 100f;
			TranslucentImage component = ((Component)val.Find("BlurPanel")).GetComponent<TranslucentImage>();
			((Graphic)component).color = new Color(((Graphic)component).color.r, ((Graphic)component).color.g, ((Graphic)component).color.b, num2);
			TranslucentImage component2 = ((Component)obj.Find("RuleVerticalLayout").Find("BlurPanel")).GetComponent<TranslucentImage>();
			((Graphic)component2).color = new Color(((Graphic)component2).color.r, ((Graphic)component2).color.g, ((Graphic)component2).color.b, num2);
			LAILogging.LogMessage($"Transparency Value: {num2}" + $"\nColor transparency: {((Graphic)component).color.a}", ConfigSetup.LoggingStyle.ObscureSoOnlyDevSees);
		}

		public static void Hook_UIScale(float value)
		{
			//IL_0036: 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_0046: 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)
			ConfigSetup.UI_Scale.Value = value;
			Transform transform = ((Component)LAIPlugin.CharSelUITransform.Find("SafeArea")).transform;
			Transform val = transform.Find("LeftHandPanel (Layer: Main)");
			Transform obj = transform.Find("RightHandPanel");
			val.localScale = Vector3.one * value;
			obj.localScale = Vector3.one * value;
		}

		public static void Hook_Overlay_ShowPostProcessing(bool value)
		{
			ConfigSetup.PostProcessing.Value = value;
			if (!Object.op_Implicit((Object)(object)LAISceneManager.sceneInstance))
			{
				return;
			}
			Transform val = LAISceneManager.sceneInstance.transform.Find("PP");
			if (Object.op_Implicit((Object)(object)val))
			{
				((Component)val).gameObject.SetActive(value);
			}
			foreach (LAIScene.PostProcessingMarker instances in InstanceTracker.GetInstancesList<LAIScene.PostProcessingMarker>())
			{
				foreach (GameObject postProcessingObject in instances.postProcessingObjects)
				{
					postProcessingObject.SetActive(value);
				}
			}
		}

		public static void Hook_LightUpdate_Color(Color color)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			ConfigSetup.Light_Color.Value = color;
			UpdateDirectionalLight();
		}

		public static void Hook_LightUpdate_Flicker(bool flicker)
		{
			ConfigSetup.Light_Flicker.Value = flicker;
			UpdateDirectionalLight();
		}

		public static void Hook_LightUpdate_Intensity(float intensity)
		{
			ConfigSetup.Light_Intensity.Value = intensity;
			UpdateDirectionalLight();
		}

		public static void UpdateDirectionalLight()
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: 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_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)LAISceneManager.sceneInstance) && Object.op_Implicit((Object)(object)Lobby.DirectionalLight))
			{
				Light component = Lobby.DirectionalLight.GetComponent<Light>();
				component.color = new Color(ConfigSetup.Light_Color.Value.r / 255f, ConfigSetup.Light_Color.Value.g / 255f, ConfigSetup.Light_Color.Value.b / 255f, ConfigSetup.Light_Color.Value.a / 255f);
				component.intensity = ConfigSetup.Light_Intensity.Value;
				FlickerLight component2 = Lobby.DirectionalLight.GetComponent<FlickerLight>();
				((Behaviour)component2).enabled = ConfigSetup.Light_Flicker.Value;
				component2.initialLightIntensity = ConfigSetup.Light_Intensity.Value;
				component.intensity = ConfigSetup.Light_Intensity.Value;
			}
		}

		public static void Hook_RescalePads(float size)
		{
			//IL_0024: 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)
			ConfigSetup.MannequinScale.Value = size;
			GameObject gameObject = ((Component)Object.FindObjectOfType<SurvivorMannequinDioramaController>()).gameObject;
			if (Object.op_Implicit((Object)(object)gameObject))
			{
				gameObject.transform.localScale = Vector3.one * size;
			}
		}

		public static void Hook_Rotate_Toggle(bool value)
		{
			ConfigSetup.MannequinEnableLocalTurn.Value = value;
			if (Object.op_Implicit((Object)(object)LAICameraManager.CurrentCameraController))
			{
				LAICameraManager.CurrentCameraController.RotateCamera(reset: true);
			}
		}

		public static void Hook_Rotate_Speed(float speed)
		{
			ConfigSetup.MannequinEnableLocalTurnMultiplier.Value = speed;
			if (Object.op_Implicit((Object)(object)LAICameraManager.CurrentCameraController))
			{
				LAICameraManager.CurrentCameraController.AdjustRotateSpeed(speed);
			}
		}

		public static void Hook_Lobby_HideProps(bool value)
		{
			ConfigSetup.MeshProps.Value = value;
			string[] meshPropNames = Lobby.MeshPropNames;
			for (int i = 0; i < meshPropNames.Length; i++)
			{
				GameObject val = GameObject.Find(meshPropNames[i]);
				if (Object.op_Implicit((Object)(object)val))
				{
					val.SetActive(ConfigSetup.MeshProps.Value);
				}
			}
			Hook_Lobby_HidePhysicsProps(ConfigSetup.PhysicsProps.Value);
		}

		public static void Hook_Lobby_HidePhysicsProps(bool value)
		{
			ConfigSetup.PhysicsProps.Value = value;
			if (!(LAISceneManager.chosenScene is Lobby))
			{
				return;
			}
			if (!Object.op_Implicit((Object)(object)Lobby.MeshPropsRef))
			{
				LAILogging.LogWarning("Hook_HidePhysicsProps: Missing MeshPropsRef for Lobby scene", ConfigSetup.LoggingStyle.ObscureSoOnlyDevSees);
				return;
			}
			Transform transform = Lobby.MeshPropsRef.transform;
			if (!Object.op_Implicit((Object)(object)transform))
			{
				return;
			}
			string[] physicsPropNames = Lobby.PhysicsPropNames;
			foreach (string text in physicsPropNames)
			{
				Transform val = transform.Find(text);
				if (Object.op_Implicit((Object)(object)val))
				{
					((Component)val).gameObject.SetActive(value);
				}
			}
		}

		public static void Hook_Overlay_Parallax(bool value)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			ConfigSetup.Parallax.Value = value;
			if (Object.op_Implicit((Object)(object)LAICameraManager.CurrentCameraController))
			{
				LAICameraManager.CurrentCameraController.GetDesiredPositionFromScreenFraction(reset: true);
			}
		}

		public static void Hook_ToggleSceneHeaderVisibility(bool value)
		{
			ConfigSetup.Scene_Header.Value = value;
			if (LAISceneManager.chosenScene != null)
			{
				LAISceneManager.TitleInstance.SetActive(value);
				LAISceneManager.SubTitleInstance.SetActive(value);
				LAISceneManager.LayoutTitleInstance.SetActive(value);
			}
		}

		public static void Hook_ToggleSceneSeerVisibility(bool value)
		{
			ConfigSetup.Scene_Seer.Value = value;
			if (LAISceneManager.chosenScene != null)
			{
				LAISceneManager.SeerTextInstance.SetActive(value);
			}
		}

		public static void Hook_BlackenSurvivors(bool value)
		{
			ConfigSetup.SIL_LockedCharactersBlack.Value = value;
			List<Methods.LAI_CharDisplayTracker> instancesList = InstanceTracker.GetInstancesList<Methods.LAI_CharDisplayTracker>();
			if (instancesList == null || instancesList.Count == 0)
			{
				return;
			}
			foreach (Methods.LAI_CharDisplayTracker item in instancesList)
			{
				if (Object.op_Implicit((Object)(object)item))
				{
					item.ToggleShadow(value);
				}
			}
		}

		public static void Hook_ToggleZooming(bool value)
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might b