Decompiled source of LethalHUD v1.1.3
plugins/LethalHUD/LethalHUD.dll
Decompiled a week 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.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using GoodItemScan; using HarmonyLib; using LethalConfig; using LethalConfig.ConfigItems; using LethalConfig.ConfigItems.Options; using LethalHUD.Compats; using LethalHUD.Configs; using LethalHUD.HUD; using LethalHUD.Misc; using LethalHUD.Patches; using LethalHUD.Scan; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoDetour; using MonoDetour.Cil; using MonoDetour.DetourTypes; using MonoDetour.HookGen; using MonoDetour.Reflection.Unspeakable; using MonoMod.Cil; using MonoMod.Utils; using On.GameNetcodeStuff.PlayerControllerB; using On.HUDManager; using SoftMasking; using TMPro; using Unity.Netcode; using Unity.Netcode.Transports.UTP; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("GoodItemScan")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("s1ckboy")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("Copyright © 2025 s1ckboy")] [assembly: AssemblyFileVersion("1.1.3.0")] [assembly: AssemblyInformationalVersion("1.1.3+9b1a9db31830c8f4309bf39d0db7dcc268bfb472")] [assembly: AssemblyProduct("LethalHUD")] [assembly: AssemblyTitle("LethalHUD")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.3.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace On.GameNetcodeStuff.PlayerControllerB { internal static class GrabObject { public delegate void PrefixSignature(PlayerControllerB self); public delegate void PostfixSignature(PlayerControllerB self, ref IEnumerator returnValue); public delegate void PrefixMoveNextSignature(SpeakableEnumerator<object, PlayerControllerB> self); public delegate void PostfixMoveNextSignature(SpeakableEnumerator<object, PlayerControllerB> self, ref bool continueEnumeration); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MonoDetourHook PrefixMoveNext(PrefixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>((MethodBase)StateMachineTarget(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook PostfixMoveNext(PostfixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>((MethodBase)StateMachineTarget(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook ILHookMoveNext(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook((MethodBase)StateMachineTarget(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(PlayerControllerB); MethodInfo method = typeFromHandle.GetMethod("GrabObject", (BindingFlags)(-1), null, Array.Empty<Type>(), null); if ((object)method == null) { throw new MissingMethodException("GameNetcodeStuff.PlayerControllerB", "GrabObject"); } return method; } public static MethodInfo StateMachineTarget() { return Extensions.GetStateMachineTarget((MethodInfo)Target()); } } internal static class LateUpdate { public delegate void PrefixSignature(PlayerControllerB self); public delegate void PostfixSignature(PlayerControllerB self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(PlayerControllerB); MethodInfo method = typeFromHandle.GetMethod("LateUpdate", (BindingFlags)(-1), null, Array.Empty<Type>(), null); if ((object)method == null) { throw new MissingMethodException("GameNetcodeStuff.PlayerControllerB", "LateUpdate"); } return method; } } internal static class DamagePlayer { public delegate void PrefixSignature(PlayerControllerB self, ref int damageNumber, ref bool hasDamageSFX, ref bool callRPC, ref CauseOfDeath causeOfDeath, ref int deathAnimation, ref bool fallDamage, ref Vector3 force); public delegate void PostfixSignature(PlayerControllerB self, ref int damageNumber, ref bool hasDamageSFX, ref bool callRPC, ref CauseOfDeath causeOfDeath, ref int deathAnimation, ref bool fallDamage, ref Vector3 force); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(PlayerControllerB); MethodInfo method = typeFromHandle.GetMethod("DamagePlayer", (BindingFlags)(-1), null, new Type[7] { typeof(int), typeof(bool), typeof(bool), typeof(CauseOfDeath), typeof(int), typeof(bool), typeof(Vector3) }, null); if ((object)method == null) { throw new MissingMethodException("GameNetcodeStuff.PlayerControllerB", "DamagePlayer"); } return method; } } } namespace On.HUDManager { internal static class PingScan_performed { public delegate void PrefixSignature(HUDManager self, ref CallbackContext context); public delegate void PostfixSignature(HUDManager self, ref CallbackContext context); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(HUDManager); MethodInfo method = typeFromHandle.GetMethod("PingScan_performed", (BindingFlags)(-1), null, new Type[1] { typeof(CallbackContext) }, null); if ((object)method == null) { throw new MissingMethodException("HUDManager", "PingScan_performed"); } return method; } } internal static class DisableAllScanElements { public delegate void PrefixSignature(HUDManager self); public delegate void PostfixSignature(HUDManager self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(HUDManager); MethodInfo method = typeFromHandle.GetMethod("DisableAllScanElements", (BindingFlags)(-1), null, Array.Empty<Type>(), null); if ((object)method == null) { throw new MissingMethodException("HUDManager", "DisableAllScanElements"); } return method; } } internal static class Start { public delegate void PrefixSignature(HUDManager self); public delegate void PostfixSignature(HUDManager self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(HUDManager); MethodInfo method = typeFromHandle.GetMethod("Start", (BindingFlags)(-1), null, Array.Empty<Type>(), null); if ((object)method == null) { throw new MissingMethodException("HUDManager", "Start"); } return method; } } internal static class OnEnable { public delegate void PrefixSignature(HUDManager self); public delegate void PostfixSignature(HUDManager self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(HUDManager); MethodInfo method = typeFromHandle.GetMethod("OnEnable", (BindingFlags)(-1), null, Array.Empty<Type>(), null); if ((object)method == null) { throw new MissingMethodException("HUDManager", "OnEnable"); } return method; } } internal static class DisplayNewScrapFound { public delegate void PrefixSignature(HUDManager self); public delegate void PostfixSignature(HUDManager self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(HUDManager); MethodInfo method = typeFromHandle.GetMethod("DisplayNewScrapFound", (BindingFlags)(-1), null, Array.Empty<Type>(), null); if ((object)method == null) { throw new MissingMethodException("HUDManager", "DisplayNewScrapFound"); } return method; } } internal static class Update { public delegate void PrefixSignature(HUDManager self); public delegate void PostfixSignature(HUDManager self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(HUDManager); MethodInfo method = typeFromHandle.GetMethod("Update", (BindingFlags)(-1), null, Array.Empty<Type>(), null); if ((object)method == null) { throw new MissingMethodException("HUDManager", "Update"); } return method; } } internal static class UpdateScanNodes { public delegate void PrefixSignature(HUDManager self, ref PlayerControllerB playerScript); public delegate void PostfixSignature(HUDManager self, ref PlayerControllerB playerScript); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(HUDManager); MethodInfo method = typeFromHandle.GetMethod("UpdateScanNodes", (BindingFlags)(-1), null, new Type[1] { typeof(PlayerControllerB) }, null); if ((object)method == null) { throw new MissingMethodException("HUDManager", "UpdateScanNodes"); } return method; } } internal static class AddChatMessage { public delegate void PrefixSignature(HUDManager self, ref string chatMessage, ref string nameOfUserWhoTyped, ref int playerWhoSent, ref bool dontRepeat); public delegate void PostfixSignature(HUDManager self, ref string chatMessage, ref string nameOfUserWhoTyped, ref int playerWhoSent, ref bool dontRepeat); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { Type typeFromHandle = typeof(HUDManager); MethodInfo method = typeFromHandle.GetMethod("AddChatMessage", (BindingFlags)(-1), null, new Type[4] { typeof(string), typeof(string), typeof(int), typeof(bool) }, null); if ((object)method == null) { throw new MissingMethodException("HUDManager", "AddChatMessage"); } return method; } } } namespace MonoDetour.HookGen { internal static class DefaultMonoDetourManager { internal static MonoDetourManager Instance { get; } = New(); internal static MonoDetourManager New() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown return new MonoDetourManager(typeof(DefaultMonoDetourManager).Assembly.GetName().Name); } } [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class, AllowMultiple = true, Inherited = false)] internal class MonoDetourTargetsAttribute : Attribute, IMonoDetourTargets { public Type? TargetType { get; } public bool IncludeNestedTypes { get; set; } public bool DistinguishOverloadsByName { get; set; } public string[]? Members { get; set; } public string[]? MemberNamePrefixes { get; set; } public string[]? MemberNameSuffixes { get; set; } public bool GenerateControlFlowVariants { get; set; } public MonoDetourTargetsAttribute(Type? targetType = null) { TargetType = targetType; IncludeNestedTypes = true; base..ctor(); } } } namespace LethalHUD { public static class Enums { public enum SlotEnums { None, Rainbow, Summer, Winter, Vaporwave, Deepmint, Radioactive, TideEmber } public enum ScanLines { Default, Circles, Hexagons, Circuit, Noisy, Scifi } public enum WeightUnit { Pounds, Kilograms, Manuls } public enum FPSPingLayout { Vertical, Horizontal } internal static Color solarFlare = new Color(1f, 0.8f, 0.3f); internal static Color moltenCore = new Color(1f, 0.2f, 0f); internal static Color skyWave = new Color(0.4f, 0.65f, 1f); internal static Color moonlitMist = new Color(0.8f, 0.8f, 1f); internal static Color pinkPrism = new Color(1f, 0.4f, 1f); internal static Color aquaPulse = new Color(0.4f, 1f, 1f); internal static Color mintWave = new Color(0.5647f, 0.8706f, 0.7843f); internal static Color deepTeal = new Color(0.1608f, 0.2863f, 0.2549f); internal static Color neonLime = new Color(0.443f, 0.78f, 0f); internal static Color lemonGlow = new Color(0.941f, 1f, 0.471f); internal static Color crimsonSpark = new Color(1f, 0.27f, 0f); internal static Color deepOcean = new Color(0f, 0.48f, 0.54f); private static readonly float baseIntensity = 352.08f; private static readonly float customBaseIntensity = 100f; internal static void DirtIntensityHandlerByScanLine() { Bloom scanBloom = ScanController.ScanBloom; if (!((Object)(object)scanBloom == (Object)null)) { if (Plugins.ConfigEntries.SelectedScanlineMode.Value == ScanLines.Default) { ((VolumeParameter<float>)(object)scanBloom.dirtIntensity).Override(Mathf.Max(0f, baseIntensity + Plugins.ConfigEntries.DirtIntensity.Value)); } else { ((VolumeParameter<float>)(object)scanBloom.dirtIntensity).Override(Mathf.Max(0f, customBaseIntensity + Plugins.ConfigEntries.DirtIntensity.Value)); } } } } [BepInPlugin("LethalHUD", "LethalHUD", "1.1.3")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugins : BaseUnityPlugin { internal static Dictionary<Enums.ScanLines, Texture2D> ScanlineTextures = new Dictionary<Enums.ScanLines, Texture2D>(); internal static Texture2D DeadPlayerIconTexture; internal static Plugins Instance { get; private set; } internal static ManualLogSource Logger { get; private set; } internal static ConfigFile Config { get; private set; } internal static ConfigEntries ConfigEntries { get; private set; } public void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } Logger = Logger.CreateLogSource("LethalHUD"); Logger.LogInfo((object)"Plugin LethalHUD loaded!"); Config = ConfigUtils.CreateGlobalConfigFile((BaseUnityPlugin)(object)this); HUDManagerPatch.Init(); PlayerControllerBPatch.Init(); string directoryName = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location); string text = Path.Combine(directoryName, "insanelyoriginalassetbundlenameforlethalhud"); AssetBundle val = AssetBundle.LoadFromFile(text); ConfigEntries = new ConfigEntries(); if ((Object)(object)val == (Object)null) { Logger.LogError((object)"Failed to load insanelyoriginalassetbundlenameforlethalhud assetbundle."); return; } DeadPlayerIconTexture = val.LoadAsset<Texture2D>("deadIcon"); foreach (Enums.ScanLines value in Enum.GetValues(typeof(Enums.ScanLines))) { string text2 = value.ToString(); Texture2D val2 = val.LoadAsset<Texture2D>(text2); if ((Object)(object)val2 != (Object)null) { ScanlineTextures[value] = val2; } else { Logger.LogWarning((object)("Texture '" + text2 + "' not found in asset bundle.")); } } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "LethalHUD"; public const string PLUGIN_NAME = "LethalHUD"; public const string PLUGIN_VERSION = "1.1.3"; } } namespace LethalHUD.Scan { internal static class ScanController { private const float ScanDuration = 1.3f; private static Texture2D _lastRecoloredTexture; private static MeshRenderer ScanRenderer { get { HUDManager instance = HUDManager.Instance; if (instance == null) { return null; } Animator scanEffectAnimator = instance.scanEffectAnimator; if (scanEffectAnimator == null) { return null; } return ((Component)scanEffectAnimator).GetComponent<MeshRenderer>(); } } private static Volume ScanVolume => Object.FindObjectsByType<Volume>((FindObjectsSortMode)0)?.FirstOrDefault((Func<Volume, bool>)delegate(Volume v) { bool? obj; if (v == null) { obj = null; } else { VolumeProfile profile = v.profile; obj = ((profile == null) ? null : ((Object)profile).name?.StartsWith("ScanVolume")); } bool? flag = obj; return flag.GetValueOrDefault(); }); private static Vignette ScanVignette { get { Volume scanVolume = ScanVolume; if (scanVolume == null) { return null; } return scanVolume.profile?.components?.OfType<Vignette>().FirstOrDefault(); } } internal static Bloom ScanBloom { get { Volume scanVolume = ScanVolume; if (scanVolume == null) { return null; } return scanVolume.profile?.components?.OfType<Bloom>().FirstOrDefault(); } } private static float ScanProgress => 0.7692308f * (HUDManager.Instance.playerPingingScan + 1f); private static void SetScanColorAlpha(float alpha) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) MeshRenderer scanRenderer = ScanRenderer; if (!((Object)(object)((scanRenderer != null) ? ((Renderer)scanRenderer).material : null) == (Object)null)) { Color color = ((Renderer)ScanRenderer).material.color; color.a = alpha; ((Renderer)ScanRenderer).material.color = color; } } internal static void SetScanColor(Color? overrideColor = null) { //IL_0014: 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_0019: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) Color val = (Color)(((??)overrideColor) ?? ConfigHelper.GetScanColor()); if (ModCompats.IsBetterScanVisionPresent) { BetterScanVisionProxy.OverrideNightVisionColor(); } MeshRenderer scanRenderer = ScanRenderer; if ((Object)(object)((scanRenderer != null) ? ((Renderer)scanRenderer).material : null) != (Object)null) { ((Renderer)ScanRenderer).material.color = val; } if ((Object)(object)ScanVignette != (Object)null) { ((VolumeParameter<Color>)(object)ScanVignette.color).Override(val); UpdateVignetteIntensity(); } if ((Object)(object)ScanBloom != (Object)null) { ((VolumeParameter<Color>)(object)ScanBloom.tint).Override(val); UpdateScanTexture(); } } internal static void UpdateScanAlpha() { float value = Plugins.ConfigEntries.Alpha.Value; float num = value; if (Plugins.ConfigEntries.FadeOut.Value && HUDManager.Instance.playerPingingScan > -1f) { num *= ScanProgress; } SetScanColorAlpha(num); } internal static void UpdateVignetteIntensity() { ((VolumeParameter<float>)(object)ScanVignette?.intensity).Override(Plugins.ConfigEntries.VignetteIntensity.Value); } internal static void UpdateScanTexture() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ScanBloom == (Object)null) { return; } Enums.DirtIntensityHandlerByScanLine(); Texture2D selectedTexture = GetSelectedTexture(); if (!((Object)(object)selectedTexture == (Object)null)) { if (Plugins.ConfigEntries.RecolorScanLines.Value) { RecolorAndApplyTexture(ConfigHelper.GetScanColor(), selectedTexture); } else { ((VolumeParameter<Texture>)(object)ScanBloom.dirtTexture).Override((Texture)(object)selectedTexture); } } } private static void RecolorAndApplyTexture(Color color, Texture2D baseTex) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0027: Unknown result type (might be due to invalid IL or missing references) Texture2D texture = new Texture2D(((Texture)baseTex).width, ((Texture)baseTex).height); texture.SetPixels(baseTex.GetPixels()); texture.Apply(false); ScanUtils.RecolorTexture(ref texture, color); if ((Object)(object)_lastRecoloredTexture != (Object)null) { Object.Destroy((Object)(object)_lastRecoloredTexture); } _lastRecoloredTexture = Object.Instantiate<Texture2D>(texture); ((VolumeParameter<Texture>)(object)ScanBloom.dirtTexture).Override((Texture)(object)_lastRecoloredTexture); } private static Texture2D GetSelectedTexture() { Enums.ScanLines value = Plugins.ConfigEntries.SelectedScanlineMode.Value; if (Plugins.ScanlineTextures.TryGetValue(value, out var value2) && (Object)(object)value2 != (Object)null) { return value2; } Plugins.Logger.LogWarning((object)$"Scanline texture '{value}' missing. Falling back to Default."); if (value != 0 && Plugins.ScanlineTextures.TryGetValue(Enums.ScanLines.Default, out var value3) && (Object)(object)value3 != (Object)null) { return value3; } Plugins.Logger.LogError((object)"No scanline textures could be applied."); return null; } } internal static class ScanNodeController { private static readonly Dictionary<ScanNodeProperties, float> nodeAppearTimes = new Dictionary<ScanNodeProperties, float>(); internal static float lifetime = Plugins.ConfigEntries.ScanNodeLifetime.Value; internal static float fadeDuration = Plugins.ConfigEntries.ScanNodeFadeDuration.Value; private static readonly AnimationCurve fadeCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); internal static void UpdateTimers(RectTransform[] scanElements, Dictionary<RectTransform, ScanNodeProperties> scanNodes) { foreach (RectTransform val in scanElements) { if ((Object)(object)val == (Object)null) { continue; } if (!scanNodes.TryGetValue(val, out var value) || (Object)(object)value == (Object)null) { CleanInvalidNodes(); continue; } if (!nodeAppearTimes.ContainsKey(value)) { nodeAppearTimes[value] = Time.time; } float num = Time.time - nodeAppearTimes[value]; if (num >= lifetime + fadeDuration) { RemoveNode(val, value, scanNodes); continue; } float alpha = ((num > lifetime) ? fadeCurve.Evaluate((num - lifetime) / fadeDuration) : 1f); CanvasGroup component = ((Component)val).GetComponent<CanvasGroup>(); component.alpha = alpha; } } internal static void UpdateGoodItemScanNodes() { if (!ModCompats.IsGoodItemScanPresent && !Plugins.ConfigEntries.ScanNodeFade.Value) { return; } Scanner scanner = GoodItemScan.scanner; if (scanner == null) { return; } List<ScanNodeProperties> list = new List<ScanNodeProperties>(scanner._scanNodes.Keys); foreach (ScanNodeProperties item in list) { if (!GoodItemScanProxy.TryGetRectTransform(item, out var rectTransform) || (Object)(object)rectTransform == (Object)null) { nodeAppearTimes.Remove(item); continue; } if (!((Component)rectTransform).gameObject.activeInHierarchy) { nodeAppearTimes.Remove(item); continue; } if (!nodeAppearTimes.ContainsKey(item)) { nodeAppearTimes[item] = Time.time; } float num = Time.time - nodeAppearTimes[item]; float num2 = ((num > lifetime) ? fadeCurve.Evaluate((num - lifetime) / fadeDuration) : 1f); CanvasGroup component = ((Component)rectTransform).GetComponent<CanvasGroup>(); if ((Object)(object)component != (Object)null) { component.alpha = num2; } ((Component)rectTransform).gameObject.SetActive(num2 > 0f); } } internal static void ResetGoodItemScanNodes() { if (!ModCompats.IsGoodItemScanPresent && !Plugins.ConfigEntries.ScanNodeFade.Value) { return; } Scanner scanner = GoodItemScan.scanner; if (scanner == null) { return; } foreach (KeyValuePair<ScanNodeProperties, int> scanNode in scanner._scanNodes) { if (GoodItemScanProxy.TryGetRectTransform(scanNode.Key, out var rectTransform) && !((Object)(object)rectTransform == (Object)null)) { nodeAppearTimes[scanNode.Key] = Time.time; ((Component)rectTransform).gameObject.SetActive(true); CanvasGroup component = ((Component)rectTransform).GetComponent<CanvasGroup>(); if ((Object)(object)component != (Object)null) { component.alpha = 1f; } } } } private static void RemoveNode(RectTransform element, ScanNodeProperties node, Dictionary<RectTransform, ScanNodeProperties> scanNodes) { ((Component)element).gameObject.SetActive(false); scanNodes.Remove(element); nodeAppearTimes.Remove(node); } private static void CleanInvalidNodes() { List<ScanNodeProperties> list = new List<ScanNodeProperties>(); foreach (KeyValuePair<ScanNodeProperties, float> nodeAppearTime in nodeAppearTimes) { if ((Object)(object)nodeAppearTime.Key == (Object)null) { list.Add(nodeAppearTime.Key); } } foreach (ScanNodeProperties item in list) { nodeAppearTimes.Remove(item); } } } public class ScanUtils { public static void RecolorTexture(ref Texture2D texture, Color color) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) float num = color.r + color.g + color.b; List<Color> list = texture.GetPixels().ToList(); Plugins.Logger.LogDebug((object)("ScanTexture pixel count: " + list.Count)); for (int num2 = list.Count - 1; num2 >= 0; num2--) { float num3 = list[num2].r + list[num2].g + list[num2].b; if (!(num3 < 0.05f) && !(list[num2].a < 0.05f)) { float num4 = ((num == 0f) ? 0f : (num3 / num)); list[num2] = new Color(color.r * num4, color.g * num4, color.b * num4); } } texture.SetPixels(list.ToArray()); } } } namespace LethalHUD.Patches { [MonoDetourTargets(typeof(HUDManager), Members = new string[] { "PingScan_performed", "Start", "OnEnable", "DisableAllScanElements", "DisplayNewScrapFound", "Update", "UpdateScanNodes", "AddChatMessage" })] internal static class HUDManagerPatch { [CompilerGenerated] private static class <>O { public static PingScan_performed.PrefixSignature <0>__OnScanTriggered; public static DisableAllScanElements.PrefixSignature <1>__OnHUDManagerDisabledAllScanElements; public static Start.PostfixSignature <2>__OnHUDManagerStart; public static OnEnable.PostfixSignature <3>__OnHUDManagerEnable; public static DisplayNewScrapFound.PostfixSignature <4>__OnHUDManagerDisplayNewScrapFound; public static Update.PostfixSignature <5>__OnHUDManagerUpdate; public static UpdateScanNodes.PostfixSignature <6>__OnHUDManagerUpdateScanNodes; public static Manipulator <7>__ILHook_AddChatMessage; public static Func<string, string> <8>__GetColoredPlayerName; public static Func<string> <9>__GetDefaultChatColorTag; } private static CallbackContext pingScan; [MonoDetourHookInitialize] public static void Init() { //IL_010c: 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_0117: Expected O, but got Unknown PingScan_performed.Prefix(OnScanTriggered); DisableAllScanElements.Prefix(OnHUDManagerDisabledAllScanElements); Start.Postfix(OnHUDManagerStart); OnEnable.Postfix(OnHUDManagerEnable); DisplayNewScrapFound.Postfix(OnHUDManagerDisplayNewScrapFound); Update.Postfix(OnHUDManagerUpdate); UpdateScanNodes.Postfix(OnHUDManagerUpdateScanNodes); object obj = <>O.<7>__ILHook_AddChatMessage; if (obj == null) { Manipulator val = ILHook_AddChatMessage; <>O.<7>__ILHook_AddChatMessage = val; obj = (object)val; } AddChatMessage.ILHook((Manipulator)obj); } private static void OnScanTriggered(HUDManager self, ref CallbackContext context) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) pingScan = context; if (ModCompats.IsGoodItemScanPresent) { ScanNodeController.ResetGoodItemScanNodes(); } } private static void OnHUDManagerStart(HUDManager self) { ScanController.SetScanColor(); ScanController.UpdateScanTexture(); PlayerHPDisplay.Init(); if (ModCompats.IsBetterScanVisionPresent) { BetterScanVisionProxy.OverrideNightVisionColor(); } } private static void OnHUDManagerEnable(HUDManager self) { if ((Object)(object)((Component)self).gameObject.GetComponent<LethalHUDMono>() == (Object)null) { ((Component)self).gameObject.AddComponent<LethalHUDMono>(); } if ((Object)(object)((Component)self).gameObject.GetComponent<FPSAndPingCounter>() == (Object)null) { ((Component)self).gameObject.AddComponent<FPSAndPingCounter>(); } ChatController.ColorChatInputField(self.chatTextField, Time.time * 0.25f); } private static void OnHUDManagerDisplayNewScrapFound(HUDManager self) { InventoryFrames.SetSlotColors(); } private static void OnHUDManagerDisabledAllScanElements(HUDManager self) { if (ModCompats.IsGoodItemScanPresent) { ScanNodeController.ResetGoodItemScanNodes(); } } private static void OnHUDManagerUpdate(HUDManager self) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) ScanController.UpdateScanAlpha(); PlayerHPDisplay.UpdateNumber(); if (Plugins.ConfigEntries.HoldScan.Value && IngamePlayerSettings.Instance.playerInput.actions.FindAction("PingScan", false).IsPressed()) { self.PingScan_performed(pingScan); } if (Plugins.ConfigEntries.WeightCounterBoolean.Value) { WeightController.UpdateWeightDisplay(); } } private static void OnHUDManagerUpdateScanNodes(HUDManager self, ref PlayerControllerB playerScript) { if (Plugins.ConfigEntries.ScanNodeFade.Value) { ScanNodeController.UpdateTimers(self.scanElements, self.scanNodes); } } private static void ILHook_AddChatMessage(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ILWeaver w = new ILWeaver(info); w.MatchMultipleStrict((Action<ILWeaver>)delegate(ILWeaver matchWeaver) { matchWeaver.InsertAfterCurrent((IEnumerable<Instruction>)new <>z__ReadOnlySingleElementList<Instruction>(matchWeaver.CreateCall((Delegate)new Func<string, string>(ChatController.GetColoredPlayerName)))); }, new Predicate<Instruction>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 2) && w.SetCurrentTo(x) }); w.MatchMultipleStrict((Action<ILWeaver>)delegate(ILWeaver matchWeaver) { ILLabel val = default(ILLabel); matchWeaver.Remove(matchWeaver.Current, ref val); matchWeaver.InsertAfterCurrent((IEnumerable<Instruction>)new <>z__ReadOnlySingleElementList<Instruction>(matchWeaver.CreateCall((Delegate)new Func<string>(ChatController.GetDefaultChatColorTag)))); }, new Predicate<Instruction>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "<color=#7069ff>") && w.SetCurrentTo(x) }); } } [MonoDetourTargets(typeof(PlayerControllerB), Members = new string[] { "GrabObject", "DamagePlayer", "LateUpdate" })] internal static class PlayerControllerBPatch { [MonoDetourHookInitialize] public static void Init() { GrabObject.Prefix(OnPlayerControllerBBeginGrabObject); LateUpdate.Postfix(OnPlayerLateUpdate); DamagePlayer.Postfix(OnPlayerControllerBDamagePlayer); } private static void OnPlayerControllerBDamagePlayer(PlayerControllerB self, ref int damageNumber, ref bool hasDamageSFX, ref bool callRPC, ref CauseOfDeath causeOfDeath, ref int deathAnimation, ref bool fallDamage, ref Vector3 force) { PlayerHPDisplay.ShakeOnHit(); } private static void OnPlayerControllerBBeginGrabObject(PlayerControllerB self) { InventoryFrames.HandsFull(); } private static void OnPlayerLateUpdate(PlayerControllerB self) { if (self.isTypingChat) { ChatController.PlayerTypingIndicator(); } if (Plugins.ConfigEntries.SprintMeterBoolean.Value) { SprintMeter.UpdateSprintMeterColor(); } } } } namespace LethalHUD.Misc { public class FPSAndPingCounter : NetworkBehaviour { private float deltaTime; private ulong currentPing; private float pingTimer; private readonly float pingInterval = 0.5f; private Vector2 offset = Vector2.zero; private UnityTransport transport; private TextMeshProUGUI fpsPingText; private void Start() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) ref UnityTransport reference = ref transport; NetworkTransport networkTransport = NetworkManager.Singleton.NetworkConfig.NetworkTransport; reference = (UnityTransport)(object)((networkTransport is UnityTransport) ? networkTransport : null); GameObject val = new GameObject("FPSAndPingCounter"); GameObject val2 = GameObject.Find("Systems/UI/Canvas/IngamePlayerHUD/"); val.transform.SetParent(val2.transform, false); fpsPingText = val.AddComponent<TextMeshProUGUI>(); ((TMP_Text)fpsPingText).font = ((TMP_Text)HUDManager.Instance.chatText).font; ((TMP_Text)fpsPingText).fontSize = 12f; ((TMP_Text)fpsPingText).richText = true; ((Graphic)fpsPingText).color = ConfigHelper.GetSlotColor(); ((TMP_Text)fpsPingText).alignment = (TextAlignmentOptions)257; RectTransform rectTransform = ((TMP_Text)fpsPingText).rectTransform; rectTransform.anchorMin = new Vector2(0f, 1f); rectTransform.anchorMax = new Vector2(0f, 1f); rectTransform.pivot = new Vector2(0f, 1f); rectTransform.anchoredPosition = new Vector2(Plugins.ConfigEntries.FPSCounterX.Value, 0f - Plugins.ConfigEntries.FPSCounterY.Value); } private void Update() { //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) deltaTime += (Time.unscaledDeltaTime - deltaTime) * 0.1f; if (((NetworkBehaviour)this).IsHost && (Object)(object)transport != (Object)null) { pingTimer += Time.deltaTime; if (pingTimer >= pingInterval) { pingTimer = 0f; foreach (NetworkClient connectedClients in NetworkManager.Singleton.ConnectedClientsList) { ulong currentRtt = ((NetworkTransport)transport).GetCurrentRtt(connectedClients.ClientId); SendPingClientRpc(connectedClients.ClientId, currentRtt); } } } if (!Plugins.ConfigEntries.ShowFPSCounter.Value && !Plugins.ConfigEntries.ShowPingCounter.Value) { return; } float num = 1f / deltaTime; string text = ""; string text2 = ((Plugins.ConfigEntries.MiscLayoutEnum.Value == Enums.FPSPingLayout.Vertical) ? "\n─────────\n" : " | "); if (Plugins.ConfigEntries.ShowFPSCounter.Value) { text += $"FPS: {num:0}"; } if (Plugins.ConfigEntries.ShowPingCounter.Value) { if (!string.IsNullOrEmpty(text)) { text += text2; } text += $"Ping: {currentPing} ms"; } ((TMP_Text)fpsPingText).alignment = (TextAlignmentOptions)257; offset = new Vector2(Plugins.ConfigEntries.FPSCounterX.Value, 0f - Plugins.ConfigEntries.FPSCounterY.Value); ((TMP_Text)fpsPingText).text = text; ((Graphic)fpsPingText).color = ConfigHelper.GetSlotColor(); ((TMP_Text)fpsPingText).rectTransform.anchoredPosition = offset; } [ClientRpc] private void SendPingClientRpc(ulong targetClientId, ulong ping) { if (NetworkManager.Singleton.LocalClientId == targetClientId) { currentPing = ping; } } } } namespace LethalHUD.HUD { internal static class ChatController { internal static string GetColoredPlayerName(string playerName) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) if (!Plugins.ConfigEntries.ColoredNames.Value || string.IsNullOrEmpty(playerName)) { return playerName; } if (HUDUtils.HasCustomGradient(Plugins.ConfigEntries.GradientNameColorA.Value, Plugins.ConfigEntries.GradientNameColorB.Value)) { Color startColor = default(Color); ColorUtility.TryParseHtmlString(Plugins.ConfigEntries.GradientNameColorA.Value, ref startColor); Color endColor = default(Color); ColorUtility.TryParseHtmlString(Plugins.ConfigEntries.GradientNameColorB.Value, ref endColor); return HUDUtils.ApplyStaticGradient(playerName, startColor, endColor); } return "<color=" + Plugins.ConfigEntries.LocalNameColor.Value + ">" + playerName + "</color>"; } internal static string GetDefaultChatColorTag() { return "<color=" + Plugins.ConfigEntries.LocalNameColor.Value + "></color>"; } internal static void PlayerTypingIndicator() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) TextMeshProUGUI typingIndicator = HUDManager.Instance.typingIndicator; ((TMP_Text)typingIndicator).enableVertexGradient = true; ((Graphic)typingIndicator).color = Color.white; if ((Object)(object)typingIndicator == (Object)null) { return; } Color startColor = default(Color); Color endColor = default(Color); if (HUDUtils.HasCustomGradient(Plugins.ConfigEntries.GradientColorA.Value, Plugins.ConfigEntries.GradientColorB.Value) && ColorUtility.TryParseHtmlString(Plugins.ConfigEntries.GradientColorA.Value, ref startColor) && ColorUtility.TryParseHtmlString(Plugins.ConfigEntries.GradientColorB.Value, ref endColor)) { HUDUtils.ApplyVertexGradient(typingIndicator, startColor, endColor, Time.time * 0.2f); return; } switch (InventoryFrames.CurrentSlotColorMode) { case Enums.SlotEnums.Rainbow: HUDUtils.ApplyRainbowGradient(typingIndicator, Time.time * 0.25f); break; case Enums.SlotEnums.None: ((TMP_Text)typingIndicator).colorGradient = new VertexGradient(ConfigHelper.GetSlotColor()); break; default: HUDUtils.ApplyVertexGradient(typingIndicator, InventoryFrames.CurrentGradientStartColor, InventoryFrames.CurrentGradientEndColor, Time.time * 0.25f); break; } } internal static void ColorChatInputField(TMP_InputField inputField, float time) { //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) Color val3; if (HUDUtils.HasCustomGradient(Plugins.ConfigEntries.GradientColorA.Value, Plugins.ConfigEntries.GradientColorB.Value)) { Color val = default(Color); Color val2 = default(Color); if (ColorUtility.TryParseHtmlString(Plugins.ConfigEntries.GradientColorA.Value, ref val) && ColorUtility.TryParseHtmlString(Plugins.ConfigEntries.GradientColorB.Value, ref val2)) { float num = Mathf.SmoothStep(0f, 1f, Mathf.Sin(time * MathF.PI * 2f) * 0.5f + 0.5f); val3 = Color.Lerp(val, val2, num); } else { val3 = ConfigHelper.GetSlotColor(); } } else { switch (InventoryFrames.CurrentSlotColorMode) { case Enums.SlotEnums.Rainbow: { float num3 = 0.5f; float num4 = time * num3 % 1f; val3 = Color.HSVToRGB(num4, 1f, 1f); break; } case Enums.SlotEnums.None: val3 = ConfigHelper.GetSlotColor(); break; default: { float num2 = Mathf.SmoothStep(0f, 1f, Mathf.Sin(time * MathF.PI * 2f) * 0.5f + 0.5f); val3 = Color.Lerp(InventoryFrames.CurrentGradientStartColor, InventoryFrames.CurrentGradientEndColor, num2); break; } } } inputField.caretColor = val3; if ((Object)(object)inputField.textComponent != (Object)null) { Color color = default(Color); ((Color)(ref color))..ctor(1f - val3.r, 1f - val3.g, 1f - val3.b, val3.a); ((Graphic)inputField.textComponent).color = color; } Graphic placeholder = inputField.placeholder; TMP_Text val4 = (TMP_Text)(object)((placeholder is TMP_Text) ? placeholder : null); if (val4 != null) { ((Graphic)val4).color = val3; } } } internal static class CompassController { internal static RawImage CompassImage => HUDManager.Instance?.compassImage; internal static void SetCompassColor(Color? overrideColor = null) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_0043: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)CompassImage == (Object)null)) { Color color = (Color)(((??)overrideColor) ?? ConfigHelper.GetSlotColor()); color.a = ((Graphic)CompassImage).color.a; ((Graphic)CompassImage).color = color; } } internal static void SetCompassWavyGradient() { //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) HUDUtils.ApplyCompassWavyGradient(InventoryFrames.CurrentGradientStartColor, InventoryFrames.CurrentGradientEndColor); } internal static void SoftMaskStuff() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)CompassImage == (Object)null)) { SoftMask componentInParent = ((Component)CompassImage).GetComponentInParent<SoftMask>(); if (!((Object)(object)componentInParent == (Object)null)) { bool value = Plugins.ConfigEntries.CompassInvertMask.Value; bool value2 = Plugins.ConfigEntries.CompassInvertOutsides.Value; float value3 = Plugins.ConfigEntries.CompassAlpha.Value; componentInParent.invertMask = value; componentInParent.invertOutsides = value2; Vector4 val = Color.op_Implicit(componentInParent.channelWeights); val.w = value3; componentInParent.channelWeights = Color.op_Implicit(val); } } } } internal static class HUDUtils { private static float _rainbowTime; private static float _gradientWaveTime; private static RawImage CompassImage => CompassController.CompassImage; internal static Color ParseHexColor(string hex) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) Color val = default(Color); if (ColorUtility.TryParseHtmlString(hex, ref val)) { return new Color(val.r, val.g, val.b); } Plugins.Logger.LogWarning((object)("Invalid HEX color: " + hex + ". Defaulting to original blue.")); return new Color(0f, 0.047f, 1f); } internal static bool HasCustomGradient(string a, string b) { if (!string.IsNullOrWhiteSpace(a) && !string.IsNullOrWhiteSpace(b)) { return !string.Equals(a, b, StringComparison.OrdinalIgnoreCase); } return false; } internal static string ApplyStaticGradient(string input, Color startColor, Color endColor, float minBrightness = 0.15f) { //IL_0022: 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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) string text = ""; int length = input.Length; for (int i = 0; i < length; i++) { float num = (float)i / (float)Mathf.Max(1, length - 1); Color val = Color.Lerp(startColor, endColor, num); float num2 = 0.299f * val.r + 0.587f * val.g + 0.114f * val.b; if (num2 < minBrightness) { float num3 = Mathf.Clamp01((minBrightness - num2) * 0.5f); val = Color.Lerp(val, Color.white, num3); } string arg = ColorUtility.ToHtmlStringRGB(val); text += $"<color=#{arg}>{input[i]}</color>"; } return text; } internal static void ApplyVertexGradient(TextMeshProUGUI tmpText, Color startColor, Color endColor, float time, float waveFrequency = 1.5f) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)tmpText == (Object)null)) { float num = Mathf.SmoothStep(0f, 1f, Mathf.Sin((time + 0f) * waveFrequency * MathF.PI * 2f) * 0.5f + 0.5f); float num2 = Mathf.SmoothStep(0f, 1f, Mathf.Sin((time + 1f) * waveFrequency * MathF.PI * 2f) * 0.5f + 0.5f); Color val = Color.Lerp(startColor, endColor, num); Color val2 = Color.Lerp(startColor, endColor, num2); VertexGradient colorGradient = default(VertexGradient); ((VertexGradient)(ref colorGradient))..ctor(val, val, val2, val2); ((TMP_Text)tmpText).colorGradient = colorGradient; ((TMP_Text)tmpText).ForceMeshUpdate(false, false); } } internal static void ApplyRainbowGradient(TextMeshProUGUI tmpText, float time) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)tmpText == (Object)null)) { float num = 0.5f; float num2 = time * num % 1f; Color val = Color.HSVToRGB((num2 + 0f) % 1f, 1f, 1f); Color val2 = Color.HSVToRGB((num2 + 0.33f) % 1f, 1f, 1f); Color val3 = Color.HSVToRGB((num2 + 0.66f) % 1f, 1f, 1f); Color val4 = Color.HSVToRGB((num2 + 0.99f) % 1f, 1f, 1f); ((TMP_Text)tmpText).colorGradient = new VertexGradient(val, val2, val3, val4); ((TMP_Text)tmpText).ForceMeshUpdate(false, false); } } internal static void ApplyCompassRainbow() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)CompassImage == (Object)null)) { _rainbowTime += Time.deltaTime * 0.15f; float num = _rainbowTime % 1f; Color color = Color.HSVToRGB(num, 1f, 1f); color.a = ((Graphic)CompassImage).color.a; ((Graphic)CompassImage).color = color; } } internal static void ApplyCompassWavyGradient(Color startColor, Color endColor) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)CompassImage == (Object)null)) { _gradientWaveTime += Time.deltaTime * 0.15f; float num = Mathf.SmoothStep(0f, 1f, Mathf.Sin(_gradientWaveTime * MathF.PI * 2f) * 0.5f + 0.5f); Color val = Color.Lerp(startColor, endColor, num); Color gamma = ((Color)(ref val)).gamma; gamma.a = ((Graphic)CompassImage).color.a; ((Graphic)CompassImage).color = gamma; } } internal static void ApplyRainbow(Image[] frames) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) int num = frames.Length; float num2 = Time.time * 0.15f; for (int i = 0; i < num; i++) { float num3 = (num2 + (float)i / (float)num) % 1f; Color color = Color.HSVToRGB(num3, 1f, 1f); if ((Object)(object)frames[i] != (Object)null) { ((Graphic)frames[i]).color = color; } } } internal static void ApplyWavyGradient(Image[] frames, Color startColor, Color endColor, float speed = 0.15f, float waveFrequency = 2f) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) if (frames != null && frames.Length != 0) { _gradientWaveTime = (_gradientWaveTime + Time.deltaTime * speed) % 1f; int num = frames.Length; for (int i = 0; i < num; i++) { float num2 = (float)i / (float)(num - 1); float num3 = Mathf.SmoothStep(0f, 1f, Mathf.Sin((_gradientWaveTime + num2 * waveFrequency) * MathF.PI * 2f) * 0.5f + 0.5f); Color val = Color.Lerp(startColor, endColor, num3); Color gamma = ((Color)(ref val)).gamma; ((Graphic)frames[i]).color = gamma; } } } internal static Color GetGradientColor(Color baseColor, float fillAmount) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) float num = default(float); float num2 = default(float); float num3 = default(float); Color.RGBToHSV(baseColor, ref num, ref num2, ref num3); float num4 = Mathf.Lerp(0f, 1f / 3f, 1f - fillAmount); float num5 = (num + num4) % 2f; return Color.HSVToRGB(num5, num2, num3); } internal static Color GetShadeColor(Color baseColor, float fillAmount) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) float num = default(float); float num2 = default(float); float num3 = default(float); Color.RGBToHSV(baseColor, ref num, ref num2, ref num3); if (num3 < 0.4f) { if (fillAmount > 0.65f) { return baseColor; } if (fillAmount > 0.55f) { float num4 = Mathf.InverseLerp(0.65f, 0.55f, fillAmount); float num5 = Mathf.Lerp(num3, 1f, num4); return Color.HSVToRGB(num, num2, Mathf.Clamp01(num5)); } if (fillAmount > 0.4f) { float num6 = Mathf.InverseLerp(0.55f, 0.4f, fillAmount); Color val = Color.HSVToRGB(num, num2, 1f); return Color.Lerp(val, Color.red, num6); } return Color.red; } num3 = Mathf.Lerp(0.5f, num3, fillAmount); return Color.HSVToRGB(num, num2, num3); } internal static Color GetWeightColor(float normalizedWeight) { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) Color val = default(Color); ColorUtility.TryParseHtmlString(Plugins.ConfigEntries.WeightStarterColor.Value, ref val); Color val2 = default(Color); ((Color)(ref val2))..ctor(1f, 0f, 0f); Color val3 = default(Color); ((Color)(ref val3))..ctor(0.5f, 0f, 0f); if (normalizedWeight <= 0.5f) { float num = normalizedWeight / 0.5f; return Color.Lerp(val, val2, num); } float num2 = (normalizedWeight - 0.5f) / 0.5f; return Color.Lerp(val2, val3, num2); } } internal static class InventoryFrames { internal static Image[] allFrames; internal static Enums.SlotEnums CurrentSlotColorMode { get; private set; } = Enums.SlotEnums.None; internal static Color CurrentGradientStartColor { get; private set; } = Color.white; internal static Color CurrentGradientEndColor { get; private set; } = Color.white; internal static void SetSlotColors() { //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0134: 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_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)HUDManager.Instance == (Object)null || HUDManager.Instance.itemSlotIconFrames == null) { return; } Image[] itemSlotIconFrames = HUDManager.Instance.itemSlotIconFrames; GameObject val = ((!ModCompats.IsNiceChatPresent) ? GameObject.Find("Systems/UI/Canvas/IngamePlayerHUD/BottomLeftCorner") : GameObject.Find("Systems/UI/Canvas/IngamePlayerHUD/BottomLeftCorner/taffyko.NiceChat.ChatContainer")); if ((Object)(object)val == (Object)null) { Debug.LogWarning((object)"InventoryFrames: BottomLeftCorner not found."); allFrames = itemSlotIconFrames; return; } Transform val2 = val.transform.Find("Image"); if ((Object)(object)val2 == (Object)null) { Debug.LogWarning((object)"InventoryFrames: Image transform not found under BottomLeftCorner."); allFrames = itemSlotIconFrames; return; } Image component = ((Component)val2).GetComponent<Image>(); if ((Object)(object)component == (Object)null) { Debug.LogWarning((object)"InventoryFrames: Image component not found."); allFrames = itemSlotIconFrames; return; } Image[] array = (Image[])(object)new Image[itemSlotIconFrames.Length + 1]; for (int i = 0; i < itemSlotIconFrames.Length; i++) { array[i] = itemSlotIconFrames[i]; } array[itemSlotIconFrames.Length] = component; allFrames = array; Color val3 = default(Color); Color val4 = default(Color); if (HUDUtils.HasCustomGradient(Plugins.ConfigEntries.GradientColorA.Value, Plugins.ConfigEntries.GradientColorB.Value) && ColorUtility.TryParseHtmlString(Plugins.ConfigEntries.GradientColorA.Value, ref val3) && ColorUtility.TryParseHtmlString(Plugins.ConfigEntries.GradientColorB.Value, ref val4)) { CurrentGradientStartColor = val3; CurrentGradientEndColor = val4; HUDUtils.ApplyWavyGradient(allFrames, val3, val4); HUDUtils.ApplyCompassWavyGradient(val3, val4); return; } CurrentSlotColorMode = Plugins.ConfigEntries.SlotRainbowColor.Value; switch (CurrentSlotColorMode) { case Enums.SlotEnums.Rainbow: HUDUtils.ApplyRainbow(allFrames); HUDUtils.ApplyCompassRainbow(); return; case Enums.SlotEnums.Summer: CurrentGradientStartColor = Enums.solarFlare; CurrentGradientEndColor = Enums.moltenCore; HUDUtils.ApplyWavyGradient(allFrames, CurrentGradientStartColor, CurrentGradientEndColor); CompassController.SetCompassWavyGradient(); return; case Enums.SlotEnums.Winter: CurrentGradientStartColor = Enums.skyWave; CurrentGradientEndColor = Enums.moonlitMist; HUDUtils.ApplyWavyGradient(allFrames, Enums.skyWave, Enums.moonlitMist); CompassController.SetCompassWavyGradient(); return; case Enums.SlotEnums.Vaporwave: CurrentGradientStartColor = Enums.pinkPrism; CurrentGradientEndColor = Enums.aquaPulse; HUDUtils.ApplyWavyGradient(allFrames, Enums.pinkPrism, Enums.aquaPulse); CompassController.SetCompassWavyGradient(); return; case Enums.SlotEnums.Deepmint: CurrentGradientStartColor = Enums.mintWave; CurrentGradientEndColor = Enums.deepTeal; HUDUtils.ApplyWavyGradient(allFrames, Enums.mintWave, Enums.deepTeal); CompassController.SetCompassWavyGradient(); return; case Enums.SlotEnums.Radioactive: CurrentGradientStartColor = Enums.neonLime; CurrentGradientEndColor = Enums.lemonGlow; HUDUtils.ApplyWavyGradient(allFrames, Enums.neonLime, Enums.lemonGlow); CompassController.SetCompassWavyGradient(); return; case Enums.SlotEnums.TideEmber: CurrentGradientStartColor = Enums.crimsonSpark; CurrentGradientEndColor = Enums.deepOcean; HUDUtils.ApplyWavyGradient(allFrames, Enums.crimsonSpark, Enums.deepOcean); CompassController.SetCompassWavyGradient(); return; } Color slotColor = ConfigHelper.GetSlotColor(); Image[] array2 = allFrames; foreach (Image val5 in array2) { if ((Object)(object)val5 != (Object)null) { ((Graphic)val5).color = slotColor; } } CompassController.SetCompassColor(slotColor); } internal static void HandsFull() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) string value = Plugins.ConfigEntries.HandsFullColor.Value; Color color = default(Color); ColorUtility.TryParseHtmlString(value, ref color); ((Graphic)HUDManager.Instance.holdingTwoHandedItem).color = color; } } internal class LethalHUDMono : MonoBehaviour { private bool togglePressed; private HUDManager hud; private Keyboard keyboard; private void Awake() { hud = HUDManager.Instance; keyboard = Keyboard.current; } private void Update() { if (keyboard != null && ((ButtonControl)keyboard.numpad5Key).wasPressedThisFrame) { togglePressed = !togglePressed; HUDManager obj = hud; if (obj != null) { obj.HideHUD(togglePressed); } } } private void LateUpdate() { InventoryFrames.SetSlotColors(); CompassController.SoftMaskStuff(); ChatController.ColorChatInputField(HUDManager.Instance.chatTextField, Time.time * 0.25f); if (Plugins.ConfigEntries.WeightCounterBoolean.Value) { WeightController.RecolorWeightText(); } if (ModCompats.IsGoodItemScanPresent && Plugins.ConfigEntries.ScanNodeFade.Value) { ScanNodeController.UpdateGoodItemScanNodes(); } if (ModCompats.IsBetterScanVisionPresent) { BetterScanVisionProxy.OverrideNightVisionColor(); } } } public static class PlayerHPDisplay { private static TextMeshProUGUI hpText; private static PlayerControllerB localPlayer; private static float shakeTimer = 0f; private static readonly float shakeDuration = 0.3f; private static readonly float hitShakeIntensity = 5f; private static readonly float criticalMaxShakeIntensity = 1.5f; private static readonly float sizeBump = 1.2f; private static readonly float sizeLerpSpeed = 3f; private static Vector2 basePosition; private static float baseFontSize; private static Color fullHPColor = Color.green; private static Color midHPColor = new Color(1f, 0.3f, 0.3f); private static Color lowHPColor = new Color(0.6f, 0f, 0f); public static void Init() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) if (Plugins.ConfigEntries.HealthIndicator.Value) { HUDManager instance = HUDManager.Instance; if (!((Object)(object)hpText != (Object)null)) { localPlayer = GameNetworkManager.Instance.localPlayerController; GameObject val = new GameObject("PlayerHPDisplay"); GameObject val2 = GameObject.Find("Systems/UI/Canvas/IngamePlayerHUD/TopLeftCorner/"); val.transform.SetParent(val2.transform, false); hpText = val.AddComponent<TextMeshProUGUI>(); ((TMP_Text)hpText).font = ((TMP_Text)instance.HUDQuotaNumerator).font; ((TMP_Text)hpText).fontSize = 24f; ((TMP_Text)hpText).alignment = (TextAlignmentOptions)513; ((Graphic)hpText).color = (Plugins.ConfigEntries.HealthStarterColor.Value ? ConfigHelper.GetSlotColor() : fullHPColor); ((TMP_Text)hpText).enableVertexGradient = false; ((TMP_Text)hpText).enableWordWrapping = false; ((TMP_Text)hpText).enableKerning = false; ((TMP_Text)hpText).fontSharedMaterial.SetFloat(ShaderUtilities.ID_OutlineWidth, 0f); ((TMP_Text)hpText).fontSharedMaterial.SetFloat(ShaderUtilities.ID_GlowPower, 0f); RectTransform rectTransform = ((TMP_Text)hpText).rectTransform; rectTransform.anchoredPosition = new Vector2(Plugins.ConfigEntries.HPIndicatorX.Value, Plugins.ConfigEntries.HPIndicatorY.Value); rectTransform.sizeDelta = new Vector2(200f, 50f); basePosition = rectTransform.anchoredPosition; baseFontSize = ((TMP_Text)hpText).fontSize; } } } public static void UpdateNumber() { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: 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_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)hpText == (Object)null) { return; } if ((Object)(object)localPlayer == (Object)null) { localPlayer = GameNetworkManager.Instance.localPlayerController; } if (!((Object)(object)localPlayer == (Object)null)) { basePosition = new Vector2(Plugins.ConfigEntries.HPIndicatorX.Value, Plugins.ConfigEntries.HPIndicatorY.Value); int health = localPlayer.health; ((TMP_Text)hpText).text = $"{health}"; float num = 0f; if (shakeTimer > 0f) { num = hitShakeIntensity; shakeTimer -= Time.deltaTime; } else if (health < 20) { num = criticalMaxShakeIntensity * (float)(20 - health) / 20f; } RectTransform rectTransform = ((TMP_Text)hpText).rectTransform; rectTransform.anchoredPosition = basePosition + Random.insideUnitCircle * num; float num2 = baseFontSize; if (shakeTimer > 0f) { num2 = baseFontSize * sizeBump; } else if (health < 20) { num2 = baseFontSize * (1f + 0.1f * (float)(20 - health) / 20f); } ((TMP_Text)hpText).fontSize = Mathf.Lerp(((TMP_Text)hpText).fontSize, num2, Time.deltaTime * sizeLerpSpeed); if (Plugins.ConfigEntries.HealthStarterColor.Value && health >= 30) { ((Graphic)hpText).color = ConfigHelper.GetSlotColor(); } else if (health >= 30) { ((Graphic)hpText).color = fullHPColor; } else if (health >= 20) { float num3 = ((float)health - 20f) / 10f; ((Graphic)hpText).color = Color.Lerp(midHPColor, lowHPColor, num3); } else { float num4 = (float)health / 20f; ((Graphic)hpText).color = Color.Lerp(lowHPColor, midHPColor, num4); } } } public static void ShakeOnHit() { shakeTimer = shakeDuration; } } internal static class SprintMeter { internal const string PlayerPrefsKey = "SprintMeterLastMode"; internal static void UpdateSprintMeterColor() { PlayerControllerB val = StartOfRound.Instance?.localPlayerController; if ((Object)(object)val?.sprintMeterUI == (Object)null) { return; } string @string = PlayerPrefs.GetString("SprintMeterLastMode", "Solid"); if (!(@string == "Solid")) { if (@string == "Shades") { ApplyShadesMode(val); } else { ApplyGradientMode(val); } } else { ApplySolidMode(val); } } private static void ApplyGradientMode(PlayerControllerB player) { //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_0021: 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_0028: 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) Color baseColor = HUDUtils.ParseHexColor(Plugins.ConfigEntries.SprintMeterColorGradient.Value); float fillAmount = player.sprintMeterUI.fillAmount; Color gradientColor = HUDUtils.GetGradientColor(baseColor, fillAmount); ((Graphic)player.sprintMeterUI).color = gradientColor; } private static void ApplySolidMode(PlayerControllerB player) { //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_001b: Unknown result type (might be due to invalid IL or missing references) Color color = HUDUtils.ParseHexColor(Plugins.ConfigEntries.SprintMeterColorSolid.Value); ((Graphic)player.sprintMeterUI).color = color; } private static void ApplyShadesMode(PlayerControllerB player) { //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_0021: 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_0028: 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) Color baseColor = HUDUtils.ParseHexColor(Plugins.ConfigEntries.SprintMeterColorShades.Value); float fillAmount = player.sprintMeterUI.fillAmount; Color shadeColor = HUDUtils.GetShadeColor(baseColor, fillAmount); ((Graphic)player.sprintMeterUI).color = shadeColor; } } internal static class WeightController { internal static float ConvertWeight(float weightInLbs) { return Plugins.ConfigEntries.WeightUnitConfig.Value switch { Enums.WeightUnit.Pounds => weightInLbs, Enums.WeightUnit.Kilograms => weightInLbs * 0.453592f, Enums.WeightUnit.Manuls => weightInLbs / 9.9f, _ => weightInLbs, }; } internal static string GetUnitString() { return Plugins.ConfigEntries.WeightUnitConfig.Value switch { Enums.WeightUnit.Pounds => "lb", Enums.WeightUnit.Kilograms => "kg", Enums.WeightUnit.Manuls => "manuls", _ => "lb", }; } internal static void RecolorWeightText() { //IL_00a9: 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_00b6: Unknown result type (might be due to invalid IL or missing references) HUDManager instance = HUDManager.Instance; if (!((Object)(object)instance == (Object)null) && !((Object)(object)instance.weightCounter == (Object)null)) { string text = ((TMP_Text)instance.weightCounter).text; string[] array = text.Split(' '); if (array.Length >= 2 && float.TryParse(array[0], out var result)) { string text2 = array[1].Split('\n')[0].ToLower().Trim(); float num = ((text2 == "manuls") ? 13.131313f : ((!(text2 == "kg")) ? 130f : 58.96696f)); float num2 = num; float normalizedWeight = Mathf.Clamp01(result / num2); Color weightColor = HUDUtils.GetWeightColor(normalizedWeight); ((Graphic)instance.weightCounter).color = weightColor; } } } private static string GetManulAsciiTired() { return " /\\_/\\ \n( -.- )\n z z z"; } private static string GetManulAsciiLight() { return " /\\_/\\ \n( o.o )\n > ^ < "; } private static string GetManulAsciiOverloaded() { return " /\\_/\\ \n( x_x )\n ~~~ "; } private static string GetManulAsciiByWeight(float manulsCount) { if (manulsCount < 2f) { return GetManulAsciiTired(); } if (manulsCount < 9f) { return GetManulAsciiLight(); } return GetManulAsciiOverloaded(); } internal static void UpdateWeightDisplay() { //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) HUDManager instance = HUDManager.Instance; if (!((Object)(object)instance == (Object)null) && !((Object)(object)instance.weightCounter == (Object)null) && !((Object)(object)instance.weightCounterAnimator == (Object)null)) { float carryWeight = GameNetworkManager.Instance.localPlayerController.carryWeight; int num = Mathf.RoundToInt(Mathf.Clamp(carryWeight - 1f, 0f, 100f) * 105f); instance.weightCounterAnimator.SetFloat("weight", (float)num / 130f); float num2 = ConvertWeight(num); string unitString = GetUnitString(); float normalizedWeight = Mathf.Clamp01(num2 / Plugins.ConfigEntries.WeightUnitConfig.Value switch { Enums.WeightUnit.Pounds => 130f, Enums.WeightUnit.Kilograms => 58.96696f, Enums.WeightUnit.Manuls => 13.131313f, _ => 130f, }); Color weightColor = HUDUtils.GetWeightColor(normalizedWeight); if (Plugins.ConfigEntries.WeightUnitConfig.Value == Enums.WeightUnit.Manuls) { ((TMP_Text)instance.weightCounter).text = $"{num2:F0} manuls\n{GetManulAsciiByWeight(num2)}"; ((Graphic)instance.weightCounter).color = weightColor; } else { ((TMP_Text)instance.weightCounter).text = $"{num2:F0} {unitString}"; ((Graphic)instance.weightCounter).color = weightColor; } } } } } namespace LethalHUD.Configs { public class ConfigEntries { internal DateTime _lastScanColorChange = DateTime.MinValue; internal DateTime _lastUnifyMostColorsChange = DateTime.MinValue; internal DateTime _lastSlotColorChange = DateTime.MinValue; internal DateTime _lastLocalNameColorChange = DateTime.MinValue; private const string DefaultMainColor = "#000CFF"; private const string DefaultSlotColor = "#3226B4"; private const string DefaultCompassColor = "#2C265B"; public static ConfigFile ConfigFile { get; private set; } public ConfigEntry<string> UnifyMostColors { get; private set; } public ConfigEntry<bool> HoldScan { get; private set; } public ConfigEntry<bool> FadeOut { get; private set; } public ConfigEntry<bool> RecolorScanLines { get; private set; } public ConfigEntry<float> Alpha { get; private set; } public ConfigEntry<float> DirtIntensity { get; private set; } public ConfigEntry<string> ScanColor { get; private set; } public ConfigEntry<float> VignetteIntensity { get; private set; } public ConfigEntry<Enums.ScanLines> SelectedScanlineMode { get; private set; } public ConfigEntry<string> SlotColor { get; private set; } public ConfigEntry<Enums.SlotEnums> SlotRainbowColor { get; private set; } public ConfigEntry<string> GradientColorA { get; private set; } public ConfigEntry<string> GradientColorB { get; private set; } public ConfigEntry<string> HandsFullColor { get; private set; } internal ConfigEntry<bool> ScanNodeFade { get; private set; } internal ConfigEntry<float> ScanNodeLifetime { get; private set; } internal ConfigEntry<float> ScanNodeFadeDuration { get; private set; } public ConfigEntry<bool> HealthIndicator { get; private set; } public ConfigEntry<bool> HealthStarterColor { get; private set; } public ConfigEntry<float> HPIndicatorX { get; private set; } public ConfigEntry<float> HPIndicatorY { get; private set; } public ConfigEntry<bool> SprintMeterBoolean { get; private set; } public ConfigEntry<string> SprintMeterColorGradient { get; private set; } public ConfigEntry<string> SprintMeterColorSolid { get; private set; } public ConfigEntry<string> SprintMeterColorShades { get; private set; } public ConfigEntry<bool> WeightCounterBoolean { get; private set; } public ConfigEntry<Enums.WeightUnit> WeightUnitConfig { get; private set; } public ConfigEntry<string> WeightStarterColor { get; private set; } public ConfigEntry<bool> CompassInvertMask { get; private set; } public ConfigEntry<bool> CompassInvertOutsides { get; private set; } public ConfigEntry<float> CompassAlpha { get; private set; } public ConfigEntry<bool> ColoredNames { get; private set; } public ConfigEntry<string> LocalNameColor { get; private set; } public ConfigEntry<string> GradientNameColorA { get; private set; } public ConfigEntry<string> GradientNameColorB { get; private set; } public ConfigEntry<bool> ShowFPSCounter { get; private set; } public ConfigEntry<bool> ShowPingCounter { get; private set; } public ConfigEntry<Enums.FPSPingLayout> MiscLayoutEnum { get; private set; } public ConfigEntry<float> FPSCounterX { get; private set; } public ConfigEntry<float> FPSCounterY { get; private set; } public ConfigEntries() { Setup(); ConfigHelper.ClearUnusedEntries(); } public void Setup() { ConfigHelper.SkipAutoGen(); UnifyMostColors = ConfigHelper.Bind(isHexColor: true, "Main", "Main Color", "#000CFF", "Allows you to change the scan and inventory frames colors in HEX format in a unified way, on reset they go back to default."); HoldScan = ConfigHelper.Bind("Scan", "Hold Scan Button", defaultValue: false, "Allows you to keep holding scan button."); FadeOut = ConfigHelper.Bind("Scan", "FadeOut", defaultValue: true, "Fade out effect for scan color."); RecolorScanLines = ConfigHelper.Bind("Scan", "RecolorScanLines", defaultValue: true, "Recolor the blue horizontal scan lines texture aswell."); SelectedScanlineMode = ConfigHelper.Bind("Scan", "Scanline", Enums.ScanLines.Default, "Select the scanline style."); DirtIntensity = ConfigHelper.Bind("Scan", "Scanline Intensity", 0f, "Set the scanline's intensity yourself. (Default value for vanilla: 352.08, others are: 100", requiresRestart: false, (AcceptableValueBase)(object)new AcceptableValueRange<float>(-500f, 500f)); ScanColor = ConfigHelper.Bind(isHexColor: true, "Scan", "ScanColor", "#000CFF", "Allows you to change the scan's color in HEX format."); Alpha = ConfigHelper.Bind("Scan", "Alpha", 0.26f, "Alpha / opacity.", requiresRestart: false, (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f)); VignetteIntensity = ConfigHelper.Bind("Scan", "VignetteIntensity", 0.46f, "Intensity of the vignette / borders effect during scan.", requiresRestart: false, (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f)); ScanNodeFade = ConfigHelper.Bind("ScanNodes", "FadeAway", defaultValue: true, "Allows you to apply fadeaway for scannodes."); ScanNodeLifetime = ConfigHelper.Bind("ScanNodes", "Lifetime", 3f, "Change how long it is visible before fading away.", requiresRestart: false, (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 10f)); ScanNodeFadeDuration = ConfigHelper.Bind("ScanNodes", "FadeDuration", 1f, "Change how long it takes to fade out.", requiresRestart: false, (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 5f)); SlotColor = ConfigHelper.Bind(isHexColor: true, "Inventory", "FrameColor", "#3226B4", "Allows you to change the inventoryslot colors."); SlotRainbowColor = ConfigHelper.Bind("Inventory", "RainbowFrames", Enums.SlotEnums.None, "If true, inventory slot frames are colored with a rainbow gradient."); GradientColorA = ConfigHelper.Bind(isHexColor: true, "Inventory", "GradientColorA", "#3226B4", "Start color for custom wavy gradient."); GradientColorB = ConfigHelper.Bind(isHexColor: true, "Inventory", "GradientColorB", "#3226B4", "End color for custom wavy gradient."); HandsFullColor = ConfigHelper.Bind(isHexColor: true, "Inventory", "HandsFullColor", "#3A00FF", "Change the color of the Hands Full text when holding a two handed item."); ColoredNames = ConfigHelper.Bind("Chat", "ColoredNames", defaultValue: false, "Enable colored player names in chat (In the future, currently its only client-sided -> only visible to others who also have this enabled)."); LocalNameColor = ConfigHelper.Bind(isHexColor: true, "Chat", "LocalNameColor", "#FF0000", "Change your name's (currently everyones) color in chat in HEX format."); GradientNameColorA = ConfigHelper.Bind(isHexColor: true, "Chat", "GradientNameColorA", "#FF0000", "Starting color for a gradient, if both left untouched LocalNameColor takes priority."); GradientNameColorB = ConfigHelper.Bind(isHexColor: true, "Chat", "GradientNameColorB", "#FF0000", "Ending color for a gradient, if both left untouched LocalNameColor takes priority."); HealthIndicator = ConfigHelper.Bind("Health/Stamina/Weight", "HealthIndicator", defaultValue: true, "Enable health points indicator."); HealthStarterColor = ConfigHelper.Bind("Health/Stamina/Weight", "HealthStarterColor", defaultValue: false, "Takes the color of the inventory slots as starter color."); HPIndicatorX = ConfigHelper.Bind("Health/Stamina/Weight", "HPIndicatorX", -295f, "X position of the HP Indicator counter on screen.", requiresRestart: false, (AcceptableValueBase)(object)new AcceptableValueRange<float>(-360f, 520f)); HPIndicatorY = ConfigHelper.Bind("Health/Stamina/Weight", "HPIndicatorY", 125f, "Y position of the HP Indicator counter on screen.", requiresRestart: false, (AcceptableValueBase)(object)new AcceptableValueRange<float>(-250f, 250f)); SprintMeterBoolean = ConfigHelper.Bind("Health/Stamina/Weight", "SprintMeterConfiguration", defaultValue: false, "Enable color configs for sprintmeter."); SprintMeterColorSolid = ConfigHelper.Bind(isHexColor: true, "Health/Stamina/Weight", "SprintMeterColorSolid", "#FF7600", "Fixed solid color for [SOLID] sprint meter mode."); SprintMeterColorGradient = ConfigHelper.Bind(isHexColor: true, "Health/Stamina/Weight", "SprintMeterColorGradient", "#FF7600", "Base color for [GRADIENT] sprint meter mode."); SprintMeterColorShades = ConfigHelper.Bind(isHexColor: true, "Health/Stamina/Weight", "SprintMeterColorShades", "#FF7600", "Base color for [SHADES] sprint meter mode."); WeightCounterBoolean = ConfigHelper.Bind("Health/Stamina/Weight", "WeightCounterConfiguration", defaultValue: false, "Enable configs for weightcounter."); WeightUnitConfig = ConfigHelper.Bind("Health/Stamina/Weight", "WeightUnit", Enums.WeightUnit.Pounds, "Select the weight unit."); WeightStarterColor = ConfigHelper.Bind(isHexColor: true, "Health/Stamina/Weight", "WeightColor", "#E55901", "The starting base color for weight display in hex format."); CompassInvertMask = ConfigHelper.Bind("Compass", "InvertMask", defaultValue: false, "Lets you invert the mask in the inside."); CompassInvertOutsides = ConfigHelper.Bind("Compass", "InvertOutsides", defaultValue: false, "Lets you invert the mask on the outside."); CompassAlpha = ConfigHelper.Bind("Compass", "Alpha", 1f, "Lets you change the alpha value of Compass.", requiresRestart: false, (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f)); ShowFPSCounter = ConfigHelper.Bind("Misc", "FPS Counter", defaultValue: false, "Enables an FPS counter."); ShowPingCounter = ConfigHelper.Bind("Misc", "Ping Counter", defaultValue: false, "Display the current network ping (ms) on the HUD."); MiscLayoutEnum = ConfigHelper.Bind("Misc", "Layout options", Enums.FPSPingLayout.Vertical, "Layout of FPS and Ping counters"); FPSCounterX = ConfigHelper.Bind("Misc", "Layout position X", 10f, "X position of the FPS counter on screen.", requiresRestart: false, (AcceptableValueBase)(object)new Acceptab