Decompiled source of Informative Door Icons v1.3.2

InformativeDoorIcons.dll

Decompiled a week ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Unity.IL2CPP;
using CellMenu;
using GTFO.API.Utilities;
using HarmonyLib;
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime.Injection;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem;
using Il2CppSystem.Collections.Generic;
using LevelGeneration;
using Player;
using SNetwork;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("InformativeDoorIcons")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("InformativeDoorIcons")]
[assembly: AssemblyTitle("InformativeDoorIcons")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace InformativeDoorIcons;

[BepInPlugin("informativedooricons.HazardousMonkey", "InformativeDoorIcons", "1.3.2")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class InformativeDoorIconsPlugin : BasePlugin
{
	public static ConfigEntry<bool> MapHighContrastInventory;

	public static ConfigEntry<bool> RemoveMapLegend;

	public static ConfigEntry<bool> ExtraDoorStateInformation;

	public static ConfigEntry<bool> DoorRotationAdjustment;

	public static ConfigEntry<bool> StyleFreeSecurityDoors;

	public static ConfigEntry<bool> SecurityDoorKeycardMatchColor;

	public static ConfigEntry<bool> ChangeWeakDoorColors;

	public static ConfigEntry<bool> ExtendToIncludeGlueDoors;

	public static ConfigEntry<string> MeleeClosedColorHex;

	public static ConfigEntry<float> MeleeClosedAlpha;

	public static ConfigEntry<string> MeleeOpenColorHex;

	public static ConfigEntry<float> MeleeOpenAlpha;

	public static ConfigEntry<string> HackClosedColorHex;

	public static ConfigEntry<float> HackClosedAlpha;

	public static ConfigEntry<string> HackOpenColorHex;

	public static ConfigEntry<float> HackOpenAlpha;

	public static ConfigEntry<string> GlueColorHex;

	public static ConfigEntry<float> GlueAlpha;

	internal float refreshTimer;

	public static InformativeDoorIconsPlugin Instance { get; private set; }

	public override void Load()
	{
		//IL_0138: Unknown result type (might be due to invalid IL or missing references)
		//IL_0142: Expected O, but got Unknown
		//IL_0199: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a3: Expected O, but got Unknown
		//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0204: Expected O, but got Unknown
		//IL_025b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0265: Expected O, but got Unknown
		//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e6: Expected O, but got Unknown
		//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0318: Unknown result type (might be due to invalid IL or missing references)
		//IL_031e: Expected O, but got Unknown
		//IL_034b: Unknown result type (might be due to invalid IL or missing references)
		//IL_035a: Unknown result type (might be due to invalid IL or missing references)
		//IL_03af: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b9: Expected O, but got Unknown
		Instance = this;
		MapHighContrastInventory = ((BasePlugin)this).Config.Bind<bool>("Misc", "High Contrast inventory in Map", false, "This makes the in-map inventory menu High Contrast, as well as making it appear on top of all other sprites. This might make it easier to see the inventory with all the new text labels.");
		RemoveMapLegend = ((BasePlugin)this).Config.Bind<bool>("Misc", "RemoveMapLegend", true, "Has anyone ever even used the thing?");
		DoorRotationAdjustment = ((BasePlugin)this).Config.Bind<bool>("- Settings", "Door Rotation Adjustment (Not Retroactive)", true, "Rotates all door icons that are mostly upside-down doors to now be rightside-up. Also rotates left/right rotated doors to use the elevator as their center. This may or may not work well for all cases.");
		ExtraDoorStateInformation = ((BasePlugin)this).Config.Bind<bool>("- Settings", "Extra door information", true, "For Security Doors, the bottom label is rewritten to display lockdowns, needed power, blood doors, and finally what zone it leads to.");
		StyleFreeSecurityDoors = ((BasePlugin)this).Config.Bind<bool>("- Settings", "- Change the color for non-alarm Security Doors", true, "Add green coloration to non-alarmed \"free\" Security Door map icons.");
		SecurityDoorKeycardMatchColor = ((BasePlugin)this).Config.Bind<bool>("- Settings", "- Security Doors match Keycard color", true, "If a door is locked via Keycard, the interior sprite of the door will now match the Keycard color until unlocked.");
		ChangeWeakDoorColors = ((BasePlugin)this).Config.Bind<bool>("- Settings", "- Change Weak Door colors", true, "If a Weak Door (breackable door) is Locked or Glued, their sprite color reflects that.");
		MeleeClosedColorHex = ((BasePlugin)this).Config.Bind<string>("- Settings", "MeleeClosedColor", "#FFFF00", "Color of a Melee-locked Weak Door icon when closed.");
		MeleeClosedAlpha = ((BasePlugin)this).Config.Bind<float>("- Settings", "MeleeClosedAlpha", 0.8f, new ConfigDescription("Opacity of the melee-locked icon (closed state), 0.0-1.0.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
		MeleeOpenColorHex = ((BasePlugin)this).Config.Bind<string>("- Settings", "MeleeOpenColor", "#FFFF00", "Color of a Melee-locked Weak Door icon when open.");
		MeleeOpenAlpha = ((BasePlugin)this).Config.Bind<float>("- Settings", "MeleeOpenAlpha", 0.1f, new ConfigDescription("Opacity of the melee-locked icon (open state), 0.0-1.0.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
		HackClosedColorHex = ((BasePlugin)this).Config.Bind<string>("- Settings", "HackClosedColor", "#00FFFF", "Color of a Hackable Weak Door icon when closed.");
		HackClosedAlpha = ((BasePlugin)this).Config.Bind<float>("- Settings", "HackClosedAlpha", 0.6f, new ConfigDescription("Opacity of the hackable icon (closed state), 0.0-1.0.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
		HackOpenColorHex = ((BasePlugin)this).Config.Bind<string>("- Settings", "HackOpenColor", "#00FFFF", "Color of a Hackable Weak Door icon when open.");
		HackOpenAlpha = ((BasePlugin)this).Config.Bind<float>("- Settings", "HackOpenAlpha", 0.1f, new ConfigDescription("Opacity of the hackable icon (open state), 0.0-1.0.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
		ExtendToIncludeGlueDoors = ((BasePlugin)this).Config.Bind<bool>("- Settings", "Addon - Color Foamed doors", true, "[Required -> Change Weak Door Colors] Changes the color of a Weak Door icon when it has a non-zero amount of Foam.");
		GlueColorHex = ((BasePlugin)this).Config.Bind<string>("- Settings", "FoamDoorColor", "#FFFFFF", "Color of a Door icon when there's a non-zero amount of Foam on it");
		GlueAlpha = ((BasePlugin)this).Config.Bind<float>("- Settings", "GlueDoorAlpha", 1f, new ConfigDescription("Opacity of the Glued door icon", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
		ClassInjector.RegisterTypeInIl2Cpp<DoorIconsUpdater>();
		new Harmony("informativedooricons.HazardousMonkey").PatchAll();
		try
		{
			byte[] array = File.ReadAllBytes(Path.Combine(DoorManager.pluginDir, "symbol_door_security_map_inner_outline.png"));
			Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false);
			((Texture)val).filterMode = (FilterMode)0;
			ImageConversion.LoadImage(val, Il2CppStructArray<byte>.op_Implicit(array));
			DoorManager.BlackKeyOutlineSprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 64f);
		}
		catch (Exception ex)
		{
			Debug.LogError(Object.op_Implicit("[IDI] Failed to load outline sprite: " + ex.Message));
		}
		LiveEdit.CreateListener(Paths.ConfigPath, Path.GetFileName(((BasePlugin)this).Config.ConfigFilePath), false).FileChanged += (LiveEditEventHandler)delegate
		{
			Debug.LogWarning(Object.op_Implicit($"[IDI] config changed {Time.time}"));
			refreshTimer = Time.time + 0.5f;
			((BasePlugin)this).Config.Reload();
			DoorManager.MarkConfigDirty();
		};
		DoorManager.RefreshConfig();
		((BasePlugin)this).Log.LogInfo((object)"[IDI] Locked and Loaded.");
	}
}
public class DoorIconsUpdater : MonoBehaviour
{
	private static GameObject _updaterHost;

	public DoorIconsUpdater(IntPtr ptr)
		: base(ptr)
	{
	}

	public static void EnsureCreated()
	{
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Expected O, but got Unknown
		if (!((Object)(object)_updaterHost != (Object)null) || !(((Il2CppObjectBase)_updaterHost).Pointer != IntPtr.Zero))
		{
			_updaterHost = new GameObject("[IDI] UpdaterHost");
			Object.DontDestroyOnLoad((Object)(object)_updaterHost);
			((Il2CppObjectBase)_updaterHost.AddComponent(Il2CppType.Of<DoorIconsUpdater>())).Cast<DoorIconsUpdater>();
			Debug.Log(Object.op_Implicit("[IDI] UpdaterHost host created."));
		}
	}

	private void Update()
	{
		if (Time.time >= InformativeDoorIconsPlugin.Instance.refreshTimer && DoorManager.ConsumeConfigDirty())
		{
			DoorManager.RefreshConfig();
			DoorManager.ApplyConfigToAllDoors();
		}
	}
}
public static class DoorManager
{
	internal struct WeakDoorEntry
	{
		public CM_SyncedGUIItem GuiItem;

		public LG_WeakDoor PhysicalDoor;

		public bool IsMeleeLocked;

		public bool IsHack;
	}

	internal struct SecurityDoorEntry
	{
		public CM_SyncedGUIItem GuiItem;

		public LG_SecurityDoor PhysicalDoor;

		public float OriginalApexCharSpacing;

		public List<GameObject> BlackKeyOutlineClones;
	}

	[HarmonyPatch(typeof(GS_Lobby), "TryStartLevelTrigger")]
	public static class InformativeDoorIcons_GS_Lobby_TryStartLevelTrigger_PurgeRegisteredDoors
	{
		public static void Postfix(GS_Lobby __instance)
		{
			if (s_weakDoor.Count > 0)
			{
				s_weakDoor.Clear();
			}
			if (s_securityDoor.Count > 0)
			{
				s_securityDoor.Clear();
			}
		}
	}

	[HarmonyPatch(typeof(LG_WeakLock), "OnSyncStatusChanged")]
	public static class InformativeDoorIcons_LG_WeakLock_OnSyncStatusChanged_IconColorResetOnUnlock
	{
		public static void Postfix(LG_WeakLock __instance, eWeakLockStatus status)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Invalid comparison between Unknown and I4
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Invalid comparison between Unknown and I4
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Invalid comparison between Unknown and I4
			//IL_00b0: 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_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)
			if (!CfgChangeWeakDoorColors || (int)status != 3)
			{
				return;
			}
			LG_WeakDoor componentInParents = CustomExtensions.GetComponentInParents<LG_WeakDoor>(((Component)__instance).gameObject);
			if (!((Object)(object)componentInParents == (Object)null) && (int)((Il2CppArrayBase<LG_WeakLock>)(object)componentInParents.WeakLocks)[0].Status == 3 && (int)((Il2CppArrayBase<LG_WeakLock>)(object)componentInParents.WeakLocks)[1].Status == 3)
			{
				if (!TryGetWeakDoorEntry(((Object)((Component)componentInParents).gameObject).GetInstanceID(), out var doorEntry))
				{
					Debug.LogWarning(Object.op_Implicit("[IDI] OnSyncStatusChanged: no GUI entry found for unlocked weak door."));
				}
				else if (CfgChangeWeakDoorColors && CfgExtendToIncludeGlueDoors && ((Component)componentInParents).gameObject.GetComponent<LG_WeakDoor_Destruction>().GetAttachedGlueVolume() > 0f)
				{
					SetWeakDoorInnerColors(doorEntry.GuiItem, CfgGlueColor, CfgGlueColor);
				}
				else
				{
					SetWeakDoorInnerColors(doorEntry.GuiItem, WeakDoorDefaultClosed, WeakDoorDefaultOpen);
				}
			}
		}
	}

	[HarmonyPatch(typeof(CM_SyncedGUIItem), "Setup")]
	public static class InformativeDoorIcons_CM_SyncedGUIItem_Setup_DoorColoration
	{
		public static void Postfix(CM_SyncedGUIItem __instance)
		{
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Invalid comparison between Unknown and I4
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Invalid comparison between Unknown and I4
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Invalid comparison between Unknown and I4
			//IL_027f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0285: Invalid comparison between Unknown and I4
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Invalid comparison between Unknown and I4
			//IL_0313: Unknown result type (might be due to invalid IL or missing references)
			//IL_0319: Invalid comparison between Unknown and I4
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0227: Expected O, but got Unknown
			//IL_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0269: 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_00e5: Invalid comparison between Unknown and I4
			//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bb: Expected O, but got Unknown
			//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Invalid comparison between Unknown and I4
			//IL_0345: Unknown result type (might be due to invalid IL or missing references)
			//IL_034c: Expected O, but got Unknown
			//IL_037f: Unknown result type (might be due to invalid IL or missing references)
			//IL_038e: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)__instance.m_gfxSecureApex == (Object)null)
			{
				return;
			}
			DoorIconsUpdater.EnsureCreated();
			GameObject gameObject = ((Component)__instance.RevealerBase.transform.parent.parent).gameObject;
			int instanceID = ((Object)gameObject).GetInstanceID();
			((Renderer)((Component)__instance.m_locatorTxt).GetComponent<MeshRenderer>()).sortingOrder = 4;
			LG_WeakDoor component = gameObject.GetComponent<LG_WeakDoor>();
			if ((Object)(object)component != (Object)null)
			{
				if (component.WeakLocks == null)
				{
					RegisterWeakDoor(instanceID, __instance, component, isMeleeLocked: false, isHack: false);
					return;
				}
				bool isMeleeLocked = (int)((Il2CppArrayBase<LG_WeakLock>)(object)component.WeakLocks)[0].m_lockType == 1 || (int)((Il2CppArrayBase<LG_WeakLock>)(object)component.WeakLocks)[1].m_lockType == 1;
				bool isHack = (int)((Il2CppArrayBase<LG_WeakLock>)(object)component.WeakLocks)[0].m_lockType == 2 || (int)((Il2CppArrayBase<LG_WeakLock>)(object)component.WeakLocks)[1].m_lockType == 2;
				RegisterWeakDoor(instanceID, __instance, component, isMeleeLocked, isHack);
				if (((int)((Il2CppArrayBase<LG_WeakLock>)(object)component.WeakLocks)[0].Status != 3 || (int)((Il2CppArrayBase<LG_WeakLock>)(object)component.WeakLocks)[1].Status != 3) && TryGetWeakDoorEntry(instanceID, out var doorEntry))
				{
					ApplyConfigToWeakDoor(in doorEntry);
				}
				return;
			}
			LG_SecurityDoor component2 = gameObject.GetComponent<LG_SecurityDoor>();
			if (!((Object)(object)component2 != (Object)null))
			{
				return;
			}
			Material fontMaterial = ((TMP_Text)__instance.m_locatorTxt).fontMaterial;
			fontMaterial.EnableKeyword("OUTLINE_ON");
			fontMaterial.SetFloat(ShaderUtilities.ID_OutlineWidth, 0.15f);
			fontMaterial.SetColor(ShaderUtilities.ID_OutlineColor, new Color(0f, 0f, 0f, 0.5f));
			fontMaterial.SetFloat(ShaderUtilities.ID_OutlineSoftness, 0f);
			((TMP_Text)__instance.m_locatorTxt).fontMaterial.SetFloat("_FaceDilate", ((TMP_Text)__instance.m_locatorTxt).outlineWidth);
			RegisterSecurityDoor(instanceID, __instance, component2);
			if (TryGetSecurityDoorEntry(instanceID, out var doorEntry2))
			{
				ApplyConfigToSecurityDoor(in doorEntry2);
			}
			if (CfgSecurityDoorKeycardMatchColor && component2.m_keyItem != null && component2.m_keyItem.m_keyName == "KEY_BLACK" && TryGetSecurityDoorEntry(instanceID, out var doorEntry3))
			{
				CreateBlackKeyOutlineClones(instanceID, doorEntry3);
			}
			if ((int)component2.LinksToLayerType == 0)
			{
				if ((Object)(object)BulkMainSprite == (Object)null)
				{
					byte[] array = File.ReadAllBytes(Path.Combine(pluginDir, "bulkMain.png"));
					Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false);
					((Texture)val).filterMode = (FilterMode)0;
					ImageConversion.LoadImage(val, Il2CppStructArray<byte>.op_Implicit(array));
					BulkMainSprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f);
				}
			}
			else if ((int)component2.LinksToLayerType == 1)
			{
				if ((Object)(object)BulkSecondarySprite == (Object)null)
				{
					byte[] array2 = File.ReadAllBytes(Path.Combine(pluginDir, "bulkSecondary.png"));
					Texture2D val2 = new Texture2D(2, 2, (TextureFormat)4, false);
					((Texture)val2).filterMode = (FilterMode)0;
					ImageConversion.LoadImage(val2, Il2CppStructArray<byte>.op_Implicit(array2));
					BulkSecondarySprite = Sprite.Create(val2, new Rect(0f, 0f, (float)((Texture)val2).width, (float)((Texture)val2).height), new Vector2(0.5f, 0.5f), 100f);
				}
			}
			else if ((int)component2.LinksToLayerType == 2 && (Object)(object)BulkOverloadSprite == (Object)null)
			{
				byte[] array3 = File.ReadAllBytes(Path.Combine(pluginDir, "bulkOverload.png"));
				Texture2D val3 = new Texture2D(2, 2, (TextureFormat)4, false);
				((Texture)val3).filterMode = (FilterMode)0;
				ImageConversion.LoadImage(val3, Il2CppStructArray<byte>.op_Implicit(array3));
				BulkOverloadSprite = Sprite.Create(val3, new Rect(0f, 0f, (float)((Texture)val3).width, (float)((Texture)val3).height), new Vector2(0.5f, 0.5f), 100f);
			}
		}
	}

	[HarmonyPatch(typeof(CM_SyncedGUIItem), "SetVisible")]
	public static class InformativeDoorIcons_CM_SyncedGUIItem_SetVisible_SecDoorStyle_1
	{
		public static void Prefix(CM_SyncedGUIItem __instance, bool visible)
		{
			//IL_0022: 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_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: 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_00d7: 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_00f3: 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_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)__instance.m_gfxSecureApex == (Object)null || !visible)
			{
				return;
			}
			if (CfgDoorRotationAdjustment && ((Component)__instance).transform.localPosition != new Vector3(0f, 0f, 0f))
			{
				Quaternion val = ((Component)__instance).transform.rotation;
				if (((Quaternion)(ref val)).eulerAngles.z != 0f)
				{
					Transform transform = ((Component)__instance).transform;
					val = transform.localRotation;
					float z = ((Quaternion)(ref val)).eulerAngles.z;
					if (z >= 110f && z <= 240f)
					{
						val = transform.localRotation;
						transform.localRotation = Quaternion.Euler(0f, 0f, ((Quaternion)(ref val)).eulerAngles.z + 180f);
					}
					bool flag = transform.localPosition.x < 0f;
					bool flag2 = transform.localPosition.x > 0f;
					val = transform.localRotation;
					z = ((Quaternion)(ref val)).eulerAngles.z;
					if (z >= 60f && z <= 290f && transform.localPosition.x != 0f)
					{
						if (flag)
						{
							val = transform.localRotation;
							z = ((Quaternion)(ref val)).eulerAngles.z;
							if (z >= 250f && z <= 280f)
							{
								val = transform.localRotation;
								transform.localRotation = Quaternion.Euler(0f, 0f, ((Quaternion)(ref val)).eulerAngles.z + 180f);
								goto IL_01df;
							}
						}
						if (flag2)
						{
							val = transform.localRotation;
							z = ((Quaternion)(ref val)).eulerAngles.z;
							if (z >= 70f && z <= 100f)
							{
								val = transform.localRotation;
								transform.localRotation = Quaternion.Euler(0f, 0f, ((Quaternion)(ref val)).eulerAngles.z + 180f);
							}
						}
					}
				}
			}
			goto IL_01df;
			IL_01df:
			LG_SecurityDoor componentInParents = CustomExtensions.GetComponentInParents<LG_SecurityDoor>(__instance.RevealerBase.gameObject);
			if ((Object)(object)componentInParents != (Object)null)
			{
				BulkheadDoorIconSwap(componentInParents, __instance);
				DoorFlavorText(componentInParents, __instance, componentInParents.m_sync.GetCurrentSyncState().status);
			}
		}
	}

	[HarmonyPatch(typeof(CM_SyncedGUIItem), "SyncSetStatus")]
	public static class InformativeDoorIcons_CM_SyncedGUIItem_SyncSetStatus_SecDoorStyle_2
	{
		public static void Postfix(CM_SyncedGUIItem __instance)
		{
			//IL_0038: 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)
			if (!((Object)(object)__instance.m_gfxSecureApex == (Object)null) && CfgExtraDoorStateInformation)
			{
				LG_SecurityDoor componentInParents = CustomExtensions.GetComponentInParents<LG_SecurityDoor>(__instance.RevealerBase.gameObject);
				if ((Object)(object)componentInParents != (Object)null)
				{
					DoorFlavorText(componentInParents, __instance, componentInParents.m_sync.GetCurrentSyncState().status);
				}
			}
		}
	}

	[HarmonyPatch(typeof(LG_SecurityDoor), "OnSyncDoorStatusChange")]
	public static class InformativeDoorIcons_LG_SecurityDoor_OnSyncDoorStatusChange_SecDoorStyle_3
	{
		public static void Postfix(LG_SecurityDoor __instance)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			TryGetSecurityDoorEntry(((Object)((Component)__instance).gameObject).GetInstanceID(), out var doorEntry);
			DoorFlavorText(__instance, doorEntry.GuiItem, __instance.LastStatus);
		}
	}

	[HarmonyPatch(typeof(LG_WeakDoor_Destruction), "AddGlue")]
	public static class InformativeDoorIcons_LG_WeakDoor_Destruction_AddGlue_WeakDoorGlueColor
	{
		public static void Postfix(LG_WeakDoor_Destruction __instance)
		{
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Invalid comparison between Unknown and I4
			if (!CfgChangeWeakDoorColors || !CfgExtendToIncludeGlueDoors)
			{
				return;
			}
			int instanceID = ((Object)((Component)__instance).gameObject).GetInstanceID();
			TryGetWeakDoorEntry(instanceID, out var doorEntry);
			if ((Object)(object)doorEntry.GuiItem == (Object)null || (Object)(object)doorEntry.PhysicalDoor == (Object)null)
			{
				Debug.LogWarning(Object.op_Implicit($"[IDI] AddGlue, GUI or Door was null, glue value: {__instance.GetAttachedGlueVolume()}, doorInstance: {instanceID}"));
				{
					foreach (WeakDoorEntry value in s_weakDoor.Values)
					{
						Debug.LogWarning(Object.op_Implicit($"entry: {((Object)((Component)value.PhysicalDoor).gameObject).GetInstanceID()}"));
					}
					return;
				}
			}
			if ((int)doorEntry.PhysicalDoor.m_sync.GetCurrentSyncState().status != 11)
			{
				WeakDoorGlueColors(((Component)__instance).gameObject.GetComponent<LG_WeakDoor>(), doorEntry.GuiItem, __instance.GetAttachedGlueVolume(), doorEntry);
			}
		}
	}

	[HarmonyPatch(typeof(CM_MapPlayerGUIItem), "SetVisible")]
	public static class InformativeDoorIcons_CM_MapPlayerGUIItem_SetVisible_PutPlayerIconsOnTop
	{
		public static void Postfix(CM_MapPlayerGUIItem __instance, bool visible)
		{
			if (visible)
			{
				((Renderer)__instance.m_localPlayerIcon).sortingOrder = 100;
				((Renderer)__instance.m_syncPlayerIcon).sortingOrder = 100;
				__instance.m_nickname.sortingOrder = 100;
			}
		}
	}

	[HarmonyPatch(typeof(CM_PageMap), "UpdatePlayerInventory")]
	public static class InformativeDoorIcons_CM_PageMap_UpdatePlayerInventory_HighContrastMapInventory
	{
		public static void Postfix(CM_PageMap __instance, SNet_Player player)
		{
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Invalid comparison between Unknown and I4
			//IL_011a: 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_00d2: 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)
			Il2CppReferenceArray<PUI_Inventory> inventory = __instance.m_inventory;
			if (inventory != null)
			{
				PUI_Inventory obj = ((Il2CppArrayBase<PUI_Inventory>)(object)inventory)[0];
				bool? obj2;
				if (obj == null)
				{
					obj2 = null;
				}
				else
				{
					GuiLayer baseLayer = obj.m_baseLayer;
					if (baseLayer == null)
					{
						obj2 = null;
					}
					else
					{
						GuiLayerBase guiLayerBase = baseLayer.GuiLayerBase;
						if (guiLayerBase == null)
						{
							obj2 = null;
						}
						else
						{
							GameObject gameObject = ((Component)guiLayerBase).gameObject;
							obj2 = ((gameObject != null) ? new bool?(gameObject.activeSelf) : null);
						}
					}
				}
				if (obj2 == false)
				{
					return;
				}
			}
			if ((int)GameStateManager.CurrentStateName < 8)
			{
				return;
			}
			PUI_Inventory val = ((Il2CppArrayBase<PUI_Inventory>)(object)__instance.m_inventory)[player.PlayerSlotIndex()];
			if (!((Object)(object)player == (Object)null) && !((Object)(object)val == (Object)null))
			{
				if (CfgMapHighContrastInventory)
				{
					InventoryStyleShift(1f, 1f, new Color(0.2f, 0.2f, 0.2f, 1f), new Color(0.2f, 0.2f, 0.2f, 1f), val, CustomInventoryBackgroundSprite);
				}
				else
				{
					InventoryStyleShift(0.3137f, 0.3922f, new Color(0.5472f, 0.5472f, 0.5472f, 0.1569f), new Color(0.4353f, 0.4353f, 0.4353f, 0.1176f), val, DefaultInventoryBackgroundSprite);
				}
			}
		}
	}

	[HarmonyPatch(typeof(CM_PageMap), "OnEnable")]
	public static class InformativeDoorIcons_CM_PageMap_OnEnable_LegendBeGone
	{
		public static void Postfix(CM_PageMap __instance)
		{
			if (!((Object)(object)__instance.m_mapLegend == (Object)null))
			{
				if (CfgRemoveMapLegend && ((Component)__instance.m_mapLegend).gameObject.activeSelf)
				{
					((Component)__instance.m_mapLegend).gameObject.SetActive(false);
				}
				else if (!CfgRemoveMapLegend && !((Component)__instance.m_mapLegend).gameObject.activeSelf)
				{
					((Component)__instance.m_mapLegend).gameObject.SetActive(true);
				}
			}
		}
	}

	internal static readonly Dictionary<int, WeakDoorEntry> s_weakDoor = new Dictionary<int, WeakDoorEntry>();

	internal static readonly Dictionary<int, SecurityDoorEntry> s_securityDoor = new Dictionary<int, SecurityDoorEntry>();

	public static string pluginDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

	public static bool CfgMapHighContrastInventory = false;

	public static bool CfgRemoveMapLegend = true;

	public static bool CfgExtraDoorStateInformation = true;

	public static bool CfgDoorRotationAdjustment = true;

	public static bool CfgChangeWeakDoorColors = true;

	public static bool CfgExtendToIncludeGlueDoors = true;

	public static bool CfgStyleFreeSecurityDoors = true;

	public static bool CfgSecurityDoorKeycardMatchColor = true;

	public static Color CfgMeleeClosedColor = new Color(1f, 1f, 0f, 0.8f);

	public static Color CfgMeleeOpenColor = new Color(1f, 1f, 0f, 0.3f);

	public static Color CfgHackClosedColor = new Color(0f, 1f, 1f, 0.6f);

	public static Color CfgHackOpenColor = new Color(0f, 1f, 1f, 0.3f);

	public static Color CfgGlueColor = new Color(1f, 1f, 1f, 0.6f);

	private static volatile bool _configDirty = false;

	public static readonly Color WeakDoorDefaultClosed = new Color(0.3373f, 0.3529f, 0.2549f, 1f);

	public static readonly Color WeakDoorDefaultOpen = new Color(0.3373f, 0.3529f, 0.2549f, 0.0549f);

	public static Sprite BlackKeyOutlineSprite { get; set; } = null;


	public static Sprite BulkMainSprite { get; set; } = null;


	public static Sprite BulkSecondarySprite { get; set; } = null;


	public static Sprite BulkOverloadSprite { get; set; } = null;


	public static Sprite DefaultInventoryBackgroundSprite { get; set; } = null;


	public static Sprite CustomInventoryBackgroundSprite { get; set; } = null;


	public static void RegisterWeakDoor(int physicalDoorInstanceId, CM_SyncedGUIItem guiItem, LG_WeakDoor physicalDoor, bool isMeleeLocked, bool isHack)
	{
		if (!s_weakDoor.ContainsKey(physicalDoorInstanceId))
		{
			s_weakDoor[physicalDoorInstanceId] = new WeakDoorEntry
			{
				GuiItem = guiItem,
				PhysicalDoor = physicalDoor,
				IsMeleeLocked = isMeleeLocked,
				IsHack = isHack
			};
		}
	}

	public static void RegisterSecurityDoor(int physicalDoorInstanceId, CM_SyncedGUIItem guiItem, LG_SecurityDoor physicalDoor)
	{
		if (s_securityDoor.ContainsKey(physicalDoorInstanceId))
		{
			return;
		}
		float originalApexCharSpacing = 0f;
		foreach (TextMeshPro componentsInChild in guiItem.m_gfxSecureApex.GetComponentsInChildren<TextMeshPro>())
		{
			if (CustomExtensions.ContainsIgnoreCase(((TMP_Text)componentsInChild).m_text, "APEX"))
			{
				originalApexCharSpacing = ((TMP_Text)componentsInChild).characterSpacing;
				break;
			}
		}
		s_securityDoor[physicalDoorInstanceId] = new SecurityDoorEntry
		{
			GuiItem = guiItem,
			PhysicalDoor = physicalDoor,
			OriginalApexCharSpacing = originalApexCharSpacing
		};
	}

	internal static bool TryGetWeakDoorEntry(int id, out WeakDoorEntry doorEntry)
	{
		return s_weakDoor.TryGetValue(id, out doorEntry);
	}

	internal static bool TryGetSecurityDoorEntry(int id, out SecurityDoorEntry doorEntry)
	{
		return s_securityDoor.TryGetValue(id, out doorEntry);
	}

	internal static void StoreSecurityDoorEntry(int id, SecurityDoorEntry entry)
	{
		s_securityDoor[id] = entry;
	}

	public static bool TryGetWeakDoorGUI(int id, out CM_SyncedGUIItem guiItem)
	{
		if (s_weakDoor.TryGetValue(id, out var value))
		{
			guiItem = value.GuiItem;
			return true;
		}
		guiItem = null;
		return false;
	}

	public static bool TryGetSecurityDoorGUI(int id, out CM_SyncedGUIItem guiItem)
	{
		if (s_securityDoor.TryGetValue(id, out var value))
		{
			guiItem = value.GuiItem;
			return true;
		}
		guiItem = null;
		return false;
	}

	public static void MarkConfigDirty()
	{
		_configDirty = true;
	}

	public static bool ConsumeConfigDirty()
	{
		if (!_configDirty)
		{
			return false;
		}
		_configDirty = false;
		return true;
	}

	public static void RefreshConfig()
	{
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: 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_00e6: 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_0118: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: Unknown result type (might be due to invalid IL or missing references)
		//IL_012c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0159: Unknown result type (might be due to invalid IL or missing references)
		//IL_0168: Unknown result type (might be due to invalid IL or missing references)
		//IL_016d: Unknown result type (might be due to invalid IL or missing references)
		//IL_024e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0272: Unknown result type (might be due to invalid IL or missing references)
		//IL_0296: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_0302: Unknown result type (might be due to invalid IL or missing references)
		CfgMapHighContrastInventory = InformativeDoorIconsPlugin.MapHighContrastInventory.Value;
		CfgRemoveMapLegend = InformativeDoorIconsPlugin.RemoveMapLegend.Value;
		CfgExtraDoorStateInformation = InformativeDoorIconsPlugin.ExtraDoorStateInformation.Value;
		CfgDoorRotationAdjustment = InformativeDoorIconsPlugin.DoorRotationAdjustment.Value;
		CfgChangeWeakDoorColors = InformativeDoorIconsPlugin.ChangeWeakDoorColors.Value;
		CfgStyleFreeSecurityDoors = InformativeDoorIconsPlugin.StyleFreeSecurityDoors.Value;
		CfgSecurityDoorKeycardMatchColor = InformativeDoorIconsPlugin.SecurityDoorKeycardMatchColor.Value;
		CfgMeleeClosedColor = ParseColorWithAlpha(InformativeDoorIconsPlugin.MeleeClosedColorHex.Value, new Color(1f, 1f, 0f), InformativeDoorIconsPlugin.MeleeClosedAlpha.Value);
		CfgMeleeOpenColor = ParseColorWithAlpha(InformativeDoorIconsPlugin.MeleeOpenColorHex.Value, new Color(1f, 1f, 0f), InformativeDoorIconsPlugin.MeleeOpenAlpha.Value);
		CfgHackClosedColor = ParseColorWithAlpha(InformativeDoorIconsPlugin.HackClosedColorHex.Value, new Color(0f, 1f, 1f), InformativeDoorIconsPlugin.HackClosedAlpha.Value);
		CfgHackOpenColor = ParseColorWithAlpha(InformativeDoorIconsPlugin.HackOpenColorHex.Value, new Color(0f, 1f, 1f), InformativeDoorIconsPlugin.HackOpenAlpha.Value);
		CfgExtendToIncludeGlueDoors = InformativeDoorIconsPlugin.ExtendToIncludeGlueDoors.Value;
		CfgGlueColor = ParseColorWithAlpha(InformativeDoorIconsPlugin.GlueColorHex.Value, new Color(1f, 1f, 1f), InformativeDoorIconsPlugin.GlueAlpha.Value);
		Debug.Log(Object.op_Implicit($"[IDI] Config refreshed -> rotation={CfgDoorRotationAdjustment} ExtraInfo={CfgExtraDoorStateInformation} keycard={CfgSecurityDoorKeycardMatchColor} weakColors={CfgChangeWeakDoorColors} styleFree={CfgStyleFreeSecurityDoors} meleeC={CfgMeleeClosedColor} meleeO={CfgMeleeOpenColor} hackC={CfgHackClosedColor} hackO={CfgHackOpenColor} glueDoors={CfgExtendToIncludeGlueDoors} glueColor={CfgGlueColor} RemoveLegend={CfgRemoveMapLegend} HCMInventory={CfgMapHighContrastInventory}"));
	}

	private static Color ParseColorWithAlpha(string hex, Color fallbackRGB, float alpha)
	{
		//IL_003d: 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_0049: 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_000a: 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_0016: 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)
		Color val = default(Color);
		if (ColorUtility.TryParseHtmlString(hex, ref val))
		{
			return new Color(val.r, val.g, val.b, alpha);
		}
		Debug.LogWarning(Object.op_Implicit("[IDI] Could not parse color '" + hex + "' — using fallback."));
		return new Color(fallbackRGB.r, fallbackRGB.g, fallbackRGB.b, alpha);
	}

	public static void ApplyConfigToAllDoors()
	{
		foreach (WeakDoorEntry value in s_weakDoor.Values)
		{
			WeakDoorEntry doorEntry = value;
			ApplyConfigToWeakDoor(in doorEntry);
		}
		foreach (KeyValuePair<int, SecurityDoorEntry> item in s_securityDoor)
		{
			if (!CfgExtraDoorStateInformation)
			{
				Debug.LogWarning(Object.op_Implicit("[IDI] applying Sec Door config"));
			}
			SecurityDoorEntry doorEntry2 = item.Value;
			ApplyConfigToSecurityDoor(in doorEntry2);
			if (CfgSecurityDoorKeycardMatchColor && item.Value.PhysicalDoor.m_keyItem != null && item.Value.PhysicalDoor.m_keyItem.m_keyName == "KEY_BLACK" && (item.Value.BlackKeyOutlineClones == null || item.Value.BlackKeyOutlineClones.Count == 0))
			{
				CreateBlackKeyOutlineClones(item.Key, item.Value);
			}
		}
		Debug.Log(Object.op_Implicit($"[IDI] Hot-reload applied to {s_weakDoor.Count} weak door(s) and {s_securityDoor.Count} security door(s)."));
	}

	internal static void ApplyConfigToWeakDoor(in WeakDoorEntry doorEntry)
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Invalid comparison between Unknown and I4
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: 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_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_010e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0113: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01be: Unknown result type (might be due to invalid IL or missing references)
		//IL_0144: Unknown result type (might be due to invalid IL or missing references)
		//IL_014a: Invalid comparison between Unknown and I4
		//IL_0158: Unknown result type (might be due to invalid IL or missing references)
		//IL_015e: Invalid comparison between Unknown and I4
		//IL_018f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0194: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_0176: Unknown result type (might be due to invalid IL or missing references)
		//IL_017b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0165: Unknown result type (might be due to invalid IL or missing references)
		//IL_016a: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)doorEntry.GuiItem == (Object)null)
		{
			return;
		}
		CM_SyncedGUIItem guiItem = doorEntry.GuiItem;
		LG_WeakDoor physicalDoor = doorEntry.PhysicalDoor;
		bool flag = (int)physicalDoor.m_sync.GetCurrentSyncState().status == 11;
		Transform transform = ((Component)guiItem.m_locatorTxt).gameObject.transform;
		Vector3? val = ((transform != null) ? new Vector3?(transform.localPosition) : null);
		Vector3 val2 = default(Vector3);
		((Vector3)(ref val2))..ctor(0f, 5.5f, 0f);
		if (!val.HasValue || val.GetValueOrDefault() != val2)
		{
			transform.localPosition = new Vector3(0f, 5.5f, 0f);
		}
		if (!CfgChangeWeakDoorColors || flag)
		{
			SetWeakDoorInnerColors(guiItem, WeakDoorDefaultClosed, WeakDoorDefaultOpen);
		}
		else
		{
			if (!((Object)(object)physicalDoor != (Object)null))
			{
				return;
			}
			LG_WeakDoor_Destruction component = ((Component)physicalDoor).gameObject.GetComponent<LG_WeakDoor_Destruction>();
			bool flag2 = CfgChangeWeakDoorColors && CfgExtendToIncludeGlueDoors && component != null && component.GetAttachedGlueVolume() > 0f;
			if (flag2)
			{
				SetWeakDoorInnerColors(guiItem, CfgGlueColor, CfgGlueColor);
				return;
			}
			Il2CppReferenceArray<LG_WeakLock> weakLocks = physicalDoor.WeakLocks;
			if (weakLocks != null && ((Il2CppArrayBase<LG_WeakLock>)(object)weakLocks).Count > 0)
			{
				if ((int)((Il2CppArrayBase<LG_WeakLock>)(object)physicalDoor.WeakLocks)[0].Status == 3 && (int)((Il2CppArrayBase<LG_WeakLock>)(object)physicalDoor.WeakLocks)[1].Status == 3)
				{
					if (flag2)
					{
						SetWeakDoorInnerColors(guiItem, CfgGlueColor, CfgGlueColor);
					}
					else
					{
						SetWeakDoorInnerColors(guiItem, WeakDoorDefaultClosed, WeakDoorDefaultOpen);
					}
				}
				else if (doorEntry.IsMeleeLocked)
				{
					SetWeakDoorInnerColors(guiItem, CfgMeleeClosedColor, CfgMeleeOpenColor);
				}
				else if (doorEntry.IsHack)
				{
					SetWeakDoorInnerColors(guiItem, CfgHackClosedColor, CfgHackOpenColor);
				}
			}
			else
			{
				SetWeakDoorInnerColors(guiItem, WeakDoorDefaultClosed, WeakDoorDefaultOpen);
			}
		}
	}

	internal static void ApplyConfigToSecurityDoor(in SecurityDoorEntry doorEntry)
	{
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Invalid comparison between Unknown and I4
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0226: Unknown result type (might be due to invalid IL or missing references)
		//IL_021d: Unknown result type (might be due to invalid IL or missing references)
		//IL_022b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0264: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)doorEntry.GuiItem == (Object)null)
		{
			return;
		}
		LG_SecurityDoor physicalDoor = doorEntry.PhysicalDoor;
		if (((physicalDoor != null) ? physicalDoor.m_sync : null) != null && (int)GameStateManager.CurrentStateName >= 8)
		{
			DoorFlavorText(doorEntry.PhysicalDoor, doorEntry.GuiItem, doorEntry.PhysicalDoor.m_sync.GetCurrentSyncState().status);
		}
		((Component)doorEntry.GuiItem.m_locatorTxt).gameObject.transform.localPosition = new Vector3(0f, 5.5f, 0f);
		foreach (MeshRenderer componentsInChild in doorEntry.GuiItem.m_gfxSecureApex.GetComponentsInChildren<MeshRenderer>())
		{
			((Renderer)componentsInChild).sortingOrder = 2;
		}
		foreach (TextMeshPro componentsInChild2 in doorEntry.GuiItem.m_gfxSecureApex.GetComponentsInChildren<TextMeshPro>())
		{
			bool flag = CustomExtensions.ContainsIgnoreCase(((TMP_Text)componentsInChild2).m_text, "APEX");
			bool flag2 = CustomExtensions.ContainsIgnoreCase(((TMP_Text)componentsInChild2).m_text, "ALARM");
			if (flag || flag2)
			{
				if (CfgExtraDoorStateInformation)
				{
					((TMP_Text)componentsInChild2).text = "ALARM";
					((TMP_Text)componentsInChild2).characterSpacing = 8f;
				}
				else
				{
					((TMP_Text)componentsInChild2).text = "APEX";
					((TMP_Text)componentsInChild2).characterSpacing = doorEntry.OriginalApexCharSpacing;
				}
				((TMP_Text)componentsInChild2).ForceMeshUpdate(false, false);
			}
		}
		foreach (SpriteRenderer componentsInChild3 in doorEntry.GuiItem.m_gfxSecureClosed.GetComponentsInChildren<SpriteRenderer>())
		{
			if (IsClampSprite(((Object)((Component)componentsInChild3).gameObject).name))
			{
				componentsInChild3.color = (CfgStyleFreeSecurityDoors ? new Color(0f, 1f, 0.5f, 1f) : new Color(0.7647f, 0.2745f, 0.2745f, 1f));
			}
		}
		if (doorEntry.PhysicalDoor.m_keyItem != null)
		{
			string keyName = doorEntry.PhysicalDoor.m_keyItem.m_keyName;
			Color color = (Color)(CfgSecurityDoorKeycardMatchColor ? GetKeyColor(keyName) : new Color(0.7647f, 0.2745f, 0.2745f, 1f));
			foreach (SpriteRenderer componentsInChild4 in doorEntry.GuiItem.m_gfxSecureKeycard.GetComponentsInChildren<SpriteRenderer>())
			{
				if (IsInnerSprite(((Object)((Component)componentsInChild4).gameObject).name))
				{
					componentsInChild4.color = color;
				}
			}
		}
		if (doorEntry.BlackKeyOutlineClones == null)
		{
			return;
		}
		foreach (GameObject blackKeyOutlineClone in doorEntry.BlackKeyOutlineClones)
		{
			if ((Object)(object)blackKeyOutlineClone != (Object)null)
			{
				blackKeyOutlineClone.SetActive(CfgSecurityDoorKeycardMatchColor);
			}
		}
	}

	internal static void CreateBlackKeyOutlineClones(int instanceId, SecurityDoorEntry entry)
	{
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Expected O, but got Unknown
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: 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)
		//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_017a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0190: Unknown result type (might be due to invalid IL or missing references)
		//IL_019a: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)BlackKeyOutlineSprite == (Object)null)
		{
			try
			{
				byte[] array = File.ReadAllBytes(Path.Combine(pluginDir, "symbol_door_security_map_inner_outline.png"));
				Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false);
				((Texture)val).filterMode = (FilterMode)0;
				ImageConversion.LoadImage(val, Il2CppStructArray<byte>.op_Implicit(array));
				BlackKeyOutlineSprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 64f);
				Debug.LogWarning(Object.op_Implicit("[IDI] BlackKeyOutlineSprite was null; created fallback in CreateBlackKeyOutlineClones."));
			}
			catch (Exception ex)
			{
				Debug.LogError(Object.op_Implicit("[IDI] CreateBlackKeyOutlineClones: failed to load outline sprite: " + ex.Message));
				return;
			}
		}
		List<GameObject> list = new List<GameObject>();
		foreach (SpriteRenderer componentsInChild in entry.GuiItem.m_gfxSecureKeycard.GetComponentsInChildren<SpriteRenderer>())
		{
			if (IsInnerSprite(((Object)((Component)componentsInChild).gameObject).name))
			{
				GameObject val2 = Object.Instantiate<GameObject>(((Component)componentsInChild).gameObject, ((Component)componentsInChild).gameObject.transform.parent);
				SpriteRenderer component = val2.GetComponent<SpriteRenderer>();
				component.sprite = BlackKeyOutlineSprite;
				component.color = Color.white;
				((Renderer)component).sortingOrder = ((Renderer)component).sortingOrder - 1;
				((Component)component).gameObject.transform.localPosition = ((((Component)component).gameObject.transform.localPosition.x > 0f) ? new Vector3(0.176f, ((Component)component).gameObject.transform.localPosition.y, ((Component)component).gameObject.transform.localPosition.z) : new Vector3(-0.176f, ((Component)component).gameObject.transform.localPosition.y, ((Component)component).gameObject.transform.localPosition.z));
				list.Add(val2);
			}
		}
		entry.BlackKeyOutlineClones = list;
		StoreSecurityDoorEntry(instanceId, entry);
	}

	internal static bool IsBackgroundSprite(string name)
	{
		return CustomExtensions.ContainsIgnoreCase(name, "background");
	}

	internal static bool IsInnerSprite(string name)
	{
		if (!name.Contains("(Clone)"))
		{
			if (!name.EndsWith("_inner"))
			{
				if (name.Contains("_inner ("))
				{
					return name.EndsWith(")");
				}
				return false;
			}
			return true;
		}
		return false;
	}

	internal static bool IsClampSprite(string name)
	{
		if (!name.Contains("(Clone)"))
		{
			if (!name.EndsWith("_clamp"))
			{
				if (name.Contains("_clamp ("))
				{
					return name.EndsWith(")");
				}
				return false;
			}
			return true;
		}
		return false;
	}

	internal static bool IsInnerBulkheadSymbolSprite(string name)
	{
		return CustomExtensions.ContainsIgnoreCase(name, "symbol_bulkhead");
	}

	private static void SetWeakDoorInnerColors(CM_SyncedGUIItem guiItem, Color closedColor, Color openColor)
	{
		//IL_002d: 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_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		foreach (SpriteRenderer componentsInChild in guiItem.m_gfxWeakClosed.GetComponentsInChildren<SpriteRenderer>())
		{
			if (IsInnerSprite(((Object)((Component)componentsInChild).gameObject).name) && componentsInChild.color != closedColor)
			{
				componentsInChild.color = closedColor;
			}
		}
		foreach (SpriteRenderer componentsInChild2 in guiItem.m_gfxWeakOpen.GetComponentsInChildren<SpriteRenderer>())
		{
			if (IsInnerSprite(((Object)((Component)componentsInChild2).gameObject).name) && componentsInChild2.color != openColor)
			{
				componentsInChild2.color = openColor;
			}
		}
	}

	private static Color GetKeyColor(string keyName)
	{
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_00aa: 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_0104: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		if (!keyName.StartsWith("KEY_", StringComparison.OrdinalIgnoreCase))
		{
			Debug.LogWarning(Object.op_Implicit("[IDI] '" + keyName + "' did not contain a valid prefix."));
			return new Color(0.4191f, 0.1387f, 0.1387f, 1f);
		}
		string text = keyName.Substring("KEY_".Length);
		switch (text)
		{
		case "BLUE":
			return new Color(0f, 0.33f, 1f, 1f);
		case "GREEN":
			return new Color(0f, 1f, 0.2f, 1f);
		case "PURPLE":
			return new Color(0.6235f, 0.1137f, 0.9372f, 1f);
		default:
		{
			Color result = default(Color);
			if (ColorUtility.TryParseHtmlString(text, ref result))
			{
				return result;
			}
			Debug.LogWarning(Object.op_Implicit("[IDI] Could not resolve color from key name: '" + keyName + "'"));
			return new Color(0.4191f, 0.1387f, 0.1387f, 1f);
		}
		}
	}

	internal static void BulkheadDoorIconSwap(LG_SecurityDoor doorSL, CM_SyncedGUIItem GUI)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: Invalid comparison between Unknown and I4
		//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ae: Invalid comparison between Unknown and I4
		//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02db: Unknown result type (might be due to invalid IL or missing references)
		//IL_02df: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
		List<SpriteRenderer> list = new List<SpriteRenderer>();
		if ((int)doorSL.LinksToLayerType == 0)
		{
			foreach (SpriteRenderer componentsInChild in GUI.m_gfxBulkheadClosed.GetComponentsInChildren<SpriteRenderer>())
			{
				if (IsInnerBulkheadSymbolSprite(((Object)((Component)componentsInChild).gameObject).name))
				{
					if ((Object)(object)BulkMainSprite != (Object)null)
					{
						componentsInChild.sprite = BulkMainSprite;
					}
					list.Add(componentsInChild);
				}
			}
			foreach (SpriteRenderer componentsInChild2 in GUI.m_gfxBulkheadOpen.GetComponentsInChildren<SpriteRenderer>())
			{
				if (IsInnerBulkheadSymbolSprite(((Object)((Component)componentsInChild2).gameObject).name))
				{
					if ((Object)(object)BulkMainSprite != (Object)null)
					{
						componentsInChild2.sprite = BulkMainSprite;
					}
					list.Add(componentsInChild2);
				}
			}
		}
		else if ((int)doorSL.LinksToLayerType == 1)
		{
			foreach (SpriteRenderer componentsInChild3 in GUI.m_gfxBulkheadClosed.GetComponentsInChildren<SpriteRenderer>())
			{
				if (IsInnerBulkheadSymbolSprite(((Object)((Component)componentsInChild3).gameObject).name))
				{
					if ((Object)(object)BulkSecondarySprite != (Object)null)
					{
						componentsInChild3.sprite = BulkSecondarySprite;
					}
					list.Add(componentsInChild3);
				}
			}
			foreach (SpriteRenderer componentsInChild4 in GUI.m_gfxBulkheadOpen.GetComponentsInChildren<SpriteRenderer>())
			{
				if (IsInnerBulkheadSymbolSprite(((Object)((Component)componentsInChild4).gameObject).name))
				{
					if ((Object)(object)BulkSecondarySprite != (Object)null)
					{
						componentsInChild4.sprite = BulkSecondarySprite;
					}
					list.Add(componentsInChild4);
				}
			}
		}
		else if ((int)doorSL.LinksToLayerType == 2)
		{
			foreach (SpriteRenderer componentsInChild5 in GUI.m_gfxBulkheadClosed.GetComponentsInChildren<SpriteRenderer>())
			{
				if (IsInnerBulkheadSymbolSprite(((Object)((Component)componentsInChild5).gameObject).name))
				{
					if ((Object)(object)BulkOverloadSprite != (Object)null)
					{
						componentsInChild5.sprite = BulkOverloadSprite;
					}
					list.Add(componentsInChild5);
				}
			}
			foreach (SpriteRenderer componentsInChild6 in GUI.m_gfxBulkheadOpen.GetComponentsInChildren<SpriteRenderer>())
			{
				if (IsInnerBulkheadSymbolSprite(((Object)((Component)componentsInChild6).gameObject).name))
				{
					if ((Object)(object)BulkOverloadSprite != (Object)null)
					{
						componentsInChild6.sprite = BulkOverloadSprite;
					}
					list.Add(componentsInChild6);
				}
			}
		}
		if (list.Count <= 0)
		{
			return;
		}
		foreach (SpriteRenderer item in list)
		{
			item.color = new Color(1f, 1f, 1f, 1f);
			((Renderer)item).sortingOrder = 2;
			Transform transform = ((Component)item).transform;
			Quaternion localRotation = ((Component)GUI).transform.localRotation;
			transform.localRotation = Quaternion.Euler(0f, 0f, 360f - ((Quaternion)(ref localRotation)).eulerAngles.z);
		}
	}

	internal static void DoorFlavorText(LG_SecurityDoor doorSL, CM_SyncedGUIItem GUI, eDoorStatus status)
	{
		//IL_0382: Unknown result type (might be due to invalid IL or missing references)
		//IL_0480: Unknown result type (might be due to invalid IL or missing references)
		//IL_0483: Invalid comparison between Unknown and I4
		//IL_0485: Unknown result type (might be due to invalid IL or missing references)
		//IL_0488: Invalid comparison between Unknown and I4
		//IL_0490: Unknown result type (might be due to invalid IL or missing references)
		//IL_0496: Invalid comparison between Unknown and I4
		//IL_04ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_04fb: Invalid comparison between Unknown and I4
		//IL_0577: Unknown result type (might be due to invalid IL or missing references)
		//IL_0579: Invalid comparison between Unknown and I4
		//IL_0558: Unknown result type (might be due to invalid IL or missing references)
		//IL_066b: Unknown result type (might be due to invalid IL or missing references)
		//IL_066e: Invalid comparison between Unknown and I4
		//IL_011c: Unknown result type (might be due to invalid IL or missing references)
		//IL_011e: Invalid comparison between Unknown and I4
		//IL_0712: Unknown result type (might be due to invalid IL or missing references)
		//IL_0714: Invalid comparison between Unknown and I4
		//IL_0121: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: Invalid comparison between Unknown and I4
		//IL_0717: Unknown result type (might be due to invalid IL or missing references)
		//IL_071d: Invalid comparison between Unknown and I4
		//IL_06ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_0185: Unknown result type (might be due to invalid IL or missing references)
		//IL_019e: Unknown result type (might be due to invalid IL or missing references)
		//IL_012a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0130: Invalid comparison between Unknown and I4
		//IL_0a1e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a28: Invalid comparison between Unknown and I4
		//IL_07a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0720: Unknown result type (might be due to invalid IL or missing references)
		//IL_0726: Invalid comparison between Unknown and I4
		//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ba: Invalid comparison between Unknown and I4
		//IL_0a6a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a44: Unknown result type (might be due to invalid IL or missing references)
		//IL_0913: Unknown result type (might be due to invalid IL or missing references)
		//IL_0646: Unknown result type (might be due to invalid IL or missing references)
		//IL_0809: Unknown result type (might be due to invalid IL or missing references)
		//IL_080f: Invalid comparison between Unknown and I4
		//IL_023a: Unknown result type (might be due to invalid IL or missing references)
		//IL_023d: Invalid comparison between Unknown and I4
		//IL_0812: Unknown result type (might be due to invalid IL or missing references)
		//IL_0818: Invalid comparison between Unknown and I4
		//IL_023f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0242: Invalid comparison between Unknown and I4
		//IL_0277: Unknown result type (might be due to invalid IL or missing references)
		//IL_0290: Unknown result type (might be due to invalid IL or missing references)
		//IL_09d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_088d: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ac: Invalid comparison between Unknown and I4
		LG_SecurityDoor_Locks component = ((Component)doorSL).gameObject.GetComponent<LG_SecurityDoor_Locks>();
		if (!CfgExtraDoorStateInformation)
		{
			if ((Object)(object)GUI.m_locatorTxt == (Object)null && (Object)(object)GUI.m_additionalTxt == (Object)null)
			{
				return;
			}
			string text = ((TMP_Text)GUI.m_locatorTxt).text;
			iTerminalItem terminalItem = doorSL.m_terminalItem;
			if (text == ((terminalItem != null) ? terminalItem.TerminalItemKey : null))
			{
				string text2 = ((TMP_Text)GUI.m_additionalTxt).text;
				GateKeyItem keyItem = doorSL.m_keyItem;
				if (text2 == "REQ: " + ((keyItem != null) ? keyItem.PublicName : null) || ((TMP_Text)GUI.m_additionalTxt).text == "OVERRIDE:" || ((TMP_Text)GUI.m_additionalTxt).text == "")
				{
					return;
				}
			}
			TextMeshPro locatorTxt = GUI.m_locatorTxt;
			if (((locatorTxt != null) ? ((TMP_Text)locatorTxt).text : null) != doorSL.m_terminalItem.TerminalItemKey)
			{
				((TMP_Text)GUI.m_locatorTxt).text = doorSL.m_terminalItem.TerminalItemKey;
				if (((Component)GUI.m_locatorTxt).gameObject.activeSelf)
				{
					((TMP_Text)GUI.m_locatorTxt).ForceMeshUpdate(false, false);
				}
			}
			if ((Object)(object)GUI.m_additionalTxt == (Object)null)
			{
				return;
			}
			if ((int)status == 3 || (int)GUI.Status == 8 || (int)GUI.m_status == 8)
			{
				if (((TMP_Text)GUI.m_additionalTxt).text != "REQ: " + doorSL.m_keyItem.PublicName)
				{
					((TMP_Text)GUI.m_additionalTxt).text = "REQ: " + doorSL.m_keyItem.PublicName;
					if (((Graphic)GUI.m_additionalTxt).color != new Color(1f, 0.5279f, 0.0221f, 1f) || (int)((TMP_Text)GUI.m_additionalTxt).alignment != 514)
					{
						((Graphic)GUI.m_additionalTxt).color = new Color(1f, 0.5279f, 0.0221f, 1f);
						((TMP_Text)GUI.m_additionalTxt).alignment = (TextAlignmentOptions)514;
					}
					if (((Component)GUI.m_additionalTxt).gameObject.activeSelf)
					{
						((TMP_Text)GUI.m_additionalTxt).ForceMeshUpdate(false, false);
					}
				}
			}
			else if ((Object)(object)component != (Object)null && component.m_hasAlarm && !component.ChainedPuzzleToSolve.IsSolved && ((int)status != 10 || (int)status != 16))
			{
				if (((TMP_Text)GUI.m_additionalTxt).text != "OVERRIDE:")
				{
					((TMP_Text)GUI.m_additionalTxt).text = "OVERRIDE:";
					if (((Graphic)GUI.m_additionalTxt).color != new Color(1f, 0.5279f, 0.0221f, 1f) || (int)((TMP_Text)GUI.m_additionalTxt).alignment != 514)
					{
						((Graphic)GUI.m_additionalTxt).color = new Color(1f, 0.5279f, 0.0221f, 1f);
						((TMP_Text)GUI.m_additionalTxt).alignment = (TextAlignmentOptions)514;
					}
					if (((Component)GUI.m_additionalTxt).gameObject.activeSelf)
					{
						((TMP_Text)GUI.m_additionalTxt).ForceMeshUpdate(false, false);
					}
				}
			}
			else
			{
				((TMP_Text)GUI.m_additionalTxt).text = "";
				if (((Component)GUI.m_additionalTxt).gameObject.activeSelf)
				{
					((TMP_Text)GUI.m_additionalTxt).ForceMeshUpdate(false, false);
				}
			}
			return;
		}
		((TMP_Text)GUI.m_additionalTxt).fontSizeMin = 30f;
		Material fontMaterial = ((TMP_Text)GUI.m_additionalTxt).fontMaterial;
		fontMaterial.EnableKeyword("OUTLINE_ON");
		fontMaterial.SetFloat(ShaderUtilities.ID_OutlineWidth, 0.15f);
		fontMaterial.SetColor(ShaderUtilities.ID_OutlineColor, new Color(0f, 0f, 0f, 0.5f));
		fontMaterial.SetFloat(ShaderUtilities.ID_OutlineSoftness, 0f);
		((TMP_Text)GUI.m_additionalTxt).fontMaterial.SetFloat("_FaceDilate", ((TMP_Text)GUI.m_additionalTxt).outlineWidth);
		if (doorSL.m_terminalNavInfoForward.Count > 0 && ((TMP_Text)GUI.m_locatorTxt).text == doorSL.m_terminalItem.TerminalItemKey)
		{
			string text3 = doorSL.m_terminalNavInfoForward[0];
			string text4 = "ZONE";
			int num = text3.LastIndexOf(text4);
			string text5 = ((num >= 0) ? text3.Substring(num + text4.Length) : text3);
			if (text5 != text3)
			{
				((TMP_Text)GUI.m_locatorTxt).text = "<size=30><color=#00ff33>Entering: Zone " + text5 + "</color></size><br>" + doorSL.m_terminalItem.TerminalItemKey;
				((TMP_Text)GUI.m_locatorTxt).fontSizeMin = 36f;
				((TMP_Text)GUI.m_locatorTxt).ForceMeshUpdate(false, false);
			}
		}
		bool flag = false;
		bool flag2 = false;
		bool flag3 = false;
		bool flag4 = false;
		bool flag5 = (int)status == 10 || (int)status == 16;
		bool num2 = (int)doorSL.m_securityDoorType == 2;
		if (doorSL.IsCheckpointDoor)
		{
			((TMP_Text)GUI.m_additionalTxt).text = "CHECKPOINT";
			((Graphic)GUI.m_additionalTxt).color = new Color(0f, 1f, 0.2f, 1f);
			((TMP_Text)GUI.m_additionalTxt).alignment = (TextAlignmentOptions)514;
			flag4 = true;
		}
		else
		{
			((TMP_Text)GUI.m_additionalTxt).text = "";
		}
		if ((int)status == 7)
		{
			if (flag4)
			{
				TextMeshPro additionalTxt = GUI.m_additionalTxt;
				((TMP_Text)additionalTxt).text = ((TMP_Text)additionalTxt).text + "<br><size=35><color=#ffcc00>LOCKDOWN</color></size>";
				((TMP_Text)GUI.m_additionalTxt).alignment = (TextAlignmentOptions)2050;
			}
			else
			{
				((TMP_Text)GUI.m_additionalTxt).text = "<size=40>LOCKDOWN</size>";
				((Graphic)GUI.m_additionalTxt).color = new Color(1f, 0.8f, 0f, 1f);
				((TMP_Text)GUI.m_additionalTxt).alignment = (TextAlignmentOptions)514;
			}
			flag4 = true;
			flag = true;
		}
		if ((int)status == 6 && !flag)
		{
			string itemKey = component.m_powerGeneratorNeeded.m_itemKey;
			bool flag6 = itemKey != null && itemKey != "";
			if (flag4)
			{
				if (flag6)
				{
					TextMeshPro additionalTxt2 = GUI.m_additionalTxt;
					((TMP_Text)additionalTxt2).text = ((TMP_Text)additionalTxt2).text + "<br><color=#ffcc00>REQ: " + itemKey + "</color>";
				}
				else
				{
					TextMeshPro additionalTxt3 = GUI.m_additionalTxt;
					((TMP_Text)additionalTxt3).text = ((TMP_Text)additionalTxt3).text + "<br><color=#ffcc00>NO POWER</color>";
				}
				((TMP_Text)GUI.m_additionalTxt).alignment = (TextAlignmentOptions)2050;
			}
			else
			{
				if (flag6)
				{
					((TMP_Text)GUI.m_additionalTxt).text = "REQ: " + itemKey;
				}
				else
				{
					((TMP_Text)GUI.m_additionalTxt).text = "NO POWER";
				}
				((Graphic)GUI.m_additionalTxt).color = new Color(1f, 0.8f, 0f, 1f);
				((TMP_Text)GUI.m_additionalTxt).alignment = (TextAlignmentOptions)514;
			}
			flag4 = true;
			flag = true;
		}
		if (!flag)
		{
			if ((int)status == 15)
			{
				if (flag4)
				{
					TextMeshPro additionalTxt4 = GUI.m_additionalTxt;
					((TMP_Text)additionalTxt4).text = ((TMP_Text)additionalTxt4).text + "<br><color=#ff8706>REQ: " + component.m_bulkheadDCNeeded.PublicName + "</color>";
					((TMP_Text)GUI.m_additionalTxt).alignment = (TextAlignmentOptions)2050;
				}
				else
				{
					((TMP_Text)GUI.m_additionalTxt).text = "REQ: " + component.m_bulkheadDCNeeded.PublicName;
					((Graphic)GUI.m_additionalTxt).color = new Color(1f, 0.5279f, 0.0221f, 1f);
					((TMP_Text)GUI.m_additionalTxt).alignment = (TextAlignmentOptions)514;
				}
				flag2 = true;
				flag4 = true;
			}
			else if ((int)status == 3 || (int)GUI.Status == 8 || (int)GUI.m_status == 8)
			{
				if (flag4)
				{
					TextMeshPro additionalTxt5 = GUI.m_additionalTxt;
					((TMP_Text)additionalTxt5).text = ((TMP_Text)additionalTxt5).text + "<br><color=#ff8706>REQ: " + doorSL.m_keyItem.PublicName + "</color>";
					((TMP_Text)GUI.m_additionalTxt).alignment = (TextAlignmentOptions)2050;
				}
				else
				{
					((TMP_Text)GUI.m_additionalTxt).text = "REQ: " + doorSL.m_keyItem.PublicName;
					((Graphic)GUI.m_additionalTxt).color = new Color(1f, 0.5279f, 0.0221f, 1f);
					((TMP_Text)GUI.m_additionalTxt).alignment = (TextAlignmentOptions)514;
				}
				flag2 = true;
				flag4 = true;
			}
		}
		if (!flag && !flag2 && component.m_hasAlarm && !component.ChainedPuzzleToSolve.IsSolved && component.ChainedPuzzleToSolve.Data.PublicAlarmName != null && !flag5 && ((int)GUI.Status != 6 || (int)GUI.m_status != 6))
		{
			if (flag4)
			{
				TextMeshPro additionalTxt6 = GUI.m_additionalTxt;
				((TMP_Text)additionalTxt6).text = ((TMP_Text)additionalTxt6).text + "<br><color=red>" + component.ChainedPuzzleToSolve.Data.PublicAlarmName + "</color>";
				((TMP_Text)GUI.m_additionalTxt).alignment = (TextAlignmentOptions)2050;
			}
			else
			{
				((TMP_Text)GUI.m_additionalTxt).text = component.ChainedPuzzleToSolve.Data.PublicAlarmName ?? "";
				((Graphic)GUI.m_additionalTxt).color = Color.red;
				((TMP_Text)GUI.m_additionalTxt).alignment = (TextAlignmentOptions)514;
			}
			flag3 = true;
			flag4 = true;
		}
		if (doorSL.ActiveEnemyWaveData != null && !flag5)
		{
			if (flag4)
			{
				TextMeshPro additionalTxt7 = GUI.m_additionalTxt;
				((TMP_Text)additionalTxt7).text = ((TMP_Text)additionalTxt7).text + "<br><color=#ff1313>MOTION DETECTED</color>";
				((TMP_Text)GUI.m_additionalTxt).alignment = (TextAlignmentOptions)2050;
			}
			else
			{
				((TMP_Text)GUI.m_additionalTxt).text = "MOTION DETECTED";
				((Graphic)GUI.m_additionalTxt).color = new Color(1f, 0.075f, 0.075f, 1f);
				((TMP_Text)GUI.m_additionalTxt).alignment = (TextAlignmentOptions)514;
			}
			flag4 = true;
		}
		if (num2 && component.m_hasAlarm && !component.ChainedPuzzleToSolve.IsSolved && !flag5)
		{
			if (GUI.m_gfxSecureApex.gameObject.activeSelf)
			{
				GUI.m_gfxBulkheadClosed.gameObject.SetActive(true);
				GUI.m_gfxSecureApex.gameObject.SetActive(false);
			}
			if (!flag3)
			{
				if (flag4)
				{
					TextMeshPro additionalTxt8 = GUI.m_additionalTxt;
					((TMP_Text)additionalTxt8).text = ((TMP_Text)additionalTxt8).text + "<br><color=red>ALARM</color>";
					((TMP_Text)GUI.m_additionalTxt).alignment = (TextAlignmentOptions)2050;
				}
				else
				{
					((TMP_Text)GUI.m_additionalTxt).text = "ALARM";
					((Graphic)GUI.m_additionalTxt).color = Color.red;
					((TMP_Text)GUI.m_additionalTxt).alignment = (TextAlignmentOptions)514;
				}
				flag4 = true;
			}
		}
		((TMP_Text)GUI.m_additionalTxt).fontSizeMax = 50f;
		((Renderer)((Component)GUI.m_additionalTxt).gameObject.GetComponent<MeshRenderer>()).sortingOrder = 4;
		if ((int)((TMP_Text)GUI.m_additionalTxt).alignment == 2050)
		{
			GUI.m_additionalTxt.transform.localPosition = new Vector3(-0.4f, -6.5f, 0f);
		}
		else
		{
			GUI.m_additionalTxt.transform.localPosition = new Vector3(-0.4f, -5.1f, 0f);
		}
		if (!((Component)GUI.m_additionalTxt).gameObject.activeSelf)
		{
			((Component)GUI.m_additionalTxt).gameObject.SetActive(true);
		}
		((TMP_Text)GUI.m_additionalTxt).ForceMeshUpdate(true, true);
	}

	internal static void WeakDoorGlueColors(LG_WeakDoor doorWL, CM_SyncedGUIItem doorGUI, float glueAmount, WeakDoorEntry doorEntry)
	{
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: 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_0034: Invalid comparison between Unknown and I4
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Invalid comparison between Unknown and I4
		//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_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		if (glueAmount <= 0f)
		{
			Il2CppReferenceArray<LG_WeakLock> weakLocks = doorWL.WeakLocks;
			if (weakLocks != null && ((Il2CppArrayBase<LG_WeakLock>)(object)weakLocks).Count > 0 && ((int)((Il2CppArrayBase<LG_WeakLock>)(object)doorWL.WeakLocks)[0].Status != 3 || (int)((Il2CppArrayBase<LG_WeakLock>)(object)doorWL.WeakLocks)[1].Status != 3))
			{
				if (doorEntry.IsMeleeLocked)
				{
					SetWeakDoorInnerColors(doorGUI, CfgMeleeClosedColor, CfgMeleeOpenColor);
					return;
				}
				if (doorEntry.IsHack)
				{
					SetWeakDoorInnerColors(doorGUI, CfgHackClosedColor, CfgHackOpenColor);
					return;
				}
			}
			SetWeakDoorInnerColors(doorGUI, WeakDoorDefaultClosed, WeakDoorDefaultOpen);
		}
		else
		{
			SetWeakDoorInnerColors(doorGUI, CfgGlueColor, CfgGlueColor);
		}
	}

	internal static void InventoryStyleShift(float generalTextAlpha, float headerTextAlpha, Color headerBackgroundColor, Color slotBackgroundColor, PUI_Inventory mapInventory, Sprite newSprite)
	{
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Expected O, but got Unknown
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Expected O, but got Unknown
		//IL_010e: 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_03c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)CustomInventoryBackgroundSprite == (Object)null)
		{
			byte[] array = File.ReadAllBytes(Path.Combine(pluginDir, "ModdedInventoryGradient.png"));
			Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false);
			((Texture)val).filterMode = (FilterMode)0;
			ImageConversion.LoadImage(val, Il2CppStructArray<byte>.op_Implicit(array));
			CustomInventoryBackgroundSprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(1f, 0.5f), 1f);
			((Object)CustomInventoryBackgroundSprite).name = "Custom";
			if ((Object)(object)CustomInventoryBackgroundSprite == (Object)null)
			{
				Debug.LogError(Object.op_Implicit("[IDI] ModdedInventoryGradient.png is null,"));
			}
		}
		if ((Object)(object)DefaultInventoryBackgroundSprite == (Object)null)
		{
			byte[] array2 = File.ReadAllBytes(Path.Combine(pluginDir, "OGInventoryGradient.png"));
			Texture2D val2 = new Texture2D(2, 2, (TextureFormat)4, false);
			((Texture)val2).filterMode = (FilterMode)0;
			ImageConversion.LoadImage(val2, Il2CppStructArray<byte>.op_Implicit(array2));
			DefaultInventoryBackgroundSprite = Sprite.Create(val2, new Rect(0f, 0f, (float)((Texture)val2).width, (float)((Texture)val2).height), new Vector2(1f, 0.5f), 1f);
			((Object)DefaultInventoryBackgroundSprite).name = "Default";
			if ((Object)(object)DefaultInventoryBackgroundSprite == (Object)null)
			{
				Debug.LogError(Object.op_Implicit("[IDI] OGInventoryGradient.png is null,"));
			}
		}
		foreach (TextMeshPro componentsInChild in ((Component)mapInventory).gameObject.GetComponentsInChildren<TextMeshPro>())
		{
			if (((Component)componentsInChild).gameObject.activeSelf && !(((TMP_Text)componentsInChild).text == ""))
			{
				bool flag = false;
				if (((TMP_Text)componentsInChild).alpha != generalTextAlpha)
				{
					((TMP_Text)componentsInChild).alpha = generalTextAlpha;
					flag = true;
				}
				if (CfgMapHighContrastInventory && componentsInChild.sortingOrder != 51)
				{
					componentsInChild.sortingOrder = 51;
					flag = true;
				}
				else if (!CfgMapHighContrastInventory && componentsInChild.sortingOrder != 0)
				{
					componentsInChild.sortingOrder = 0;
					flag = true;
				}
				if (flag)
				{
					((TMP_Text)componentsInChild).ForceMeshUpdate(false, false);
				}
			}
		}
		Enumerator<InventorySlot, PUI_InventoryItem> enumerator2 = mapInventory.m_inventorySlots.Values.GetEnumerator();
		while (enumerator2.MoveNext())
		{
			PUI_InventoryItem current2 = enumerator2.Current;
			if (!((Component)current2).gameObject.activeSelf)
			{
				continue;
			}
			foreach (SpriteRenderer componentsInChild2 in current2.m_slim_root.GetComponentsInChildren<SpriteRenderer>())
			{
				if (((Component)componentsInChild2).gameObject.activeSelf && IsBackgroundSprite(((Object)((Component)componentsInChild2).gameObject).name))
				{
					if (CfgMapHighContrastInventory && ((Renderer)componentsInChild2).sortingOrder != 50)
					{
						((Renderer)componentsInChild2).sortingOrder = 50;
					}
					else if (!CfgMapHighContrastInventory && ((Renderer)componentsInChild2).sortingOrder != 0)
					{
						((Renderer)componentsInChild2).sortingOrder = 0;
					}
					if (componentsInChild2.color != headerBackgroundColor)
					{
						componentsInChild2.color = slotBackgroundColor;
					}
					if (!CustomExtensions.ContainsIgnoreCase(((Object)((Component)componentsInChild2).gameObject).name, "Background Small") && (Object)(object)newSprite != (Object)null && (Object)(object)componentsInChild2.sprite != (Object)(object)newSprite)
					{
						componentsInChild2.sprite = newSprite;
					}
				}
			}
		}
		TextMeshPro componentInChildren = mapInventory.m_headerRoot.GetComponentInChildren<TextMeshPro>();
		if (((TMP_Text)componentInChildren).alpha != headerTextAlpha && (Object)(object)componentInChildren != (Object)null)
		{
			((TMP_Text)componentInChildren).alpha = headerTextAlpha;
			((TMP_Text)componentInChildren).ForceMeshUpdate(false, false);
		}
		SpriteRenderer componentInChildren2 = mapInventory.m_headerRoot.GetComponentInChildren<SpriteRenderer>();
		if (((Component)componentInChildren2).gameObject.activeSelf && !((Object)(object)componentInChildren2 == (Object)null))
		{
			if (CfgMapHighContrastInventory && ((Renderer)componentInChildren2).sortingOrder != 50)
			{
				((Renderer)componentInChildren2).sortingOrder = 50;
			}
			else if (!CfgMapHighContrastInventory && ((Renderer)componentInChildren2).sortingOrder != 0)
			{
				((Renderer)componentInChildren2).sortingOrder = 0;
			}
			if (componentInChildren2.color != headerBackgroundColor)
			{
				componentInChildren2.color = headerBackgroundColor;
			}
			if ((Object)(object)newSprite != (Object)null && (Object)(object)componentInChildren2.sprite != (Object)(object)newSprite)
			{
				componentInChildren2.sprite = newSprite;
			}
		}
	}
}