Decompiled source of LobbyAppearanceImprovements v1.2.0

LobbyAppearanceImprovements.dll

Decompiled 2 months ago
using System;
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 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.Scenes;
using Microsoft.CodeAnalysis;
using On.RoR2;
using On.RoR2.SurvivorMannequins;
using On.RoR2.UI;
using On.RoR2.UI.MainMenu;
using PaladinMod.Misc;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.SurvivorMannequins;
using RoR2.UI;
using RoR2.UI.MainMenu;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.EventSystems;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: OptIn]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("LobbyAppearanceImprovements")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Mod for Risk of Rain 2")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+9050a1e79a0b3e167c4b92614c561fd5da67baae")]
[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]
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
	[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_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: 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_0026: 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_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)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		Quaternion val = default(Quaternion);
		((Quaternion)(ref val))..ctor(AngVel.x, AngVel.y, AngVel.z, 0f);
		Quaternion val2 = val * Current;
		return new Quaternion(0.5f * val2.x, 0.5f * val2.y, 0.5f * val2.z, 0.5f * val2.w);
	}

	public static Vector3 DerivToAngVel(Quaternion Current, Quaternion Deriv)
	{
		//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_0003: 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)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: 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_003a: 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_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_0013: 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_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: 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)
		//IL_0037: 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_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)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: 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_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: 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_0081: 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)
		//IL_0084: 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_001b: 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_0013: 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_015c: 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_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: 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_00ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fa: 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_0133: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_0147: Unknown result type (might be due to invalid IL or missing references)
		//IL_014d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0153: Unknown result type (might be due to invalid IL or missing references)
		//IL_0158: 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);
		float num2 = ((num > 0f) ? 1f : (-1f));
		target.x *= num2;
		target.y *= num2;
		target.z *= num2;
		target.w *= num2;
		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.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	[ExcludeFromCodeCoverage]
	[DebuggerNonUserCode]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	[ExcludeFromCodeCoverage]
	[DebuggerNonUserCode]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	[ExcludeFromCodeCoverage]
	[DebuggerNonUserCode]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	[ExcludeFromCodeCoverage]
	[DebuggerNonUserCode]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	[ExcludeFromCodeCoverage]
	[DebuggerNonUserCode]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	[ExcludeFromCodeCoverage]
	[DebuggerNonUserCode]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[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;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	[ExcludeFromCodeCoverage]
	[DebuggerNonUserCode]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	[ExcludeFromCodeCoverage]
	[DebuggerNonUserCode]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	[ExcludeFromCodeCoverage]
	[DebuggerNonUserCode]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
}
namespace LobbyAppearanceImprovements
{
	public static class Commands
	{
		[ConCommand(/*Could not decode attribute arguments.*/)]
		public static void CMD_SpawnPrefab(ConCommandArgs args)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: 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)
			string argString = ((ConCommandArgs)(ref args)).GetArgString(0);
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)argString).WaitForCompletion();
			GameObject val2 = Object.Instantiate<GameObject>(val);
			val2.transform.position = new Vector3(((ConCommandArgs)(ref args)).GetArgFloat(1), ((ConCommandArgs)(ref args)).GetArgFloat(2), ((ConCommandArgs)(ref args)).GetArgFloat(3));
		}

		public static void CMD_SpawnRestraintBar(ConCommandArgs args)
		{
			GameObject val = Object.Instantiate<GameObject>(SceneSetup.ContactLight_RestraintBar, Survivors.Commando.displayPrefab.transform);
		}

		[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)
					{
						LAILayout lAILayout = (LAILayout)Activator.CreateInstance(item.Value);
						if (lAILayout.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_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_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: 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;
			string text = "{ \"" + name + "\", new [] {new Vector3(" + footPosition.x + "f, " + footPosition.y + "f, " + footPosition.z + "f), new Vector3(" + rotation.x + ", " + rotation.y + "f, " + rotation.z + "f) } },";
			Debug.Log((object)text);
		}
	}
	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<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> Shaking { get; set; }

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

		public static ConfigEntry<bool> Scene_Header { 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_00cf: Unknown result type (might be due to invalid IL or missing references)
			string 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.");
			Shaking = config.Bind<bool>(text, "Shaking", false, "Toggles any shaking that may happen during by the scene itself. Does not toggle shaking generated from character displays.");
			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.");
			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_0001: 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_0017: Expected O, but got Unknown
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Expected O, but got Unknown
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Expected O, but got Unknown
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Expected O, but got Unknown
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Expected O, but got Unknown
			//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Expected O, but got Unknown
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Expected O, but got Unknown
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bd: Expected O, but got Unknown
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0325: Expected O, but got Unknown
			//IL_039f: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a9: Expected O, but got Unknown
			//IL_03f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fe: Expected O, but got Unknown
			//IL_045c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0466: Expected O, but got Unknown
			//IL_04cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d7: Expected O, but got Unknown
			//IL_0522: Unknown result type (might be due to invalid IL or missing references)
			//IL_052c: Expected O, but got Unknown
			//IL_0577: Unknown result type (might be due to invalid IL or missing references)
			//IL_0581: Expected O, but got Unknown
			//IL_05e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f2: Expected O, but got Unknown
			//IL_0637: Unknown result type (might be due to invalid IL or missing references)
			//IL_0641: Expected O, but got Unknown
			//IL_0686: Unknown result type (might be due to invalid IL or missing references)
			//IL_0690: Expected O, but got Unknown
			//IL_06c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d1: Expected O, but got Unknown
			//IL_071c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0726: Expected O, but got Unknown
			//IL_07bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c5: Expected O, but got Unknown
			inLobbyConfigEntry = new ModConfigEntry
			{
				DisplayName = "Lobby Appearance Improvements"
			};
			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["Background Elements"] = new List<IConfigField>
			{
				(IConfigField)new BooleanConfigField(((ConfigEntryBase)MeshProps).Definition.Key, ((ConfigEntryBase)MeshProps).Description.Description, (Func<bool>)(() => MeshProps.Value), (Action<bool>)HookMethods.Hook_HideProps),
				(IConfigField)new BooleanConfigField(((ConfigEntryBase)PhysicsProps).Definition.Key, ((ConfigEntryBase)PhysicsProps).Description.Description, (Func<bool>)(() => PhysicsProps.Value), (Action<bool>)HookMethods.Hook_HidePhysicsProps),
				(IConfigField)new BooleanConfigField(((ConfigEntryBase)Shaking).Definition.Key, ((ConfigEntryBase)Shaking).Description.Description, (Func<bool>)(() => Shaking.Value), (Action<bool>)HookMethods.Hook_DisableShaking)
			};
			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 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)
			};
			ModConfigCatalog.Add(inLobbyConfigEntry);
		}

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

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

		public static void SetSceneLayoutFromLobby(bool value)
		{
			if (value)
			{
				Methods.LoadSceneAndLayoutResult loadSceneAndLayoutResult = Methods.LoadSceneAndLayout(tempSceneName, tempLayoutName);
				tempConfirmChoice = false;
				switch (loadSceneAndLayoutResult)
				{
				case Methods.LoadSceneAndLayoutResult.NoSceneNoLayout:
					break;
				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;
				}
			}
		}
	}
	internal static class LAICameraManager
	{
		public class CameraController : MonoBehaviour
		{
			public float fov = 60f;

			public float pitch = 0f;

			public float yaw = 0f;

			public bool restart = false;

			public bool logit = false;

			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_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: 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;
		}
	}
	public static class LAILanguage
	{
		public static void Init()
		{
			LanguageAPI.Add("LAI_MAP_CAPTAINSHELM_TITLE", "Captain's Helm");
			LanguageAPI.Add("LAI_MAP_CAPTAINSHELM_SUBTITLE", "Stargazing Platform");
			LanguageAPI.Add("LAI_MAP_CONTACTLIGHT_TITLE", "Contact Light");
			LanguageAPI.Add("LAI_MAP_CONTACTLIGHT_SUBTITLE", "Emergency Pods");
			LanguageAPI.Add("LAI_MAP_CONTACTLIGHT_RANDOMVOIDPLANET", "Consumed Planet");
			LanguageAPI.Add("LAI_MAP_CONTACTLIGHT_RANDOMVOIDPLANET", "An Echo");
			LanguageAPI.Add("LAI_MAP_LOBBY_TITLE", "UES SAFE TRAVELS");
			LanguageAPI.Add("LAI_MAP_LOBBY_SUBTITLE", "Captain's Ship");
			LanguageAPI.Add("LAI_MAP_LOBBY_INFINITETOWER_TITLE", "U?S ??FE TR?V??S");
			LanguageAPI.Add("LAI_MAP_LOBBY_INFINITETOWER_SUBTITLE", "C?p??in's S??p");
			LanguageAPI.Add("LAI_MAP_LOBBYMULTI_TITLE", "Survivor's Room");
			LanguageAPI.Add("LAI_MAP_LOBBYMULTI_SUBTITLE", "The Multi Before The Play");
			LanguageAPI.Add("LAI_MAP_VOIDOUTROFLOOR_TITLE", "Sunk t' Nadir");
			LanguageAPI.Add("LAI_MAP_VOIDOUTROFLOOR_SUBTITLE", "The Ocean Floor");
			LanguageAPI.Add("LAI_MAP_TITLE_FORMAT", "{0}");
			LanguageAPI.Add("LAI_MAP_SUBTTILE_FORMAT", "<color=grey>{0}</color>");
			LanguageAPI.Add("LAI_MAP_LAYOUT_FORMAT", "<color=grey>{0}</color>");
			LanguageAPI.Add("LAI_LAYOUT_ROR2_TITLE", "Risk of Rain, Too");
			LanguageAPI.Add("LAI_LAYOUT_PALADINONLY_TITLE", "Paladin's Entrance");
			LanguageAPI.Add("LAI_LAYOUT_CAPTAINSHELM_TITLE", "Outlook");
			LanguageAPI.Add("LAI_LAYOUT_MOONDEFAULT_TITLE", "Silence");
			LanguageAPI.Add("LAI_EMPTY_TITLE", "");
		}
	}
	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;
	}
	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__1_0;

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

		public static SurvivorMannequinDioramaController mannequinDioramaController;

		public static void Init()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			object obj = <>c.<>9__1_0;
			if (obj == null)
			{
				hook_OnEnable val = delegate(orig_OnEnable orig, SurvivorMannequinDioramaController self)
				{
					mannequinDioramaController = self;
					orig.Invoke(self);
				};
				<>c.<>9__1_0 = val;
				obj = (object)val;
			}
			SurvivorMannequinDioramaController.OnEnable += (hook_OnEnable)obj;
		}
	}
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.DestroyedClone.LobbyAppearanceImprovements", "LobbyAppearanceImprovements", "1.2.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency("com.bepis.r2api", "4.3.5")]
	[R2APISubmoduleDependency(new string[] { "SceneAssetAPI" })]
	[R2APISubmoduleDependency(new string[] { "R2API" })]
	[R2APISubmoduleDependency(new string[] { "PrefabAPI" })]
	[R2APISubmoduleDependency(new string[] { "LanguageAPI" })]
	public class LAIPlugin : BaseUnityPlugin
	{
		public const string ModVer = "1.2.0";

		public const string ModName = "LobbyAppearanceImprovements";

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

		public static Transform CharSelUITransform;

		public static Transform LAITitleRef;

		private static CharacterSelectController _characterSelectController;

		public static StringBuilder stringBuilder = new StringBuilder();

		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_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Expected O, but got Unknown
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			LAILogging.Init(((BaseUnityPlugin)this).Logger);
			ConfigSetup.Initialize(((BaseUnityPlugin)this).Config);
			LAILanguage.Init();
			LAIMannequinManager.Init();
			LAICameraManager.Init();
			CharacterSelectController.Awake += new hook_Awake(CharacterSelectController_Awake);
			LAISceneManager.Initialize();
			MainMenuController.Start += new hook_Start(DeferredAssemblySetup);
		}

		private void CacheSkyboxMaterial(Stage obj)
		{
			stringBuilder.AppendLine($"{obj.sceneDef.cachedName} - {RenderSettings.skybox} - {((Object)RenderSettings.skybox).name}");
			Debug.Log((object)stringBuilder.ToString());
		}

		private void DeferredAssemblySetup(orig_Start orig, MainMenuController self)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			orig.Invoke(self);
			AssemblySetup();
			MainMenuController.Start -= new hook_Start(DeferredAssemblySetup);
		}

		private void CharacterSelectController_Awake(orig_Awake orig, CharacterSelectController self)
		{
			orig.Invoke(self);
			CharacterSelectController = self;
			if (SceneManager.sceneCount == 1)
			{
				if (!Object.op_Implicit((Object)(object)((Component)self).gameObject.GetComponent<Methods.LAICameraController>()))
				{
					((Component)self).gameObject.AddComponent<Methods.LAICameraController>();
				}
				CharSelUITransform = GameObject.Find("CharacterSelectUI").transform;
				ValidateConfig();
				Methods.LoadSceneAndLayout(ConfigSetup.Scene_Selection.Value, ConfigSetup.SIL_SelectedLayout.Value);
				LAITitleRef = self.activeSurvivorInfoPanel.transform.Find("SurvivorNamePanel/SurvivorName");
				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_DisableShaking(ConfigSetup.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.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
	{
		private class TitleRefEnsurer : MonoBehaviour
		{
			public bool foundRef = false;

			public float stopwatch;

			private const float cooldown = 1f;

			private void Awake()
			{
				stopwatch = 1f;
			}

			private void FixedUpdate()
			{
				stopwatch -= Time.fixedDeltaTime;
				if (stopwatch < 0f)
				{
					stopwatch = 1f;
					Transform val = ((Component)LAIPlugin.CharacterSelectController).transform.Find("SurvivorNamePanel/SurvivorName");
					if (Object.op_Implicit((Object)(object)val))
					{
						LAIPlugin.LAITitleRef = val;
					}
					if (Object.op_Implicit((Object)(object)LAIPlugin.LAITitleRef))
					{
						LAILogging.LogMessage("Found the titleref!", ConfigSetup.LoggingStyle.UserShouldSee);
						CreateOrUpdateHeaderText();
						((Behaviour)this).enabled = false;
						Object.Destroy((Object)(object)((Component)this).gameObject);
					}
				}
			}
		}

		public static LAIScene chosenScene = null;

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

		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 void Initialize()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: 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));
		}

		private static void OnSceneLoaded(LAIScene scene)
		{
			HookMethods.Hook_DisableShaking(ConfigSetup.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_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)LAIPlugin.LAITitleRef))
			{
				LAILogging.LogMessage("LAITITLEREF missing, attempting spawn", ConfigSetup.LoggingStyle.UserShouldSee);
				new GameObject("LAI_TEMP_ENSUREHEADERREF").AddComponent<TitleRefEnsurer>();
				return;
			}
			LAILogging.LogMessage("LAITITLEREF existing!, attempting spawn", ConfigSetup.LoggingStyle.UserShouldSee);
			if (!Object.op_Implicit((Object)(object)TitleInstance))
			{
				TitleInstance = Object.Instantiate<GameObject>(((Component)LAIPlugin.LAITitleRef).gameObject, ((Component)LAIPlugin.CharacterSelectController).transform);
				((Object)TitleInstance).name = "LobbyAppearanceImprovements_Scene_Title";
				TitleInstance.transform.localPosition = new Vector3(0f, 450f, 0f);
			}
			((TMP_Text)TitleInstance.GetComponent<HGTextMeshProUGUI>()).text = Language.GetString(chosenScene.SceneTitleToken);
			if (!Object.op_Implicit((Object)(object)SubTitleInstance))
			{
				SubTitleInstance = Object.Instantiate<GameObject>(((Component)LAIPlugin.LAITitleRef).gameObject, ((Component)LAIPlugin.CharacterSelectController).transform);
				((Object)SubTitleInstance).name = "LobbyAppearanceImprovements_Scene_Subtitle";
				SubTitleInstance.transform.localPosition = new Vector3(0f, 500f, 300f);
			}
			((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>(((Component)LAIPlugin.LAITitleRef).gameObject, ((Component)LAIPlugin.CharacterSelectController).transform);
				((Object)LayoutTitleInstance).name = "LobbyAppearanceImprovements_Layout_Title";
				LayoutTitleInstance.transform.localPosition = new Vector3(0f, 600f, 800f);
			}
			((TMP_Text)LayoutTitleInstance.GetComponent<HGTextMeshProUGUI>()).text = Language.GetStringFormatted("LAI_MAP_LAYOUT_FORMAT", new object[1] { Language.GetString(LAILayoutManager.chosenLayout.LayoutTitleToken) });
			HookMethods.Hook_ToggleSceneHeaderVisibility(ConfigSetup.Scene_Header.Value);
		}
	}
	public static class Methods
	{
		public class LAI_CharDisplayTracker : MonoBehaviour
		{
			public CharacterModel characterModel;

			public bool hasUnlocked = false;

			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 = false;

			public LocalUser localUser;

			private CharacterSelectController characterSelectController;

			private bool screenIsFocused = true;

			public void Start()
			{
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0042: 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)
				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) ? 3 : 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_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: 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_002f: 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_003b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0048: Unknown result type (might be due to invalid IL or missing references)
				boxCollider = ((Component)this).gameObject.AddComponent<BoxCollider>();
				Renderer targetRenderer = highlight.targetRenderer;
				Bounds bounds = targetRenderer.bounds;
				Vector3 size = ((Bounds)(ref bounds)).size;
				Vector3 center = ((Bounds)(ref bounds)).center;
				boxCollider.size = size;
				boxCollider.center = center;
			}

			public void SetupBoxColliderOld()
			{
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: 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_002f: 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_0041: 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_0052: 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_0058: 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_006c: Unknown result type (might be due to invalid IL or missing references)
				boxCollider = ((Component)this).gameObject.AddComponent<BoxCollider>();
				Renderer targetRenderer = highlight.targetRenderer;
				Bounds bounds = 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.UserShouldSee);
				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);
				return (text != "" && Object.op_Implicit((Object)(object)val)) ? ((Component)val).GetComponent<SkinnedMeshRenderer>() : null;
			}

			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_0077: 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 string sepDefaults = "==Defaults==";

			public string setpParallax = "==Parallax==";

			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 string sepZoom = "==Zoom==";

			public string sepRotate = "==Rotate==";

			public Vector3 rotate_initialPosition;

			public Vector3 rotate_currentPosition;

			public float rotate_multiplier = 2f;

			public Vector3 rotate_defaultRotationChar;

			public string setpOther = "==Other==";

			private bool screenIsFocused = true;

			private Vector3 MousePosition;

			private bool mouse0Click = false;

			public CharacterSelectController characterSelectController;

			public SurvivorMannequinDioramaController survivorMannequinDioramaController = null;

			public static bool isFreeCam;

			public float freeCamMultiplier = 1f;

			public Vector3 DefaultPosition { get; private set; }

			public Quaternion DefaultRotation { get; private set; }

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

			public SurvivorMannequinSlotController[] survivorMannequinSlotControllers { get; set; }

			public void Awake()
			{
				//IL_0046: 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_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_00cc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d9: 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_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_00b3: 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)
				if (!Object.op_Implicit((Object)(object)instance))
				{
					instance = this;
				}
				else
				{
					LAILogging.LogWarning("Two instances of LAICameraController were spawned?", ConfigSetup.LoggingStyle.UserShouldSee);
				}
				sceneCamera = GameObject.Find("Main Camera/Scene Camera");
				DefaultPosition = sceneCamera.transform.position;
				DefaultRotation = sceneCamera.transform.rotation;
				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 = DefaultPosition;
				DesiredCenterPosition = DefaultPosition;
				desiredPosition = DefaultPosition;
				desiredRotation = DefaultRotation;
				if ((Object)(object)LAICameraManager.CurrentCameraController != (Object)null && (Object)(object)LAICameraManager.CurrentCameraController != (Object)(object)this)
				{
					LAILogging.LogWarning("Somehow there are two camera parallaxes?", ConfigSetup.LoggingStyle.UserShouldSee);
				}
				LAICameraManager.CurrentCameraController = this;
			}

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

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

			public void Update()
			{
				//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_0043: Unknown result type (might be due to invalid IL or missing references)
				//IL_0048: 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_007a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0080: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b6: 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_00c0: 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_00a0: 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();
						}
						if (ConfigSetup.MannequinEnableLocalTurn.Value)
						{
							RotateCamera();
						}
						if (Input.GetKeyDown(ConfigSetup.SIL_ResetCameraKey.Value))
						{
							if (DesiredCenterPosition == DefaultPosition)
							{
								HookMethods.SetCameraFromSurvivor(LocalUserManager.GetFirstLocalUser().userProfile.GetSurvivorPreference().survivorIndex);
							}
							else
							{
								SetCamera();
							}
						}
					}
				}
				DampPosition();
				DampRotation();
			}

			private void DampRotation()
			{
				//IL_0017: 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_002d: 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_0012: 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_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_0048: Unknown result type (might be due to invalid IL or missing references)
				//IL_005e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0063: 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_007f: 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_009f: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ee: 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_0108: Unknown result type (might be due to invalid IL or missing references)
				//IL_010d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0126: Unknown result type (might be due to invalid IL or missing references)
				//IL_013c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0141: 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_015c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0161: 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 = DefaultPosition;
				}
				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_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_0018: 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_00b7: 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_00d1: 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_00eb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f0: 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_00fc: Unknown result type (might be due to invalid IL or missing references)
				//IL_010f: 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_0181: Unknown result type (might be due to invalid IL or missing references)
				//IL_0188: Unknown result type (might be due to invalid IL or missing references)
				//IL_018d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0192: Unknown result type (might be due to invalid IL or missing references)
				if (reset)
				{
					rotate_initialPosition = DefaultPosition;
					rotate_currentPosition = DefaultPosition;
					if (survivorMannequinSlotControllers == null)
					{
						LAILogging.LogError("survivorMannequinSlotControllers is missing!", ConfigSetup.LoggingStyle.UserShouldSee);
						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.UserShouldSee);
						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 = DefaultPosition;
					rotate_currentPosition = DefaultPosition;
					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;
					float num2 = num * rotate_multiplier;
					survivorMannequinSlotControllers[0].mannequinInstanceTransform.eulerAngles = rotate_defaultRotationChar + num2 * Vector3.up;
				}
			}

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

			public void DampPosition()
			{
				//IL_0017: 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_0037: 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_0021: Unknown result type (might be due to invalid IL or missing references)
				//IL_005e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0070: 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_00be: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c8: 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_00f1: Unknown result type (might be due to invalid IL or missing references)
				//IL_010c: Unknown result type (might be due to invalid IL or missing references)
				//IL_010d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0009: Unknown result type (might be due to invalid IL or missing references)
				//IL_0013: 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_0111: 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_0003: 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)
				desiredPosition = DefaultPosition;
			}
		}

		public class DelaySetupMeshCollider : MonoBehaviour
		{
			public float delayInSeconds;

			public MeshCollider meshCollider;

			public Mesh meshToBind;

			private float stopwatch = 0f;

			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_000b: 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)
			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_0088: 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_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: 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_00b5: 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_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: 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)
			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 desiredCenterPosition = ((position == default(Vector3)) ? currentCameraController.DefaultPosition : position);
			currentCameraController.DesiredCenterPosition = desiredCenterPosition;
			Quaternion desiredRotation = ((rotation == default(Vector3)) ? currentCameraController.DefaultRotation : Quaternion.Euler(rotation));
			currentCameraController.desiredRotation = desiredRotation;
		}

		public static GameObject CreateDisplay(string bodyPrefabName, Vector3 position, Vector3 rotation, Transform parent = null, bool addCollider = false)
		{
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: 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)
			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.UserShouldSee);
				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.UserShouldSee);
				return null;
			}
			GameObject displayPrefab = val.displayPrefab;
			GameObject val2 = Object.Instantiate<GameObject>(displayPrefab, position, Quaternion.Euler(rotation), parent);
			LAI_CharDisplayTracker lAI_CharDisplayTracker = val2.AddComponent<LAI_CharDisplayTracker>();
			if (addCollider && ConfigSetup.SIL_ClickOnCharacterToSwap.Value)
			{
				CapsuleCollider val3 = val2.AddComponent<CapsuleCollider>();
				val3.radius = 1f;
				ClickToSelectCharacter clickToSelectCharacter = val2.AddComponent<ClickToSelectCharacter>();
				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 val4 = LAISceneManager.sceneInstance.transform.Find("HANDTeaser");
				if (Object.op_Implicit((Object)(object)val4))
				{
					((Component)val4).gameObject.SetActive(false);
				}
				break;
			}
			case "RobPaladin":
				if (Chainloader.PluginInfos.ContainsKey("com.rob.Paladin"))
				{
					SetupPaladinDisplay(val2);
				}
				break;
			}
			return val2;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void SetupPaladinDisplay(GameObject gameObject)
		{
			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);
			}
			(LAISceneManager.chosenScene = (LAIScene)Activator.CreateInstance(value)).CreateScene(selectScene: true);
			ConfigSetup.Scene_Selection.Value = text;
		}

		public static void SelectLayout(string layoutName, bool saveChanges = true)
		{
			//IL_00d6: 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_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: 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_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_DisableShaking(bool value)
		{
			ConfigSetup.Shaking.Value = value;
			PreGameShakeController[] array = Object.FindObjectsOfType<PreGameShakeController>();
			PreGameShakeController[] array2 = array;
			foreach (PreGameShakeController val in array2)
			{
				if (Object.op_Implicit((Object)(object)val))
				{
					((Behaviour)val).enabled = false;
				}
			}
			ShakeEmitter[] array3 = Object.FindObjectsOfType<ShakeEmitter>();
			ShakeEmitter[] array4 = array3;
			foreach (ShakeEmitter val2 in array4)
			{
				if (Object.op_Implicit((Object)(object)val2))
				{
					((Behaviour)val2).enabled = value;
				}
			}
		}

		public static void Hook_UI_BlurOpacity(int value)
		{
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: 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 val2 = 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)val2.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.UserShouldSee);
		}

		public static void Hook_UIScale(float value)
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: 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)
			ConfigSetup.UI_Scale.Value = value;
			Transform transform = ((Component)LAIPlugin.CharSelUITransform.Find("SafeArea")).transform;
			Transform val = transform.Find("LeftHandPanel (Layer: Main)");
			Transform val2 = transform.Find("RightHandPanel");
			val.localScale = Vector3.one * value;
			val2.localScale = Vector3.one * value;
		}

		public static void Hook_Overlay_ShowPostProcessing(bool value)
		{
			ConfigSetup.PostProcessing.Value = value;
			if (Object.op_Implicit((Object)(object)LAISceneManager.sceneInstance))
			{
				Transform val = LAISceneManager.sceneInstance.transform.Find("PP");
				if (Object.op_Implicit((Object)(object)val))
				{
					((Component)val).gameObject.SetActive(value);
				}
			}
		}

		public static void Hook_LightUpdate_Color(Color color)
		{
			//IL_0006: 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_003e: 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_0068: 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_008d: 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_002b: 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)
			ConfigSetup.MannequinScale.Value = size;
			SurvivorMannequinDioramaController val = Object.FindObjectOfType<SurvivorMannequinDioramaController>();
			GameObject gameObject = ((Component)val).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_HideProps(bool value)
		{
			ConfigSetup.MeshProps.Value = value;
			string[] meshPropNames = Lobby.MeshPropNames;
			foreach (string text in meshPropNames)
			{
				GameObject val = GameObject.Find(text);
				if (Object.op_Implicit((Object)(object)val))
				{
					val.SetActive(ConfigSetup.MeshProps.Value);
				}
			}
			Hook_HidePhysicsProps(ConfigSetup.PhysicsProps.Value);
		}

		public static void Hook_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.UserShouldSee);
				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_0022: 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_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_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			ConfigSetup.SIL_ZoomEnable.Value = value;
			if (value)
			{
				UserProfile.onSurvivorPreferenceChangedGlobal += MoveCameraOnSurvivorPreferenceChange;
				return;
			}
			UserProfile.onSurvivorPreferenceChangedGlobal -= MoveCameraOnSurvivorPreferenceChange;
			Methods.SetCamera();
		}

		private static void MoveCameraOnSurvivorPreferenceChange(UserProfile userProfile)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			SetCameraFromSurvivor(userProfile.GetSurvivorPreference().survivorIndex);
		}

		public static void SetCameraFromSurvivor(SurvivorIndex survivorIndex)
		{
			//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)
			string bodyName = BodyCatalog.GetBodyName(SurvivorCatalog.GetBodyIndexFromSurvivorIndex(survivorIndex));
			SetCameraFromBodyName(bodyName);
		}

		public static void SetCameraFromBodyName(string bodyName)
		{
			//IL_0048: 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_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			if (LAILayoutManager.chosenLayout != null && LAILayoutManager.chosenLayout.CharacterCameraSettings != null)
			{
				if (LAILayoutManager.chosenLayout.CharacterCameraSettings.TryGetValue(bodyName, out var value))
				{
					Methods.SetCamera(null, value);
				}
				else
				{
					Methods.SetCamera();
				}
			}
		}
	}
	public static class SceneSetup
	{
		public static Action<GameObject[]> SceneAssetAPI_IntroAction;

		public static Action<GameObject[]> SceneAssetAPI_LobbyAction;

		public static Action<GameObject[]> SceneAssetAPI_TitleAction;

		public static Action<GameObject[]> SceneAssetAPI_VoidOutroAction;

		public static Action<GameObject[]> SceneAssetAPI_itmoonAction;

		public static GameObject brotherConstellation;

		public static GameObject VoidOutroSet7;

		public static GameObject SpaceCabin;

		public static GameObject CaptainHelmObject;

		public static GameObject ContactLightPrefab;

		public static GameObject ContactLight_RestraintBar;

		public static GameObject ContactLight_Commando;

		public static GameObject ContactLight_Enforcer;

		public static GameObject ContactLight_Bandit2;

		public static GameObject ContactLight_Huntress;

		public static GameObject ContactLight_HAND;

		public static GameObject ContactLight_Engineer;

		public static GameObject ContactLight_Miner;

		public static GameObject ContactLight_Sniper;

		public static GameObject ContactLight_Acrid;

		public static GameObject ContactLight_Mercenary;

		public static GameObject ContactLight_Loader;

		public static GameObject ContactLight_CHEF;

		public static void Init()
		{
			SceneAssetAPI_IntroAction = (Action<GameObject[]>)Delegate.Combine(SceneAssetAPI_IntroAction, new Action<GameObject[]>(CaptainHelm_Setup));
			SceneAssetAPI.AddAssetRequest("intro", SceneAssetAPI_IntroAction);
			SceneAssetAPI_TitleAction = (Action<GameObject[]>)Delegate.Combine(SceneAssetAPI_TitleAction, new Action<GameObject[]>(LobbyMulti_Setup));
			SceneAssetAPI.AddAssetRequest("title", SceneAssetAPI_TitleAction);
			SceneAssetAPI_VoidOutroAction = (Action<GameObject[]>)Delegate.Combine(SceneAssetAPI_VoidOutroAction, new Action<GameObject[]>(VoidOceanFloor_Setup));
			SceneAssetAPI.AddAssetRequest("voidoutro", SceneAssetAPI_VoidOutroAction);
			SceneAssetAPI_itmoonAction = (Action<GameObject[]>)Delegate.Combine(SceneAssetAPI_itmoonAction, new Action<GameObject[]>(MoonSetup));
			SceneAssetAPI.AddAssetRequest("itmoon", SceneAssetAPI_itmoonAction);
		}

		private static void MoonSetup(GameObject[] obj)
		{
			foreach (GameObject val in obj)
			{
				if (((Object)val).name == "HOLDER: Stage")
				{
					brotherConstellation = PrefabAPI.InstantiateClone(((Component)val.transform.Find("HOLDER: Constellations/mdlBrotherConstellation")).gameObject, "LAI_MITHRIXCONSTELLATION", false);
					break;
				}
			}
		}

		private static void VoidOceanFloor_Setup(GameObject[] obj)
		{
			foreach (GameObject val in obj)
			{
				if (((Object)val).name == "Set 7: Bottom of the Ocean")
				{
					VoidOutroSet7 = PrefabAPI.InstantiateClone(val, "LAI_VOIDOUTROSET7", false);
					((Behaviour)((Component)VoidOutroSet7.transform.Find("CrabHolder")).GetComponent<ShakeEmitter>()).enabled = false;
					VoidOutroSet7.gameObject.SetActive(true);
					break;
				}
			}
		}

		private static void LobbyMulti_Setup(GameObject[] gameObjects)
		{
			foreach (GameObject val in gameObjects)
			{
				if (((Object)val).name == "MainMenu")
				{
					SpaceCabin = PrefabAPI.InstantiateClone(((Component)val.transform.Find("MENU: Multiplayer/World Position/HOLDER: Background")).gameObject, "LAI_SPACECABIN", false);
					SpaceCabin.isStatic = false;
					Transform[] componentsInChildren = ((Component)SpaceCabin.transform).GetComponentsInChildren<Transform>();
					foreach (Transform val2 in componentsInChildren)
					{
						((Component)val2).gameObject.isStatic = false;
					}
					break;
				}
			}
		}

		public static void CaptainHelm_Setup(GameObject[] gameObjects)
		{
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Expected O, but got Unknown
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: 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_012a: Unknown result type (might be due to