Decompiled source of CleanestHud v0.11.3

plugins/CleanestHud.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using CleanestHud.HudChanges;
using EntityStates.Seeker;
using IL.RoR2;
using IL.RoR2.UI;
using LookingGlass.ItemCounters;
using LookingGlass.StatsDisplay;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.EntityStates.Seeker;
using On.RoR2;
using On.RoR2.CameraModes;
using On.RoR2.ConVar;
using On.RoR2.UI;
using R2API.Utils;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.CameraModes;
using RoR2.ConVar;
using RoR2.HudOverlay;
using RoR2.UI;
using RoR2.UI.SkinControllers;
using SS2;
using SS2.Items;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("CleanestHud")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+7ba1cfa15a699c5641723b0afa0a359bd47298fe")]
[assembly: AssemblyProduct("CleanestHud")]
[assembly: AssemblyTitle("CleanestHud")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace CleanestHud
{
	public static class ConfigOptions
	{
		public static class SpecialConfig
		{
			public enum SeekerMeditateHudPosition
			{
				AboveHealthBar,
				OverCrosshair
			}

			public enum SeekerLotusHudPosition
			{
				AboveHealthBar,
				LeftOfHealthbar
			}
		}

		public static ConfigEntry<float> HudTransparency;

		public static ConfigEntry<bool> ShowSkillKeybinds;

		public static ConfigEntry<bool> ShowSkillAndEquipmentOutlines;

		public static ConfigEntry<bool> ShowSprintAndInventoryKeybinds;

		public static ConfigEntry<bool> AllowInspectPanelFadeIn;

		public static ConfigEntry<float> InspectPanelFadeInDuration;

		public static ConfigEntry<bool> AllowAllyCardBackgrounds;

		public static ConfigEntry<bool> AllowScoreboardLabels;

		public static ConfigEntry<bool> AllowScoreboardItemHighlightColoring;

		public static ConfigEntry<bool> AllowAutoScoreboardHighlight;

		public static ConfigEntry<bool> AllowConsistentDifficultyBarColor;

		public static ConfigEntry<bool> AllowSimulacrumWaveBarAnimating;

		public static ConfigEntry<bool> AllowVoidFiendMeterAnimating;

		public static ConfigEntry<SpecialConfig.SeekerMeditateHudPosition> SeekerMeditateHudPosition;

		public static ConfigEntry<SpecialConfig.SeekerLotusHudPosition> SeekerLotusHudPosition;

		public static ConfigEntry<string> BodyNameBlacklist_Config;

		internal static string[] BodyNameBlacklist_Array;

		public static ConfigEntry<bool> AllowDebugLogging;

		private static void HudTransparency_SettingChanged(object sender, EventArgs e)
		{
			if (Main.IsHudEditable)
			{
				(((Component)Main.MyHud).GetComponent<CanvasGroup>() ?? ((Component)Main.MyHud).gameObject.AddComponent<CanvasGroup>()).alpha = HudTransparency.Value;
				HudDetails.SetInspectPanelMaxAlpha();
			}
		}

		private static void ShowSkillKeybinds_SettingChanged(object sender, EventArgs e)
		{
			if (Main.IsHudEditable)
			{
				HudDetails.SetSkillsAndEquipmentReminderTextStatus();
				HudStructure.RepositionSkillScaler();
				HudStructure.RepositionSprintAndInventoryReminders();
			}
		}

		private static void ShowSkillAndEquipmentOutlines_SettingChanged(object sender, EventArgs e)
		{
			if (Main.IsHudEditable)
			{
				HudDetails.SetSkillOutlinesStatus();
			}
		}

		private static void ShowSprintAndInventoryKeybinds_SettingChanged(object sender, EventArgs e)
		{
			if (Main.IsHudEditable)
			{
				HudDetails.SetSprintAndInventoryKeybindsStatus();
			}
		}

		private static void AllowInspectPanelFadeIn_SettingChanged(object sender, EventArgs e)
		{
			if (Main.IsHudEditable)
			{
				HudDetails.SetInspectPanelFadeInStatus();
			}
		}

		private static void InspectPanelFadeInDuration_SettingChanged(object sender, EventArgs e)
		{
			if (Main.IsHudEditable)
			{
				HudDetails.SetInspectPanelFadeInStatus();
			}
		}

		private static void AllowAllyCardBackgrounds_SettingChanged(object sender, EventArgs e)
		{
			if (Main.IsHudEditable)
			{
				if (AllowAllyCardBackgrounds.Value)
				{
					HudColor.ColorAllAllyCardBackgrounds();
				}
				HudDetails.SetAllyCardBackgroundsStatus();
			}
		}

		private static void AllowScoreboardLabels_SettingChanged(object sender, EventArgs e)
		{
			if (Main.IsHudEditable)
			{
				HudDetails.SetScoreboardLabelsActiveOrNot(HudResources.ImportantHudTransforms.SpringCanvas.Find("ScoreboardPanel"));
			}
		}

		private static void AllowScoreboardItemHighlightColoring_SettingChanged(object sender, EventArgs e)
		{
			if (Main.IsHudEditable)
			{
				ScoreboardController component = ((Component)HudResources.ImportantHudTransforms.SpringCanvas.Find("ScoreboardPanel")).GetComponent<ScoreboardController>();
				for (int i = 0; i < component.stripAllocator.elements.Count; i++)
				{
					((MonoBehaviour)Main.MyHud).StartCoroutine(HudColor.DelayColorItemIconHighlights(component.stripAllocator.elements[i]));
				}
			}
		}

		private static void AllowConsistentDifficultyBarColor_SettingChanged(object sender, EventArgs e)
		{
			if (Main.IsHudEditable)
			{
				HudDetails.SetFakeInfiniteLastDifficultySegmentStatus();
				HudColor.ColorDifficultyBar();
			}
		}

		private static void AllowSimulacrumWaveBarAnimating_SettingChanged(object sender, EventArgs e)
		{
			if (Main.IsHudEditable)
			{
				HudDetails.SetSimulacrumWaveBarAnimatorStatus();
			}
		}

		private static void AllowVoidFiendMeterAnimating_SettingChanged(object sender, EventArgs e)
		{
			if (Main.IsHudEditable)
			{
				SurvivorSpecific.SetVoidFiendMeterAnimatorStatus();
			}
		}

		private static void SeekerMeditateHudPosition_SettingChanged(object sender, EventArgs e)
		{
			if (Main.IsHudEditable)
			{
				SurvivorSpecific.RepositionSeekerMeditationUI();
			}
		}

		private static void SeekerLotusUiPosition_SettingChanged(object sender, EventArgs e)
		{
			if (Main.IsHudEditable)
			{
				SurvivorSpecific.RepositionSeekerLotusUI();
			}
		}

		private static void BodyNameBlacklist_Config_SettingChanged(object sender, EventArgs e)
		{
			BodyNameBlacklist_Array = BodyNameBlacklist_Config.Value.Split(',');
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		internal static void BindConfigOptions(ConfigFile config)
		{
			HudTransparency = config.Bind<float>("HUD Settings", "HUD Transparency", 0.8f, "How transparent should the entire HUD be?\n1 = 100% opaque (no transparency), 0.8 = 80% opaque (20% transparency)");
			ShowSkillAndEquipmentOutlines = config.Bind<bool>("HUD Settings", "Show skill outlines", true, "Should skills have survivor-colored outlines?");
			ShowSkillKeybinds = config.Bind<bool>("HUD Settings", "Show skill & equipment keybinds", false, "Should the keybinds set for your 4 skills & equipment be displayed below your skills be shown?");
			ShowSprintAndInventoryKeybinds = config.Bind<bool>("HUD Settings", "Show sprint and inventory keybinds", false, "Should the keybinds set for sprinting and opening the inventory menu be shown?");
			AllowInspectPanelFadeIn = config.Bind<bool>("HUD Settings", "Allow inspect panel fade-in", false, "Should the inspect panel do it's fade-in animation whenever an item is clicked?");
			InspectPanelFadeInDuration = config.Bind<float>("HUD Settings", "Inspect panel fade-in duration", 0.4f, "Set a custom duration for the inspect panel's fade-in animation. Vanilla is 0.2");
			AllowAllyCardBackgrounds = config.Bind<bool>("HUD Settings", "Allow ally backgrounds", true, "Should the allies on the left side of the HUD have their backgrounds? If Allowd, the backgrounds will be properly colored.");
			AllowScoreboardLabels = config.Bind<bool>("HUD Settings", "Allow inventories menu labels", false, "Should the player/items/equipment labels be visible on the inventories screen?");
			AllowScoreboardItemHighlightColoring = config.Bind<bool>("HUD Settings", "Allow changing inventory item icon highlight colors", true, "Should the highlights for item icons in the TAB inventories menu be colored based on the survivor that has those items?");
			AllowAutoScoreboardHighlight = config.Bind<bool>("HUD Settings", "Allow auto highlight when opening the inventory menu", false, "Should the automatic highlight for the first person in TAB inventories list be Allowd?");
			AllowConsistentDifficultyBarColor = config.Bind<bool>("HUD Settings", "Allow consistent difficulty bar segment colors", true, "Should the coloring for the difficulty bar stay the same instead of getting darker as the difficulty increases?");
			AllowSimulacrumWaveBarAnimating = config.Bind<bool>("HUD Settings", "Allow simulacrum wave progress bar animations", false, "Should the progress bar on the simulacrum's wave UI be allowed to animate & squish around whenever enemies spawn/enemies are left?\nNOTE: Will cause the bar to become stuck squished after a second or 2 of an active wave.");
			AllowVoidFiendMeterAnimating = config.Bind<bool>("HUD Settings - Survivor Specific", "Allow Void Fiend corruption meter animations", false, "Should Void Fiend's corruption meter be allowed to animate & squish around whenever the percentage changes?\nNOTE: Currently, when the animations disabled, the colors of the meter do not change based on your form.");
			SeekerMeditateHudPosition = config.Bind<SpecialConfig.SeekerMeditateHudPosition>("HUD Settings - Survivor Specific", "Seeker Meditate Minigame UI Position", SpecialConfig.SeekerMeditateHudPosition.OverCrosshair, "Choose the position for the UI of the minigame you do for Seeker's meditation.");
			SeekerLotusHudPosition = config.Bind<SpecialConfig.SeekerLotusHudPosition>("HUD Settings - Survivor Specific", "Seeker Lotus UI Position", SpecialConfig.SeekerLotusHudPosition.LeftOfHealthbar, "Choose the position for the lotus flower thing on the UI that shows your progress towards your 7th meditation.");
			BodyNameBlacklist_Config = config.Bind<string>("HUD Settings - Survivor Specific", "Survivor Blacklist", "", "If the HUD gets messed up when playing with certain survivors, add their BODY name (i.e. CommandoBody) here to stop the mod's hud changes when playing that survivor. Each body name needs separated by a comma and NO spaces.");
			BodyNameBlacklist_Array = BodyNameBlacklist_Config.Value.Split(',');
			AllowDebugLogging = config.Bind<bool>("Other", "Allow debug logging", false, "Allow to do some extra debug logging that can help diagnose issues with the mod.");
			if (ModSupport.RiskOfOptionsMod.ModIsRunning)
			{
				HudTransparency.SettingChanged += HudTransparency_SettingChanged;
				ShowSkillAndEquipmentOutlines.SettingChanged += ShowSkillAndEquipmentOutlines_SettingChanged;
				ShowSkillKeybinds.SettingChanged += ShowSkillKeybinds_SettingChanged;
				ShowSprintAndInventoryKeybinds.SettingChanged += ShowSprintAndInventoryKeybinds_SettingChanged;
				AllowInspectPanelFadeIn.SettingChanged += AllowInspectPanelFadeIn_SettingChanged;
				InspectPanelFadeInDuration.SettingChanged += InspectPanelFadeInDuration_SettingChanged;
				AllowAllyCardBackgrounds.SettingChanged += AllowAllyCardBackgrounds_SettingChanged;
				AllowScoreboardItemHighlightColoring.SettingChanged += AllowScoreboardItemHighlightColoring_SettingChanged;
				AllowConsistentDifficultyBarColor.SettingChanged += AllowConsistentDifficultyBarColor_SettingChanged;
				AllowSimulacrumWaveBarAnimating.SettingChanged += AllowSimulacrumWaveBarAnimating_SettingChanged;
				AllowVoidFiendMeterAnimating.SettingChanged += AllowVoidFiendMeterAnimating_SettingChanged;
				SeekerMeditateHudPosition.SettingChanged += SeekerMeditateHudPosition_SettingChanged;
				SeekerLotusHudPosition.SettingChanged += SeekerLotusUiPosition_SettingChanged;
				BodyNameBlacklist_Config.SettingChanged += BodyNameBlacklist_Config_SettingChanged;
				ModSupport.RiskOfOptionsMod.AddOptions();
			}
			if (ModSupport.LookingGlassMod.ModIsRunning)
			{
				ModSupport.LookingGlassMod.HookStatsPanelConfig_SettingChanged();
			}
		}
	}
	internal static class Extensions
	{
		public static Transform FindWithPartialMatch(this Transform thisTransform, string partialName)
		{
			if (thisTransform.childCount == 0)
			{
				return null;
			}
			for (int i = 0; i < thisTransform.childCount; i++)
			{
				Transform child = thisTransform.GetChild(i);
				if (((Object)child).name.Contains(partialName))
				{
					return child;
				}
			}
			return null;
		}

		public static List<Transform> FindListOfPartialMatches(this Transform thisTransform, string partialName)
		{
			List<Transform> list = new List<Transform>();
			if (thisTransform.childCount == 0)
			{
				return null;
			}
			for (int i = 0; i < thisTransform.childCount; i++)
			{
				Transform child = thisTransform.GetChild(i);
				if (((Object)child).name.Contains(partialName))
				{
					list.Add(child);
				}
			}
			return list;
		}
	}
	internal class HudResources
	{
		internal static class HudAssets
		{
			internal static Sprite WhiteSprite;

			internal static Material FontMaterial;

			internal static GameObject SimulacrumWaveUI;

			internal static GameObject EnemyInfoPanel;

			internal static GameObject GameEndReportPanel;

			internal static GameObject ViendCrosshair;

			internal static GameObject ViendCorruption;

			internal static GameObject ScoreboardStrip;

			internal static GameObject ItemIconScoreboard;

			internal static GameObject MoonDetonationPanel;

			internal static GameObject StatStripTemplate;

			internal static GameObject ChatBox;

			internal static GameObject ItemIconPrefab;

			internal static Sprite LastDifficultySegmentSprite;

			internal static void LoadHudAssets()
			{
				//IL_0005: 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_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_002b: Unknown result type (might be due to invalid IL or missing references)
				//IL_003f: 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_0056: Unknown result type (might be due to invalid IL or missing references)
				//IL_005b: Unknown result type (might be due to invalid IL or missing references)
				//IL_006d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0072: Unknown result type (might be due to invalid IL or missing references)
				//IL_0084: Unknown result type (might be due to invalid IL or missing references)
				//IL_0089: Unknown result type (might be due to invalid IL or missing references)
				//IL_009b: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b2: 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_00c9: 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_00e0: 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_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_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_0125: Unknown result type (might be due to invalid IL or missing references)
				//IL_012a: Unknown result type (might be due to invalid IL or missing references)
				//IL_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)
				WhiteSprite = Sprite.Create(Addressables.LoadAssetAsync<Texture2D>((object)"RoR2/Base/Common/texWhite.png").WaitForCompletion(), new Rect(0f, 0f, 4f, 4f), Vector2.zero);
				FontMaterial = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/Fonts/Bombardier/tmpBombDropshadow3D.mat").WaitForCompletion();
				ChatBox = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/UI/ChatBox.prefab").WaitForCompletion();
				SimulacrumWaveUI = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/GameModes/InfiniteTowerRun/InfiniteTowerAssets/InfiniteTowerDefaultWaveUI.prefab").WaitForCompletion();
				EnemyInfoPanel = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/UI/EnemyInfoPanel.prefab").WaitForCompletion();
				GameEndReportPanel = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/UI/GameEndReportPanel.prefab").WaitForCompletion();
				ViendCrosshair = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidSurvivor/VoidSurvivorCrosshair.prefab").WaitForCompletion();
				ViendCorruption = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidSurvivor/VoidSurvivorCorruptionUISimplified.prefab").WaitForCompletion();
				ScoreboardStrip = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/UI/ScoreboardStrip.prefab").WaitForCompletion();
				ItemIconScoreboard = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/UI/ItemIconScoreboard.prefab").WaitForCompletion();
				MoonDetonationPanel = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/UI/HudCountdownPanel.prefab").WaitForCompletion();
				StatStripTemplate = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/UI/StatStripTemplate.prefab").WaitForCompletion();
				ItemIconPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/UI/ItemIconScoreboard_InGame.prefab").WaitForCompletion();
			}
		}

		internal static class ImportantHudTransforms
		{
			internal static Transform MainUIArea;

			internal static Transform MainContainer;

			internal static Transform UpperRightCluster;

			internal static Transform RunInfoHudPanel;

			internal static Transform RightInfoBar;

			internal static Transform SpringCanvas;

			internal static Transform TopCenterCluster;

			internal static Transform BottomLeftCluster;

			internal static Transform BottomCenterCluster;

			internal static Transform BottomRightCluster;

			internal static Transform RightCluster;

			internal static Transform BarRoots;

			internal static Transform SkillsScaler;

			internal static Transform InspectPanelArea
			{
				get
				{
					if (!Main.IsHudFinishedLoading)
					{
						return null;
					}
					return Helpers.GetContainerFromScoreboardPanel(SpringCanvas.Find("ScoreboardPanel")).GetChild(2).GetChild(0);
				}
			}

			internal static void FindHudTransforms()
			{
				MainUIArea = Main.MyHud.mainUIPanel.transform;
				MainContainer = Main.MyHud.mainContainer.transform;
				UpperRightCluster = ((Component)Main.MyHud.gameModeUiRoot).transform;
				RunInfoHudPanel = UpperRightCluster.GetChild(0);
				RightInfoBar = RunInfoHudPanel.Find("RightInfoBar");
				SpringCanvas = MainUIArea.Find("SpringCanvas");
				TopCenterCluster = SpringCanvas.Find("TopCenterCluster");
				BottomLeftCluster = SpringCanvas.Find("BottomLeftCluster");
				BottomCenterCluster = SpringCanvas.Find("BottomCenterCluster");
				BottomRightCluster = SpringCanvas.Find("BottomRightCluster");
				RightCluster = SpringCanvas.Find("RightCluster");
				BarRoots = BottomLeftCluster.Find("BarRoots");
				SkillsScaler = BottomRightCluster.Find("Scaler");
			}
		}
	}
	internal static class Log
	{
		private static ManualLogSource _logSource;

		internal static void Init(ManualLogSource logSource)
		{
			_logSource = logSource;
		}

		internal static void Debug(object data)
		{
			if (ConfigOptions.AllowDebugLogging.Value)
			{
				_logSource.LogDebug(data);
			}
		}

		internal static void Error(object data)
		{
			_logSource.LogError(data);
		}

		internal static void Fatal(object data)
		{
			_logSource.LogFatal(data);
		}

		internal static void Info(object data)
		{
			_logSource.LogInfo(data);
		}

		internal static void Message(object data)
		{
			_logSource.LogMessage(data);
		}

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
	internal static class Main
	{
		internal static class OnHooks
		{
			[CompilerGenerated]
			private sealed class <DelayScoreboardController_Rebuild>d__13 : IEnumerator<object>, IEnumerator, IDisposable
			{
				private int <>1__state;

				private object <>2__current;

				public ScoreboardController scoreboardController;

				object IEnumerator<object>.Current
				{
					[DebuggerHidden]
					get
					{
						return <>2__current;
					}
				}

				object IEnumerator.Current
				{
					[DebuggerHidden]
					get
					{
						return <>2__current;
					}
				}

				[DebuggerHidden]
				public <DelayScoreboardController_Rebuild>d__13(int <>1__state)
				{
					this.<>1__state = <>1__state;
				}

				[DebuggerHidden]
				void IDisposable.Dispose()
				{
					<>1__state = -2;
				}

				private bool MoveNext()
				{
					switch (<>1__state)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						<>2__current = null;
						<>1__state = 1;
						return true;
					case 1:
						<>1__state = -1;
						EditScoreboardStripsIfApplicable(scoreboardController);
						return false;
					}
				}

				bool IEnumerator.MoveNext()
				{
					//ILSpy generated this explicit interface implementation from .override directive in MoveNext
					return this.MoveNext();
				}

				[DebuggerHidden]
				void IEnumerator.Reset()
				{
					throw new NotSupportedException();
				}
			}

			[CompilerGenerated]
			private sealed class <WaitForHpBarToFinishLoading>d__1 : IEnumerator<object>, IEnumerator, IDisposable
			{
				private int <>1__state;

				private object <>2__current;

				public Transform hpBarShrunkenRoot;

				object IEnumerator<object>.Current
				{
					[DebuggerHidden]
					get
					{
						return <>2__current;
					}
				}

				object IEnumerator.Current
				{
					[DebuggerHidden]
					get
					{
						return <>2__current;
					}
				}

				[DebuggerHidden]
				public <WaitForHpBarToFinishLoading>d__1(int <>1__state)
				{
					this.<>1__state = <>1__state;
				}

				[DebuggerHidden]
				void IDisposable.Dispose()
				{
					<>1__state = -2;
				}

				private bool MoveNext()
				{
					switch (<>1__state)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						break;
					case 1:
						<>1__state = -1;
						break;
					}
					if (hpBarShrunkenRoot.childCount == 0)
					{
						Log.Debug("HUD HP bar does not have any children to modify yet, waiting");
						<>2__current = null;
						<>1__state = 1;
						return true;
					}
					BeginLiveHudChanges();
					return false;
				}

				bool IEnumerator.MoveNext()
				{
					//ILSpy generated this explicit interface implementation from .override directive in MoveNext
					return this.MoveNext();
				}

				[DebuggerHidden]
				void IEnumerator.Reset()
				{
					throw new NotSupportedException();
				}
			}

			internal static void HUD_Awake(orig_Awake orig, HUD hud)
			{
				orig.Invoke(hud);
				Log.Debug("HUD_Awake");
				MyHud = hud;
				HudResources.ImportantHudTransforms.FindHudTransforms();
				Transform hpBarShrunkenRoot = MyHud.mainUIPanel.transform.Find("SpringCanvas").Find("BottomLeftCluster").Find("BarRoots")
					.Find("HealthbarRoot")
					.Find("ShrunkenRoot");
				((MonoBehaviour)MyHud).StartCoroutine(WaitForHpBarToFinishLoading(hpBarShrunkenRoot));
			}

			[IteratorStateMachine(typeof(<WaitForHpBarToFinishLoading>d__1))]
			private static IEnumerator WaitForHpBarToFinishLoading(Transform hpBarShrunkenRoot)
			{
				//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
				return new <WaitForHpBarToFinishLoading>d__1(0)
				{
					hpBarShrunkenRoot = hpBarShrunkenRoot
				};
			}

			private static void BeginLiveHudChanges()
			{
				CharacterBody hudTargetBody = HudTargetBody;
				IsHudFinishedLoading = true;
				SizeBasedPositionsNeedCalculating = true;
				if (ConfigOptions.BodyNameBlacklist_Array.Contains(((Object)hudTargetBody).name.Substring(0, ((Object)hudTargetBody).name.Length - 7)))
				{
					IsHudUserBlacklisted = true;
					return;
				}
				HudStructure.EditHudStructure();
				HudStructure.RepositionHudElementsBasedOnWidth();
				HudDetails.EditHudDetails();
				OnCameraChange(hudTargetBody);
			}

			internal static void HUD_OnDestroy(orig_OnDestroy orig, HUD self)
			{
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(self);
				IsHudFinishedLoading = false;
				IsHudUserBlacklisted = false;
				HudColor.SurvivorColor = Color.clear;
			}

			internal static void CameraModeBase_OnTargetChanged(orig_OnTargetChanged orig, CameraModeBase self, CameraRigController cameraRigController, OnTargetChangedArgs args)
			{
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(self, cameraRigController, args);
				if (!Object.op_Implicit((Object)(object)cameraRigController.targetBody))
				{
					Log.Debug("cameraRigController.targetBody was invalid? returning");
				}
				else
				{
					OnCameraChange(cameraRigController.targetBody);
				}
			}

			internal static void OnCameraChange(CharacterBody targetCharacterBody)
			{
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				//IL_0039: Unknown result type (might be due to invalid IL or missing references)
				Log.Debug("OnCameraChange");
				Log.Debug("cameraRigController.targetBody.baseNameToken is " + targetCharacterBody.baseNameToken);
				HudColor.SurvivorColor = Helpers.GetAdjustedColor(targetCharacterBody.bodyColor, 0.85f, 0.85f);
				if (!IsHudEditable)
				{
					Log.Debug("Camera changed while HUD was not editable, returning");
					return;
				}
				string baseNameToken = targetCharacterBody.baseNameToken;
				if (!(baseNameToken == "VOIDSURVIVOR_BODY_NAME"))
				{
					if (baseNameToken == "SEEKER_BODY_NAME")
					{
						((MonoBehaviour)MyHud).StartCoroutine(SurvivorSpecific.DelayRepositionSeekerLotusUI());
					}
				}
				else
				{
					((MonoBehaviour)MyHud).StartCoroutine(SurvivorSpecific.DelayEditVoidFiendCorruptionUI());
				}
			}

			internal static void BaseConVar_AttemptSetString(orig_AttemptSetString orig, BaseConVar self, string newValue)
			{
				orig.Invoke(self, newValue);
				if (self.name == "resolution")
				{
					SizeBasedPositionsNeedCalculating = true;
					HudStructure.RepositionHudElementsBasedOnWidth();
				}
			}

			internal static void AllyCardController_Awake(orig_Awake orig, AllyCardController self)
			{
				orig.Invoke(self);
				if (!IsHudUserBlacklisted)
				{
					Transform child = ((Component)self).transform.GetChild(0);
					((MonoBehaviour)MyHud).StartCoroutine(HudDetails.DelayEditAllyCardPortrait(child));
					if (!ConfigOptions.AllowAllyCardBackgrounds.Value)
					{
						((Behaviour)((Component)self).GetComponent<Image>()).enabled = false;
					}
				}
			}

			internal static void AllyCardController_UpdateInfo(orig_UpdateInfo orig, AllyCardController self)
			{
				orig.Invoke(self);
				if (!IsHudUserBlacklisted && ConfigOptions.AllowAllyCardBackgrounds.Value)
				{
					HudColor.ColorAllyCardControllerBackground(self);
				}
			}

			internal static void HealthBar_InitializeHealthBar(orig_InitializeHealthBar orig, HealthBar self)
			{
				if (((Object)self).name != "HealthbarRoot")
				{
					orig.Invoke(self);
					return;
				}
				Log.Debug("HealthBar_InitializeHealthBar");
				self.spriteAsNumberManager = null;
				Transform val = ((Component)self).transform.Find("Managed_Sprite_HP");
				if ((Object)(object)val != (Object)null)
				{
					((Component)val).gameObject.SetActive(false);
				}
				else
				{
					Log.Debug("Couldn't find managedSpriteHP! This is OK though since it isn't needed for the HUD.");
				}
				Transform val2 = ((Component)self).transform.Find("Slash");
				if ((Object)(object)val2 != (Object)null)
				{
					((Component)val2).gameObject.SetActive(true);
				}
				else
				{
					Log.Error("Couldn't find \"Slash\" on the HP bar! Another mod may have already disabled/removed it. This means the improved HP bar text will not be shown, and no text will be shown if \"managedSpriteHP\" was successfully set to inactive. Report this on github!");
				}
				orig.Invoke(self);
			}

			internal static void InfiniteTowerWaveProgressBar_OnEnable(orig_OnEnable orig, InfiniteTowerWaveProgressBar simulacrumTowerWaveProgressBar)
			{
				orig.Invoke(simulacrumTowerWaveProgressBar);
				if (!IsHudUserBlacklisted)
				{
					simulacrumTowerWaveProgressBar.barImage.sprite = HudResources.HudAssets.WhiteSprite;
					HudColor.ColorSimulacrumWaveProgressBar(((Component)simulacrumTowerWaveProgressBar.barImage).transform.parent);
					HudDetails.SetSimulacrumWaveBarAnimatorStatus();
				}
			}

			internal static void NotificationUIController_SetUpNotification(orig_SetUpNotification orig, NotificationUIController self, NotificationInfo notificationInfo)
			{
				orig.Invoke(self, notificationInfo);
				if (!IsHudUserBlacklisted)
				{
					((MonoBehaviour)MyHud).StartCoroutine(HudDetails.DelayRemoveNotificationBackground());
				}
			}

			internal static void ScoreboardController_Rebuild(orig_Rebuild orig, ScoreboardController scoreboardController)
			{
				if (IsHudUserBlacklisted)
				{
					orig.Invoke(scoreboardController);
					return;
				}
				HudStructure.AssetEdits.EditScoreboardStripAsset();
				HudDetails.SetScoreboardLabelsActiveOrNot(((Component)scoreboardController).transform);
				orig.Invoke(scoreboardController);
				((MonoBehaviour)MyHud).StartCoroutine(DelayScoreboardController_Rebuild(scoreboardController));
			}

			[IteratorStateMachine(typeof(<DelayScoreboardController_Rebuild>d__13))]
			private static IEnumerator DelayScoreboardController_Rebuild(ScoreboardController scoreboardController)
			{
				//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
				return new <DelayScoreboardController_Rebuild>d__13(0)
				{
					scoreboardController = scoreboardController
				};
			}

			private static void EditScoreboardStripsIfApplicable(ScoreboardController scoreboardController)
			{
				//IL_005f: 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)
				foreach (ScoreboardStrip element in scoreboardController.stripAllocator.elements)
				{
					Transform transform = ((Component)element).transform;
					if ((Object)(object)element.userBody == (Object)null)
					{
						Log.Debug("scoreboard strip had a null body, returning");
						break;
					}
					if (element.itemInventoryDisplay.itemIconPrefabWidth != 58f)
					{
						HudStructure.EditScoreboardStrip(element);
					}
					if (!Helpers.AreColorsEqualIgnoringAlpha(((Graphic)((Component)transform.GetChild(0)).GetComponent<Image>()).color, element.userBody.bodyColor))
					{
						HudColor.ColorAllOfScoreboardStrip(element);
					}
				}
			}

			internal static void ScoreboardController_SelectFirstScoreboardStrip(orig_SelectFirstScoreboardStrip orig, ScoreboardController self)
			{
				if (IsHudUserBlacklisted)
				{
					orig.Invoke(self);
				}
				if (ConfigOptions.AllowAutoScoreboardHighlight.Value)
				{
					orig.Invoke(self);
				}
			}

			internal static void DifficultyBarController_OnCurrentSegmentIndexChanged(orig_OnCurrentSegmentIndexChanged orig, DifficultyBarController self, int newSegmentIndex)
			{
				orig.Invoke(self, newSegmentIndex);
				if (!IsHudUserBlacklisted)
				{
					Log.Debug("DifficultyBarController_OnCurrentSegmentIndexChanged");
					Log.Debug($"newSegmentIndex is {newSegmentIndex}");
					Log.Debug($"ConfigOptions.AllowConsistentDifficultyBarColor.Value is {ConfigOptions.AllowConsistentDifficultyBarColor.Value}");
					if (newSegmentIndex > 6 && ConfigOptions.AllowConsistentDifficultyBarColor.Value)
					{
						HudDetails.SetFakeInfiniteLastDifficultySegmentStatus();
					}
				}
			}

			internal static void VoidSurvivorController_OnOverlayInstanceAdded(orig_OnOverlayInstanceAdded orig, VoidSurvivorController self, OverlayController controller, GameObject instance)
			{
				orig.Invoke(self, controller, instance);
				if (!IsHudUserBlacklisted)
				{
					((Behaviour)self.overlayInstanceAnimator).enabled = ConfigOptions.AllowVoidFiendMeterAnimating.Value;
				}
			}

			internal static void MeditationUI_SetupInputUIIcons(orig_SetupInputUIIcons orig, MeditationUI self)
			{
				orig.Invoke(self);
				if (!IsHudUserBlacklisted)
				{
					SurvivorSpecific.RepositionSeekerMeditationUI();
				}
			}
		}

		internal static class ILHooks
		{
			[CompilerGenerated]
			private sealed class <DelayFixFirstBuffRotation>d__2 : IEnumerator<object>, IEnumerator, IDisposable
			{
				private int <>1__state;

				private object <>2__current;

				public RectTransform rectTransform;

				object IEnumerator<object>.Current
				{
					[DebuggerHidden]
					get
					{
						return <>2__current;
					}
				}

				object IEnumerator.Current
				{
					[DebuggerHidden]
					get
					{
						return <>2__current;
					}
				}

				[DebuggerHidden]
				public <DelayFixFirstBuffRotation>d__2(int <>1__state)
				{
					this.<>1__state = <>1__state;
				}

				[DebuggerHidden]
				void IDisposable.Dispose()
				{
					<>1__state = -2;
				}

				private bool MoveNext()
				{
					//IL_0034: Unknown result type (might be due to invalid IL or missing references)
					switch (<>1__state)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						<>2__current = null;
						<>1__state = 1;
						return true;
					case 1:
						<>1__state = -1;
						((Transform)rectTransform).rotation = Quaternion.identity;
						return false;
					}
				}

				bool IEnumerator.MoveNext()
				{
					//ILSpy generated this explicit interface implementation from .override directive in MoveNext
					return this.MoveNext();
				}

				[DebuggerHidden]
				void IEnumerator.Reset()
				{
					throw new NotSupportedException();
				}
			}

			internal static void BossGroup_UpdateObservations(ILContext il)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Expected O, but got Unknown
				ILCursor val = new ILCursor(il);
				if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "<sprite name=\"CloudRight\" tint=1>")
				}))
				{
					Log.Error("COULD NOT IL HOOK BossGroup_UpdateObservations");
					Log.Warning($"cursor is {val}");
					Log.Warning($"il is {il}");
				}
				else
				{
					val.EmitDelegate<Func<string, string>>((Func<string, string>)((string cloudRightString) => cloudRightString.Insert(0, " ")));
				}
			}

			internal static void BuffDisplay_UpdateLayout(ILContext il)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Expected O, but got Unknown
				//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				if (!val.TryGotoNext((MoveType)1, new Func<Instruction, bool>[3]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallvirt<BuffIcon>(x, "get_rectTransform"),
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0),
					(Instruction x) => ILPatternMatchingExt.MatchCallvirt<RectTransform>(x, "set_anchoredPosition")
				}))
				{
					Log.Error("COULD NOT IL HOOK BuffDisplay_UpdateLayout");
					Log.Warning($"cursor is {val}");
					Log.Warning($"il is {il}");
					return;
				}
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Action<BuffDisplay>>((Action<BuffDisplay>)delegate(BuffDisplay buffDisplay)
				{
					//IL_008a: Unknown result type (might be due to invalid IL or missing references)
					if (!(((Object)buffDisplay).name != "BuffDisplayRoot") && buffDisplay.buffIconDisplayData.Count >= 1)
					{
						if ((Object)(object)buffDisplay.buffIconDisplayData[0].buffIconComponent != (Object)null)
						{
							((MonoBehaviour)MyHud).StartCoroutine(DelayFixFirstBuffRotation(buffDisplay.buffIconDisplayData[0].buffIconComponent.rectTransform));
						}
						if (IsHudEditable)
						{
							((Transform)buffDisplay.rectTranform).localPosition = new Vector3(-25f * (float)buffDisplay.buffIconDisplayData.Count, -45f, 0f);
						}
					}
				});
			}

			[IteratorStateMachine(typeof(<DelayFixFirstBuffRotation>d__2))]
			private static IEnumerator DelayFixFirstBuffRotation(RectTransform rectTransform)
			{
				//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
				return new <DelayFixFirstBuffRotation>d__2(0)
				{
					rectTransform = rectTransform
				};
			}

			internal static void ItemIcon_SetItemIndex(ILContext il)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Expected O, but got Unknown
				//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
				//IL_025b: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				if (!val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[3]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
					(Instruction x) => ILPatternMatchingExt.MatchLdfld<ItemIcon>(x, "glowImage"),
					(Instruction x) => ILPatternMatchingExt.MatchCall<Object>(x, "op_Implicit")
				}))
				{
					Log.Error("COULD NOT IL HOOK ItemIcon_SetItemIndex PART 1");
					Log.Warning($"cursor is {val}");
					Log.Warning($"il is {il}");
					return;
				}
				try
				{
					val.Emit(OpCodes.Ldarg_0);
					val.EmitDelegate<Action<ItemIcon>>((Action<ItemIcon>)delegate(ItemIcon itemIcon)
					{
						if (!(((Object)itemIcon.image).name != "ItemIconScoreboard_InGame(Clone)"))
						{
							itemIcon.glowImage = ((Component)((Component)itemIcon).transform.GetChild(1)).GetComponent<RawImage>();
							HudColor.ColorSingleItemIconHighlight(itemIcon);
						}
					});
				}
				catch (Exception arg)
				{
					Log.Error($"COULD NOT EMIT INTO ItemIcon_SetItemIndex PART 1 DUE TO {arg}");
				}
				if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[3]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.75f),
					(Instruction x) => ILPatternMatchingExt.MatchNewobj<Color>(x),
					(Instruction x) => ILPatternMatchingExt.MatchCallvirt<Graphic>(x, "set_color")
				}))
				{
					Log.Error("COULD NOT IL HOOK ItemIcon_SetItemIndex PART 2");
					Log.Warning($"cursor is {val}");
					Log.Warning($"il is {il}");
					return;
				}
				ILLabel val2 = val.DefineLabel();
				try
				{
					val.MarkLabel(val2);
					val.Index = 0;
				}
				catch (Exception arg2)
				{
					Log.Error($"COULD NOT EMIT INTO ItemIcon_SetItemIndex PART 2 DUE TO {arg2}");
				}
				if (!val.TryGotoNext((MoveType)1, new Func<Instruction, bool>[3]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
					(Instruction x) => ILPatternMatchingExt.MatchLdfld<ItemIcon>(x, "glowImage"),
					(Instruction x) => ILPatternMatchingExt.MatchCall<Object>(x, "op_Implicit")
				}))
				{
					Log.Error("COULD NOT IL HOOK ItemIcon_SetItemIndex PART 3");
					Log.Warning($"cursor is {val}");
					Log.Warning($"il is {il}");
					return;
				}
				try
				{
					val.Emit(OpCodes.Br, (object)val2);
				}
				catch (Exception arg3)
				{
					Log.Error($"COULD NOT EMIT INTO ItemIcon_SetItemIndex PART 3 DUE TO {arg3}");
				}
			}
		}

		internal static class Events
		{
			internal static void InfiniteTowerRun_onWaveInitialized(InfiniteTowerWaveController obj)
			{
				if (!IsHudUserBlacklisted)
				{
					((MonoBehaviour)MyHud).StartCoroutine(HudDetails.DelayRemoveSimulacrumWavePopUpPanelDetails());
					((MonoBehaviour)MyHud).StartCoroutine(HudDetails.DelayRemoveTimeUntilNextWaveBackground());
				}
			}

			internal static void Run_onRunStartGlobal(Run obj)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				HudColor.SurvivorColor = Color.clear;
			}
		}

		internal static class Helpers
		{
			public static Color GetAdjustedColor(Color rgbColor, float saturationMultiplier = 1f, float brightnessMultiplier = 1f, float colorIntensityMultiplier = 1f, float transparencyMultiplier = 1f)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				//IL_002b: Unknown result type (might be due to invalid IL or missing references)
				//IL_003a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0049: 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)
				float num = default(float);
				float num2 = default(float);
				float num3 = default(float);
				Color.RGBToHSV(rgbColor, ref num, ref num2, ref num3);
				Color result = Color.HSVToRGB(num, num2 * saturationMultiplier, num3 * brightnessMultiplier, true);
				result.r = rgbColor.r * colorIntensityMultiplier;
				result.g = rgbColor.g * colorIntensityMultiplier;
				result.b = rgbColor.b * colorIntensityMultiplier;
				result.a = rgbColor.a * transparencyMultiplier;
				return result;
			}

			internal static void LogMissingHudVariable(string methodName, string variableName, string containingClassName = null)
			{
				string text = "Could not do " + methodName;
				if (containingClassName != null)
				{
					text = text + " in " + containingClassName;
				}
				text = text + "! The " + variableName + " was null or did it not exist!";
				Log.Error(text);
			}

			internal static bool AreColorsEqualIgnoringAlpha(Color color1, Color color2)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: 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_001c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0022: Unknown result type (might be due to invalid IL or missing references)
				if (color1.r == color2.r && color1.g == color2.g)
				{
					return color1.b == color2.b;
				}
				return false;
			}

			internal static Color ChangeColorWhileKeepingAlpha(Color originalColor, Color newColor)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				return new Color(newColor.r, newColor.b, newColor.g, originalColor.a);
			}
		}

		internal static HUD MyHud = null;

		internal static bool IsHudFinishedLoading = false;

		internal static bool IsHudUserBlacklisted = false;

		internal static bool SizeBasedPositionsNeedCalculating;

		internal static List<Color> LastKnownScoreboardBodyColors = new List<Color>();

		internal static bool IsHudEditable
		{
			get
			{
				if (IsHudFinishedLoading)
				{
					return !IsHudUserBlacklisted;
				}
				return false;
			}
		}

		internal static CharacterBody HudTargetBody
		{
			get
			{
				if (!Object.op_Implicit((Object)(object)MyHud))
				{
					Log.Error("HUD did not exist when trying to get HudTargetBody!");
				}
				if (!Object.op_Implicit((Object)(object)MyHud.targetBodyObject))
				{
					Log.Error("HUD did not have a valid targetBodyObject!");
				}
				return MyHud.targetBodyObject.GetComponent<CharacterBody>();
			}
		}

		internal static bool IsGameModeSimulacrum => Run.instance.gameModeIndex == GameModeCatalog.FindGameModeIndex("InfiniteTowerRun");

		internal static bool AreSimulacrumWavesRunning
		{
			get
			{
				Run instance = Run.instance;
				if ((Object)(object)((InfiniteTowerRun)((instance is InfiniteTowerRun) ? instance : null)).waveController != (Object)null)
				{
					return true;
				}
				return false;
			}
		}
	}
	public static class ModAssets
	{
		public static AssetBundle AssetBundle;

		public const string BundleName = "cleanesthud";

		public static string AssetBundlePath => Path.Combine(Path.GetDirectoryName(Plugin.PluginInfo.Location), "cleanesthud");

		public static void Init()
		{
			AssetBundle = AssetBundle.LoadFromFile(AssetBundlePath);
		}
	}
	internal static class ModSupport
	{
		internal static class RiskOfOptionsMod
		{
			private static bool? _modexists;

			public static bool ModIsRunning
			{
				get
				{
					if (!_modexists.HasValue)
					{
						_modexists = Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions");
					}
					return _modexists.Value;
				}
			}

			[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
			internal static void AddOptions()
			{
				//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_0033: Unknown result type (might be due to invalid IL or missing references)
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				//IL_004e: Expected O, but got Unknown
				//IL_0049: Unknown result type (might be due to invalid IL or missing references)
				//IL_0053: Expected O, but got Unknown
				//IL_0058: Unknown result type (might be due to invalid IL or missing references)
				//IL_0062: Expected O, but got Unknown
				//IL_0067: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: 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_0085: Unknown result type (might be due to invalid IL or missing references)
				//IL_008f: Expected O, but got Unknown
				//IL_0094: 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_00a4: 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_00bf: Expected O, but got Unknown
				//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c4: Expected O, but got Unknown
				//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d3: Expected O, but got Unknown
				//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e2: Expected O, but got Unknown
				//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f1: Expected O, but got Unknown
				//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
				//IL_0100: Expected O, but got Unknown
				//IL_0105: Unknown result type (might be due to invalid IL or missing references)
				//IL_010f: Expected O, but got Unknown
				//IL_0114: Unknown result type (might be due to invalid IL or missing references)
				//IL_011e: Expected O, but got Unknown
				//IL_0123: Unknown result type (might be due to invalid IL or missing references)
				//IL_012d: Expected O, but got Unknown
				//IL_0132: Unknown result type (might be due to invalid IL or missing references)
				//IL_013c: Expected O, but got Unknown
				//IL_0141: Unknown result type (might be due to invalid IL or missing references)
				//IL_014b: Expected O, but got Unknown
				//IL_0150: Unknown result type (might be due to invalid IL or missing references)
				//IL_015a: Expected O, but got Unknown
				//IL_015f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0169: Expected O, but got Unknown
				ModSettingsManager.SetModIcon(ModAssets.AssetBundle.LoadAsset<Sprite>("CleanestHudIcon.png"));
				ModSettingsManager.SetModDescription("Adds an artifact that disables proc chains and prevents most items from starting a proc chain.");
				ModSettingsManager.AddOption((BaseOption)new StepSliderOption(ConfigOptions.HudTransparency, new StepSliderConfig
				{
					min = 0f,
					max = 1f,
					increment = 0.025f
				}));
				ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(ConfigOptions.ShowSkillAndEquipmentOutlines));
				ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(ConfigOptions.ShowSkillKeybinds));
				ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(ConfigOptions.ShowSprintAndInventoryKeybinds));
				ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(ConfigOptions.AllowInspectPanelFadeIn));
				ModSettingsManager.AddOption((BaseOption)new StepSliderOption(ConfigOptions.InspectPanelFadeInDuration, new StepSliderConfig
				{
					min = 0.025f,
					max = 10f,
					increment = 0.025f
				}));
				ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(ConfigOptions.AllowAllyCardBackgrounds));
				ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(ConfigOptions.AllowScoreboardLabels));
				ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(ConfigOptions.AllowScoreboardItemHighlightColoring));
				ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(ConfigOptions.AllowAutoScoreboardHighlight));
				ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(ConfigOptions.AllowConsistentDifficultyBarColor));
				ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(ConfigOptions.AllowSimulacrumWaveBarAnimating));
				ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(ConfigOptions.AllowVoidFiendMeterAnimating));
				ModSettingsManager.AddOption((BaseOption)new ChoiceOption((ConfigEntryBase)(object)ConfigOptions.SeekerMeditateHudPosition));
				ModSettingsManager.AddOption((BaseOption)new ChoiceOption((ConfigEntryBase)(object)ConfigOptions.SeekerLotusHudPosition));
				ModSettingsManager.AddOption((BaseOption)new StringInputFieldOption(ConfigOptions.BodyNameBlacklist_Config));
				ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(ConfigOptions.AllowDebugLogging));
			}
		}

		internal static class Starstorm2
		{
			internal static class CompositeInjectorSupport
			{
				[CompilerGenerated]
				private sealed class <DelayColorInjectorSlots>d__3 : IEnumerator<object>, IEnumerator, IDisposable
				{
					private int <>1__state;

					private object <>2__current;

					object IEnumerator<object>.Current
					{
						[DebuggerHidden]
						get
						{
							return <>2__current;
						}
					}

					object IEnumerator.Current
					{
						[DebuggerHidden]
						get
						{
							return <>2__current;
						}
					}

					[DebuggerHidden]
					public <DelayColorInjectorSlots>d__3(int <>1__state)
					{
						this.<>1__state = <>1__state;
					}

					[DebuggerHidden]
					void IDisposable.Dispose()
					{
						<>1__state = -2;
					}

					private bool MoveNext()
					{
						switch (<>1__state)
						{
						default:
							return false;
						case 0:
							<>1__state = -1;
							<>2__current = null;
							<>1__state = 1;
							return true;
						case 1:
							<>1__state = -1;
							ColorInjectorSlots();
							return false;
						}
					}

					bool IEnumerator.MoveNext()
					{
						//ILSpy generated this explicit interface implementation from .override directive in MoveNext
						return this.MoveNext();
					}

					[DebuggerHidden]
					void IEnumerator.Reset()
					{
						throw new NotSupportedException();
					}
				}

				[CompilerGenerated]
				private sealed class <DelayEditInjectorSlots>d__1 : IEnumerator<object>, IEnumerator, IDisposable
				{
					private int <>1__state;

					private object <>2__current;

					object IEnumerator<object>.Current
					{
						[DebuggerHidden]
						get
						{
							return <>2__current;
						}
					}

					object IEnumerator.Current
					{
						[DebuggerHidden]
						get
						{
							return <>2__current;
						}
					}

					[DebuggerHidden]
					public <DelayEditInjectorSlots>d__1(int <>1__state)
					{
						this.<>1__state = <>1__state;
					}

					[DebuggerHidden]
					void IDisposable.Dispose()
					{
						<>1__state = -2;
					}

					private bool MoveNext()
					{
						switch (<>1__state)
						{
						default:
							return false;
						case 0:
							<>1__state = -1;
							<>2__current = null;
							<>1__state = 1;
							return true;
						case 1:
							<>1__state = -1;
							EditInjectorSlots();
							return false;
						}
					}

					bool IEnumerator.MoveNext()
					{
						//ILSpy generated this explicit interface implementation from .override directive in MoveNext
						return this.MoveNext();
					}

					[DebuggerHidden]
					void IEnumerator.Reset()
					{
						throw new NotSupportedException();
					}
				}

				internal static int KnownInjectorSlotCount = -1;

				[IteratorStateMachine(typeof(<DelayEditInjectorSlots>d__1))]
				internal static IEnumerator DelayEditInjectorSlots()
				{
					//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
					return new <DelayEditInjectorSlots>d__1(0);
				}

				[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
				internal static void EditInjectorSlots()
				{
					//IL_0091: 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_00b9: Unknown result type (might be due to invalid IL or missing references)
					//IL_00be: Unknown result type (might be due to invalid IL or missing references)
					//IL_00c3: 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_012f: Unknown result type (might be due to invalid IL or missing references)
					//IL_0131: Unknown result type (might be due to invalid IL or missing references)
					//IL_0164: Unknown result type (might be due to invalid IL or missing references)
					//IL_0169: Unknown result type (might be due to invalid IL or missing references)
					IconHolder val = default(IconHolder);
					if (!ModIsRunning || !Main.IsHudFinishedLoading || !((Component)Main.MyHud).gameObject.TryGetComponent<IconHolder>(ref val))
					{
						return;
					}
					Vector3 val2 = default(Vector3);
					for (int i = 0; i < val.icons.Length && val.icons[i].displayRoot.activeSelf; i++)
					{
						Transform transform = val.icons[i].displayRoot.transform;
						((Component)transform).GetComponent<RectTransform>();
						((Component)val.icons[i]).GetComponent<RectTransform>();
						((Component)val.icons[i]).transform.GetChild(0).position = ((Component)Main.MyHud.equipmentIcons[1]).transform.GetChild(0).position;
						RectTransform component = ((Component)((Component)val.icons[i]).transform.GetChild(0)).GetComponent<RectTransform>();
						Vector3 zero = Vector3.zero;
						Rect rect = component.rect;
						zero.x = ((Rect)(ref rect)).width * 3f;
						zero.y -= 107 * (i / 10);
						if (i < 10)
						{
							zero.x += 100 * (i % 10);
						}
						else
						{
							zero.x += 100 * ((i - 11) % 10 + 5);
						}
						Transform transform2 = ((Component)val.icons[i]).transform;
						transform2.localPosition += zero;
						Transform child = transform.GetChild(0);
						((Component)child).gameObject.SetActive(false);
						((Vector3)(ref val2))..ctor(1.1f, 1.1f, 1.1f);
						if (child.localScale != val2)
						{
							HudStructure.ScaleEquipmentSlot(transform, 1.1f);
						}
					}
				}

				[IteratorStateMachine(typeof(<DelayColorInjectorSlots>d__3))]
				internal static IEnumerator DelayColorInjectorSlots()
				{
					//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
					return new <DelayColorInjectorSlots>d__3(0);
				}

				[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
				internal static void ColorInjectorSlots()
				{
					//IL_005a: Unknown result type (might be due to invalid IL or missing references)
					//IL_0073: Unknown result type (might be due to invalid IL or missing references)
					//IL_008c: 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)
					IconHolder val = default(IconHolder);
					if (!ModIsRunning || !Main.IsHudFinishedLoading || !((Component)Main.MyHud).gameObject.TryGetComponent<IconHolder>(ref val))
					{
						return;
					}
					EquipmentIconButEpic[] icons = val.icons;
					foreach (EquipmentIconButEpic val2 in icons)
					{
						if (!val2.displayRoot.activeSelf)
						{
							break;
						}
						Transform transform = val2.displayRoot.transform;
						((Graphic)((Component)transform.GetChild(0)).GetComponent<Image>()).color = Main.Helpers.GetAdjustedColor(HudColor.SurvivorColor, 1f, 1f, 0.643f);
						((Graphic)((Component)transform.Find("BGPanel")).GetComponent<Image>()).color = Main.Helpers.GetAdjustedColor(HudColor.SurvivorColor, 1f, 1f, 0.643f);
					}
				}
			}

			private static bool? _modexists;

			internal static bool ModIsRunning
			{
				get
				{
					if (!_modexists.HasValue)
					{
						_modexists = Chainloader.PluginInfos.ContainsKey("com.TeamMoonstorm");
					}
					return _modexists.Value;
				}
			}

			[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
			internal static void CharacterBody_onBodyInventoryChangedGlobal(CharacterBody characterBody)
			{
				if (!Main.IsHudFinishedLoading)
				{
					Log.Debug("onBodyInventoryChangedGlobal happened while the HUD was not done loading, returning");
					return;
				}
				int itemCount = characterBody.inventory.GetItemCount(Items.CompositeInjector);
				if (itemCount != CompositeInjectorSupport.KnownInjectorSlotCount)
				{
					CompositeInjectorSupport.KnownInjectorSlotCount = itemCount;
					((MonoBehaviour)Main.MyHud).StartCoroutine(CompositeInjectorSupport.DelayEditInjectorSlots());
					((MonoBehaviour)Main.MyHud).StartCoroutine(CompositeInjectorSupport.DelayColorInjectorSlots());
				}
			}
		}

		internal static class LookingGlassMod
		{
			[CompilerGenerated]
			private sealed class <DelayRemoveLookingGlassStatsPanelBackground>d__9 : IEnumerator<object>, IEnumerator, IDisposable
			{
				private int <>1__state;

				private object <>2__current;

				private Transform <rightInfoBar>5__2;

				private Transform <playerStats>5__3;

				object IEnumerator<object>.Current
				{
					[DebuggerHidden]
					get
					{
						return <>2__current;
					}
				}

				object IEnumerator.Current
				{
					[DebuggerHidden]
					get
					{
						return <>2__current;
					}
				}

				[DebuggerHidden]
				public <DelayRemoveLookingGlassStatsPanelBackground>d__9(int <>1__state)
				{
					this.<>1__state = <>1__state;
				}

				[DebuggerHidden]
				void IDisposable.Dispose()
				{
					<rightInfoBar>5__2 = null;
					<playerStats>5__3 = null;
					<>1__state = -2;
				}

				private bool MoveNext()
				{
					switch (<>1__state)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						<>2__current = null;
						<>1__state = 1;
						return true;
					case 1:
					{
						<>1__state = -1;
						Transform child = ((Component)Main.MyHud.gameModeUiRoot).transform.GetChild(0);
						<rightInfoBar>5__2 = child.Find("RightInfoBar");
						<playerStats>5__3 = null;
						goto IL_008e;
					}
					case 2:
						<>1__state = -1;
						goto IL_008e;
					case 3:
						{
							<>1__state = -1;
							break;
						}
						IL_008e:
						if (!Object.op_Implicit((Object)(object)<rightInfoBar>5__2.Find("PlayerStats")))
						{
							Log.Debug("Couldn't find LookingGlass PlayerStats, waiting a lil bit");
							<>2__current = null;
							<>1__state = 2;
							return true;
						}
						<playerStats>5__3 = <rightInfoBar>5__2.Find("PlayerStats");
						break;
					}
					PanelSkinController val = default(PanelSkinController);
					if (!((Component)<playerStats>5__3).TryGetComponent<PanelSkinController>(ref val))
					{
						Log.Debug("Couldn't find LookingGlass PlayerStats PanelSkinController, waiting a lil bit");
						<>2__current = null;
						<>1__state = 3;
						return true;
					}
					RemoveLookingGlassStatsPanelBackground(<playerStats>5__3);
					return false;
				}

				bool IEnumerator.MoveNext()
				{
					//ILSpy generated this explicit interface implementation from .override directive in MoveNext
					return this.MoveNext();
				}

				[DebuggerHidden]
				void IEnumerator.Reset()
				{
					throw new NotSupportedException();
				}
			}

			private static bool? _modexists;

			internal static bool ModIsRunning
			{
				get
				{
					if (!_modexists.HasValue)
					{
						_modexists = Chainloader.PluginInfos.ContainsKey("droppod.lookingglass");
					}
					return _modexists.Value;
				}
			}

			internal static bool ItemCountersConfigValue
			{
				[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
				get
				{
					if (ModIsRunning)
					{
						return ItemCounter.itemCounters.Value;
					}
					return false;
				}
			}

			internal static bool StatsPanelConfigValue
			{
				[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
				get
				{
					if (ModIsRunning)
					{
						return StatsDisplayClass.statsDisplay.Value;
					}
					return false;
				}
			}

			[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
			internal static void HookStatsPanelConfig_SettingChanged()
			{
				if (StatsDisplayClass.statsDisplay != null)
				{
					StatsDisplayClass.statsDisplay.SettingChanged += StatsPanelConfig_SettingChanged;
				}
			}

			internal static void StatsPanelConfig_SettingChanged(object sender, EventArgs e)
			{
				if (Main.IsHudEditable && StatsPanelConfigValue)
				{
					((MonoBehaviour)Main.MyHud).StartCoroutine(DelayRemoveLookingGlassStatsPanelBackground());
				}
			}

			[IteratorStateMachine(typeof(<DelayRemoveLookingGlassStatsPanelBackground>d__9))]
			internal static IEnumerator DelayRemoveLookingGlassStatsPanelBackground()
			{
				//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
				return new <DelayRemoveLookingGlassStatsPanelBackground>d__9(0);
			}

			private static void RemoveLookingGlassStatsPanelBackground(Transform playerStats)
			{
				Object.Destroy((Object)(object)((Component)playerStats).GetComponent<PanelSkinController>());
				Object.Destroy((Object)(object)((Component)playerStats).GetComponent<Image>());
			}
		}
	}
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("LordVGames.CleanestHud", "CleanestHud", "0.11.3")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_Awake <0>__HUD_Awake;

			public static hook_OnDestroy <1>__HUD_OnDestroy;

			public static hook_OnTargetChanged <2>__CameraModeBase_OnTargetChanged;

			public static hook_AttemptSetString <3>__BaseConVar_AttemptSetString;

			public static hook_Awake <4>__AllyCardController_Awake;

			public static hook_UpdateInfo <5>__AllyCardController_UpdateInfo;

			public static hook_InitializeHealthBar <6>__HealthBar_InitializeHealthBar;

			public static hook_OnCurrentSegmentIndexChanged <7>__DifficultyBarController_OnCurrentSegmentIndexChanged;

			public static hook_OnEnable <8>__InfiniteTowerWaveProgressBar_OnEnable;

			public static hook_SetUpNotification <9>__NotificationUIController_SetUpNotification;

			public static hook_Rebuild <10>__ScoreboardController_Rebuild;

			public static hook_SelectFirstScoreboardStrip <11>__ScoreboardController_SelectFirstScoreboardStrip;

			public static hook_OnOverlayInstanceAdded <12>__VoidSurvivorController_OnOverlayInstanceAdded;

			public static hook_SetupInputUIIcons <13>__MeditationUI_SetupInputUIIcons;

			public static Manipulator <14>__BossGroup_UpdateObservations;

			public static Manipulator <15>__BuffDisplay_UpdateLayout;

			public static Manipulator <16>__ItemIcon_SetItemIndex;

			public static Action<InfiniteTowerWaveController> <17>__InfiniteTowerRun_onWaveInitialized;

			public static Action<Run> <18>__Run_onRunStartGlobal;

			public static Action<CharacterBody> <19>__CharacterBody_onBodyInventoryChangedGlobal;
		}

		public const string PluginAuthor = "LordVGames";

		public const string PluginName = "CleanestHud";

		public const string PluginVersion = "0.11.3";

		public const string PluginGUID = "LordVGames.CleanestHud";

		public static PluginInfo PluginInfo { get; private set; }

		public void Awake()
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Expected O, but got Unknown
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Expected O, but got Unknown
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			//IL_00a0: 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_00ab: Expected O, but got Unknown
			//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_00cb: Expected O, but got Unknown
			//IL_00e0: 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_00eb: Expected O, but got Unknown
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Expected O, but got Unknown
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Expected O, but got Unknown
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Expected O, but got Unknown
			//IL_0160: 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_016b: Expected O, but got Unknown
			//IL_0180: 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_018b: Expected O, but got Unknown
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Expected O, but got Unknown
			//IL_01c0: 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_01cb: Expected O, but got Unknown
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01eb: Expected O, but got Unknown
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Expected O, but got Unknown
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Expected O, but got Unknown
			//IL_0240: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: Unknown result type (might be due to invalid IL or missing references)
			//IL_024b: Expected O, but got Unknown
			PluginInfo = ((BaseUnityPlugin)this).Info;
			Log.Init(((BaseUnityPlugin)this).Logger);
			ModAssets.Init();
			ConfigOptions.BindConfigOptions(((BaseUnityPlugin)this).Config);
			HudResources.HudAssets.LoadHudAssets();
			HudDetails.AssetEdits.EditHudElementPrefabDetails();
			object obj = <>O.<0>__HUD_Awake;
			if (obj == null)
			{
				hook_Awake val = Main.OnHooks.HUD_Awake;
				<>O.<0>__HUD_Awake = val;
				obj = (object)val;
			}
			HUD.Awake += (hook_Awake)obj;
			object obj2 = <>O.<1>__HUD_OnDestroy;
			if (obj2 == null)
			{
				hook_OnDestroy val2 = Main.OnHooks.HUD_OnDestroy;
				<>O.<1>__HUD_OnDestroy = val2;
				obj2 = (object)val2;
			}
			HUD.OnDestroy += (hook_OnDestroy)obj2;
			object obj3 = <>O.<2>__CameraModeBase_OnTargetChanged;
			if (obj3 == null)
			{
				hook_OnTargetChanged val3 = Main.OnHooks.CameraModeBase_OnTargetChanged;
				<>O.<2>__CameraModeBase_OnTargetChanged = val3;
				obj3 = (object)val3;
			}
			CameraModeBase.OnTargetChanged += (hook_OnTargetChanged)obj3;
			object obj4 = <>O.<3>__BaseConVar_AttemptSetString;
			if (obj4 == null)
			{
				hook_AttemptSetString val4 = Main.OnHooks.BaseConVar_AttemptSetString;
				<>O.<3>__BaseConVar_AttemptSetString = val4;
				obj4 = (object)val4;
			}
			BaseConVar.AttemptSetString += (hook_AttemptSetString)obj4;
			object obj5 = <>O.<4>__AllyCardController_Awake;
			if (obj5 == null)
			{
				hook_Awake val5 = Main.OnHooks.AllyCardController_Awake;
				<>O.<4>__AllyCardController_Awake = val5;
				obj5 = (object)val5;
			}
			AllyCardController.Awake += (hook_Awake)obj5;
			object obj6 = <>O.<5>__AllyCardController_UpdateInfo;
			if (obj6 == null)
			{
				hook_UpdateInfo val6 = Main.OnHooks.AllyCardController_UpdateInfo;
				<>O.<5>__AllyCardController_UpdateInfo = val6;
				obj6 = (object)val6;
			}
			AllyCardController.UpdateInfo += (hook_UpdateInfo)obj6;
			object obj7 = <>O.<6>__HealthBar_InitializeHealthBar;
			if (obj7 == null)
			{
				hook_InitializeHealthBar val7 = Main.OnHooks.HealthBar_InitializeHealthBar;
				<>O.<6>__HealthBar_InitializeHealthBar = val7;
				obj7 = (object)val7;
			}
			HealthBar.InitializeHealthBar += (hook_InitializeHealthBar)obj7;
			object obj8 = <>O.<7>__DifficultyBarController_OnCurrentSegmentIndexChanged;
			if (obj8 == null)
			{
				hook_OnCurrentSegmentIndexChanged val8 = Main.OnHooks.DifficultyBarController_OnCurrentSegmentIndexChanged;
				<>O.<7>__DifficultyBarController_OnCurrentSegmentIndexChanged = val8;
				obj8 = (object)val8;
			}
			DifficultyBarController.OnCurrentSegmentIndexChanged += (hook_OnCurrentSegmentIndexChanged)obj8;
			object obj9 = <>O.<8>__InfiniteTowerWaveProgressBar_OnEnable;
			if (obj9 == null)
			{
				hook_OnEnable val9 = Main.OnHooks.InfiniteTowerWaveProgressBar_OnEnable;
				<>O.<8>__InfiniteTowerWaveProgressBar_OnEnable = val9;
				obj9 = (object)val9;
			}
			InfiniteTowerWaveProgressBar.OnEnable += (hook_OnEnable)obj9;
			object obj10 = <>O.<9>__NotificationUIController_SetUpNotification;
			if (obj10 == null)
			{
				hook_SetUpNotification val10 = Main.OnHooks.NotificationUIController_SetUpNotification;
				<>O.<9>__NotificationUIController_SetUpNotification = val10;
				obj10 = (object)val10;
			}
			NotificationUIController.SetUpNotification += (hook_SetUpNotification)obj10;
			object obj11 = <>O.<10>__ScoreboardController_Rebuild;
			if (obj11 == null)
			{
				hook_Rebuild val11 = Main.OnHooks.ScoreboardController_Rebuild;
				<>O.<10>__ScoreboardController_Rebuild = val11;
				obj11 = (object)val11;
			}
			ScoreboardController.Rebuild += (hook_Rebuild)obj11;
			object obj12 = <>O.<11>__ScoreboardController_SelectFirstScoreboardStrip;
			if (obj12 == null)
			{
				hook_SelectFirstScoreboardStrip val12 = Main.OnHooks.ScoreboardController_SelectFirstScoreboardStrip;
				<>O.<11>__ScoreboardController_SelectFirstScoreboardStrip = val12;
				obj12 = (object)val12;
			}
			ScoreboardController.SelectFirstScoreboardStrip += (hook_SelectFirstScoreboardStrip)obj12;
			object obj13 = <>O.<12>__VoidSurvivorController_OnOverlayInstanceAdded;
			if (obj13 == null)
			{
				hook_OnOverlayInstanceAdded val13 = Main.OnHooks.VoidSurvivorController_OnOverlayInstanceAdded;
				<>O.<12>__VoidSurvivorController_OnOverlayInstanceAdded = val13;
				obj13 = (object)val13;
			}
			VoidSurvivorController.OnOverlayInstanceAdded += (hook_OnOverlayInstanceAdded)obj13;
			object obj14 = <>O.<13>__MeditationUI_SetupInputUIIcons;
			if (obj14 == null)
			{
				hook_SetupInputUIIcons val14 = Main.OnHooks.MeditationUI_SetupInputUIIcons;
				<>O.<13>__MeditationUI_SetupInputUIIcons = val14;
				obj14 = (object)val14;
			}
			MeditationUI.SetupInputUIIcons += (hook_SetupInputUIIcons)obj14;
			object obj15 = <>O.<14>__BossGroup_UpdateObservations;
			if (obj15 == null)
			{
				Manipulator val15 = Main.ILHooks.BossGroup_UpdateObservations;
				<>O.<14>__BossGroup_UpdateObservations = val15;
				obj15 = (object)val15;
			}
			BossGroup.UpdateObservations += (Manipulator)obj15;
			object obj16 = <>O.<15>__BuffDisplay_UpdateLayout;
			if (obj16 == null)
			{
				Manipulator val16 = Main.ILHooks.BuffDisplay_UpdateLayout;
				<>O.<15>__BuffDisplay_UpdateLayout = val16;
				obj16 = (object)val16;
			}
			BuffDisplay.UpdateLayout += (Manipulator)obj16;
			object obj17 = <>O.<16>__ItemIcon_SetItemIndex;
			if (obj17 == null)
			{
				Manipulator val17 = Main.ILHooks.ItemIcon_SetItemIndex;
				<>O.<16>__ItemIcon_SetItemIndex = val17;
				obj17 = (object)val17;
			}
			ItemIcon.SetItemIndex += (Manipulator)obj17;
			InfiniteTowerRun.onWaveInitialized += Main.Events.InfiniteTowerRun_onWaveInitialized;
			Run.onRunStartGlobal += Main.Events.Run_onRunStartGlobal;
			if (ModSupport.Starstorm2.ModIsRunning)
			{
				CharacterBody.onBodyInventoryChangedGlobal += ModSupport.Starstorm2.CharacterBody_onBodyInventoryChangedGlobal;
			}
		}
	}
}
namespace CleanestHud.HudChanges
{
	internal class Helpers
	{
		internal static Transform GetContainerFromScoreboardPanel(Transform scoreboardPanel)
		{
			Transform child = scoreboardPanel.GetChild(0);
			if (((Object)child).name == "CommandQueueScoreboardWrapper")
			{
				child = child.GetChild(0);
			}
			return child;
		}

		internal static Transform GetScoreboardPanelFromContainer(Transform container)
		{
			Transform parent = container.parent;
			if (((Object)parent).name == "CommandQueueScoreboardWrapper")
			{
				parent = parent.parent;
			}
			return parent;
		}

		internal static bool TestLevelDisplayClusterAvailability()
		{
			Transform val = Main.MyHud.mainUIPanel.transform.Find("SpringCanvas").Find("BottomCenterCluster").Find("BarRoots");
			try
			{
				val.Find("LevelDisplayCluster");
			}
			catch
			{
				Log.Info("levelDisplayCluster could not be found, not coloring hud\nthis can mean something messed up, but more than likely everthing is fine");
				return false;
			}
			return true;
		}
	}
	internal class HudColor
	{
		[CompilerGenerated]
		private sealed class <ColorBackdropImageOverFadeIn>d__12 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public Transform backdrop;

			private Image <backdropImage>5__2;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <ColorBackdropImageOverFadeIn>d__12(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<backdropImage>5__2 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0065: Unknown result type (might be due to invalid IL or missing references)
				//IL_006a: Unknown result type (might be due to invalid IL or missing references)
				//IL_002a: Unknown result type (might be due to invalid IL or missing references)
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0042: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<backdropImage>5__2 = ((Component)backdrop).GetComponent<Image>();
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if (!Main.Helpers.AreColorsEqualIgnoringAlpha(((Graphic)<backdropImage>5__2).color, SurvivorColor))
				{
					Color survivorColor = SurvivorColor;
					survivorColor.a = 0.055f;
					((Graphic)<backdropImage>5__2).color = survivorColor;
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <DelayColorItemIconHighlights>d__14 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public ScoreboardStrip scoreboardStrip;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <DelayColorItemIconHighlights>d__14(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = null;
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					ColorItemIconGlowImages(scoreboardStrip);
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private static Color _survivorColor;

		public const float DefaultHudColorIntensity = 0.643f;

		public const float DefaultSurvivorColorMultiplier = 0.85f;

		public static Color SurvivorColor
		{
			get
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				return _survivorColor;
			}
			set
			{
				//IL_000f: 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_0067: 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_0089: Unknown result type (might be due to invalid IL or missing references)
				//IL_008a: Unknown result type (might be due to invalid IL or missing references)
				Log.Debug("SurvivorColor has changed!");
				Log.Debug($"New color will be {value}");
				Log.Debug($"_survivorColor is {_survivorColor}");
				if (Object.op_Implicit((Object)(object)Main.MyHud) && Main.MyHud.skillIcons.Length != 0)
				{
					if (((Graphic)Main.MyHud.skillIcons[0].isReadyPanelObject.GetComponent<Image>()).color == value)
					{
						Log.Debug("HUD is already using the new color, returning.");
						return;
					}
					Log.Debug("HUD is not using the new color yet!");
					_survivorColor = value;
					UpdateHudColor();
				}
				else
				{
					Log.Debug("HUD has not finished setting up yet, not coloring");
				}
			}
		}

		public static void UpdateHudColor()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			Log.Debug("UpdateHudColor");
			if (!Main.IsHudEditable)
			{
				Log.Debug("Tried to run UpdateHudColor, but the HUD is not editable!");
			}
			else if (Helpers.TestLevelDisplayClusterAvailability())
			{
				Log.Debug($"SurvivorColor is {SurvivorColor}");
				Transform val = HudResources.ImportantHudTransforms.RunInfoHudPanel.Find("InfiniteTowerDefaultWaveUI(Clone)");
				if (Main.IsGameModeSimulacrum && Object.op_Implicit((Object)(object)val))
				{
					ColorSimulacrumWaveProgressBar(val.Find("FillBarRoot"));
				}
				else
				{
					ColorDifficultyBar();
				}
				ColorXpBar(HudResources.ImportantHudTransforms.BarRoots.Find("LevelDisplayCluster").Find("ExpBarRoot"));
				ColorSkillAndEquipmentSlots();
				ColorCurrenciesPanel();
				ColorInspectionPanel(Helpers.GetContainerFromScoreboardPanel(HudResources.ImportantHudTransforms.SpringCanvas.Find("ScoreboardPanel")));
			}
		}

		private static void ColorXpBar(Transform xpBarRoot)
		{
			//IL_001a: 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_002c: Unknown result type (might be due to invalid IL or missing references)
			Image component = ((Component)xpBarRoot.Find("ShrunkenRoot").Find("FillPanel")).GetComponent<Image>();
			Color survivorColor = SurvivorColor;
			survivorColor.a = 0.72f;
			((Graphic)component).color = survivorColor;
		}

		private static void ColorSkillAndEquipmentSlots()
		{
			//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_00c9: 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_00e9: 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_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			GameObject isReadyPanelObject = Main.MyHud.skillIcons[0].isReadyPanelObject;
			GameObject isReadyPanelObject2 = Main.MyHud.skillIcons[1].isReadyPanelObject;
			GameObject isReadyPanelObject3 = Main.MyHud.skillIcons[2].isReadyPanelObject;
			GameObject isReadyPanelObject4 = Main.MyHud.skillIcons[3].isReadyPanelObject;
			Transform transform = Main.MyHud.equipmentIcons[0].displayRoot.transform;
			Transform val = transform.Find("IsReadyPanel");
			Transform val2 = transform.Find("BGPanel");
			Transform transform2 = Main.MyHud.equipmentIcons[1].displayRoot.transform;
			Transform val3 = transform2.Find("IsReadyPanel");
			Transform val4 = transform2.Find("BGPanel");
			((Graphic)isReadyPanelObject.GetComponent<Image>()).color = SurvivorColor;
			((Graphic)isReadyPanelObject2.GetComponent<Image>()).color = SurvivorColor;
			((Graphic)isReadyPanelObject3.GetComponent<Image>()).color = SurvivorColor;
			((Graphic)isReadyPanelObject4.GetComponent<Image>()).color = SurvivorColor;
			((Graphic)((Component)val).GetComponent<Image>()).color = SurvivorColor;
			((Graphic)((Component)val2).GetComponent<Image>()).color = Main.Helpers.GetAdjustedColor(SurvivorColor, 1f, 1f, 0.643f);
			((Graphic)((Component)val3).GetComponent<Image>()).color = SurvivorColor;
			((Graphic)((Component)val4).GetComponent<Image>()).color = Main.Helpers.GetAdjustedColor(SurvivorColor, 1f, 1f, 0.643f);
			if (ModSupport.Starstorm2.ModIsRunning)
			{
				((MonoBehaviour)Main.MyHud).StartCoroutine(ModSupport.Starstorm2.CompositeInjectorSupport.DelayColorInjectorSlots());
			}
		}

		private static void ColorCurrenciesPanel()
		{
			//IL_004a: 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_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: 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)
			Transform transform = ((Component)Main.MyHud.moneyText).transform;
			Transform val = transform.Find("BackgroundPanel");
			Transform parent = transform.parent;
			Transform val2 = parent.Find("LunarCoinRoot").Find("BackgroundPanel");
			Transform obj = parent.Find("VoidCoinRoot").Find("BackgroundPanel");
			Color adjustedColor = Main.Helpers.GetAdjustedColor(SurvivorColor, 1f, 1f, 0.643f);
			((Graphic)((Component)val).GetComponent<RawImage>()).color = adjustedColor;
			((Graphic)((Component)val2).GetComponent<RawImage>()).color = adjustedColor;
			((Graphic)((Component)obj).GetComponent<RawImage>()).color = adjustedColor;
		}

		private static void ColorInspectionPanel(Transform container)
		{
			//IL_0027: 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)
			Image component = ((Component)container.Find("InspectPanel").GetChild(0).GetChild(0)).GetComponent<Image>();
			component.sprite = HudResources.HudAssets.WhiteSprite;
			((Graphic)component).color = Main.Helpers.GetAdjustedColor(SurvivorColor, 1f, 1f, 1f, 0.15f);
		}

		internal static void ColorDifficultyBar()
		{
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: 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_0098: 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_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_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: 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_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_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: 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_0171: 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_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: 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_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_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			Transform val = HudResources.ImportantHudTransforms.RunInfoHudPanel.Find("DifficultyBar");
			Transform obj = val.Find("Scroll View");
			Transform backdrop = obj.Find("Backdrop");
			obj.Find("Viewport").Find("Content");
			Color[] array = Array.Empty<Color>();
			array = (Color[])((!ConfigOptions.AllowConsistentDifficultyBarColor.Value) ? ((Array)new Color[9]
			{
				SurvivorColor,
				Main.Helpers.GetAdjustedColor(SurvivorColor, 1f, 8f / 9f),
				Main.Helpers.GetAdjustedColor(SurvivorColor, 1f, 7f / 9f),
				Main.Helpers.GetAdjustedColor(SurvivorColor, 1f, 2f / 3f),
				Main.Helpers.GetAdjustedColor(SurvivorColor, 1f, 5f / 9f),
				Main.Helpers.GetAdjustedColor(SurvivorColor, 1f, 4f / 9f),
				Main.Helpers.GetAdjustedColor(SurvivorColor, 1f, 1f / 3f),
				Main.Helpers.GetAdjustedColor(SurvivorColor, 1f, 2f / 9f),
				Main.Helpers.GetAdjustedColor(SurvivorColor, 1f, 1f / 9f)
			}) : ((Array)Enumerable.Repeat<Color>(SurvivorColor, 9).ToArray()));
			DifficultyBarController component = ((Component)val).GetComponent<DifficultyBarController>();
			for (int i = 0; i < component.segmentDefs.Length; i++)
			{
				component.segmentDefs[i].color = array[i];
			}
			for (int j = 0; j < component.images.Length; j++)
			{
				(((Component)component.images[j]).gameObject.GetComponent<HudEditorComponents.DifficultyScalingBarColorChanger>() ?? ((Component)component.images[j]).gameObject.AddComponent<HudEditorComponents.DifficultyScalingBarColorChanger>()).newColor = array[j];
			}
			((MonoBehaviour)Main.MyHud).StartCoroutine(ColorBackdropImageOverFadeIn(backdrop));
		}

		[IteratorStateMachine(typeof(<ColorBackdropImageOverFadeIn>d__12))]
		private static IEnumerator ColorBackdropImageOverFadeIn(Transform backdrop)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <ColorBackdropImageOverFadeIn>d__12(0)
			{
				backdrop = backdrop
			};
		}

		internal static void ColorSimulacrumWaveProgressBar(Transform fillBarRoot)
		{
			//IL_0014: 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_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			if (Main.AreSimulacrumWavesRunning)
			{
				((Graphic)((Component)fillBarRoot.GetChild(2)).GetComponent<Image>()).color = Main.Helpers.GetAdjustedColor(SurvivorColor, 1f, 1f, 0.5f);
				Image component = ((Component)fillBarRoot.GetChild(3)).GetComponent<Image>();
				(((Component)component).GetComponent<HudEditorComponents.SimulacrumBarColorChanger>() ?? ((Component)component).gameObject.AddComponent<HudEditorComponents.SimulacrumBarColorChanger>()).newFillBarColor = Main.Helpers.GetAdjustedColor(SurvivorColor, 1f, 1f, 0.5f);
			}
		}

		[IteratorStateMachine(typeof(<DelayColorItemIconHighlights>d__14))]
		internal static IEnumerator DelayColorItemIconHighlights(ScoreboardStrip scoreboardStrip)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <DelayColorItemIconHighlights>d__14(0)
			{
				scoreboardStrip = scoreboardStrip
			};
		}

		internal static void ColorItemIconGlowImages(ScoreboardStrip scoreboardStrip)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			Color bodyColor = default(Color);
			if (ConfigOptions.AllowScoreboardItemHighlightColoring.Value)
			{
				bodyColor = scoreboardStrip.userBody.bodyColor;
			}
			else
			{
				((Color)(ref bodyColor))..ctor(1f, 0.8353f, 0.1934f);
			}
			foreach (ItemIcon itemIcon in scoreboardStrip.itemInventoryDisplay.itemIcons)
			{
				((Graphic)itemIcon.glowImage).color = bodyColor;
			}
		}

		internal static void ColorEquipmentSlotHighlight(ScoreboardStrip scoreboardStrip)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			((Graphic)((Component)((Component)scoreboardStrip.equipmentIcon).transform.GetChild(1)).GetComponent<RawImage>()).color = scoreboardStrip.userBody.bodyColor;
		}

		internal static void ColorSingleItemIconHighlight(ItemIcon itemIcon)
		{
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)itemIcon == (Object)null || (Object)(object)itemIcon.glowImage == (Object)null)
			{
				Log.Debug("Item icon or it's image was null, not coloring it.");
				return;
			}
			ScoreboardStrip component = ((Component)((Component)itemIcon).transform.parent.parent.parent).GetComponent<ScoreboardStrip>();
			if ((Object)(object)component == (Object)null)
			{
				Log.Debug("ScoreboardStrip was null??? returning");
			}
			else if ((Object)(object)component.userBody == (Object)null)
			{
				Log.Debug("ScoreboardStrip's userBody was null?????????? returning");
			}
			else
			{
				((Graphic)itemIcon.glowImage).color = ((Component)((Component)itemIcon).transform.parent.parent.parent).GetComponent<ScoreboardStrip>().userBody.bodyColor;
			}
		}

		internal static void ColorAllyCardControllerBackground(AllyCardController allyCardController)
		{
			//IL_0022: 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_003f: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)allyCardController) && Object.op_Implicit((Object)(object)allyCardController.cachedSourceCharacterBody))
			{
				Image component = ((Component)allyCardController).GetComponent<Image>();
				Color bodyColor = allyCardController.cachedSourceCharacterBody.bodyColor;
				bodyColor.a = 0.15f;
				component.sprite = HudResources.HudAssets.WhiteSprite;
				((Graphic)component).color = bodyColor;
			}
		}

		internal static void ColorAllAllyCardBackgrounds()
		{
			Transform child = HudResources.ImportantHudTransforms.SpringCanvas.Find("LeftCluster").GetChild(0);
			for (int i = 0; i < child.childCount; i++)
			{
				ColorAllyCardControllerBackground(((Component)child.GetChild(i)).GetComponent<AllyCardController>());
			}
		}

		internal static void ColorAllOfScoreboardStrip(ScoreboardStrip scoreboardStrip)
		{
			ColorScoreboardStrip(scoreboardStrip);
			ColorItemIconGlowImages(scoreboardStrip);
			HudDetails.EditScoreboardStripEquipmentSlotHighlight(scoreboardStrip);
			ColorEquipmentSlotHighlight(scoreboardStrip);
		}

		private static void ColorScoreboardStrip(ScoreboardStrip scoreboardStrip)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: 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_004b: 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_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			Transform transform = ((Component)scoreboardStrip).transform;
			if (!((Object)(object)scoreboardStrip.userBody == (Object)null))
			{
				Image component = ((Component)transform.GetChild(0)).GetComponent<Image>();
				Color bodyColor = scoreboardStrip.userBody.bodyColor;
				bodyColor.a = 0.15f;
				if (!(((Graphic)component).color == bodyColor))
				{
					((Graphic)component).color = bodyColor;
					Color adjustedColor = Main.Helpers.GetAdjustedColor(scoreboardStrip.userBody.bodyColor, 1f, 3f);
					((Graphic)((Component)transform).gameObject.GetComponent<RawImage>()).color = adjustedColor;
				}
			}
		}
	}
	internal class HudDetails
	{
		internal static class AssetEdits
		{
			internal static void EditHudElementPrefabDetails()
			{
				EditItemIcon();
				RemoveMonsterPanelsHudDetails();
				RemoveGameEndPanelDetails();
				RemoveScoreboardStripAssetDetails();
				RemoveMoonDetonationPanelDetails();
				RemoveStatStripTemplateImage();
				RemoveChatBoxDetails();
			}

			private static void EditItemIcon()
			{
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				//IL_0045: Unknown result type (might be due to invalid IL or missing references)
				//IL_004a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0060: Unknown result type (might be due to invalid IL or missing references)
				//IL_0065: Unknown result type (might be due to invalid IL or missing references)
				//IL_006a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0080: Unknown result type (might be due to invalid IL or missing references)
				//IL_0085: Unknown result type (might be due to invalid IL or missing references)
				//IL_008a: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
				((Component)HudResources.HudAssets.ItemIconPrefab.transform.GetChild(1)).GetComponent<RawImage>().texture = (Texture)(object)ModAssets.AssetBundle.LoadAsset<Texture2D>("NewNavHighlight");
				HGButton component = HudResources.HudAssets.ItemIconPrefab.GetComponent<HGButton>();
				((ColorBlock)(ref ((Selectable)component).m_Colors)).highlightedColor = Main.Helpers.ChangeColorWhileKeepingAlpha(((ColorBlock)(ref ((Selectable)component).m_Colors)).highlightedColor, Color.white);
				((ColorBlock)(ref ((Selectable)component).m_Colors)).normalColor = Main.Helpers.ChangeColorWhileKeepingAlpha(((ColorBlock)(ref ((Selectable)component).m_Colors)).normalColor, Color.white);
				((ColorBlock)(ref ((Selectable)component).m_Colors)).pressedColor = Main.Helpers.ChangeColorWhileKeepingAlpha(((ColorBlock)(ref ((Selectable)component).m_Colors)).pressedColor, Color.white);
				((ColorBlock)(ref ((Selectable)component).m_Colors)).selectedColor = Main.Helpers.ChangeColorWhileKeepingAlpha(((ColorBlock)(ref ((Selectable)component).m_Colors)).selectedColor, Color.white);
				((Selectable)component).m_Colors.m_ColorMultiplier = 1.5f;
			}

			private static void RemoveMonsterPanelsHudDetails()
			{
				((Behaviour)HudResources.HudAssets.EnemyInfoPanel.GetComponent<Image>()).enabled = false;
				Transform obj = HudResources.HudAssets.EnemyInfoPanel.transform.Find("InnerFrame");
				((Behaviour)((Component)obj).GetComponent<Image>()).enabled = false;
				((Behaviour)((Component)obj.Find("MonsterBodiesContainer").Find("MonsterBodyIconContainer")).GetComponent<Image>()).enabled = false;
				((Behaviour)((Component)obj.Find("InventoryContainer").Find("InventoryDisplay")).GetComponent<Image>()).enabled = false;
			}

			private static void RemoveGameEndPanelDetails()
			{
				//IL_017b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0195: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
				Transform obj = HudResources.HudAssets.GameEndReportPanel.transform.Find("SafeArea (JUICED)");
				Transform obj2 = obj.Find("HeaderArea");
				Transform val = obj2.Find("DeathFlavorText");
				Transform obj3