Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Minimal UI v2.3.15
BepInEx/plugins/MinimalUI.dll
Decompiled 4 days ago
The result has been truncated due to the large size, download it to view full contents!
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 System.Threading; 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.AlmanacCompat; using MinimalUI.ELCompat; using MinimalUI.Extensions; 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.15")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.3.15.0")] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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] [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_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) 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; Animator val2 = default(Animator); if (((Component)val.m_biomeNameSmall).TryGetComponent<Animator>(ref val2)) { ((Component)internalbiometext).gameObject.AddComponent<Animator>().runtimeAnimatorController = Object.Instantiate<RuntimeAnimatorController>(val2.runtimeAnimatorController); } internalbiometext.outlineWidth = 0.15f; val.m_biomeNameSmall = internalbiometext; Transform transform = val.m_biomeNameSmall.transform; transform.localPosition += new Vector3(0f, 20f, 0f); } else { Animator val3 = default(Animator); if (((Component)val.m_biomeNameSmall).TryGetComponent<Animator>(ref val3)) { ((Component)internalbiometext).gameObject.AddComponent<Animator>().runtimeAnimatorController = Object.Instantiate<RuntimeAnimatorController>(val3.runtimeAnimatorController); } val.m_biomeNameSmall = internalbiometext; } Image val4 = default(Image); Image val5 = default(Image); if (((Component)internalsmallmarker).TryGetComponent<Image>(ref val4) && ((Component)val.m_smallMarker).TryGetComponent<Image>(ref val5)) { val4.sprite = val5.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 APIManager { public static class Patcher { private class MonoAssemblyResolver : IAssemblyResolver, IDisposable { public AssemblyDefinition Resolve(AssemblyNameReference name) { return AssemblyDefinition.ReadAssembly(AppDomain.CurrentDomain.Load(name.FullName).Location); } public AssemblyDefinition Resolve(AssemblyNameReference name, ReaderParameters parameters) { return Resolve(name); } public void Dispose() { } } private class AssemblyLoadInterceptor { private static string? assemblyPath; private static MethodInfo TargetMethod() { return AccessTools.DeclaredMethod(typeof(Assembly), "Load", new Type[1] { typeof(byte[]) }, (Type[])null); } private static bool Prefix(ref byte[] __0, ref Assembly? __result) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown assemblyPath = null; if (modifyNextLoad) { modifyNextLoad = false; try { AssemblyDefinition val = AssemblyDefinition.ReadAssembly((Stream)new MemoryStream(__0), new ReaderParameters { AssemblyResolver = (IAssemblyResolver)(object)new MonoAssemblyResolver() }); try { ((Dictionary<string, string>)typeof(EnvVars).Assembly.GetType("BepInEx.Preloader.RuntimeFixes.UnityPatches").GetProperty("AssemblyLocations").GetValue(null))[val.FullName] = currentAssemblyPath; FixupModuleReferences(val.MainModule); using MemoryStream memoryStream = new MemoryStream(); val.Write((Stream)memoryStream); __0 = memoryStream.ToArray(); string dumpedAssembliesPath = Patcher.dumpedAssembliesPath; char directorySeparatorChar = Path.DirectorySeparatorChar; string path = dumpedAssembliesPath + directorySeparatorChar + ((AssemblyNameReference)val.Name).Name + ".dll"; if (loadDumpedAssemblies.Value || dumpAssemblies.Value) { File.WriteAllBytes(path, __0); } if (loadDumpedAssemblies.Value) { assemblyPath = path; __result = null; return false; } } finally { ((IDisposable)val)?.Dispose(); } } catch (BadImageFormatException) { } catch (Exception ex2) { Debug.LogError((object)("Failed patching ... " + ex2)); } } return true; } private static void Postfix(ref Assembly? __result) { if (assemblyPath != null && __result == null) { __result = Assembly.LoadFrom(assemblyPath); assemblyPath = null; } } } private static PluginInfo? lastPluginInfo; private static bool modifyNextLoad = false; private static string modGUID = null; private static HashSet<string> redirectedNamespaces = null; private static readonly Assembly patchingAssembly = Assembly.GetExecutingAssembly(); private static string currentAssemblyPath = null; private static readonly ConfigEntry<bool> dumpAssemblies = (ConfigEntry<bool>)AccessTools.DeclaredField(typeof(AssemblyPatcher), "ConfigDumpAssemblies").GetValue(null); private static readonly ConfigEntry<bool> loadDumpedAssemblies = (ConfigEntry<bool>)AccessTools.DeclaredField(typeof(AssemblyPatcher), "ConfigLoadDumpedAssemblies").GetValue(null); private static readonly string dumpedAssembliesPath = (string)AccessTools.DeclaredField(typeof(AssemblyPatcher), "DumpedAssembliesPath").GetValue(null); private static void GrabPluginInfo(PluginInfo __instance) { lastPluginInfo = __instance; } [HarmonyPriority(700)] private static void CheckAssemblyLoadFile(string __0) { PluginInfo? obj = lastPluginInfo; if (__0 == ((obj != null) ? obj.Location : null) && lastPluginInfo.Dependencies.Any((BepInDependency d) => d.DependencyGUID == modGUID)) { modifyNextLoad = true; currentAssemblyPath = __0; } lastPluginInfo = null; } [HarmonyPriority(500)] private static bool InterceptAssemblyLoadFile(string __0, ref Assembly? __result) { if (modifyNextLoad && (object)__result == null) { __result = Assembly.Load(File.ReadAllBytes(__0)); return false; } return true; } private static void FixupModuleReferences(ModuleDefinition module) { foreach (TypeDefinition type3 in module.GetTypes()) { if ((object)patchingAssembly.GetType(((MemberReference)type3).FullName) == null) { Dispatch(type3); } } static bool AreSame(TypeReference a, TypeReference b) { return (bool)typeof(MetadataResolver).Assembly.GetType("Mono.Cecil.MetadataResolver").GetMethod("AreSame", BindingFlags.Static | BindingFlags.NonPublic, null, new Type[2] { typeof(TypeReference), typeof(TypeReference) }, null).Invoke(null, new object[2] { a, b }); } void Dispatch(TypeDefinition type) { if (type.BaseType != null && (object)type.BaseType.Scope == module && redirectedNamespaces.Contains(baseDeclaringType(type.BaseType).Namespace)) { Type type2 = patchingAssembly.GetType(((MemberReference)type.BaseType).FullName); if ((object)type2 != null) { type.BaseType = module.ImportReference(type2); } } DispatchGenericParameters((IGenericParameterProvider)(object)type, ((MemberReference)type).FullName); DispatchInterfaces(type, ((MemberReference)type).FullName); DispatchAttributes((ICustomAttributeProvider)(object)type, ((MemberReference)type).FullName); DispatchFields(type, ((MemberReference)type).FullName); DispatchProperties(type, ((MemberReference)type).FullName); DispatchEvents(type, ((MemberReference)type).FullName); DispatchMethods(type); } void DispatchAttributes(ICustomAttributeProvider provider, string referencingEntityName) { //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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: 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_012b: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_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 (!provider.HasCustomAttributes) { return; } Enumerator<CustomAttribute> enumerator2 = provider.CustomAttributes.GetEnumerator(); try { while (enumerator2.MoveNext()) { CustomAttribute current2 = enumerator2.Current; MethodReference val = importMethodReference(current2.Constructor); if (val != null) { current2.Constructor = val; } else { VisitMethod(current2.Constructor, referencingEntityName); } for (int i = 0; i < current2.ConstructorArguments.Count; i++) { CustomAttributeArgument val2 = current2.ConstructorArguments[i]; current2.ConstructorArguments[i] = new CustomAttributeArgument(VisitType(((CustomAttributeArgument)(ref val2)).Type, referencingEntityName), ((CustomAttributeArgument)(ref val2)).Value); } CustomAttributeArgument argument; for (int j = 0; j < current2.Properties.Count; j++) { CustomAttributeNamedArgument val3 = current2.Properties[j]; Collection<CustomAttributeNamedArgument> properties = current2.Properties; int num = j; string name = ((CustomAttributeNamedArgument)(ref val3)).Name; argument = ((CustomAttributeNamedArgument)(ref val3)).Argument; TypeReference? obj = VisitType(((CustomAttributeArgument)(ref argument)).Type, referencingEntityName); argument = ((CustomAttributeNamedArgument)(ref val3)).Argument; properties[num] = new CustomAttributeNamedArgument(name, new CustomAttributeArgument(obj, ((CustomAttributeArgument)(ref argument)).Value)); } for (int k = 0; k < current2.Fields.Count; k++) { CustomAttributeNamedArgument val4 = current2.Fields[k]; Collection<CustomAttributeNamedArgument> fields = current2.Fields; int num2 = k; string name2 = ((CustomAttributeNamedArgument)(ref val4)).Name; argument = ((CustomAttributeNamedArgument)(ref val4)).Argument; TypeReference? obj2 = VisitType(((CustomAttributeArgument)(ref argument)).Type, referencingEntityName); argument = ((CustomAttributeNamedArgument)(ref val4)).Argument; fields[num2] = new CustomAttributeNamedArgument(name2, new CustomAttributeArgument(obj2, ((CustomAttributeArgument)(ref argument)).Value)); } } } finally { ((IDisposable)enumerator2/*cast due to .constrained prefix*/).Dispose(); } } void DispatchEvents(TypeDefinition type, string referencingEntityName) { //IL_0006: 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) Enumerator<EventDefinition> enumerator2 = type.Events.GetEnumerator(); try { while (enumerator2.MoveNext()) { EventDefinition current2 = enumerator2.Current; ((EventReference)current2).EventType = VisitType(((EventReference)current2).EventType, referencingEntityName); DispatchAttributes((ICustomAttributeProvider)(object)current2, referencingEntityName); } } finally { ((IDisposable)enumerator2/*cast due to .constrained prefix*/).Dispose(); } } void DispatchFields(TypeDefinition type, string referencingEntityName) { //IL_0006: 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) Enumerator<FieldDefinition> enumerator2 = type.Fields.GetEnumerator(); try { while (enumerator2.MoveNext()) { FieldDefinition current2 = enumerator2.Current; ((FieldReference)current2).FieldType = VisitType(((FieldReference)current2).FieldType, referencingEntityName); DispatchAttributes((ICustomAttributeProvider)(object)current2, referencingEntityName); } } finally { ((IDisposable)enumerator2/*cast due to .constrained prefix*/).Dispose(); } } void DispatchGenericArguments(IGenericInstance genericInstance, string referencingEntityName) { for (int i = 0; i < genericInstance.GenericArguments.Count; i++) { genericInstance.GenericArguments[i] = VisitType(genericInstance.GenericArguments[i], referencingEntityName); } } void DispatchGenericParameters(IGenericParameterProvider provider, string referencingEntityName) { //IL_0006: 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) Enumerator<GenericParameter> enumerator2 = provider.GenericParameters.GetEnumerator(); try { while (enumerator2.MoveNext()) { GenericParameter current2 = enumerator2.Current; DispatchAttributes((ICustomAttributeProvider)(object)current2, referencingEntityName); for (int i = 0; i < current2.Constraints.Count; i++) { current2.Constraints[i] = VisitType(current2.Constraints[i], referencingEntityName); } } } finally { ((IDisposable)enumerator2/*cast due to .constrained prefix*/).Dispose(); } } void DispatchInterfaces(TypeDefinition type, string referencingEntityName) { //IL_0006: 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) Enumerator<InterfaceImplementation> enumerator2 = type.Interfaces.GetEnumerator(); try { while (enumerator2.MoveNext()) { InterfaceImplementation current2 = enumerator2.Current; current2.InterfaceType = VisitType(current2.InterfaceType, referencingEntityName); } } finally { ((IDisposable)enumerator2/*cast due to .constrained prefix*/).Dispose(); } } void DispatchMethod(MethodDefinition method) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) ((MethodReference)method).ReturnType = VisitType(((MethodReference)method).ReturnType, ((MemberReference)method).FullName); DispatchAttributes((ICustomAttributeProvider)(object)((MethodReference)method).MethodReturnType, ((MemberReference)method).FullName); DispatchGenericParameters((IGenericParameterProvider)(object)method, ((MemberReference)method).FullName); Enumerator<ParameterDefinition> enumerator2 = ((MethodReference)method).Parameters.GetEnumerator(); try { while (enumerator2.MoveNext()) { ParameterDefinition current2 = enumerator2.Current; ((ParameterReference)current2).ParameterType = VisitType(((ParameterReference)current2).ParameterType, ((MemberReference)method).FullName); DispatchAttributes((ICustomAttributeProvider)(object)current2, ((MemberReference)method).FullName); } } finally { ((IDisposable)enumerator2/*cast due to .constrained prefix*/).Dispose(); } for (int i = 0; i < method.Overrides.Count; i++) { MethodReference val = importMethodReference(method.Overrides[i]); if (val != null) { method.Overrides[i] = val; } else { VisitMethod(method.Overrides[i], ((MemberReference)method).FullName); } } if (method.HasBody) { DispatchMethodBody(method.Body); } } void DispatchMethodBody(MethodBody body) { //IL_0006: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) Enumerator<VariableDefinition> enumerator2 = body.Variables.GetEnumerator(); try { while (enumerator2.MoveNext()) { VariableDefinition current2 = enumerator2.Current; ((VariableReference)current2).VariableType = VisitType(((VariableReference)current2).VariableType, ((MemberReference)body.Method).FullName); } } finally { ((IDisposable)enumerator2/*cast due to .constrained prefix*/).Dispose(); } Enumerator<Instruction> enumerator3 = body.Instructions.GetEnumerator(); try { while (enumerator3.MoveNext()) { Instruction current3 = enumerator3.Current; object operand = current3.Operand; FieldReference val = (FieldReference)((operand is FieldReference) ? operand : null); if (val == null) { MethodReference val2 = (MethodReference)((operand is MethodReference) ? operand : null); if (val2 == null) { TypeReference val3 = (TypeReference)((operand is TypeReference) ? operand : null); if (val3 != null) { current3.Operand = VisitType(val3, ((MemberReference)body.Method).FullName); } } else { MethodReference val4 = importMethodReference(val2); if (val4 != null) { current3.Operand = val4; } else { VisitMethod(val2, ((MemberReference)body.Method).FullName); } } } else { FieldReference val5 = importFieldReference(val); if (val5 != null) { current3.Operand = val5; } else { VisitField(val, ((MemberReference)body.Method).FullName); } } } } finally { ((IDisposable)enumerator3/*cast due to .constrained prefix*/).Dispose(); } } void DispatchMethods(TypeDefinition type) { //IL_0006: 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) Enumerator<MethodDefinition> enumerator2 = type.Methods.GetEnumerator(); try { while (enumerator2.MoveNext()) { MethodDefinition current2 = enumerator2.Current; DispatchMethod(current2); } } finally { ((IDisposable)enumerator2/*cast due to .constrained prefix*/).Dispose(); } } void DispatchProperties(TypeDefinition type, string referencingEntityName) { //IL_0006: 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) Enumerator<PropertyDefinition> enumerator2 = type.Properties.GetEnumerator(); try { while (enumerator2.MoveNext()) { PropertyDefinition current2 = enumerator2.Current; ((PropertyReference)current2).PropertyType = VisitType(((PropertyReference)current2).PropertyType, referencingEntityName); DispatchAttributes((ICustomAttributeProvider)(object)current2, referencingEntityName); } } finally { ((IDisposable)enumerator2/*cast due to .constrained prefix*/).Dispose(); } } TypeReference FixupType(TypeReference type) { if ((object)type.Scope == module && redirectedNamespaces.Contains(baseDeclaringType(type).Namespace)) { if (type.IsNested) { return FixupType(((MemberReference)type).DeclaringType); } Type type2 = patchingAssembly.GetType(((MemberReference)type).FullName); if ((object)type2 != null) { return module.ImportReference(type2); } } return type; } void VisitField(FieldReference? field, string referencingEntityName) { if (field != null) { field.FieldType = VisitType(field.FieldType, referencingEntityName); if (!(field is FieldDefinition)) { ((MemberReference)field).DeclaringType = VisitType(((MemberReference)field).DeclaringType, referencingEntityName); } } } void VisitMethod(MethodReference? method, string referencingEntityName) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (method != null) { GenericInstanceMethod val = (GenericInstanceMethod)(object)((method is GenericInstanceMethod) ? method : null); if (val != null) { DispatchGenericArguments((IGenericInstance)(object)val, referencingEntityName); } method.ReturnType = VisitType(method.ReturnType, referencingEntityName); Enumerator<ParameterDefinition> enumerator2 = method.Parameters.GetEnumerator(); try { while (enumerator2.MoveNext()) { ParameterDefinition current2 = enumerator2.Current; ((ParameterReference)current2).ParameterType = VisitType(((ParameterReference)current2).ParameterType, referencingEntityName); } } finally { ((IDisposable)enumerator2/*cast due to .constrained prefix*/).Dispose(); } if (!(method is MethodSpecification)) { ((MemberReference)method).DeclaringType = VisitType(((MemberReference)method).DeclaringType, referencingEntityName); } } } TypeReference? VisitType(TypeReference? type, string referencingEntityName) { if (type == null) { return type; } if (type.GetElementType().IsGenericParameter) { return type; } GenericInstanceType val = (GenericInstanceType)(object)((type is GenericInstanceType) ? type : null); if (val != null) { DispatchGenericArguments((IGenericInstance)(object)val, referencingEntityName); } return FixupType(type); } static TypeReference baseDeclaringType(TypeReference type) { while (((MemberReference)type).DeclaringType != null) { type = ((MemberReference)type).DeclaringType; } return type; } FieldReference? importFieldReference(FieldReference field) { if ((object)((MemberReference)field).DeclaringType.Scope == module && redirectedNamespaces.Contains(baseDeclaringType(((MemberReference)field).DeclaringType).Namespace)) { FieldInfo fieldInfo = patchingAssembly.GetType(((MemberReference)((MemberReference)field).DeclaringType).FullName)?.GetField(((MemberReference)field).Name, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if ((object)fieldInfo != null) { return module.ImportReference(fieldInfo); } } return null; } MethodReference? importMethodReference(MethodReference method) { //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Expected O, but got Unknown if ((object)((MemberReference)method).DeclaringType.Scope == module && redirectedNamespaces.Contains(baseDeclaringType(((MemberReference)method).DeclaringType).Namespace)) { if (((MemberReference)method).Name == ".cctor") { ConstructorInfo[] array = patchingAssembly.GetType(((MemberReference)((MemberReference)method).DeclaringType).FullName)?.GetConstructors(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (array != null && array.Length == 1) { return module.ImportReference((MethodBase)array[0]); } } else if (((MemberReference)method).Name == ".ctor") { ConstructorInfo constructorInfo = patchingAssembly.GetType(((MemberReference)((MemberReference)method).DeclaringType).FullName)?.GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).FirstOrDefault(CompareMethods); if ((object)constructorInfo != null) { return module.ImportReference((MethodBase)constructorInfo); } } else { MethodInfo methodInfo = patchingAssembly.GetType(((MemberReference)((MemberReference)method).DeclaringType).FullName)?.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).FirstOrDefault(delegate(MethodInfo m) { if (m.Name != ((MemberReference)method).Name) { return false; } return (((MemberReference)method.ReturnType).ContainsGenericParameter == m.ReturnType.IsGenericParameter || AreSame(method.ReturnType, module.ImportReference(m.ReturnType))) && CompareMethods(m); }); if ((object)methodInfo != null) { MethodReference val = module.ImportReference((MethodBase)methodInfo); MethodReference obj = method; GenericInstanceMethod val2 = (GenericInstanceMethod)(object)((obj is GenericInstanceMethod) ? obj : null); if (val2 != null) { GenericInstanceMethod val3 = new GenericInstanceMethod(val); for (int num = 0; num < val2.GenericArguments.Count; num++) { val2.GenericArguments[num] = VisitType(val2.GenericArguments[num], ((MemberReference)method).FullName); val3.GenericArguments.Add(val2.GenericArguments[num]); } val = (MethodReference)(object)val3; } return val; } } } return null; bool CompareMethods(MethodBase m) { ParameterInfo[] parameters = m.GetParameters(); if (method.IsGenericInstance != m.IsGenericMethodDefinition || parameters.Length != 0 != method.HasParameters) { return false; } if (method.HasParameters) { if (method.Parameters.Count != parameters.Length) { return false; } for (int i = 0; i < method.Parameters.Count; i++) { if (parameters[i].ParameterType.IsGenericParameter ? (!((ParameterReference)method.Parameters[i]).ParameterType.IsGenericParameter) : (!AreSame(((ParameterReference)method.Parameters[i]).ParameterType, module.ImportReference(parameters[i].ParameterType)))) { return false; } } } return true; } } } public static bool PreventHarmonyInteropFixLoad(Assembly? __0) { return __0 == null; } public static void Patch(IEnumerable<string>? extraNamespaces = null) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Expected O, but got Unknown //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Expected O, but got Unknown Harmony val = new Harmony("org.bepinex.plugins.APIManager"); val.Patch((MethodBase)AccessTools.DeclaredMethod(typeof(PluginInfo), "ToString", (Type[])null, (Type[])null), new HarmonyMethod(AccessTools.DeclaredMethod(typeof(Patcher), "GrabPluginInfo", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); val.Patch((MethodBase)AccessTools.DeclaredMethod(typeof(Assembly), "LoadFile", new Type[1] { typeof(string) }, (Type[])null), new HarmonyMethod(AccessTools.DeclaredMethod(typeof(Patcher), "InterceptAssemblyLoadFile", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); val.Patch((MethodBase)AccessTools.DeclaredMethod(typeof(Assembly), "LoadFile", new Type[1] { typeof(string) }, (Type[])null), new HarmonyMethod(AccessTools.DeclaredMethod(typeof(Patcher), "CheckAssemblyLoadFile", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); new PatchClassProcessor(val, typeof(AssemblyLoadInterceptor), true).Patch(); Type type = typeof(AssemblyPatcher).Assembly.GetType("BepInEx.Preloader.RuntimeFixes.HarmonyInteropFix"); if ((object)type != null) { val.Patch((MethodBase)AccessTools.DeclaredMethod(type, "OnAssemblyLoad", (Type[])null, (Type[])null), new HarmonyMethod(AccessTools.DeclaredMethod(typeof(Patcher), "PreventHarmonyInteropFixLoad", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } IEnumerable<TypeInfo> source; try { source = patchingAssembly.DefinedTypes.ToList(); } catch (ReflectionTypeLoadException ex) { source = from t in ex.Types where t != null select t.GetTypeInfo(); } BaseUnityPlugin val2 = (BaseUnityPlugin)Chainloader.ManagerObject.GetComponent((Type)source.First((TypeInfo t) => t.IsClass && typeof(BaseUnityPlugin).IsAssignableFrom(t))); redirectedNamespaces = new HashSet<string>(extraNamespaces ?? Array.Empty<string>()) { ((object)val2).GetType().Namespace }; modGUID = val2.Info.Metadata.GUID; } } } namespace MinimalUI { public class Constants { internal const string ModName = "MinimalUI"; internal const string ModVersion = "2.3.15"; internal const string Author = "Azumatt"; internal const string ModGUID = "Azumatt.MinimalUI"; internal const long RELOAD_DELAY = 10000000L; internal const long RELOAD_DELAY2 = 20000000L; internal const int QualMax = 99998; internal const string BkgText = "bkg"; internal const string BorderText = "border (1)"; 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 defaultadrenalineColor = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)124, (byte)75, byte.MaxValue)); internal static readonly Color defaultadrenalineColor2 = 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 KGSortCraft = "kg_SortedCraft"; internal const string KGEnchantSystem = "kg.ValheimEnchantmentSystem"; internal const string ServerCharacters = "org.bepinex.plugins.servercharacters"; internal const string OneMoreMeal = "com.zhaila.valheim.onemoremeal"; internal const string MUI_MapName = "MUIMap"; internal const string GuardianPowerName = "GuardianPower"; internal const string Name = "Name"; internal const string BorderBar = "border"; 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"; internal const string SCMaintTimer = "ServerCharacters Maintenance Timer"; } 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 = null; public static ColoredFlash HealthSlowColorFlash = null; 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 = null; public static ColoredFlash StaminaSlowColorFlash = null; 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 = null; public static ColoredFlash EitrSlowColorFlash = null; public const string ObjectAdrenalineName = "MUI_AdrenalineBar"; internal static RectTransform? AdrenalineBarRoot; internal static GuiBar? AdrenalineBarSlow; internal static GuiBar? AdrenalineBarFast; internal static TMP_Text? AdrenalineText; internal static Animator? AdrenalineAnimator; public static ColoredFlash AdrenalineFastColorFlash = null; public static ColoredFlash AdrenalineSlowColorFlash = null; 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; internal static readonly Vector3 SlimBarScale = new Vector3(1f, 0.85f, 1f); public static void Create() { HealthBar.Create(); StaminaBar.Create(); EitrBar.Create(); AdrenalineBar.Create(); GpBar.Create(); FoodBar.Create(); } public static void ApplySlimBarScale(RectTransform root, GuiBar fast, GuiBar slow) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) ((Transform)((Component)((Transform)root).Find("border")).GetComponent<RectTransform>()).localScale = SlimBarScale; ((Transform)((Component)((Transform)root).Find("Bkg".ToLower())).GetComponent<RectTransform>()).localScale = SlimBarScale; ((Transform)((Component)fast).GetComponent<RectTransform>()).localScale = SlimBarScale; ((Transform)((Component)slow).GetComponent<RectTransform>()).localScale = SlimBarScale; } public static TMP_Text CreateBarText(TMP_Text sourceText, RectTransform parent, int rot) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) TMP_Text obj = Object.Instantiate<TMP_Text>(sourceText, (Transform)(object)parent); RectTransform component = ((Component)obj).GetComponent<RectTransform>(); ((Transform)component).localEulerAngles = new Vector3(0f, 0f, (float)(-rot)); ((Transform)component).localScale = new Vector3(0.9f, 0.9f, 1f); Outline obj2 = ((Component)obj).gameObject.AddComponent<Outline>(); ((Shadow)obj2).effectColor = Color.black; ((Shadow)obj2).effectDistance = MinimalUIPlugin.OutlineSize.Value; ((Component)obj).gameObject.SetActive(true); return obj; } public static void SpriteFix(RectTransform root) { Image val = default(Image); if (((Component)((Transform)root).Find("fast").Find("bar")).TryGetComponent<Image>(ref val)) { val.sprite = MinimalUIPlugin.CustomBarBackground; val.type = (Type)0; } Image val2 = default(Image); if (((Component)((Transform)root).Find("slow").Find("bar")).TryGetComponent<Image>(ref val2)) { val2.sprite = MinimalUIPlugin.CustomBarBackground; val2.type = (Type)0; } } } [HarmonyPatch(typeof(Hud), "UpdateHealth")] internal static class HudUpdateHealthPatch { private static void Postfix(Hud __instance, Player player) { if (MinimalUIPlugin.CustomHealthBar.Value.IsOn()) { HealthBar.UpdateHealth(((Character)player).GetMaxHealth(), ((Character)player).GetHealth()); if (MinimalUIPlugin.CustomHealthBarStretch.Value.IsOn()) { 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.IsOn()) { return; } StaminaBar.UpdateStamina(((Character)player).GetMaxStamina(), player.GetStamina()); if (MinimalUIPlugin.CustomStaminaBarStretch.Value.IsOn()) { SetStaminaBarSize((float)((double)((Character)player).GetMaxStamina() / 25.0 * 32.0), __instance); } if (!MinimalUIPlugin.CustomStaminaBarHide.Value.IsOn()) { 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.IsOn()) { return; } EitrBar.UpdateEitr(((Character)player).GetMaxEitr(), player.GetEitr()); if (MinimalUIPlugin.CustomEitrBarStretch.Value.IsOn()) { SetEitrBarSize((float)((double)((Character)player).GetMaxEitr() / 25.0 * 32.0)); } if (!MinimalUIPlugin.CustomEitrBarHide.Value.IsOn()) { 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), "UpdateAdrenaline")] internal static class HudUpdateAdrenalinePatch { private static void Postfix(Hud __instance, Player player, float dt) { if (!MinimalUIPlugin.CustomAdrenalineBar.Value.IsOn()) { return; } AdrenalineBar.UpdateAdrenaline(((Character)player).GetMaxAdrenaline(), player.GetAdrenaline()); if (MinimalUIPlugin.CustomAdrenalineBarStretch.Value.IsOn()) { SetAdrenalineBarSize((float)((double)((Character)player).GetMaxAdrenaline() / 25.0 * 32.0 * 2.0)); } if (!MinimalUIPlugin.CustomAdrenalineBarHide.Value.IsOn()) { return; } if ((double)__instance.m_adrenalineHideTimer < 1.0) { if (!((Component)CustomBars.AdrenalineBarRoot).gameObject.activeSelf) { ((Component)CustomBars.AdrenalineBarRoot).gameObject.SetActive(true); } } else { ((Component)CustomBars.AdrenalineBarRoot).gameObject.SetActive(false); } } public static void SetAdrenalineBarSize(float size) { CustomBars.AdrenalineBarRoot.SetSizeWithCurrentAnchors((Axis)0, size); CustomBars.AdrenalineBarSlow.SetWidth(size); CustomBars.AdrenalineBarFast.SetWidth(size); } } [HarmonyPatch(typeof(Hud), "UpdateFood")] internal static class HudUpdateFoodPatch { private static void Postfix(Hud __instance, Player player) { if (MinimalUIPlugin.CustomFoodBar.Value.IsOn()) { 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.IsOn()) { 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) if (MinimalUIPlugin.HealthBarFlash.Value.IsOn() && MinimalUIPlugin.CustomHealthBar.Value.IsOn()) { 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (MinimalUIPlugin.HealthBarFlash.Value.IsOn() && MinimalUIPlugin.CustomHealthBar.Value.IsOn() && ((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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) if (MinimalUIPlugin.StaminaBarFlash.Value.IsOn() && MinimalUIPlugin.CustomStaminaBar.Value.IsOn()) { 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) if (MinimalUIPlugin.StaminaBarFlash.Value.IsOn() && MinimalUIPlugin.CustomStaminaBar.Value.IsOn()) { 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) if (MinimalUIPlugin.EitrBarFlash.Value.IsOn() && MinimalUIPlugin.CustomEitrBar.Value.IsOn()) { 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) if (MinimalUIPlugin.EitrBarFlash.Value.IsOn() && MinimalUIPlugin.CustomEitrBar.Value.IsOn()) { CustomBars.EitrFastColorFlash.Flash(MinimalUIPlugin.EitrBarFlashColor.Value); CustomBars.EitrSlowColorFlash.Flash(MinimalUIPlugin.EitrBarFlashColor.Value); } } } public class Helpers { public static void ApplyImageSettings(Image image, Sprite defaultSprite, Sprite customSprite, Sprite jcSprite, Color alphaColor, bool useJCUI, bool useCustomUI) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) ((Graphic)image).color = alphaColor; if (useJCUI) { image.sprite = jcSprite; } else if (useCustomUI) { image.sprite = customSprite; } else { image.sprite = defaultSprite; } } public static void ProcessChildImages(Transform parent, Func<Transform, bool> predicate, Action<Image> action) { Transform[] componentsInChildren = ((Component)parent).GetComponentsInChildren<Transform>(); Image obj = default(Image); foreach (Transform val in componentsInChildren) { if (predicate(val) && ((Component)val).TryGetComponent<Image>(ref obj)) { action(obj); } } } public static bool NameContains(Transform transform, params string[] keywords) { string nameLower = ((Object)transform).name.ToLower(); return keywords.Any((string keyword) => nameLower.Contains(keyword.ToLower())); } public static int CalculateBarRotation(int configValue) { return 90 - configValue / 90 % 4 * 90; } } [BepInPlugin("Azumatt.MinimalUI", "MinimalUI", "2.3.15")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class MinimalUIPlugin : BaseUnityPlugin { public 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; } } private static string ConfigFileName = "Azumatt.MinimalUI.cfg"; private static string ConfigFileFullPath; private static string zipFolderPath; private FileSystemWatcher _configWatcher; private FileSystemWatcher _imageWatcher; private readonly object _configReloadLock = new object(); private readonly object _imageReloadLock = new object(); private DateTime _lastConfigReloadTime; private DateTime _lastImageReloadTime; 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 static readonly string BkgTextUpp; 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 StatBarBackground; 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 AchievementsBkgImage; internal static Image AchievementDetailsBkgImage; 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<Vector2> CustomAdrenalineBarPos; 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<float> CustomAdrenalineBarScale; 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<int> CustomAdrenalineBarRotation; 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> CustomAdrenalineBar; internal static ConfigEntry<Toggle> CustomAdrenalineBarStretch; internal static ConfigEntry<Toggle> CustomAdrenalineBarHide; 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<Color> AdrenalineBarColor; internal static ConfigEntry<Color> AdrenalineBarColor2; internal static ConfigEntry<Toggle> StaminaBarFlash; internal static ConfigEntry<Color> StaminaBarFlashColor; internal static ConfigEntry<Toggle> EitrBarFlash; internal static ConfigEntry<Color> EitrBarFlashColor; internal static ConfigEntry<Toggle> AdrenalineBarFlash; internal static ConfigEntry<Color> AdrenalineBarFlashColor; 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_0731: Unknown result type (might be due to invalid IL or missing references) //IL_073b: Expected O, but got Unknown //IL_0771: Unknown result type (might be due to invalid IL or missing references) //IL_077b: Expected O, but got Unknown //IL_0790: Unknown result type (might be due to invalid IL or missing references) //IL_07b4: Unknown result type (might be due to invalid IL or missing references) //IL_07f9: Unknown result type (might be due to invalid IL or missing references) //IL_0803: Expected O, but got Unknown //IL_0818: Unknown result type (might be due to invalid IL or missing references) //IL_085d: Unknown result type (might be due to invalid IL or missing references) //IL_0867: Expected O, but got Unknown //IL_0892: Unknown result type (might be due to invalid IL or missing references) //IL_08b6: Unknown result type (might be due to invalid IL or missing references) //IL_0931: Unknown result type (might be due to invalid IL or missing references) //IL_093b: Expected O, but got Unknown //IL_09a7: Unknown result type (might be due to invalid IL or missing references) //IL_09b1: Expected O, but got Unknown //IL_0a41: Unknown result type (might be due to invalid IL or missing references) //IL_0a4b: Expected O, but got Unknown //IL_0a7e: Unknown result type (might be due to invalid IL or missing references) //IL_0a88: Expected O, but got Unknown //IL_0abb: Unknown result type (might be due to invalid IL or missing references) //IL_0ac5: Expected O, but got Unknown //IL_0af8: Unknown result type (might be due to invalid IL or missing references) //IL_0b02: Expected O, but got Unknown //IL_0b35: Unknown result type (might be due to invalid IL or missing references) //IL_0b3f: Expected O, but got Unknown //IL_0b66: Unknown result type (might be due to invalid IL or missing references) //IL_0b70: Expected O, but got Unknown //IL_0ba3: Unknown result type (might be due to invalid IL or missing references) //IL_0bad: Expected O, but got Unknown //IL_0be0: Unknown result type (might be due to invalid IL or missing references) //IL_0bea: Expected O, but got Unknown //IL_0c1d: Unknown result type (might be due to invalid IL or missing references) //IL_0c27: Expected O, but got Unknown //IL_0c46: Unknown result type (might be due to invalid IL or missing references) //IL_0c5a: Unknown result type (might be due to invalid IL or missing references) //IL_0c64: Expected O, but got Unknown //IL_0c8c: Unknown result type (might be due to invalid IL or missing references) //IL_0ca0: Unknown result type (might be due to invalid IL or missing references) //IL_0caa: Expected O, but got Unknown //IL_0cc9: Unknown result type (might be due to invalid IL or missing references) //IL_0cdd: Unknown result type (might be due to invalid IL or missing references) //IL_0ce7: Expected O, but got Unknown //IL_0d06: Unknown result type (might be due to invalid IL or missing references) //IL_0d1a: Unknown result type (might be due to invalid IL or missing references) //IL_0d24: Expected O, but got Unknown //IL_0d40: Unknown result type (might be due to invalid IL or missing references) //IL_0d54: Unknown result type (might be due to invalid IL or missing references) //IL_0d5e: Expected O, but got Unknown //IL_0d7d: Unknown result type (might be due to invalid IL or missing references) //IL_0dab: Unknown result type (might be due to invalid IL or missing references) //IL_0dd9: Unknown result type (might be due to invalid IL or missing references) //IL_0e07: Unknown result type (might be due to invalid IL or missing references) //IL_0e35: Unknown result type (might be due to invalid IL or missing references) //IL_0e63: Unknown result type (might be due to invalid IL or missing references) //IL_0e91: Unknown result type (might be due to invalid IL or missing references) //IL_0ebf: Unknown result type (might be due to invalid IL or missing references) //IL_0eed: Unknown result type (might be due to invalid IL or missing references) //IL_0f1b: Unknown result type (might be due to invalid IL or missing references) //IL_0f49: Unknown result type (might be due to invalid IL or missing references) //IL_0f77: Unknown result type (might be due to invalid IL or missing references) //IL_0fa5: Unknown result type (might be due to invalid IL or missing references) //IL_0fd3: Unknown result type (might be due to invalid IL or missing references) //IL_1001: Unknown result type (might be due to invalid IL or missing references) //IL_102f: Unknown result type (might be due to invalid IL or missing references) //IL_105d: Unknown result type (might be due to invalid IL or missing references) //IL_108b: Unknown result type (might be due to invalid IL or missing references) //IL_10b9: 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, 1f), "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.On, "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"); CustomAdrenalineBar = ((BaseUnityPlugin)this).Config.Bind<Toggle>("3 - Adrenaline Bar", "Use Adrenaline Bar", Toggle.On, new ConfigDescription("Use the custom adrenaline bar provided by this mod. Does not extend the bar the more adrenaline you have. It's a set size with a custom skin.", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Order = 4 } })); CustomAdrenalineBar.SettingChanged += TurnOffMuiAdrenalineBar; CustomAdrenalineBarStretch = ((BaseUnityPlugin)this).Config.Bind<Toggle>("3 - Adrenaline Bar", "Adrenaline Bar Stretch", Toggle.Off, new ConfigDescription("Stretches the adrenaline bar based on how much adrenaline you have, instead of the static size. Mimic's vanilla bar behavior", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Order = 3 } })); CustomAdrenalineBarHide = ((BaseUnityPlugin)this).Config.Bind<Toggle>("3 - Adrenaline Bar", "Hide Adrenaline Bar", Toggle.Off, new ConfigDescription("Hides the adrenaline bar when empty. Mimic's vanilla bar behavior", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Order = 2 } })); AdrenalineBarColor = ((BaseUnityPlugin)this).Config.Bind<Color>("3 - Adrenaline Bar", "Adrenaline Bar Color", Constants.defaultadrenalineColor, "Color of the Adrenaline bar"); AdrenalineBarColor2 = ((BaseUnityPlugin)this).Config.Bind<Color>("3 - Adrenaline Bar", "Secondary Adrenaline Bar Color", Constants.defaultadrenalineColor2, "Color of the secondary Adrenaline bar"); AdrenalineBarFlash = ((BaseUnityPlugin)this).Config.Bind<Toggle>("3 - Adrenaline Bar", "Use Flashing", Toggle.On, new ConfigDescription("Enable the flashing behind the adrenaline bar.", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Order = 1 } })); AdrenalineBarFlashColor = ((BaseUnityPlugin)this).Config.Bind<Color>("3 - Adrenaline Bar", "Adrenaline Flash Color", Color.red, "Color of the flashing behind the adrenaline 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)