Decompiled source of Minimal UI v2.3.8

BepInEx/plugins/MinimalUI.dll

Decompiled 4 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using BepInEx.Preloader;
using BepInEx.Preloader.Patching;
using HarmonyLib;
using JetBrains.Annotations;
using Microsoft.CodeAnalysis;
using MinimalUI.ELCompat;
using MinimalUI.Patches;
using MinimalUI.UI;
using MinimalUI.UI.Bars;
using MinimalUI.UI.MonoScripts;
using MinimalUI.UI.TemplateUI;
using MinimalUI.WILCompat;
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.UI;
using Valheim.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("MinimalUI")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Azumatt")]
[assembly: AssemblyProduct("MinimalUI")]
[assembly: AssemblyCopyright("Copyright ©  2022")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("AD01B640-81E6-4815-BC6D-6BCDE86C7C7F")]
[assembly: AssemblyFileVersion("2.3.8")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.3.8.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

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

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

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
public class DragNDrop : MonoBehaviour
{
	public float gridSize = 10f;

	private RectTransform window;

	private Vector2 delta;

	public static void ApplyDragWindowCntrl(GameObject go)
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Expected O, but got Unknown
		//IL_0021: 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_004f: Expected O, but got Unknown
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		DragNDrop drag = go.AddComponent<DragNDrop>();
		EventTrigger obj = go.AddComponent<EventTrigger>();
		Entry val = new Entry();
		val.eventID = (EventTriggerType)13;
		((UnityEvent<BaseEventData>)(object)val.callback).AddListener((UnityAction<BaseEventData>)delegate
		{
			drag.BeginDrag();
		});
		obj.triggers.Add(val);
		Entry val2 = new Entry();
		val2.eventID = (EventTriggerType)5;
		((UnityEvent<BaseEventData>)(object)val2.callback).AddListener((UnityAction<BaseEventData>)delegate
		{
			drag.Drag();
		});
		obj.triggers.Add(val2);
	}

	private void Awake()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Expected O, but got Unknown
		window = (RectTransform)((Component)this).transform;
	}

	public void BeginDrag()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		delta = Vector2.op_Implicit(Input.mousePosition - ((Transform)window).position);
	}

	public void Drag()
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: 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_00a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: 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_00ce: 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_00e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0104: Unknown result type (might be due to invalid IL or missing references)
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		//IL_013e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0126: Unknown result type (might be due to invalid IL or missing references)
		//IL_0130: Unknown result type (might be due to invalid IL or missing references)
		//IL_0177: Unknown result type (might be due to invalid IL or missing references)
		//IL_015f: Unknown result type (might be due to invalid IL or missing references)
		//IL_016a: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_018c: 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_01c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
		Vector2 position = Vector2.op_Implicit(Input.mousePosition) - delta;
		Rect rect = window.rect;
		float num = ((Rect)(ref rect)).width * ((Component)this).transform.root.lossyScale.x;
		rect = window.rect;
		Vector2 val = default(Vector2);
		((Vector2)(ref val))..ctor(num, ((Rect)(ref rect)).height * ((Component)this).transform.root.lossyScale.y);
		Vector2 val2 = default(Vector2);
		val2.x = position.x - window.pivot.x * val.x;
		val2.y = position.y - window.pivot.y * val.y;
		Vector2 val3 = default(Vector2);
		val3.x = position.x + (1f - window.pivot.x) * val.x;
		val3.y = position.y + (1f - window.pivot.y) * val.y;
		if (val2.x < 0f)
		{
			position.x = window.pivot.x * val.x;
		}
		else if (val3.x > (float)Screen.width)
		{
			position.x = (float)Screen.width - (1f - window.pivot.x) * val.x;
		}
		if (val2.y < 0f)
		{
			position.y = window.pivot.y * val.y;
		}
		else if (val3.y > (float)Screen.height)
		{
			position.y = (float)Screen.height - (1f - window.pivot.y) * val.y;
		}
		if (HudUpdatePatchCheckTemplateActive.isGridSnapping)
		{
			SnapToGrid(ref position);
		}
		((Transform)window).position = Vector2.op_Implicit(position);
	}

	private void SnapToGrid(ref Vector2 position)
	{
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		float num = Mathf.Round(position.x / gridSize) * gridSize;
		float num2 = Mathf.Round(position.y / gridSize) * gridSize;
		position = new Vector2(num, num2);
	}
}
public class MUIMap : MonoBehaviour
{
	internal static GameObject newMap;

	private static GameObject instantiatedMap;

	[SerializeField]
	private GameObject MapRoot;

	[SerializeField]
	private RawImage MapSmall;

	[SerializeField]
	private TMP_Text BiomeTextSmall;

	[SerializeField]
	private RectTransform pinrootsmall;

	[SerializeField]
	private RectTransform SmallShip;

	[SerializeField]
	private RectTransform SmallMarker;

	[SerializeField]
	private RenderTexture MUIMapTexture;

	[SerializeField]
	private Image MaskImage;

	[SerializeField]
	private Image Border;

	[SerializeField]
	private Image DarkenInner;

	[SerializeField]
	private Image DarkenOuter;

	[SerializeField]
	private RectTransform WindDir;

	[SerializeField]
	private RectTransform Compass;

	[SerializeField]
	private Transform DaytimeIndicatorIcons;

	internal static GameObject internalMapRoot;

	internal static RawImage internalsmallmap;

	internal static TMP_Text internalbiometext;

	internal static RectTransform internalpinroot;

	internal static RectTransform internalsmallship;

	internal static RectTransform internalsmallmarker;

	internal static RenderTexture internalrendermaptext;

	internal static RectTransform internalWindDir;

	internal static RectTransform internalCompass;

	internal static Transform internalDaytimeIndicatorIcons;

	public static GameObject defaultSmallRoot;

	public static TMP_Text defaultBiomeNameSmall;

	public static RectTransform defaultSmallMarker;

	public static RawImage defaultMapImageSmall;

	public static RectTransform defaultSmallShipMarker;

	public static RectTransform defaultPinRootSmall;

	public static RectTransform defaultWindMarker;

	public static GameObject newMapObject;

	public static Vector3 defaultDaytimeIndicatorIconsPosition;

	private void Awake()
	{
		//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)
		internalMapRoot = MapRoot;
		internalsmallmap = MapSmall;
		if (Chainloader.PluginInfos.ContainsKey("org.bepinex.plugins.servercharacter"))
		{
			((Object)BiomeTextSmall).name = "small_biome";
		}
		internalbiometext = BiomeTextSmall;
		internalpinroot = pinrootsmall;
		internalsmallship = SmallShip;
		internalsmallmarker = SmallMarker;
		internalrendermaptext = MUIMapTexture;
		internalWindDir = WindDir;
		internalCompass = Compass;
		internalDaytimeIndicatorIcons = DaytimeIndicatorIcons;
		defaultDaytimeIndicatorIconsPosition = Utils.FindChild(((Component)this).transform, "Icons", (IterativeSearchType)0).localPosition;
	}

	private void Update()
	{
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0138: Unknown result type (might be due to invalid IL or missing references)
		//IL_014a: Unknown result type (might be due to invalid IL or missing references)
		//IL_014f: Unknown result type (might be due to invalid IL or missing references)
		if (!((Object)(object)ZNet.instance != (Object)null) || !((Object)(object)EnvMan.instance != (Object)null))
		{
			return;
		}
		double timeSeconds = ZNet.instance.GetTimeSeconds();
		int day = EnvMan.instance.GetDay(timeSeconds);
		double morningStartSec = EnvMan.instance.GetMorningStartSec(day);
		double num = EnvMan.instance.GetMorningStartSec(day) + (double)EnvMan.instance.m_dayLengthSec * 0.5;
		double num2 = (double)EnvMan.instance.m_dayLengthSec * 0.5;
		if ((Object)(object)internalDaytimeIndicatorIcons != (Object)null)
		{
			internalDaytimeIndicatorIcons.localPosition = defaultDaytimeIndicatorIconsPosition;
			double num3 = 0.0;
			if (timeSeconds >= morningStartSec && timeSeconds < num)
			{
				num3 = 0.0;
			}
			else if (timeSeconds >= morningStartSec && timeSeconds < morningStartSec + num2)
			{
				double num4 = timeSeconds - morningStartSec;
				num3 = -60.0 * num4 / num2;
			}
			else if (timeSeconds >= num && timeSeconds < num + num2)
			{
				double num5 = timeSeconds - num;
				num3 = -60.0 * num5 / num2;
			}
			else
			{
				double num6 = timeSeconds - morningStartSec - num2;
				num3 = 33.0 * num6 / (num - morningStartSec - 2.0 * num2) - 27.0;
			}
			Transform obj = internalDaytimeIndicatorIcons;
			obj.localPosition += new Vector3((float)num3, 0f, 0f);
		}
	}

	public void ZoomIn()
	{
		//IL_000f: 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_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		Vector3 localScale = ((Component)internalsmallmap).gameObject.transform.localScale;
		((Component)internalsmallmap).transform.localScale = new Vector3(localScale.x + 0.1f, localScale.y + 0.1f, localScale.z + 0.1f);
	}

	public void ZoomOut()
	{
		//IL_000f: 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_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		Vector3 localScale = ((Component)internalsmallmap).gameObject.transform.localScale;
		((Component)internalsmallmap).transform.localScale = new Vector3(localScale.x - 0.1f, localScale.y - 0.1f, localScale.z - 0.1f);
	}

	public static void CreateMinimalMap(object? sender, EventArgs? e, Minimap minimap = null)
	{
		//IL_014b: Unknown result type (might be due to invalid IL or missing references)
		//IL_015f: 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)
		Minimap val = (Minimap)((!((Object)(object)minimap == (Object)null)) ? ((object)minimap) : ((object)(((Object)(object)Minimap.instance == (Object)null) ? null : Minimap.instance)));
		if (!((Object)(object)val != (Object)null))
		{
			return;
		}
		if ((Object)(object)newMapObject == (Object)null)
		{
			newMapObject = Object.Instantiate<GameObject>(newMap, ((Component)val).transform, false);
			((Object)newMapObject).name = "MUIMap";
			DragWindowCntrl.ApplyDragWindowCntrl(newMapObject);
			((Component)((Component)val).transform.Find("small")).gameObject.SetActive(false);
			val.m_smallRoot = internalMapRoot;
			TMP_Text obj = Object.Instantiate<TMP_Text>(val.m_biomeNameSmall, internalMapRoot.transform, false);
			((Object)obj).name = "small_biome";
			Mappatcher.serverCharactersPlaceholderToClone = ((Component)obj).gameObject;
			Mappatcher.serverCharactersPlaceholderToClone.gameObject.SetActive(true);
			if (Localization.instance.GetSelectedLanguage() != "English")
			{
				internalbiometext.font = val.m_biomeNameSmall.font;
				((Component)internalbiometext).gameObject.AddComponent<Animator>().runtimeAnimatorController = Object.Instantiate<RuntimeAnimatorController>(((Component)val.m_biomeNameSmall).GetComponent<Animator>().runtimeAnimatorController);
				internalbiometext.outlineWidth = 0.15f;
				val.m_biomeNameSmall = internalbiometext;
				Transform transform = val.m_biomeNameSmall.transform;
				transform.localPosition += new Vector3(0f, 20f, 0f);
			}
			else
			{
				((Component)internalbiometext).gameObject.AddComponent<Animator>().runtimeAnimatorController = Object.Instantiate<RuntimeAnimatorController>(((Component)val.m_biomeNameSmall).GetComponent<Animator>().runtimeAnimatorController);
				val.m_biomeNameSmall = internalbiometext;
			}
			((Component)internalsmallmarker).GetComponent<Image>().sprite = ((Component)val.m_smallMarker).GetComponent<Image>().sprite;
			val.m_smallMarker = internalsmallmarker;
			((Graphic)internalsmallmap).material = Object.Instantiate<Material>(((Graphic)val.m_mapImageSmall).material);
			((MaskableGraphic)internalsmallmap).maskable = true;
			val.m_mapImageSmall = internalsmallmap;
			val.m_smallShipMarker = internalsmallship;
			val.m_pinRootSmall = internalpinroot;
			((Graphic)internalsmallmap).material.SetInt("_StencilComp", 6);
			((Component)internalsmallmap).gameObject.GetComponent<MaskableGraphic>().maskable = false;
			UIUtil.SaveWindowPositions(newMapObject.gameObject, initialLoad: true);
		}
		else
		{
			ResetAndDestroyMap(val, destroy: true);
		}
	}

	public static void GetDefaultObjects(Minimap instance)
	{
		defaultSmallRoot = instance.m_smallRoot;
		defaultBiomeNameSmall = instance.m_biomeNameSmall;
		defaultSmallMarker = instance.m_smallMarker;
		defaultMapImageSmall = instance.m_mapImageSmall;
		defaultSmallShipMarker = instance.m_smallShipMarker;
		defaultPinRootSmall = instance.m_pinRootSmall;
		defaultWindMarker = instance.m_windMarker;
	}

	private static void ResetAndDestroyMap(Minimap minimap, bool destroy = false)
	{
		Minimap val = (Minimap)((!((Object)(object)minimap == (Object)null)) ? ((object)minimap) : ((object)(((Object)(object)Minimap.instance == (Object)null) ? null : Minimap.instance)));
		if (!((Object)(object)newMapObject == (Object)null) && !((Object)(object)val == (Object)null))
		{
			val.m_smallRoot = defaultSmallRoot;
			val.m_biomeNameSmall = defaultBiomeNameSmall;
			val.m_smallMarker = defaultSmallMarker;
			val.m_mapImageSmall = defaultMapImageSmall;
			val.m_smallShipMarker = defaultSmallShipMarker;
			val.m_pinRootSmall = defaultPinRootSmall;
			val.m_windMarker = defaultWindMarker;
			((Component)((Component)val).transform.Find("small")).gameObject.SetActive(true);
			if (destroy)
			{
				Object.Destroy((Object)(object)newMapObject);
			}
		}
	}
}
namespace MinimalUI
{
	public class Constants
	{
		internal static readonly Color defaultHBColor = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)85, (byte)85, byte.MaxValue));

		internal static readonly Color defaultHBColor2 = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)216, (byte)0, byte.MaxValue));

		internal static readonly Color defaultstaminaColor = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)243, (byte)75, byte.MaxValue));

		internal static readonly Color defaultstaminaColor2 = Color32.op_Implicit(new Color32((byte)128, (byte)128, (byte)128, byte.MaxValue));

		internal static readonly Color defaulteitrColor = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)75, (byte)239, byte.MaxValue));

		internal static readonly Color defaulteitrColor2 = Color32.op_Implicit(new Color32((byte)128, (byte)128, (byte)128, byte.MaxValue));

		internal static readonly Color defaultGPColor = Color32.op_Implicit(new Color32((byte)204, (byte)112, (byte)0, byte.MaxValue));

		internal static Color _defaultGpColor2 = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)216, (byte)0, byte.MaxValue));

		internal const string RandyMinimalGUID = "randyknapp.mods.minimalstatuseffects";

		internal const string RandyELGUID = "randyknapp.mods.epicloot";

		internal const string MUI_MapName = "MUIMap";

		internal const string GuardianPowerName = "GuardianPower";

		internal const string Name = "Name";

		internal const string FastGuiBar = "fast";

		internal const string SlowGuiBar = "slow";

		internal const string Bar = "bar";

		internal const string HealthText = "HealthText";

		internal const string TimeText = "TimeText";

		internal const string Bkg = "Bkg";

		internal const string Border = "Border";

		internal const string Blur = "blur";

		internal const string Darken = "Darken";

		internal const string HotKeyBar = "HotKeyBar";

		internal const string SelectedInfo = "SelectedInfo";

		internal const string QuickSlotsHotkeyBar = "QuickSlotsHotkeyBar";

		internal const string Texts = "Texts";

		internal const string Skills = "Skills";

		internal const string Trophies = "Trophies";

		internal const string PVP = "PVP";
	}
	public class CustomBars
	{
		public const string ObjectHealthName = "MUI_HPBar";

		internal static RectTransform? HealthBarRoot;

		internal static GuiBar? HealthBarSlow;

		internal static GuiBar? HealthBarFast;

		internal static TMP_Text? HealthText;

		internal static Animator? HealthAnimator;

		public static ColoredFlash HealthFastColorFlash;

		public static ColoredFlash HealthSlowColorFlash;

		public const string ObjectStaminaName = "MUI_StaminaBar";

		internal static RectTransform? StaminaBarRoot;

		internal static GuiBar? StaminaBarSlow;

		internal static GuiBar? StaminaBarFast;

		internal static TMP_Text? StaminaText;

		internal static Animator? StaminaAnimator;

		public static ColoredFlash StaminaFastColorFlash;

		public static ColoredFlash StaminaSlowColorFlash;

		public const string ObjectEitrName = "MUI_EitrBar";

		internal static RectTransform? EitrBarRoot;

		internal static GuiBar? EitrBarSlow;

		internal static GuiBar? EitrBarFast;

		internal static TMP_Text? EitrText;

		internal static Animator? EitrAnimator;

		public static ColoredFlash EitrFastColorFlash;

		public static ColoredFlash EitrSlowColorFlash;

		public const string ObjectGpName = "MUI_GuardianPowerBar";

		internal static RectTransform? GpBarRoot;

		internal static GuiBar? GpBarSlow;

		internal static GuiBar? GpBarFast;

		internal static TMP_Text? GpText;

		public const string ObjectFoodName = "MUI_FoodBar";

		public const string ObjectFoodName1 = "food0";

		public const string ObjectFoodName2 = "food1";

		public const string ObjectFoodName3 = "food2";

		internal static RectTransform? FoodPanel;

		internal static RectTransform? FoodBarRoot;

		public static RectTransform? Food0;

		public static RectTransform? Food1;

		public static RectTransform? Food2;

		public static RectTransform? Foodicon;

		public static void Create()
		{
			HealthBar.Create();
			StaminaBar.Create();
			EitrBar.Create();
			GpBar.Create();
			FoodBar.Create();
		}

		public static void SpriteFix(RectTransform root)
		{
			((Component)((Transform)root).Find("fast").Find("bar")).GetComponent<Image>().sprite = MinimalUIPlugin.CustomBarBackground;
			((Component)((Transform)root).Find("slow").Find("bar")).GetComponent<Image>().sprite = MinimalUIPlugin.CustomBarBackground;
			((Component)((Transform)root).Find("fast").Find("bar")).GetComponent<Image>().type = (Type)0;
			((Component)((Transform)root).Find("slow").Find("bar")).GetComponent<Image>().type = (Type)0;
		}
	}
	[HarmonyPatch(typeof(Hud), "UpdateHealth")]
	internal static class HudUpdateHealthPatch
	{
		private static void Postfix(Hud __instance, Player player)
		{
			if (MinimalUIPlugin.CustomHealthBar.Value == MinimalUIPlugin.Toggle.On)
			{
				HealthBar.UpdateHealth(((Character)player).GetMaxHealth(), ((Character)player).GetHealth());
				if (MinimalUIPlugin.CustomHealthBarStretch.Value == MinimalUIPlugin.Toggle.On)
				{
					SetHealthBarSize((float)((double)((Character)player).GetMaxHealth() / 25.0 * 32.0));
				}
			}
		}

		public static void SetHealthBarSize(float size)
		{
			size = Mathf.Ceil(size);
			Mathf.Max(size + 56f, 138f);
			CustomBars.HealthBarRoot.SetSizeWithCurrentAnchors((Axis)0, size);
			CustomBars.HealthBarSlow.SetWidth(size);
			CustomBars.HealthBarFast.SetWidth(size);
		}
	}
	[HarmonyPatch(typeof(Hud), "UpdateStamina")]
	internal static class HudUpdateStaminaPatch
	{
		private static void Postfix(Hud __instance, Player player, float dt)
		{
			if (MinimalUIPlugin.CustomStaminaBar.Value != 0)
			{
				return;
			}
			StaminaBar.UpdateStamina(((Character)player).GetMaxStamina(), player.GetStamina());
			if (MinimalUIPlugin.CustomStaminaBarStretch.Value == MinimalUIPlugin.Toggle.On)
			{
				SetStaminaBarSize((float)((double)((Character)player).GetMaxStamina() / 25.0 * 32.0), __instance);
			}
			if (MinimalUIPlugin.CustomStaminaBarHide.Value != 0)
			{
				return;
			}
			if ((double)__instance.m_staminaHideTimer < 1.0)
			{
				if (!((Component)CustomBars.StaminaBarRoot).gameObject.activeSelf)
				{
					((Component)CustomBars.StaminaBarRoot).gameObject.SetActive(true);
				}
			}
			else
			{
				((Component)CustomBars.StaminaBarRoot).gameObject.SetActive(false);
			}
		}

		public static void SetStaminaBarSize(float size, Hud __instance)
		{
			CustomBars.StaminaBarRoot.SetSizeWithCurrentAnchors((Axis)0, size);
			CustomBars.StaminaBarSlow.SetWidth(size);
			CustomBars.StaminaBarFast.SetWidth(size);
		}
	}
	[HarmonyPatch(typeof(Hud), "UpdateEitr")]
	internal static class HudUpdateEitrPatch
	{
		private static void Postfix(Hud __instance, Player player, float dt)
		{
			if (MinimalUIPlugin.CustomEitrBar.Value != 0)
			{
				return;
			}
			EitrBar.UpdateEitr(((Character)player).GetMaxEitr(), player.GetEitr());
			if (MinimalUIPlugin.CustomEitrBarStretch.Value == MinimalUIPlugin.Toggle.On)
			{
				SetEitrBarSize((float)((double)((Character)player).GetMaxEitr() / 25.0 * 32.0));
			}
			if (MinimalUIPlugin.CustomEitrBarHide.Value != 0)
			{
				return;
			}
			if ((double)__instance.m_eitrHideTimer < 1.0)
			{
				if (!((Component)CustomBars.EitrBarRoot).gameObject.activeSelf)
				{
					((Component)CustomBars.EitrBarRoot).gameObject.SetActive(true);
				}
			}
			else
			{
				((Component)CustomBars.EitrBarRoot).gameObject.SetActive(false);
			}
		}

		public static void SetEitrBarSize(float size)
		{
			CustomBars.EitrBarRoot.SetSizeWithCurrentAnchors((Axis)0, size);
			CustomBars.EitrBarSlow.SetWidth(size);
			CustomBars.EitrBarFast.SetWidth(size);
		}
	}
	[HarmonyPatch(typeof(Hud), "UpdateFood")]
	internal static class HudUpdateFoodPatch
	{
		private static void Postfix(Hud __instance, Player player)
		{
			if (MinimalUIPlugin.CustomFoodBar.Value == MinimalUIPlugin.Toggle.On)
			{
				FoodBar.UpdateFood(player);
			}
		}
	}
	[HarmonyPatch(typeof(Hud), "UpdateGuardianPower")]
	internal static class Hud_UpdateGuardianPower_Patch
	{
		private static void Postfix(Hud __instance, Player player)
		{
			if (MinimalUIPlugin.CustomGpBar.Value == MinimalUIPlugin.Toggle.On)
			{
				GpBar.UpdateGuardianPower();
			}
		}
	}
	[HarmonyPatch(typeof(Player), "StartGuardianPower")]
	internal static class Player_StartGuardianPower_Patch
	{
		private static void Postfix(Player __instance)
		{
			if (__instance.m_guardianPowerCooldown <= 0f)
			{
				MinimalUIPlugin.StartingCooldown = Player.m_localPlayer.m_guardianPowerCooldown;
			}
		}
	}
	[HarmonyPatch(typeof(Hud), "FlashHealthBar")]
	internal static class HudFlashHealthBarPatch
	{
		private static void Postfix(Hud __instance)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			if (MinimalUIPlugin.HealthBarFlash.Value == MinimalUIPlugin.Toggle.On && MinimalUIPlugin.CustomHealthBar.Value == MinimalUIPlugin.Toggle.On)
			{
				CustomBars.HealthFastColorFlash.Flash(MinimalUIPlugin.HealthBarFlashColor.Value);
				CustomBars.HealthSlowColorFlash.Flash(MinimalUIPlugin.HealthBarFlashColor.Value);
			}
		}
	}
	[HarmonyPatch(typeof(Player), "OnDamaged")]
	internal static class PlayerOnDamagedPatch
	{
		private static void Postfix(Player __instance)
		{
			//IL_0030: 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)
			if (MinimalUIPlugin.HealthBarFlash.Value == MinimalUIPlugin.Toggle.On && MinimalUIPlugin.CustomHealthBar.Value == MinimalUIPlugin.Toggle.On && ((Character)__instance).GetHealth() < 25f)
			{
				CustomBars.HealthFastColorFlash.Flash(MinimalUIPlugin.HealthBarFlashColor.Value);
				CustomBars.HealthSlowColorFlash.Flash(MinimalUIPlugin.HealthBarFlashColor.Value);
			}
		}
	}
	[HarmonyPatch(typeof(Hud), "StaminaBarEmptyFlash")]
	internal static class HudStaminaBarNoStaminaFlashPatch
	{
		private static void Postfix(Hud __instance)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			if (MinimalUIPlugin.StaminaBarFlash.Value == MinimalUIPlugin.Toggle.On && MinimalUIPlugin.CustomStaminaBar.Value == MinimalUIPlugin.Toggle.On)
			{
				CustomBars.StaminaFastColorFlash.Flash(MinimalUIPlugin.StaminaBarFlashColor.Value);
				CustomBars.StaminaSlowColorFlash.Flash(MinimalUIPlugin.StaminaBarFlashColor.Value);
			}
		}
	}
	[HarmonyPatch(typeof(Hud), "StaminaBarUppgradeFlash")]
	internal static class HudStaminaBarUpgradeStaminaFlashPatch
	{
		private static void Postfix(Hud __instance)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			if (MinimalUIPlugin.StaminaBarFlash.Value == MinimalUIPlugin.Toggle.On && MinimalUIPlugin.CustomStaminaBar.Value == MinimalUIPlugin.Toggle.On)
			{
				CustomBars.StaminaFastColorFlash.Flash(MinimalUIPlugin.EitrBarFlashColor.Value);
				CustomBars.StaminaSlowColorFlash.Flash(MinimalUIPlugin.EitrBarFlashColor.Value);
			}
		}
	}
	[HarmonyPatch(typeof(Hud), "EitrBarEmptyFlash")]
	internal static class HudEitrBarNoEitrFlashPatch
	{
		private static void Postfix(Hud __instance)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			if (MinimalUIPlugin.EitrBarFlash.Value == MinimalUIPlugin.Toggle.On && MinimalUIPlugin.CustomEitrBar.Value == MinimalUIPlugin.Toggle.On)
			{
				CustomBars.EitrFastColorFlash.Flash(MinimalUIPlugin.EitrBarFlashColor.Value);
				CustomBars.EitrSlowColorFlash.Flash(MinimalUIPlugin.EitrBarFlashColor.Value);
			}
		}
	}
	[HarmonyPatch(typeof(Hud), "EitrBarUppgradeFlash")]
	internal static class HudEitrBarUpgradeEitrFlashPatch
	{
		private static void Postfix(Hud __instance)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			if (MinimalUIPlugin.EitrBarFlash.Value == MinimalUIPlugin.Toggle.On && MinimalUIPlugin.CustomEitrBar.Value == MinimalUIPlugin.Toggle.On)
			{
				CustomBars.EitrFastColorFlash.Flash(MinimalUIPlugin.EitrBarFlashColor.Value);
				CustomBars.EitrSlowColorFlash.Flash(MinimalUIPlugin.EitrBarFlashColor.Value);
			}
		}
	}
	[BepInPlugin("Azumatt.MinimalUI", "MinimalUI", "2.3.8")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class MinimalUIPlugin : BaseUnityPlugin
	{
		internal enum Toggle
		{
			On,
			Off
		}

		private class ConfigurationManagerAttributes
		{
			[UsedImplicitly]
			public int? Order;

			[UsedImplicitly]
			public bool? Browsable;

			[UsedImplicitly]
			public string? Category;

			[UsedImplicitly]
			public Action<ConfigEntryBase>? CustomDrawer;
		}

		private class AcceptableShortcuts : AcceptableValueBase
		{
			public AcceptableShortcuts()
				: base(typeof(KeyboardShortcut))
			{
			}

			public override object Clamp(object value)
			{
				return value;
			}

			public override bool IsValid(object value)
			{
				return true;
			}

			public override string ToDescriptionString()
			{
				return "# Acceptable values: " + string.Join(", ", KeyboardShortcut.AllKeyCodes);
			}
		}

		[HarmonyPatch(typeof(InventoryGui))]
		private class InventoryGuiPatch
		{
			[HarmonyPrefix]
			[HarmonyPatch("OnRightClickItem")]
			private static bool OnRightClickItemPrefix(ref InventoryGui __instance, ref ItemData item)
			{
				if (Input.GetKey((KeyCode)304) && Input.GetKey((KeyCode)308))
				{
					TextInput.instance.RequestText((TextReceiver)(object)new CrafterNameTextReceiver(item), "Crafter Name", 255);
					return false;
				}
				return true;
			}
		}

		private class CrafterNameTextReceiver : TextReceiver
		{
			private readonly ItemData item;

			public CrafterNameTextReceiver(ItemData item)
			{
				this.item = item;
			}

			public string GetText()
			{
				return item.m_crafterName;
			}

			public void SetText(string text)
			{
				item.m_crafterName = text;
			}
		}

		internal const string ModName = "MinimalUI";

		internal const string ModVersion = "2.3.8";

		internal const string Author = "Azumatt";

		private const string ModGUID = "Azumatt.MinimalUI";

		private static string ConfigFileName = "Azumatt.MinimalUI.cfg";

		private static string ConfigFileFullPath;

		private static string zipFolderPath;

		private readonly Harmony _harmony = new Harmony("Azumatt.MinimalUI");

		public static readonly ManualLogSource MinimalUILogger;

		internal static MinimalUIPlugin instance;

		internal static bool BTInstalled;

		internal static bool ELInstalled;

		internal AssetBundle mapBundle;

		internal static GameObject? GameBlur;

		internal static bool MoveableInventoryInstalled;

		internal static bool JcInstalled;

		internal const int QualMax = 99998;

		internal const string BkgText = "bkg";

		internal static readonly string BkgTextUpp;

		internal const string BorderText = "border (1)";

		internal static float Timer;

		internal static float StartingCooldown;

		internal static Vector3 LastMousePos;

		internal static string CurrentlyDragging;

		internal static Transform HudrootTransform;

		internal static RectTransform BuildSelectedTransform;

		internal static Sprite CraftingSprite;

		internal static Sprite InventorySprite;

		internal static Sprite CustomBarBackground;

		internal static Sprite SpriteSkillsDialog;

		internal static Sprite SpriteSplitDialog;

		internal static Sprite SpriteVariantDialog;

		internal static Sprite SpriteContainer;

		internal static Sprite SpriteCraftingPanel;

		internal static Sprite SpriteInfoPanel;

		internal static Sprite SpriteCompendiumPanel;

		internal static Sprite SpriteServerSelectPanel;

		internal static Sprite SpriteTrophysPanel;

		internal static Sprite SpritePlayerInvPanel;

		internal static Sprite SpriteBuildMenuPanel;

		internal static Sprite SpriteRemoveCharacterDialog;

		internal static Sprite SpriteBottomWindowPanel;

		internal static Sprite JCspriteSkillsDialog;

		internal static Sprite JCspriteSplitDialog;

		internal static Sprite JCspriteVariantDialog;

		internal static Sprite JCspriteContainer;

		internal static Sprite JCspriteCraftingPanel;

		internal static Sprite JCspriteInfoPanel;

		internal static Sprite JCspriteCompendiumPanel;

		internal static Sprite JCspriteServerSelectPanel;

		internal static Sprite JCspriteTrophysPanel;

		internal static Sprite JCspritePlayerInvPanel;

		internal static Sprite JCspriteBuildMenuPanel;

		internal static Sprite JCspriteRemoveCharacterDialog;

		internal static Sprite JCspriteBottomWindowPanel;

		internal static readonly List<Image> TransformBackgroundsPlayerInv;

		internal static readonly List<Image> TransformBackgroundsSpriteSkillsDialog;

		internal static readonly List<Image> TransformBackgroundsSpriteSplitDialog;

		internal static readonly List<Image> TransformBackgroundsCompendium;

		internal static Image InfoPanelImage;

		internal static Image BuildMenuPanelImage;

		internal static Image CraftingPanelImage;

		internal static Image ContainerBkgImage;

		internal static Image ContainerWeightBkgImage;

		internal static Image ContainerWeightBkgImage2;

		internal static Image TrophiesBkgImage;

		internal static Image SplitDialogPanelImage;

		internal static Image GridImage;

		internal static GameObject GridImageGO;

		internal static Vector2 GpNamePos;

		internal static Vector2 GpIconPos;

		internal static Vector2 GpBkgPos;

		internal static Vector2 GpTimeTextPos;

		internal static Image BottomWindowBkgImage;

		internal static Image RemoveCharacterDialogImage;

		internal static Image NewCharacterBkgImage;

		internal static Image CustomizationPanelBkgImage;

		internal static Image PleaseWaitPanelBkgImage;

		internal static Image ManageSavesMenuBkgImage;

		internal static Image StartGamePanelBkgImage;

		internal static Image WorldModifiersBkgImage;

		internal static Image RemoveWorldDialogImage;

		internal static Image NewWorldDialogImage;

		internal static Image EaqBkg;

		internal static Image RandysEaqHotbarBkg;

		internal static Material flashMaterial;

		internal static ConfigEntry<Color> AlphaElement;

		internal static ConfigEntry<Toggle> CustomUI;

		internal static ConfigEntry<Toggle> AlwaysOpen;

		internal static ConfigEntry<Toggle> ClearLitPanelMaterial;

		internal static ConfigEntry<Color> QualColor;

		internal static ConfigEntry<int> QualTextSize;

		internal static ConfigEntry<int> QualTextXSize;

		internal static ConfigEntry<Color> GridImageColor;

		internal static ConfigEntry<Toggle> CreatePanelButtons;

		internal static ConfigEntry<Toggle> ShowAsStars;

		internal static ConfigEntry<float> InventoryScale;

		internal static ConfigEntry<float> ChestInventoryScale;

		internal static ConfigEntry<float> CraftingPanelScale;

		internal static ConfigEntry<float> InfoPanelScale;

		internal static ConfigEntry<float> HotbarScale;

		internal static ConfigEntry<int> HotbarItemsPerRow;

		internal static ConfigEntry<float> QuickSlotsScale;

		internal static ConfigEntry<float> BuildMenuScale;

		internal static ConfigEntry<float> SelectedBuildPanelScale;

		internal static ConfigEntry<KeyboardShortcut> KeyboardShortcut;

		internal static ConfigEntry<KeyboardShortcut> KeyboardShortcutRotation;

		internal static ConfigEntry<KeyboardShortcut> KeyboardShortcutEditMode;

		internal static ConfigEntry<KeyboardShortcut> KeyboardShortcutEditModeCycle;

		internal static ConfigEntry<KeyboardShortcut> KeyboardShortcutEditModeGrid;

		internal static ConfigEntry<Vector2> CustomHealthBarPos;

		internal static ConfigEntry<Vector2> CustomFoodBarPos;

		internal static ConfigEntry<Vector2> CustomFood1Pos;

		internal static ConfigEntry<Vector2> CustomFood2Pos;

		internal static ConfigEntry<Vector2> CustomFood3Pos;

		internal static ConfigEntry<Vector2> CustomGpBarPos;

		internal static ConfigEntry<Vector2> CustomStaminaBarPos;

		internal static ConfigEntry<Vector2> CustomEitrBarPos;

		internal static ConfigEntry<float> CustomHealthBarScale;

		internal static ConfigEntry<float> CustomFoodBarScale;

		internal static ConfigEntry<float> CustomFood1Scale;

		internal static ConfigEntry<float> CustomFood2Scale;

		internal static ConfigEntry<float> CustomFood3Scale;

		internal static ConfigEntry<float> CustomGpBarScale;

		internal static ConfigEntry<float> CustomStaminaBarScale;

		internal static ConfigEntry<float> CustomEitrBarScale;

		internal static ConfigEntry<int> CustomHealthBarRotation;

		internal static ConfigEntry<int> CustomFoodBarRotation;

		internal static ConfigEntry<int> CustomFood1Rotation;

		internal static ConfigEntry<int> CustomFood2Rotation;

		internal static ConfigEntry<int> CustomFood3Rotation;

		internal static ConfigEntry<int> CustomGpBarRotation;

		internal static ConfigEntry<int> CustomStaminaBarRotation;

		internal static ConfigEntry<int> CustomEitrBarRotation;

		internal static ConfigEntry<Vector2> InventoryPosition;

		internal static ConfigEntry<Vector2> ChestInventoryPosition;

		internal static ConfigEntry<Vector2> CraftingPanelPosition;

		internal static ConfigEntry<Vector2> InformationPanelPosition;

		internal static ConfigEntry<Vector2> HotbarPosition;

		internal static ConfigEntry<Vector2> QuickSlotsPosition;

		internal static ConfigEntry<Vector2> BuildMenuPosition;

		internal static ConfigEntry<Vector2> SelectedBuildPanelPosition;

		internal static ConfigEntry<Vector2> MuiMapPosition;

		internal static ConfigEntry<Vector2> GuardianPowerPosition;

		internal static ConfigEntry<Vector2> OutlineSize;

		internal static ConfigEntry<Toggle> CustomHealthBar;

		internal static ConfigEntry<Toggle> CustomHealthBarStretch;

		internal static ConfigEntry<Toggle> CustomStaminaBar;

		internal static ConfigEntry<Toggle> CustomStaminaBarStretch;

		internal static ConfigEntry<Toggle> CustomStaminaBarHide;

		internal static ConfigEntry<Toggle> CustomEitrBar;

		internal static ConfigEntry<Toggle> CustomEitrBarStretch;

		internal static ConfigEntry<Toggle> CustomEitrBarHide;

		internal static ConfigEntry<Toggle> CustomGpBar;

		internal static ConfigEntry<Toggle> CustomFoodBar;

		internal static ConfigEntry<Color> HealthBarColor;

		internal static ConfigEntry<Color> HealthBarColor2;

		internal static ConfigEntry<Toggle> HealthBarFlash;

		internal static ConfigEntry<Color> HealthBarFlashColor;

		internal static ConfigEntry<Color> StaminaBarColor;

		internal static ConfigEntry<Color> StaminaBarColor2;

		internal static ConfigEntry<Color> EitrBarColor;

		internal static ConfigEntry<Color> EitrBarColor2;

		internal static ConfigEntry<Toggle> StaminaBarFlash;

		internal static ConfigEntry<Color> StaminaBarFlashColor;

		internal static ConfigEntry<Toggle> EitrBarFlash;

		internal static ConfigEntry<Color> EitrBarFlashColor;

		internal static ConfigEntry<Color> GpBarColor;

		internal static ConfigEntry<Color> GpBarColor2;

		internal static ConfigEntry<Toggle> WeightDisplay;

		internal static ConfigEntry<Toggle> ShowDirectWeight;

		internal static ConfigEntry<Toggle> MUIMapRotation;

		internal static ConfigEntry<Toggle> MUIMapEnabled;

		internal static ConfigEntry<Toggle> compassEnabled;

		internal static ConfigEntry<int> nexusID;

		internal static ConfigEntry<Toggle> showPlayerMarkers;

		internal static ConfigEntry<Toggle> usePlayerDirection;

		internal static ConfigEntry<Toggle> showCenterMarker;

		public static ConfigEntry<string> compassFile;

		public static ConfigEntry<string> overlayFile;

		public static ConfigEntry<string> underlayFile;

		public static ConfigEntry<string> maskFile;

		public static ConfigEntry<string> centerFile;

		public static ConfigEntry<Color> compassColor;

		public static ConfigEntry<Color> centerColor;

		public static ConfigEntry<Color> markerColor;

		public static ConfigEntry<float> compassYOffset;

		public static ConfigEntry<Vector3> offsetSEs;

		public static ConfigEntry<float> compassScale;

		public static ConfigEntry<float> markerScale;

		public static ConfigEntry<float> minMarkerDistance;

		public static ConfigEntry<float> maxMarkerDistance;

		public static ConfigEntry<float> minMarkerScale;

		public static ConfigEntry<string> ignoredMarkerNames;

		public static ConfigEntry<string> ignoredMarkerTypes;

		private ConfigEntry<string> selectedZipFile;

		public static float lastAngle;

		public static bool dbgl;

		public static string[] ignoredTypes;

		public static string[] ignoredNames;

		internal static ConfigEntry<Toggle> Jcui;

		internal static ConfigEntry<Toggle> ChangeWILBackground;

		internal static ConfigEntry<Toggle> ChangeELBackground;

		private void Awake()
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Expected O, but got Unknown
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_029f: Expected O, but got Unknown
			//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f5: Expected O, but got Unknown
			//IL_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_032e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0373: Unknown result type (might be due to invalid IL or missing references)
			//IL_037d: Expected O, but got Unknown
			//IL_0392: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e1: Expected O, but got Unknown
			//IL_042d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0437: Expected O, but got Unknown
			//IL_046d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0477: Expected O, but got Unknown
			//IL_048c: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ff: Expected O, but got Unknown
			//IL_0514: Unknown result type (might be due to invalid IL or missing references)
			//IL_0559: Unknown result type (might be due to invalid IL or missing references)
			//IL_0563: Expected O, but got Unknown
			//IL_05af: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b9: Expected O, but got Unknown
			//IL_05ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f9: Expected O, but got Unknown
			//IL_060e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0632: Unknown result type (might be due to invalid IL or missing references)
			//IL_0677: Unknown result type (might be due to invalid IL or missing references)
			//IL_0681: Expected O, but got Unknown
			//IL_0696: Unknown result type (might be due to invalid IL or missing references)
			//IL_06db: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e5: Expected O, but got Unknown
			//IL_0710: Unknown result type (might be due to invalid IL or missing references)
			//IL_0734: Unknown result type (might be due to invalid IL or missing references)
			//IL_07af: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b9: Expected O, but got Unknown
			//IL_0825: Unknown result type (might be due to invalid IL or missing references)
			//IL_082f: Expected O, but got Unknown
			//IL_08bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c9: Expected O, but got Unknown
			//IL_08fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0906: Expected O, but got Unknown
			//IL_0939: Unknown result type (might be due to invalid IL or missing references)
			//IL_0943: Expected O, but got Unknown
			//IL_0976: Unknown result type (might be due to invalid IL or missing references)
			//IL_0980: Expected O, but got Unknown
			//IL_09b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_09bd: Expected O, but got Unknown
			//IL_09e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ee: Expected O, but got Unknown
			//IL_0a21: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a2b: Expected O, but got Unknown
			//IL_0a5e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a68: Expected O, but got Unknown
			//IL_0a9b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa5: Expected O, but got Unknown
			//IL_0ac4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ae2: Expected O, but got Unknown
			//IL_0b0a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b1e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b28: Expected O, but got Unknown
			//IL_0b47: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b5b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b65: Expected O, but got Unknown
			//IL_0b84: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b98: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ba2: Expected O, but got Unknown
			//IL_0bbe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bdc: Expected O, but got Unknown
			//IL_0bfb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c29: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c57: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c85: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cb3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ce1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d0f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d3d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d6b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d99: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dc7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0df5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e23: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e51: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e7f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ead: Unknown result type (might be due to invalid IL or missing references)
			//IL_0edb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f09: Unknown result type (might be due to invalid IL or missing references)
			instance = this;
			bool saveOnConfigSet = ((BaseUnityPlugin)this).Config.SaveOnConfigSet;
			((BaseUnityPlugin)this).Config.SaveOnConfigSet = false;
			AlphaElement = ((BaseUnityPlugin)this).Config.Bind<Color>("1 - General", "Alpha", new Color(1f, 1f, 1f, 0f), "Alpha for the backgrounds. Lower = more transparent. Optionally set a color here. The closer you get to white and full transparency, the closer you get to vanilla UI or your custom background being visible.");
			AlphaElement.SettingChanged += ReloadImagesFromFolder;
			CustomUI = ((BaseUnityPlugin)this).Config.Bind<Toggle>("1 - General", "Use Custom Backgrounds", Toggle.Off, "Turn on using custom backgrounds from the plugins folder. Must follow the naming convention mentioned in the mod description. Only one instance of the files can be in the plugins folder at one time. The files can be anywhere in the plugins folder and the mod will find them. If you have them in the plugins folder, but your background is still transparent, remember to change your alpha value to be fully visible.");
			CustomUI.SettingChanged += ReloadImagesFromFolder;
			AlwaysOpen = ((BaseUnityPlugin)this).Config.Bind<Toggle>("1 - General", "Always Open", Toggle.On, "Turn on default game functionality to always have your inventory and crafting windows open when you press TAB.");
			OutlineSize = ((BaseUnityPlugin)this).Config.Bind<Vector2>("1 - General", "Outline Size", new Vector2(0.5f, 0.5f), "Change the size of the black outline on the health and stamina bars. Lower = smaller outline.");
			ClearLitPanelMaterial = ((BaseUnityPlugin)this).Config.Bind<Toggle>("1 - General", "Clear Lit Panel Material", Toggle.Off, "Turn on to apply the clear material to panels that have the lit panel material. This will make the panel backgrounds you gave look closer to the photoshop version. Valheim has a subtle material applied to panels to make them a bit darker and change with the day/night. Turning on simply removes that.This is a global setting and will affect all panels. ");
			ClearLitPanelMaterial.SettingChanged += ToggleLitPanelMaterial;
			CreatePanelButtons = ((BaseUnityPlugin)this).Config.Bind<Toggle>("1 - General", "Create Panel Buttons", Toggle.Off, "Turn on to create the toggle buttons for crafting and inventory on the info panel (Where the compendium and PvP toggles live)");
			CreatePanelButtons.SettingChanged += MinimalUI.Patches.InventoryGuiPatch.TogglePanelButtons;
			GridImageColor = ((BaseUnityPlugin)this).Config.Bind<Color>("1 - General", "Grid Image Color", new Color(0f, 0f, 0f, 1f), "Color of the grid image");
			GridImageColor.SettingChanged += ChangeGridColor;
			ShowAsStars = ((BaseUnityPlugin)this).Config.Bind<Toggle>("2 - Quality", "Quality As Stars", Toggle.Off, new ConfigDescription("Show the inventory item's level as stars instead of numbers.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			QualColor = ((BaseUnityPlugin)this).Config.Bind<Color>("2 - Quality", "Quality Number Color", new Color(1f, 0.75f, 0f, 1f), "Color of the quality numbers");
			QualTextSize = ((BaseUnityPlugin)this).Config.Bind<int>("2 - Quality", "Quality Text Size", 14, "Size of the number values for quality");
			QualTextXSize = ((BaseUnityPlugin)this).Config.Bind<int>("2 - Quality", "Quality x Size", 13, "Size of the x that appears before the quality number");
			CustomHealthBar = ((BaseUnityPlugin)this).Config.Bind<Toggle>("3 - Health Bar", "Use Health Bar", Toggle.On, new ConfigDescription("Use the custom health bar provided by this mod. Does not extend the bar the more health you have. It's a set size with a custom skin.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 6
				}
			}));
			CustomHealthBar.SettingChanged += ToggleFoodHealthPanel;
			CustomHealthBarStretch = ((BaseUnityPlugin)this).Config.Bind<Toggle>("3 - Health Bar", "Health Bar Stretch", Toggle.Off, new ConfigDescription("Stretches the health bar based on how much health you have, instead of the static size. Mimic's vanilla bar behavior", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 5
				}
			}));
			HealthBarColor = ((BaseUnityPlugin)this).Config.Bind<Color>("3 - Health Bar", "Health Bar Color", Constants.defaultHBColor, "Color of the health bar");
			HealthBarColor2 = ((BaseUnityPlugin)this).Config.Bind<Color>("3 - Health Bar", "Secondary Health Bar Color", Constants.defaultHBColor2, "Color of the secondary health bar");
			HealthBarFlash = ((BaseUnityPlugin)this).Config.Bind<Toggle>("3 - Health Bar", "Use Flashing", Toggle.On, new ConfigDescription("Enable the flashing behind the health bar. Triggers when your health is below 25%.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 3
				}
			}));
			HealthBarFlashColor = ((BaseUnityPlugin)this).Config.Bind<Color>("3 - Health Bar", "Health Flash Color", Color.red, "Color of the flashing behind the health bar");
			CustomStaminaBar = ((BaseUnityPlugin)this).Config.Bind<Toggle>("3 - Stamina Bar", "Use Stamina Bar", Toggle.On, new ConfigDescription("Use the custom stamina bar provided by this mod. Does not extend the bar the more stamina you have. It's a set size with a custom skin.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 4
				}
			}));
			CustomStaminaBar.SettingChanged += TurnOffMuiStaminaBar;
			CustomStaminaBarStretch = ((BaseUnityPlugin)this).Config.Bind<Toggle>("3 - Stamina Bar", "Stamina Bar Stretch", Toggle.Off, new ConfigDescription("Stretches the stamina bar based on how much stamina you have, instead of the static size. Mimic's vanilla bar behavior", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 3
				}
			}));
			CustomStaminaBarHide = ((BaseUnityPlugin)this).Config.Bind<Toggle>("3 - Stamina Bar", "Hide Stamina Bar", Toggle.Off, new ConfigDescription("Hides the stamina bar when empty. Mimic's vanilla bar behavior", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 2
				}
			}));
			StaminaBarColor = ((BaseUnityPlugin)this).Config.Bind<Color>("3 - Stamina Bar", "Stamina Bar Color", Constants.defaultstaminaColor, "Color of the Stamina bar");
			StaminaBarColor2 = ((BaseUnityPlugin)this).Config.Bind<Color>("3 - Stamina Bar", "Secondary Stamina Bar Color", Constants.defaultstaminaColor2, "Color of the secondary Stamina bar");
			StaminaBarFlash = ((BaseUnityPlugin)this).Config.Bind<Toggle>("3 - Stamina Bar", "Use Flashing", Toggle.On, new ConfigDescription("Enable the flashing behind the stamina bar.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			StaminaBarFlashColor = ((BaseUnityPlugin)this).Config.Bind<Color>("3 - Stamina Bar", "Stamina Flash Color", Color.red, "Color of the flashing behind the stamina bar");
			CustomEitrBar = ((BaseUnityPlugin)this).Config.Bind<Toggle>("3 - Eitr Bar", "Use Eitr Bar", Toggle.On, new ConfigDescription("Use the custom eitr bar provided by this mod. Does not extend the bar the more eitr you have. It's a set size with a custom skin.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 4
				}
			}));
			CustomEitrBar.SettingChanged += TurnOffMuiEitrBar;
			CustomEitrBarStretch = ((BaseUnityPlugin)this).Config.Bind<Toggle>("3 - Eitr Bar", "Eitr Bar Stretch", Toggle.Off, new ConfigDescription("Stretches the eitr bar based on how much eitr you have, instead of the static size. Mimic's vanilla bar behavior", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 3
				}
			}));
			CustomEitrBarHide = ((BaseUnityPlugin)this).Config.Bind<Toggle>("3 - Eitr Bar", "Hide Eitr Bar", Toggle.Off, new ConfigDescription("Hides the eitr bar when empty. Mimic's vanilla bar behavior", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 2
				}
			}));
			EitrBarColor = ((BaseUnityPlugin)this).Config.Bind<Color>("3 - Eitr Bar", "Eitr Bar Color", Constants.defaulteitrColor, "Color of the Eitr bar");
			EitrBarColor2 = ((BaseUnityPlugin)this).Config.Bind<Color>("3 - Eitr Bar", "Secondary Eitr Bar Color", Constants.defaulteitrColor2, "Color of the secondary Eitr bar");
			EitrBarFlash = ((BaseUnityPlugin)this).Config.Bind<Toggle>("3 - Eitr Bar", "Use Flashing", Toggle.On, new ConfigDescription("Enable the flashing behind the eitr bar.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			EitrBarFlashColor = ((BaseUnityPlugin)this).Config.Bind<Color>("3 - Eitr Bar", "Eitr Flash Color", Color.red, "Color of the flashing behind the eitr bar");
			CustomGpBar = ((BaseUnityPlugin)this).Config.Bind<Toggle>("3 - GP Bar", "Use Power Bar", Toggle.On, new ConfigDescription("Use the custom Guardian Power bar provided by this mod. Shows cooldown time in bar format instead of just a time countdown.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			CustomGpBar.SettingChanged += TurnOffMuigpBar;
			GpBarColor = ((BaseUnityPlugin)this).Config.Bind<Color>("3 - GP Bar", "GP Bar Color", Constants.defaultGPColor, "Color of the GP bar");
			GpBarColor2 = ((BaseUnityPlugin)this).Config.Bind<Color>("3 - GP Bar", "Secondary GP Bar Color", Color.green, "Color of the secondary GP bar");
			CustomFoodBar = ((BaseUnityPlugin)this).Config.Bind<Toggle>("3 - Food Bar", "Use Food Bar", Toggle.On, "Use the food 'bar' provided by this mod. Shows the food information.");
			CustomFoodBar.SettingChanged += ToggleFoodHealthPanel;
			WeightDisplay = ((BaseUnityPlugin)this).Config.Bind<Toggle>("4 - Weight Status Display", "Enabled?", Toggle.On, new ConfigDescription("Enable or disable the custom weight status effect display.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			ShowDirectWeight = ((BaseUnityPlugin)this).Config.Bind<Toggle>("4 - Weight Status Display", "Show Direct Weight Value", Toggle.Off, "Choose to show the direct weight value instead of the percentage.");
			WeightDisplay.SettingChanged += ToggleWeightDisplay;
			MUIMapEnabled = ((BaseUnityPlugin)this).Config.Bind<Toggle>("5 - MUI Minimap", "Enable Custom Minimap", Toggle.On, new ConfigDescription("If set to On, you will use the MinimalUI minimap skin.  Reboot your game for the toggle to take effect properly.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			MUIMapEnabled.SettingChanged += delegate(object sender, EventArgs e)
			{
				MUIMap.CreateMinimalMap(sender, e);
			};
			MUIMapRotation = ((BaseUnityPlugin)this).Config.Bind<Toggle>("5 - MUI Minimap", "Custom Minimap Rotation", Toggle.Off, "If set to On, the minimap will rotate with the player's looking direction.");
			if (!Chainloader.PluginInfos.ContainsKey("aedenthorn.MovableInventoryWindows"))
			{
				InventoryScale = ((BaseUnityPlugin)this).Config.Bind<float>("2 - Inventory", "Inventory Scale", 0.85f, new ConfigDescription("Scale of Inventory", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 10f), Array.Empty<object>()));
				ChestInventoryScale = ((BaseUnityPlugin)this).Config.Bind<float>("2 - Inventory", "Chest Inventory Scale", 0.85f, new ConfigDescription("Scale of Chest Inventory", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 10f), Array.Empty<object>()));
				CraftingPanelScale = ((BaseUnityPlugin)this).Config.Bind<float>("2 - Inventory", "Crafting Panel Scale", 0.85f, new ConfigDescription("Scale of Crafting Panel", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 10f), Array.Empty<object>()));
				InfoPanelScale = ((BaseUnityPlugin)this).Config.Bind<float>("2 - Inventory", "Info Panel Scale", 0.85f, new ConfigDescription("Scale of Information Panel", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 10f), Array.Empty<object>()));
				HotbarScale = ((BaseUnityPlugin)this).Config.Bind<float>("2 - Inventory", "Hotbar Scale", 0.85f, new ConfigDescription("Scale of Hotbar", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 10f), Array.Empty<object>()));
				HotbarItemsPerRow = ((BaseUnityPlugin)this).Config.Bind<int>("2 - Inventory", "Hotbar PerRow", 1, new ConfigDescription("Number of items per row in the hotbar", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 8), Array.Empty<object>()));
				QuickSlotsScale = ((BaseUnityPlugin)this).Config.Bind<float>("2 - Inventory", "QuickSlots Scale", 0.85f, new ConfigDescription("Scale of QuickSlots", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 10f), Array.Empty<object>()));
				BuildMenuScale = ((BaseUnityPlugin)this).Config.Bind<float>("2 - Inventory", "Build Menu Scale", 0.85f, new ConfigDescription("Building menu scale", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 10f), Array.Empty<object>()));
				SelectedBuildPanelScale = ((BaseUnityPlugin)this).Config.Bind<float>("2 - Inventory", "Selected Build Panel Scale", 0.85f, new ConfigDescription("Scale of the currently selected build piece's Panel", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 10f), Array.Empty<object>()));
				KeyboardShortcut = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("3 - Keys", "Keyboard Shortcut Modifier", new KeyboardShortcut((KeyCode)306, Array.Empty<KeyCode>()), new ConfigDescription("The shortcut needed to be held down while clicking on the panels to resize them.", (AcceptableValueBase)(object)new AcceptableShortcuts(), Array.Empty<object>()));
				KeyboardShortcutRotation = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("3 - Keys", "Keyboard Rotation Shortcut Modifier", new KeyboardShortcut((KeyCode)306, (KeyCode[])(object)new KeyCode[1] { (KeyCode)304 }), new ConfigDescription("The shortcut needed to be held down while clicking on the panels to rotate them.", (AcceptableValueBase)(object)new AcceptableShortcuts(), Array.Empty<object>()));
				KeyboardShortcutEditMode = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("3 - Keys", "Edit Mode Toggle", new KeyboardShortcut((KeyCode)288, Array.Empty<KeyCode>()), new ConfigDescription("The shortcut needed to be pressed to enter the editing mode for the UI.", (AcceptableValueBase)(object)new AcceptableShortcuts(), Array.Empty<object>()));
				KeyboardShortcutEditModeCycle = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("3 - Keys", "Cycle Edit Layer", new KeyboardShortcut((KeyCode)324, Array.Empty<KeyCode>()), new ConfigDescription("The shortcut needed to be pressed to cycle which layer you are editing while in edit mode.", (AcceptableValueBase)(object)new AcceptableShortcuts(), Array.Empty<object>()));
				KeyboardShortcutEditModeGrid = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("3 - Keys", "Toggle Grid", new KeyboardShortcut((KeyCode)103, Array.Empty<KeyCode>()), new ConfigDescription("The shortcut needed to be pressed to toggle on and off the grid while in edit mode.", (AcceptableValueBase)(object)new AcceptableShortcuts(), Array.Empty<object>()));
				CustomHealthBarPos = ((BaseUnityPlugin)this).Config.Bind<Vector2>("4 - Positions", "Health Bar Position", new Vector2(66.5f, 37.8f), "Position of the health bar");
				CustomFoodBarPos = ((BaseUnityPlugin)this).Config.Bind<Vector2>("4 - Positions", "Food Bar Position", new Vector2(28.5f, 100.8f), "Position of the food bar");
				CustomFood1Pos = ((BaseUnityPlugin)this).Config.Bind<Vector2>("4 - Positions", "Food 1 Position", new Vector2(-66.5f, 150.8f), "Position of the food bar");
				CustomFood2Pos = ((BaseUnityPlugin)this).Config.Bind<Vector2>("4 - Positions", "Food 2 Position", new Vector2(-66.5f, 90.8f), "Position of the food bar");
				CustomFood3Pos = ((BaseUnityPlugin)this).Config.Bind<Vector2>("4 - Positions", "Food 3 Position", new Vector2(-66.5f, 30.8f), "Position of the food bar");
				CustomStaminaBarPos = ((BaseUnityPlugin)this).Config.Bind<Vector2>("4 - Positions", "Stamina Bar Position", new Vector2(235.5f, 37.8f), "Position of the stamina bar");
				CustomEitrBarPos = ((BaseUnityPlugin)this).Config.Bind<Vector2>("4 - Positions", "Eitr Bar Position", new Vector2(235.5f, 82.8f), "Position of the eitr bar");
				CustomGpBarPos = ((BaseUnityPlugin)this).Config.Bind<Vector2>("4 - Positions", "GP Bar Position", new Vector2(66.5f, 82.8f), "Position of the GP bar");
				InventoryPosition = ((BaseUnityPlugin)this).Config.Bind<Vector2>("4 - Positions", "Inventory Position", new Vector2(0.03f, 0.835f), "Current position of the Inventory");
				ChestInventoryPosition = ((BaseUnityPlugin)this).Config.Bind<Vector2>("4 - Positions", "Chest Inventory Position", new Vector2(-0.0194f, 1.065f), "Current position of the Chest Inventory");
				CraftingPanelPosition = ((BaseUnityPlugin)this).Config.Bind<Vector2>("4 - Positions", "Crafting Panel Position", new Vector2(1f, 1f), "Current position of the Crafting Panel");
				InformationPanelPosition = ((BaseUnityPlugin)this).Config.Bind<Vector2>("4 - Positions", "Info Panel Position", new Vector2(0.634f, 1.024f), "Current position of the Info Panel");
				HotbarPosition = ((BaseUnityPlugin)this).Config.Bind<Vector2>("4 - Positions", "Hotbar Position", new Vector2(-36f, 902f), "Current position of the Hotbar");
				QuickSlotsPosition = ((BaseUnityPlugin)this).Config.Bind<Vector2>("4 - Positions", "QuickSlots Position", new Vector2(9999f, 9999f), "Current position of the QuickSlots");
				BuildMenuPosition = ((BaseUnityPlugin)this).Config.Bind<Vector2>("4 - Positions", "Build Menu Position", new Vector2(9999f, 9999f), "Current position of the Build Menu");
				SelectedBuildPanelPosition = ((BaseUnityPlugin)this).Config.Bind<Vector2>("4 - Positions", "Selected Build Panel Position", new Vector2(0f, 20f), "Current position of the currently selected build piece's Panel");
				MuiMapPosition = ((BaseUnityPlugin)this).Config.Bind<Vector2>("4 - Positions", "MUI Map Position", new Vector2(-28f, -45f), "Current position of MUI minimap");
				GuardianPowerPosition = ((BaseUnityPlugin)this).Config.Bind<Vector2>("4 - Positions", "GuardianPower Icon Position", new Vector2(207f, 43f), "Current position of GuardianPower Icon");
				CustomHealthBarScale = ((BaseUnityPlugin)this).Config.Bind<float>("4.5 - Scales", "Health Bar Scale", 1f, "Scale of the health bar");
				CustomFoodBarScale = ((BaseUnityPlugin)this).Config.Bind<float>("4.5 - Scales", "Food Bar Scale", 1f, "Scale of the food bar");
				CustomFood1Scale = ((BaseUnityPlugin)this).Config.Bind<float>("4.5 - Scales", "Food 1 Scale", 1f, "Scale of the food bar");
				CustomFood2Scale = ((BaseUnityPlugin)this).Config.Bind<float>("4.5 - Scales", "Food 2 Scale", 1f, "Scale of the food bar");
				CustomFood3Scale = ((BaseUnityPlugin)this).Config.Bind<float>("4.5 - Scales", "Food 3 Scale", 1f, "Scale of the food bar");
				CustomStaminaBarScale = ((BaseUnityPlugin)this).Config.Bind<float>("4.5 - Scales", "Stamina Bar Scale", 1f, "Scale of the stamina bar");
				CustomEitrBarScale = ((BaseUnityPlugin)this).Config.Bind<float>("4.5 - Scales", "Eitr Bar Scale", 1f, "Scale of the eitr bar");
				CustomGpBarScale = ((BaseUnityPlugin)this).Config.Bind<float>("4.5 - Scales", "GP Bar Scale", 1f, "Scale of the GP bar");
				CustomHealthBarRotation = ((BaseUnityPlugin)this).Config.Bind<int>("4.5 - Rotations", "Health Bar Rotation", 90, "Rotation of the health bar");
				CustomFoodBarRotation = ((BaseUnityPlugin)this).Config.Bind<int>("4.5 - Rotations", "Food Bar Rotation", 0, "Rotation of the food bar");
				CustomStaminaBarRotation = ((BaseUnityPlugin)this).Config.Bind<int>("4.5 - Rotations", "Stamina Bar Rotation", 90, "Rotation of the stamina bar");
				CustomEitrBarRotation = ((BaseUnityPlugin)this).Config.Bind<int>("4.5 - Rotations", "Eitr Bar Rotation", 90, "Rotation of the eitr bar");
				CustomGpBarRotation = ((BaseUnityPlugin)this).Config.Bind<int>("4.5 - Rotations", "GP Bar Rotation", 90, "Rotation of the GP bar");
			}
			Jcui = ((BaseUnityPlugin)this).Config.Bind<Toggle>("5 - JC", "JC UI Toggle", Toggle.On, "If set to true, the Jewelcrafting UI will be used when Jewelcrafting is installed. This config option is dependant on the mod being present. Reboot your game for the toggle to take effect.");
			ChangeWILBackground = ((BaseUnityPlugin)this).Config.Bind<Toggle>("6 - Background Control", "Change WardIsLove Background", Toggle.On, "If set to true, the WardIsLove GUI background will be changed to the MUI background. This config option is dependant on the mod being present.");
			ChangeELBackground = ((BaseUnityPlugin)this).Config.Bind<Toggle>("6 - Background Control", "Change EpicLoot Background", Toggle.On, "If set to true, the EpicLoot backgrounds will be changed to the MUI background. This config option is dependant on the mod being present.");
			if (Chainloader.PluginInfos.ContainsKey("org.bepinex.plugins.jewelcrafting"))
			{
				JcInstalled = true;
			}
			if (Chainloader.PluginInfos.ContainsKey("aedenthorn.MovableInventoryWindows"))
			{
				MoveableInventoryInstalled = true;
			}
			CraftingSprite = loadSprite("MUI_CraftingIcon64x64.png", isEmbed: true);
			InventorySprite = loadSprite("MUI_InventoryIcon64x64.png", isEmbed: true);
			CustomBarBackground = loadSprite("MUI_custombar.png", isEmbed: true);
			ReloadImagesFromFolder(null, null);
			LoadMapBundle();
			LoadTransparentShader();
			LoadAndBindZipFile();
			_harmony.PatchAll();
			SetupWatcher();
			((BaseUnityPlugin)this).Config.SaveOnConfigSet = saveOnConfigSet;
		}

		private void Start()
		{
			Chainloader.PluginInfos.TryGetValue("Menthus.bepinex.plugins.BetterTrader", out var value);
			Chainloader.PluginInfos.TryGetValue("randyknapp.mods.epicloot", out var value2);
			Chainloader.PluginInfos.TryGetValue("Azumatt.WardIsLove", out var value3);
			if (value != null && (Object)(object)value.Instance != (Object)null)
			{
				MinimalUILogger.LogDebug((object)"BetterTrader detected.");
				BTInstalled = true;
			}
			if (value2 != null && (Object)(object)value2.Instance != (Object)null)
			{
				MinimalUILogger.LogDebug((object)"EpicLoot detected.");
				_harmony.PatchAll(typeof(MinimalUI.ELCompat.ELCompat));
				ELInstalled = true;
			}
			if (value3 != null && (Object)(object)value3.Instance != (Object)null)
			{
				_harmony.PatchAll(typeof(MinimalUI.WILCompat.WILCompat));
			}
		}

		private void OnDestroy()
		{
			((BaseUnityPlugin)this).Config.Save();
		}

		private void SetupWatcher()
		{
			FileSystemWatcher fileSystemWatcher = new FileSystemWatcher(Paths.ConfigPath, ConfigFileName);
			fileSystemWatcher.Changed += ReadConfigValues;
			fileSystemWatcher.Created += ReadConfigValues;
			fileSystemWatcher.Renamed += ReadConfigValues;
			fileSystemWatcher.IncludeSubdirectories = true;
			fileSystemWatcher.SynchronizingObject = ThreadingHelper.SynchronizingObject;
			fileSystemWatcher.EnableRaisingEvents = true;
			FileSystemWatcher fileSystemWatcher2 = new FileSystemWatcher(Paths.ConfigPath, "MUI_*.png");
			fileSystemWatcher2.Changed += ReloadImagesFromFolder;
			fileSystemWatcher2.Created += ReloadImagesFromFolder;
			fileSystemWatcher2.Renamed += ReloadImagesFromFolder;
			fileSystemWatcher2.IncludeSubdirectories = true;
			fileSystemWatcher2.SynchronizingObject = ThreadingHelper.SynchronizingObject;
			fileSystemWatcher2.EnableRaisingEvents = true;
		}

		private void ReadConfigValues(object sender, FileSystemEventArgs e)
		{
			if (!File.Exists(ConfigFileFullPath))
			{
				return;
			}
			try
			{
				MinimalUILogger.LogDebug((object)"ReadConfigValues called");
				((BaseUnityPlugin)this).Config.Reload();
			}
			catch
			{
				MinimalUILogger.LogError((object)("There was an issue loading your " + ConfigFileName));
				MinimalUILogger.LogError((object)"Please check your config entries for spelling and format!");
			}
		}

		private void LoadMapBundle()
		{
			mapBundle = GetAssetBundleFromResources("muimap");
			try
			{
				MUIMap.newMap = mapBundle.LoadAsset<GameObject>("MUIMap");
			}
			catch (Exception arg)
			{
				MinimalUILogger.LogError((object)$"Error loading map bundle {arg}");
			}
		}

		private void LoadTransparentShader()
		{
			Shader val = GetAssetBundleFromResources("transparentshader").LoadAsset<Shader>("UI-Unlit-Transparent");
			if ((Object)(object)val == (Object)null)
			{
				MinimalUILogger.LogError((object)"Failed to load transparent shader from resources.");
			}
			else
			{
				FejdStartupAwakePatch.transparentShader = val;
			}
		}

		private void LoadAndBindZipFile()
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Expected O, but got Unknown
			selectedZipFile = ((BaseUnityPlugin)this).Config.Bind<string>("1 - General", "Used Custom Background", GetDefaultZipFile(GetZipFiles()), new ConfigDescription("Select a zip file to unzip", (AcceptableValueBase)(object)new AcceptableValueList<string>(GetZipFiles()), Array.Empty<object>()));
			selectedZipFile.SettingChanged += OnSelectedZipFileChanged;
		}

		private string GetDefaultZipFile(string[] zipFiles)
		{
			if (!Directory.Exists(zipFolderPath))
			{
				return "No zip files found";
			}
			string text = Directory.GetDirectories(zipFolderPath).FirstOrDefault();
			if (text != null)
			{
				string text2 = Path.GetFileName(text) + ".zip";
				if (zipFiles.Contains(text2))
				{
					return text2;
				}
			}
			return "No zip files found";
		}

		private string[] GetZipFiles()
		{
			if (!Directory.Exists(zipFolderPath))
			{
				Directory.CreateDirectory(zipFolderPath);
			}
			return Directory.GetFiles(zipFolderPath, "*.zip").Select(Path.GetFileName).ToArray();
		}

		private void OnSelectedZipFileChanged(object sender, EventArgs e)
		{
			if (!string.IsNullOrEmpty(selectedZipFile.Value))
			{
				UnzipSelectedFile(selectedZipFile.Value);
			}
		}

		private void UnzipSelectedFile(string zipFileName)
		{
			if (Directory.Exists(zipFolderPath))
			{
				string[] directories = Directory.GetDirectories(zipFolderPath);
				for (int i = 0; i < directories.Length; i++)
				{
					Directory.Delete(directories[i], recursive: true);
				}
				directories = Directory.GetFiles(zipFolderPath, "MUI_*.png");
				for (int i = 0; i < directories.Length; i++)
				{
					File.Delete(directories[i]);
				}
				ZipFile.ExtractToDirectory(Path.Combine(zipFolderPath, zipFileName), zipFolderPath);
			}
		}

		private static AssetBundle GetAssetBundleFromResources(string filename)
		{
			string filename2 = filename;
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			string name = executingAssembly.GetManifestResourceNames().Single((string str) => str.EndsWith(filename2));
			using Stream stream = executingAssembly.GetManifestResourceStream(name);
			return AssetBundle.LoadFromStream(stream);
		}

		private static void ReloadImagesFromFolder(object sender, FileSystemEventArgs e)
		{
			Load("(file system)");
		}

		private static void ReloadImagesFromFolder(object sender, EventArgs e)
		{
			Load("(setting changed)");
		}

		private static void ToggleWeightDisplay(object sender, EventArgs e)
		{
			if ((Object)(object)HudAwakePatch2.WeightSEGO != (Object)null)
			{
				HudAwakePatch2.WeightSEGO.SetActive(WeightDisplay.Value == Toggle.On);
			}
		}

		private static void ToggleLitPanelMaterial(object sender, EventArgs e)
		{
			Material[] array = Resources.FindObjectsOfTypeAll<Material>();
			foreach (Material val in array)
			{
				if (Object.op_Implicit((Object)(object)val) && ((Object)val).name == "litpanel")
				{
					val.shader = ((ClearLitPanelMaterial.Value == Toggle.On) ? FejdStartupAwakePatch.transparentShader : FejdStartupAwakePatch.originalShader);
				}
			}
		}

		private static void Load(string calledMethod)
		{
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_0795: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_07dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0823: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_086a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0903: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0328: Unknown result type (might be due to invalid IL or missing references)
			//IL_0933: Unknown result type (might be due to invalid IL or missing references)
			//IL_0358: Unknown result type (might be due to invalid IL or missing references)
			//IL_0963: Unknown result type (might be due to invalid IL or missing references)
			//IL_0388: Unknown result type (might be due to invalid IL or missing references)
			//IL_0993: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_09f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0418: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a23: Unknown result type (might be due to invalid IL or missing references)
			//IL_0448: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a53: Unknown result type (might be due to invalid IL or missing references)
			//IL_0478: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a83: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ae3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0508: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b13: Unknown result type (might be due to invalid IL or missing references)
			//IL_0538: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b43: Unknown result type (might be due to invalid IL or missing references)
			//IL_0568: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b73: Unknown result type (might be due to invalid IL or missing references)
			//IL_0598: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ba3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c03: Unknown result type (might be due to invalid IL or missing references)
			//IL_0628: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c33: Unknown result type (might be due to invalid IL or missing references)
			//IL_0658: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c63: Unknown result type (might be due to invalid IL or missing references)
			//IL_0688: Unknown result type (might be due to invalid IL or missing references)
			MinimalUILogger.LogDebug((object)("ReloadImagesFromFolder " + calledMethod + " called"));
			if ((Object)(object)Player.m_localPlayer != (Object)null)
			{
				((Character)Player.m_localPlayer).Message((MessageType)2, "Reloading images...please wait...", 12, (Sprite)null);
			}
			CustomBarBackground = loadSprite("MUI_custombar.png", isEmbed: true);
			if (JcInstalled)
			{
				JCspriteSkillsDialog = loadSprite("MUI_JC_SkillsDialogPanel512x512.png", isEmbed: true);
				JCspriteSplitDialog = loadSprite("MUI_JC_SplitDialogPanel256x256.png", isEmbed: true);
				JCspriteVariantDialog = loadSprite("MUI_JC_VariantDialogPanel256x256.png", isEmbed: true);
				JCspriteContainer = loadSprite("MUI_JC_ContainerPanel295x180.png", isEmbed: true);
				JCspriteCraftingPanel = loadSprite("MUI_JC_CraftingPanel578x671.png", isEmbed: true);
				JCspriteInfoPanel = loadSprite("MUI_JC_InfoPanel280x90.png", isEmbed: true);
				JCspritePlayerInvPanel = loadSprite("MUI_JC_PlayerInvPanel295x154.png", isEmbed: true);
				JCspriteServerSelectPanel = loadSprite("MUI_JC_ServerSelectPanel578x671.png", isEmbed: true);
				JCspriteCompendiumPanel = loadSprite("MUI_JC_CompendiumPanel440x330.png", isEmbed: true);
				JCspriteTrophysPanel = loadSprite("MUI_JC_TrophiesPanel562x329.png", isEmbed: true);
				JCspriteBuildMenuPanel = loadSprite("MUI_JC_BuildMenuPanel512x512.png", isEmbed: true);
				JCspriteRemoveCharacterDialog = loadSprite("MUI_JC_RemoveCharacterDialog270x100.png", isEmbed: true);
				JCspriteBottomWindowPanel = loadSprite("MUI_JC_BottomWindowPanel512x60.png", isEmbed: true);
				foreach (Image item in TransformBackgroundsPlayerInv)
				{
					item.sprite = JCspritePlayerInvPanel;
					((Graphic)item).color = AlphaElement.Value;
				}
				foreach (Image item2 in TransformBackgroundsSpriteSkillsDialog)
				{
					item2.sprite = JCspriteSkillsDialog;
					((Graphic)item2).color = AlphaElement.Value;
				}
				foreach (Image item3 in TransformBackgroundsCompendium)
				{
					item3.sprite = JCspriteCompendiumPanel;
					((Graphic)item3).color = AlphaElement.Value;
				}
				foreach (Image item4 in TransformBackgroundsSpriteSplitDialog)
				{
					item4.sprite = JCspriteSplitDialog;
					((Graphic)item4).color = AlphaElement.Value;
				}
				if ((Object)(object)InventoryGui.instance != (Object)null)
				{
					((Component)((Transform)InventoryGui.instance.m_player).Find("AzuEquipmentBkg")).GetComponent<Image>().sprite = JCspritePlayerInvPanel;
					((Graphic)((Component)((Transform)InventoryGui.instance.m_player).Find("AzuEquipmentBkg")).GetComponent<Image>()).color = AlphaElement.Value;
					TextInput.instance.m_panel.GetComponent<Image>().sprite = JCspriteSplitDialog;
					((Graphic)TextInput.instance.m_panel.GetComponent<Image>()).color = AlphaElement.Value;
				}
				if ((Object)(object)InfoPanelImage != (Object)null)
				{
					InfoPanelImage.sprite = JCspriteInfoPanel;
					((Graphic)InfoPanelImage).color = AlphaElement.Value;
				}
				if ((Object)(object)BuildMenuPanelImage != (Object)null)
				{
					BuildMenuPanelImage.sprite = JCspriteBuildMenuPanel;
					((Graphic)BuildMenuPanelImage).color = AlphaElement.Value;
				}
				if ((Object)(object)CraftingPanelImage != (Object)null)
				{
					CraftingPanelImage.sprite = JCspriteCraftingPanel;
					((Graphic)CraftingPanelImage).color = AlphaElement.Value;
				}
				if ((Object)(object)ContainerBkgImage != (Object)null)
				{
					ContainerBkgImage.sprite = JCspriteContainer;
					((Graphic)ContainerBkgImage).color = AlphaElement.Value;
				}
				if ((Object)(object)ContainerWeightBkgImage != (Object)null)
				{
					ContainerWeightBkgImage.sprite = JCspritePlayerInvPanel;
					((Graphic)ContainerWeightBkgImage).color = AlphaElement.Value;
				}
				if ((Object)(object)ContainerWeightBkgImage2 != (Object)null)
				{
					ContainerWeightBkgImage2.sprite = JCspritePlayerInvPanel;
					((Graphic)ContainerWeightBkgImage2).color = AlphaElement.Value;
				}
				if ((Object)(object)TrophiesBkgImage != (Object)null)
				{
					TrophiesBkgImage.sprite = JCspriteTrophysPanel;
					((Graphic)TrophiesBkgImage).color = AlphaElement.Value;
				}
				if ((Object)(object)SplitDialogPanelImage != (Object)null)
				{
					SplitDialogPanelImage.sprite = JCspriteSplitDialog;
					((Graphic)SplitDialogPanelImage).color = AlphaElement.Value;
				}
				if ((Object)(object)BottomWindowBkgImage != (Object)null)
				{
					BottomWindowBkgImage.sprite = JCspriteBottomWindowPanel;
					((Graphic)BottomWindowBkgImage).color = AlphaElement.Value;
				}
				if ((Object)(object)RemoveCharacterDialogImage != (Object)null)
				{
					RemoveCharacterDialogImage.sprite = JCspriteRemoveCharacterDialog;
					((Graphic)RemoveCharacterDialogImage).color = AlphaElement.Value;
				}
				if ((Object)(object)NewCharacterBkgImage != (Object)null)
				{
					NewCharacterBkgImage.sprite = JCspriteRemoveCharacterDialog;
					((Graphic)NewCharacterBkgImage).color = AlphaElement.Value;
				}
				if ((Object)(object)CustomizationPanelBkgImage != (Object)null)
				{
					CustomizationPanelBkgImage.sprite = JCspriteSplitDialog;
					((Graphic)CustomizationPanelBkgImage).color = AlphaElement.Value;
				}
				if ((Object)(object)PleaseWaitPanelBkgImage != (Object)null)
				{
					PleaseWaitPanelBkgImage.sprite = JCspriteSplitDialog;
					((Graphic)PleaseWaitPanelBkgImage).color = AlphaElement.Value;
				}
				if ((Object)(object)ManageSavesMenuBkgImage != (Object)null)
				{
					ManageSavesMenuBkgImage.sprite = JCspriteSplitDialog;
					((Graphic)ManageSavesMenuBkgImage).color = AlphaElement.Value;
				}
				if ((Object)(object)StartGamePanelBkgImage != (Object)null)
				{
					StartGamePanelBkgImage.sprite = JCspriteServerSelectPanel;
					((Graphic)StartGamePanelBkgImage).color = AlphaElement.Value;
				}
				if ((Object)(object)WorldModifiersBkgImage != (Object)null)
				{
					WorldModifiersBkgImage.sprite = JCspriteServerSelectPanel;
					((Graphic)WorldModifiersBkgImage).color = AlphaElement.Value;
				}
				if ((Object)(object)RemoveWorldDialogImage != (Object)null)
				{
					RemoveWorldDialogImage.sprite = JCspriteSkillsDialog;
					((Graphic)RemoveWorldDialogImage).color = AlphaElement.Value;
				}
				if ((Object)(object)NewWorldDialogImage != (Object)null)
				{
					NewWorldDialogImage.sprite = JCspriteSkillsDialog;
					((Graphic)NewWorldDialogImage).color = AlphaElement.Value;
				}
				if ((Object)(object)EaqBkg != (Object)null)
				{
					EaqBkg.sprite = JCspritePlayerInvPanel;
					((Graphic)EaqBkg).color = AlphaElement.Value;
				}
				if ((Object)(object)RandysEaqHotbarBkg != (Object)null)
				{
					RandysEaqHotbarBkg.sprite = JCspritePlayerInvPanel;
					((Graphic)RandysEaqHotbarBkg).color = AlphaElement.Value;
				}
			}
			if (CustomUI.Value != 0)
			{
				return;
			}
			SpriteSkillsDialog = loadSprite("MUI_SkillsDialogPanel512x512.png");
			SpriteSplitDialog = loadSprite("MUI_SplitDialogPanel256x256.png");
			SpriteVariantDialog = loadSprite("MUI_VariantDialogPanel256x256.png");
			SpriteContainer = loadSprite("MUI_ContainerPanel295x180.png");
			SpriteCraftingPanel = loadSprite("MUI_CraftingPanel578x671.png");
			SpriteInfoPanel = loadSprite("MUI_InfoPanel280x90.png");
			SpritePlayerInvPanel = loadSprite("MUI_PlayerInvPanel295x154.png");
			SpriteServerSelectPanel = loadSprite("MUI_ServerSelectPanel578x671.png");
			SpriteCompendiumPanel = loadSprite("MUI_CompendiumPanel440x330.png");
			SpriteTrophysPanel = loadSprite("MUI_TrophiesPanel562x329.png");
			SpriteBuildMenuPanel = loadSprite("MUI_BuildMenuPanel512x512.png");
			SpriteRemoveCharacterDialog = loadSprite("MUI_RemoveCharacterDialog270x100.png");
			SpriteBottomWindowPanel = loadSprite("MUI_BottomWindowPanel512x60.png");
			foreach (Image item5 in TransformBackgroundsPlayerInv)
			{
				item5.sprite = SpritePlayerInvPanel;
				((Graphic)item5).color = AlphaElement.Value;
			}
			foreach (Image item6 in TransformBackgroundsSpriteSkillsDialog)
			{
				item6.sprite = SpriteSkillsDialog;
				((Graphic)item6).color = AlphaElement.Value;
			}
			foreach (Image item7 in TransformBackgroundsCompendium)
			{
				item7.sprite = SpriteCompendiumPanel;
				((Graphic)item7).color = AlphaElement.Value;
			}
			foreach (Image item8 in TransformBackgroundsSpriteSplitDialog)
			{
				item8.sprite = SpriteSplitDialog;
				((Graphic)item8).color = AlphaElement.Value;
			}
			if ((Object)(object)InventoryGui.instance != (Object)null)
			{
				Transform val = ((Transform)InventoryGui.instance.m_player).Find("AzuEquipmentBkg");
				if ((Object)(object)val != (Object)null)
				{
					((Component)val).GetComponent<Image>().sprite = SpritePlayerInvPanel;
					((Graphic)((Component)val).GetComponent<Image>()).color = AlphaElement.Value;
				}
			}
			if ((Object)(object)InfoPanelImage != (Object)null)
			{
				InfoPanelImage.sprite = SpriteInfoPanel;
				((Graphic)InfoPanelImage).color = AlphaElement.Value;
			}
			if ((Object)(object)BuildMenuPanelImage != (Object)null)
			{
				BuildMenuPanelImage.sprite = SpriteBuildMenuPanel;
				((Graphic)BuildMenuPanelImage).color = AlphaElement.Value;
			}
			if ((Object)(object)CraftingPanelImage != (Object)null)
			{
				CraftingPanelImage.sprite = SpriteCraftingPanel;
				((Graphic)CraftingPanelImage).color = AlphaElement.Value;
			}
			if ((Object)(object)ContainerBkgImage != (Object)null)
			{
				ContainerBkgImage.sprite = SpriteContainer;
				((Graphic)ContainerBkgImage).color = AlphaElement.Value;
			}
			if ((Object)(object)ContainerWeightBkgImage != (Object)null)
			{
				ContainerWeightBkgImage.sprite = SpritePlayerInvPanel;
				((Graphic)ContainerWeightBkgImage).color = AlphaElement.Value;
			}
			if ((Object)(object)ContainerWeightBkgImage2 != (Object)null)
			{
				ContainerWeightBkgImage2.sprite = SpritePlayerInvPanel;
				((Graphic)ContainerWeightBkgImage2).color = AlphaElement.Value;
			}
			if ((Object)(object)TrophiesBkgImage != (Object)null)
			{
				TrophiesBkgImage.sprite = SpriteTrophysPanel;
				((Graphic)TrophiesBkgImage).color = AlphaElement.Value;
			}
			if ((Object)(object)SplitDialogPanelImage != (Object)null)
			{
				SplitDialogPanelImage.sprite = SpriteSplitDialog;
				((Graphic)SplitDialogPanelImage).color = AlphaElement.Value;
			}
			if ((Object)(object)BottomWindowBkgImage != (Object)null)
			{
				BottomWindowBkgImage.sprite = SpriteBottomWindowPanel;
				((Graphic)BottomWindowBkgImage).color = AlphaElement.Value;
			}
			if ((Object)(object)RemoveCharacterDialogImage != (Object)null)
			{
				RemoveCharacterDialogImage.sprite = SpriteRemoveCharacterDialog;
				((Graphic)RemoveCharacterDialogImage).color = AlphaElement.Value;
			}
			if ((Object)(object)NewCharacterBkgImage != (Object)null)
			{
				NewCharacterBkgImage.sprite = SpriteRemoveCharacterDialog;
				((Graphic)NewCharacterBkgImage).color = AlphaElement.Value;
			}
			if ((Object)(object)CustomizationPanelBkgImage != (Object)null)
			{
				CustomizationPanelBkgImage.sprite = SpriteSplitDialog;
				((Graphic)CustomizationPanelBkgImage).color = AlphaElement.Value;
			}
			if ((Object)(object)ManageSavesMenuBkgImage != (Object)null)
			{
				ManageSavesMenuBkgImage.sprite = SpriteSplitDialog;
				((Graphic)ManageSavesMenuBkgImage).color = AlphaElement.Value;
			}
			if ((Object)(object)StartGamePanelBkgImage != (Object)null)
			{
				StartGamePanelBkgImage.sprite = SpriteServerSelectPanel;
				((Graphic)StartGamePanelBkgImage).color = AlphaElement.Value;
			}
			if ((Object)(object)WorldModifiersBkgImage != (Object)null)
			{
				WorldModifiersBkgImage.sprite = SpriteServerSelectPanel;
				((Graphic)WorldModifiersBkgImage).color = AlphaElement.Value;
			}
			if ((Object)(object)RemoveWorldDialogImage != (Object)null)
			{
				RemoveWorldDialogImage.sprite = SpriteSkillsDialog;
				((Graphic)RemoveWorldDialogImage).color = AlphaElement.Value;
			}
			if ((Object)(object)NewWorldDialogImage != (Object)null)
			{
				NewWorldDialogImage.sprite = SpriteSkillsDialog;
				((Graphic)NewWorldDialogImage).color = AlphaElement.Value;
			}
			if ((Object)(object)EaqBkg != (Object)null)
			{
				EaqBkg.sprite = SpritePlayerInvPanel;
				((Graphic)EaqBkg).color = AlphaElement.Value;
			}
			if ((Object)(object)RandysEaqHotbarBkg != (Object)null)
			{
				RandysEaqHotbarBkg.sprite = SpritePlayerInvPanel;
				((Graphic)RandysEaqHotbarBkg).color = AlphaElement.Value;
			}
		}

		internal static void TurnOffMuiStaminaBar(object sender, EventArgs e)
		{
			if (!((Object)(object)HudrootTransform == (Object)null))
			{
				if ((Object)(object)CustomBars.StaminaBarRoot != (Object)null)
				{
					((Component)CustomBars.StaminaBarRoot).gameObject.SetActive(CustomStaminaBar.Value == Toggle.On);
				}
				((Component)HudrootTransform.Find("staminapanel")).gameObject.SetActive(CustomStaminaBar.Value != Toggle.On);
			}
		}

		internal static void TurnOffMuiEitrBar(object sender, EventArgs e)
		{
			if (!((Object)(object)HudrootTransform == (Object)null))
			{
				if ((Object)(object)CustomBars.EitrBarRoot != (Object)null)
				{
					((Component)CustomBars.EitrBarRoot).gameObject.SetActive(CustomEitrBar.Value == Toggle.On);
				}
				((Component)HudrootTransform.Find("eitrpanel")).gameObject.SetActive(CustomEitrBar.Value != Toggle.On);
			}
		}

		internal static void TurnOffMuigpBar(object sender, EventArgs e)
		{
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: 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_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: 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_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)HudrootTransform == (Object)null)
			{
				return;
			}
			Transform val = HudrootTransform.Find("GuardianPower");
			if ((Object)(object)val == (Object)null || (Object)(object)CustomBars.GpBarRoot == (Object)null)
			{
				return;
			}
			((Component)CustomBars.GpBarRoot).gameObject.SetActive(CustomGpBar.Value == Toggle.On);
			if ((Object)(object)CustomBars.GpText != (Object)null)
			{
				((Component)CustomBars.GpText).gameObject.SetActive(CustomGpBar.Value == Toggle.On);
			}
			if (CustomGpBar.Value == Toggle.On)
			{
				if ((Object)(object)CustomBars.HealthBarRoot != (Object)null)
				{
					Vector3 position = ((Component)CustomBars.HealthBarRoot).transform.position;
					((Component)val.Find("Name")).GetComponent<RectTransform>().anchoredPosition = new Vector2(position.x - 150f, ((Component)CustomBars.GpBarRoot).GetComponent<RectTransform>().anchoredPosition.y - 75f);
					((Component)val.Find("Icon")).GetComponent<RectTransform>().anchoredPosition = new Vector2(position.x - 210f, ((Component)CustomBars.GpBarRoot).GetComponent<RectTransform>().anchoredPosition.y - 100f);
					((Component)val.Find("Bkg")).GetComponent<RectTransform>().anchoredPosition = new Vector2(position.x - 210f, ((Component)CustomBars.GpBarRoot).GetComponent<RectTransform>().anchoredPosition.y - 97f);
				}
				((Component)val.Find("TimeText")).gameObject.SetActive(false);
				((Component)val.Find("Name")).gameObject.SetActive(false);
			}
			else
			{
				((Component)val.Find("Name")).GetComponent<RectTransform>().anchoredPosition = GpNamePos;
				((Component)val.Find("Icon")).GetComponent<RectTransform>().anchoredPosition = GpIconPos;
				((Component)val.Find("Bkg")).GetComponent<RectTransform>().anchoredPosition = GpBkgPos;
				((Component)val.Find("TimeText")).gameObject.SetActive(true);
				((Component)val.Find("Name")).gameObject.SetActive(true);
			}
		}

		internal static void ToggleFoodHealthPanel(object sender, EventArgs e)
		{
			if (!((Object)(object)Hud.instance == (Object)null))
			{
				if (!((Component)Hud.instance.m_healthPanel).gameObject.activeSelf)
				{
					((Component)Hud.instance.m_healthPanel).gameObject.SetActive(true);
				}
				if ((Object)(object)CustomBars.FoodPanel != (Object)null)
				{
					((Component)CustomBars.FoodPanel).gameObject.SetActive(CustomFoodBar.Value == Toggle.On);
					((Component)CustomBars.Food0).gameObject.SetActive(CustomFoodBar.Value == Toggle.On);
					((Component)CustomBars.Food1).gameObject.SetActive(CustomFoodBar.Value == Toggle.On);
					((Component)CustomBars.Food2).gameObject.SetActive(CustomFoodBar.Value == Toggle.On);
				}
				if ((Object)(object)CustomBars.HealthBarRoot != (Object)null)
				{
					((Component)CustomBars.HealthBarRoot).gameObject.SetActive(CustomHealthBar.Value == Toggle.On);
				}
				((Component)((Transform)Hud.instance.m_healthPanel).Find("food0")).gameObject.SetActive(CustomFoodBar.Value != Toggle.On);
				((Component)((Transform)Hud.instance.m_healthPanel).Find("food1")).gameObject.SetActive(CustomFoodBar.Value != Toggle.On);
				((Component)((Transform)Hud.instance.m_healthPanel).Find("food2")).gameObject.SetActive(CustomFoodBar.Value != Toggle.On);
				((Component)((Transform)Hud.instance.m_healthPanel).Find("foodicon (1)")).gameObject.SetActive(CustomFoodBar.Value != Toggle.On);
				((Component)((Transform)Hud.instance.m_healthPanel).Find("Health")).gameObject.SetActive(CustomHealthBar.Value != Toggle.On);
				((Component)((Transform)Hud.instance.m_healthPanel).Find("healthicon")).gameObject.SetActive(CustomHealthBar.Value != Toggle.On);
			}
		}

		internal static void ChangeGridColor(object sender, EventArgs e)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)GridImage == (Object)null))
			{
				((Graphic)GridImage).color = GridImageColor.Value;
			}
		}

		public static void ApplyDragWindowCntrl(GameObject go)
		{
			//IL_0018: Unknown result ty