Decompiled source of LethalCheat v1.5.2
BepInEx/plugins/Acromata-TwoHandedMod-1.0.0/BepInEx/plugins/TwoHandedMod.dll
Decompiled 3 months agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using TwoHanded.Patches; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("TwoHanded")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("TwoHanded")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("4b54e22a-0014-42b8-b3c4-ee3db577c8bf")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace TwoHanded { [BepInPlugin("Acromata.TwoHanded", "Two Handed Mod", "1.0.0")] public class TwoHandedBase : BaseUnityPlugin { private const string modGUID = "Acromata.TwoHanded"; private const string modName = "Two Handed Mod"; private const string modVersion = "1.0.0"; private readonly Harmony harmony = new Harmony("Acromata.TwoHanded"); private static TwoHandedBase Instance; internal ManualLogSource logSource; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } logSource = Logger.CreateLogSource("Acromata.TwoHanded"); harmony.PatchAll(typeof(TwoHandedBase)); harmony.PatchAll(typeof(PlayerControllerBPatch)); } } } namespace TwoHanded.Patches { [HarmonyPatch(typeof(PlayerControllerB))] internal class PlayerControllerBPatch { [HarmonyPatch("BeginGrabObject")] [HarmonyPostfix] private static void UpdateBeginGrabObject(ref bool ___twoHanded) { ___twoHanded = false; } [HarmonyPatch("GrabObjectClientRpc")] [HarmonyPostfix] private static void UpdateGrabObjectClientRpc(ref bool ___twoHanded) { ___twoHanded = false; } [HarmonyPatch("SwitchToItemSlot")] [HarmonyPostfix] private static void UpdateSwitchToItemSlot(ref bool ___twoHanded) { ___twoHanded = false; } } }
BepInEx/plugins/AinaVT-LethalConfig-1.4.2/plugins/LethalConfig/LethalConfig.dll
Decompiled 3 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using LethalConfig.AutoConfig; using LethalConfig.ConfigItems; using LethalConfig.ConfigItems.Options; using LethalConfig.Mods; using LethalConfig.MonoBehaviours; using LethalConfig.MonoBehaviours.Components; using LethalConfig.MonoBehaviours.Managers; using LethalConfig.Utils; using Newtonsoft.Json; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.Serialization; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyVersion("0.0.0.0")] [CompilerGenerated] [EditorBrowsable(EditorBrowsableState.Never)] [GeneratedCode("Unity.MonoScriptGenerator.MonoScriptInfoGenerator", null)] internal class UnitySourceGeneratedAssemblyMonoScriptTypes_v1 { private struct MonoScriptData { public byte[] FilePathsData; public byte[] TypesData; public int TotalTypes; public int TotalFiles; public bool IsEditorOnly; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static MonoScriptData Get() { MonoScriptData result = default(MonoScriptData); result.FilePathsData = new byte[3877] { 0, 0, 0, 3, 0, 0, 0, 49, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 65, 117, 116, 111, 67, 111, 110, 102, 105, 103, 92, 65, 117, 116, 111, 67, 111, 110, 102, 105, 103, 71, 101, 110, 101, 114, 97, 116, 111, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 45, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 65, 117, 116, 111, 67, 111, 110, 102, 105, 103, 92, 67, 111, 110, 102, 105, 103, 69, 110, 116, 114, 121, 80, 97, 116, 104, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 45, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 92, 66, 97, 115, 101, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 53, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 92, 66, 111, 111, 108, 67, 104, 101, 99, 107, 66, 111, 120, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 53, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 92, 69, 110, 117, 109, 68, 114, 111, 112, 68, 111, 119, 110, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 56, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 92, 70, 108, 111, 97, 116, 73, 110, 112, 117, 116, 70, 105, 101, 108, 100, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 52, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 92, 70, 108, 111, 97, 116, 83, 108, 105, 100, 101, 114, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 56, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 92, 70, 108, 111, 97, 116, 83, 116, 101, 112, 83, 108, 105, 100, 101, 114, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 54, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 92, 71, 101, 110, 101, 114, 105, 99, 66, 117, 116, 116, 111, 110, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 54, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 92, 73, 110, 116, 73, 110, 112, 117, 116, 70, 105, 101, 108, 100, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 50, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 92, 73, 110, 116, 83, 108, 105, 100, 101, 114, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 50, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 92, 79, 112, 116, 105, 111, 110, 115, 92, 66, 97, 115, 101, 79, 112, 116, 105, 111, 110, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 55, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 92, 79, 112, 116, 105, 111, 110, 115, 92, 66, 97, 115, 101, 82, 97, 110, 103, 101, 79, 112, 116, 105, 111, 110, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 58, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 92, 79, 112, 116, 105, 111, 110, 115, 92, 66, 111, 111, 108, 67, 104, 101, 99, 107, 66, 111, 120, 79, 112, 116, 105, 111, 110, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 54, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 92, 79, 112, 116, 105, 111, 110, 115, 92, 67, 97, 110, 77, 111, 100, 105, 102, 121, 82, 101, 115, 117, 108, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 58, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 92, 79, 112, 116, 105, 111, 110, 115, 92, 69, 110, 117, 109, 68, 114, 111, 112, 68, 111, 119, 110, 79, 112, 116, 105, 111, 110, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 61, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 92, 79, 112, 116, 105, 111, 110, 115, 92, 70, 108, 111, 97, 116, 73, 110, 112, 117, 116, 70, 105, 101, 108, 100, 79, 112, 116, 105, 111, 110, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 57, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 92, 79, 112, 116, 105, 111, 110, 115, 92, 70, 108, 111, 97, 116, 83, 108, 105, 100, 101, 114, 79, 112, 116, 105, 111, 110, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 61, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 92, 79, 112, 116, 105, 111, 110, 115, 92, 70, 108, 111, 97, 116, 83, 116, 101, 112, 83, 108, 105, 100, 101, 114, 79, 112, 116, 105, 111, 110, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 59, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 92, 79, 112, 116, 105, 111, 110, 115, 92, 71, 101, 110, 101, 114, 105, 99, 66, 117, 116, 116, 111, 110, 79, 112, 116, 105, 111, 110, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 59, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 92, 79, 112, 116, 105, 111, 110, 115, 92, 73, 110, 116, 73, 110, 112, 117, 116, 70, 105, 101, 108, 100, 79, 112, 116, 105, 111, 110, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 55, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 92, 79, 112, 116, 105, 111, 110, 115, 92, 73, 110, 116, 83, 108, 105, 100, 101, 114, 79, 112, 116, 105, 111, 110, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 58, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 92, 79, 112, 116, 105, 111, 110, 115, 92, 84, 101, 120, 116, 68, 114, 111, 112, 68, 111, 119, 110, 79, 112, 116, 105, 111, 110, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 60, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 92, 79, 112, 116, 105, 111, 110, 115, 92, 84, 101, 120, 116, 73, 110, 112, 117, 116, 70, 105, 101, 108, 100, 79, 112, 116, 105, 111, 110, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 53, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 92, 84, 101, 120, 116, 68, 114, 111, 112, 68, 111, 119, 110, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 55, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 92, 84, 101, 120, 116, 73, 110, 112, 117, 116, 70, 105, 101, 108, 100, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 26, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 67, 111, 110, 102, 105, 103, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 38, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 77, 97, 110, 97, 103, 101, 114, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 37, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 80, 108, 117, 103, 105, 110, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 27, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 100, 115, 92, 77, 111, 100, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 31, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 100, 115, 92, 77, 111, 100, 73, 110, 102, 111, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 44, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 100, 115, 92, 84, 104, 117, 110, 100, 101, 114, 115, 116, 111, 114, 101, 77, 97, 110, 105, 102, 101, 115, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 67, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 67, 111, 109, 112, 111, 110, 101, 110, 116, 115, 92, 66, 111, 111, 108, 67, 104, 101, 99, 107, 66, 111, 120, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 67, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 67, 111, 109, 112, 111, 110, 101, 110, 116, 115, 92, 69, 110, 117, 109, 68, 114, 111, 112, 68, 111, 119, 110, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 70, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 67, 111, 109, 112, 111, 110, 101, 110, 116, 115, 92, 70, 108, 111, 97, 116, 73, 110, 112, 117, 116, 70, 105, 101, 108, 100, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 66, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 67, 111, 109, 112, 111, 110, 101, 110, 116, 115, 92, 70, 108, 111, 97, 116, 83, 108, 105, 100, 101, 114, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 70, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 67, 111, 109, 112, 111, 110, 101, 110, 116, 115, 92, 70, 108, 111, 97, 116, 83, 116, 101, 112, 83, 108, 105, 100, 101, 114, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 68, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 67, 111, 109, 112, 111, 110, 101, 110, 116, 115, 92, 71, 101, 110, 101, 114, 105, 99, 66, 117, 116, 116, 111, 110, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 68, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 67, 111, 109, 112, 111, 110, 101, 110, 116, 115, 92, 73, 110, 116, 73, 110, 112, 117, 116, 70, 105, 101, 108, 100, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 64, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 67, 111, 109, 112, 111, 110, 101, 110, 116, 115, 92, 73, 110, 116, 83, 108, 105, 100, 101, 114, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 64, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 67, 111, 109, 112, 111, 110, 101, 110, 116, 115, 92, 77, 111, 100, 67, 111, 110, 102, 105, 103, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 67, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 67, 111, 109, 112, 111, 110, 101, 110, 116, 115, 92, 84, 101, 120, 116, 68, 114, 111, 112, 68, 111, 119, 110, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 69, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 67, 111, 109, 112, 111, 110, 101, 110, 116, 115, 92, 84, 101, 120, 116, 73, 110, 112, 117, 116, 70, 105, 101, 108, 100, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 47, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 67, 111, 110, 102, 105, 103, 73, 110, 102, 111, 66, 111, 120, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 44, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 67, 111, 110, 102, 105, 103, 76, 105, 115, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 44, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 67, 111, 110, 102, 105, 103, 77, 101, 110, 117, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 56, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 67, 111, 110, 102, 105, 103, 77, 101, 110, 117, 78, 111, 116, 105, 102, 105, 99, 97, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 48, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 68, 101, 115, 99, 114, 105, 112, 116, 105, 111, 110, 66, 111, 120, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 65, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 67, 111, 110, 102, 105, 103, 77, 101, 110, 117, 65, 117, 100, 105, 111, 77, 97, 110, 97, 103, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 60, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 77, 97, 110, 97, 103, 101, 114, 115, 92, 67, 111, 110, 102, 105, 103, 77, 101, 110, 117, 77, 97, 110, 97, 103, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 44, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 77, 111, 100, 73, 110, 102, 111, 66, 111, 120, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 41, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 77, 111, 100, 76, 105, 115, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 45, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 77, 111, 100, 76, 105, 115, 116, 73, 116, 101, 109, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 47, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 83, 101, 99, 116, 105, 111, 110, 72, 101, 97, 100, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 41, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 84, 111, 111, 108, 116, 105, 112, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 47, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 84, 111, 111, 108, 116, 105, 112, 83, 121, 115, 116, 101, 109, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 48, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 84, 111, 111, 108, 116, 105, 112, 84, 114, 105, 103, 103, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 46, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 92, 86, 101, 114, 115, 105, 111, 110, 76, 97, 98, 101, 108, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 45, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 80, 97, 116, 99, 104, 101, 115, 92, 77, 101, 110, 117, 77, 97, 110, 97, 103, 101, 114, 80, 97, 116, 99, 104, 101, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 50, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 80, 97, 116, 99, 104, 101, 115, 92, 81, 117, 105, 99, 107, 77, 101, 110, 117, 77, 97, 110, 97, 103, 101, 114, 80, 97, 116, 99, 104, 101, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 43, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 85, 116, 105, 108, 115, 92, 65, 115, 115, 101, 109, 98, 108, 121, 69, 120, 116, 101, 110, 115, 105, 111, 110, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 31, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 85, 116, 105, 108, 115, 92, 65, 115, 115, 101, 116, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 33, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 85, 116, 105, 108, 115, 92, 76, 111, 103, 85, 116, 105, 108, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 35, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 85, 116, 105, 108, 115, 92, 77, 101, 110, 117, 115, 85, 116, 105, 108, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 34, 92, 65, 115, 115, 101, 116, 115, 92, 83, 99, 114, 105, 112, 116, 115, 92, 85, 116, 105, 108, 115, 92, 80, 97, 116, 104, 85, 116, 105, 108, 115, 46, 99, 115 }; result.TypesData = new byte[3566] { 0, 0, 0, 0, 43, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 65, 117, 116, 111, 67, 111, 110, 102, 105, 103, 124, 65, 117, 116, 111, 67, 111, 110, 102, 105, 103, 71, 101, 110, 101, 114, 97, 116, 111, 114, 0, 0, 0, 0, 58, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 65, 117, 116, 111, 67, 111, 110, 102, 105, 103, 46, 65, 117, 116, 111, 67, 111, 110, 102, 105, 103, 71, 101, 110, 101, 114, 97, 116, 111, 114, 124, 65, 117, 116, 111, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 0, 0, 0, 0, 66, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 65, 117, 116, 111, 67, 111, 110, 102, 105, 103, 46, 65, 117, 116, 111, 67, 111, 110, 102, 105, 103, 71, 101, 110, 101, 114, 97, 116, 111, 114, 124, 67, 111, 110, 102, 105, 103, 70, 105, 108, 101, 65, 115, 115, 101, 109, 98, 108, 121, 80, 97, 105, 114, 0, 0, 0, 0, 39, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 65, 117, 116, 111, 67, 111, 110, 102, 105, 103, 124, 67, 111, 110, 102, 105, 103, 69, 110, 116, 114, 121, 80, 97, 116, 104, 0, 0, 0, 0, 39, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 124, 66, 97, 115, 101, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 0, 0, 0, 0, 44, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 124, 66, 97, 115, 101, 86, 97, 108, 117, 101, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 0, 0, 0, 0, 47, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 124, 66, 111, 111, 108, 67, 104, 101, 99, 107, 66, 111, 120, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 0, 0, 0, 0, 47, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 124, 69, 110, 117, 109, 68, 114, 111, 112, 68, 111, 119, 110, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 0, 0, 0, 0, 50, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 124, 70, 108, 111, 97, 116, 73, 110, 112, 117, 116, 70, 105, 101, 108, 100, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 0, 0, 0, 0, 46, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 124, 70, 108, 111, 97, 116, 83, 108, 105, 100, 101, 114, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 0, 0, 0, 0, 50, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 124, 70, 108, 111, 97, 116, 83, 116, 101, 112, 83, 108, 105, 100, 101, 114, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 0, 0, 0, 0, 48, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 124, 71, 101, 110, 101, 114, 105, 99, 66, 117, 116, 116, 111, 110, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 0, 0, 0, 0, 48, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 124, 73, 110, 116, 73, 110, 112, 117, 116, 70, 105, 101, 108, 100, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 0, 0, 0, 0, 44, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 124, 73, 110, 116, 83, 108, 105, 100, 101, 114, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 0, 0, 0, 0, 44, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 46, 79, 112, 116, 105, 111, 110, 115, 124, 66, 97, 115, 101, 79, 112, 116, 105, 111, 110, 115, 0, 0, 0, 0, 49, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 46, 79, 112, 116, 105, 111, 110, 115, 124, 66, 97, 115, 101, 82, 97, 110, 103, 101, 79, 112, 116, 105, 111, 110, 115, 0, 0, 0, 0, 52, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 46, 79, 112, 116, 105, 111, 110, 115, 124, 66, 111, 111, 108, 67, 104, 101, 99, 107, 66, 111, 120, 79, 112, 116, 105, 111, 110, 115, 0, 0, 0, 0, 48, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 46, 79, 112, 116, 105, 111, 110, 115, 124, 67, 97, 110, 77, 111, 100, 105, 102, 121, 82, 101, 115, 117, 108, 116, 0, 0, 0, 0, 52, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 46, 79, 112, 116, 105, 111, 110, 115, 124, 69, 110, 117, 109, 68, 114, 111, 112, 68, 111, 119, 110, 79, 112, 116, 105, 111, 110, 115, 0, 0, 0, 0, 55, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 46, 79, 112, 116, 105, 111, 110, 115, 124, 70, 108, 111, 97, 116, 73, 110, 112, 117, 116, 70, 105, 101, 108, 100, 79, 112, 116, 105, 111, 110, 115, 0, 0, 0, 0, 51, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 46, 79, 112, 116, 105, 111, 110, 115, 124, 70, 108, 111, 97, 116, 83, 108, 105, 100, 101, 114, 79, 112, 116, 105, 111, 110, 115, 0, 0, 0, 0, 55, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 46, 79, 112, 116, 105, 111, 110, 115, 124, 70, 108, 111, 97, 116, 83, 116, 101, 112, 83, 108, 105, 100, 101, 114, 79, 112, 116, 105, 111, 110, 115, 0, 0, 0, 0, 53, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 46, 79, 112, 116, 105, 111, 110, 115, 124, 71, 101, 110, 101, 114, 105, 99, 66, 117, 116, 116, 111, 110, 79, 112, 116, 105, 111, 110, 115, 0, 0, 0, 0, 53, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 46, 79, 112, 116, 105, 111, 110, 115, 124, 73, 110, 116, 73, 110, 112, 117, 116, 70, 105, 101, 108, 100, 79, 112, 116, 105, 111, 110, 115, 0, 0, 0, 0, 49, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 46, 79, 112, 116, 105, 111, 110, 115, 124, 73, 110, 116, 83, 108, 105, 100, 101, 114, 79, 112, 116, 105, 111, 110, 115, 0, 0, 0, 0, 52, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 46, 79, 112, 116, 105, 111, 110, 115, 124, 84, 101, 120, 116, 68, 114, 111, 112, 68, 111, 119, 110, 79, 112, 116, 105, 111, 110, 115, 0, 0, 0, 0, 54, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 46, 79, 112, 116, 105, 111, 110, 115, 124, 84, 101, 120, 116, 73, 110, 112, 117, 116, 70, 105, 101, 108, 100, 79, 112, 116, 105, 111, 110, 115, 0, 0, 0, 0, 47, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 124, 84, 101, 120, 116, 68, 114, 111, 112, 68, 111, 119, 110, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 0, 0, 0, 0, 49, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 115, 124, 84, 101, 120, 116, 73, 110, 112, 117, 116, 70, 105, 101, 108, 100, 67, 111, 110, 102, 105, 103, 73, 116, 101, 109, 0, 0, 0, 0, 20, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 124, 67, 111, 110, 102, 105, 103, 115, 0, 0, 0, 0, 32, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 124, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 77, 97, 110, 97, 103, 101, 114, 0, 0, 0, 0, 23, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 124, 80, 108, 117, 103, 105, 110, 73, 110, 102, 111, 0, 0, 0, 0, 31, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 124, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 80, 108, 117, 103, 105, 110, 0, 0, 0, 0, 21, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 100, 115, 124, 77, 111, 100, 0, 0, 0, 0, 25, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 100, 115, 124, 77, 111, 100, 73, 110, 102, 111, 0, 0, 0, 0, 38, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 100, 115, 124, 84, 104, 117, 110, 100, 101, 114, 115, 116, 111, 114, 101, 77, 97, 110, 105, 102, 101, 115, 116, 0, 0, 0, 0, 61, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 46, 67, 111, 109, 112, 111, 110, 101, 110, 116, 115, 124, 66, 111, 111, 108, 67, 104, 101, 99, 107, 66, 111, 120, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 61, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 46, 67, 111, 109, 112, 111, 110, 101, 110, 116, 115, 124, 69, 110, 117, 109, 68, 114, 111, 112, 68, 111, 119, 110, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 64, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 46, 67, 111, 109, 112, 111, 110, 101, 110, 116, 115, 124, 70, 108, 111, 97, 116, 73, 110, 112, 117, 116, 70, 105, 101, 108, 100, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 60, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 46, 67, 111, 109, 112, 111, 110, 101, 110, 116, 115, 124, 70, 108, 111, 97, 116, 83, 108, 105, 100, 101, 114, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 64, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 46, 67, 111, 109, 112, 111, 110, 101, 110, 116, 115, 124, 70, 108, 111, 97, 116, 83, 116, 101, 112, 83, 108, 105, 100, 101, 114, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 62, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 46, 67, 111, 109, 112, 111, 110, 101, 110, 116, 115, 124, 71, 101, 110, 101, 114, 105, 99, 66, 117, 116, 116, 111, 110, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 62, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 46, 67, 111, 109, 112, 111, 110, 101, 110, 116, 115, 124, 73, 110, 116, 73, 110, 112, 117, 116, 70, 105, 101, 108, 100, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 58, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 46, 67, 111, 109, 112, 111, 110, 101, 110, 116, 115, 124, 73, 110, 116, 83, 108, 105, 100, 101, 114, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 1, 0, 0, 0, 58, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 46, 67, 111, 109, 112, 111, 110, 101, 110, 116, 115, 124, 77, 111, 100, 67, 111, 110, 102, 105, 103, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 1, 0, 0, 0, 58, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 46, 67, 111, 109, 112, 111, 110, 101, 110, 116, 115, 124, 77, 111, 100, 67, 111, 110, 102, 105, 103, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 61, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 46, 67, 111, 109, 112, 111, 110, 101, 110, 116, 115, 124, 84, 101, 120, 116, 68, 114, 111, 112, 68, 111, 119, 110, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 63, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 46, 67, 111, 109, 112, 111, 110, 101, 110, 116, 115, 124, 84, 101, 120, 116, 73, 110, 112, 117, 116, 70, 105, 101, 108, 100, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 41, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 124, 67, 111, 110, 102, 105, 103, 73, 110, 102, 111, 66, 111, 120, 0, 0, 0, 0, 38, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 124, 67, 111, 110, 102, 105, 103, 76, 105, 115, 116, 0, 0, 0, 0, 38, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 124, 67, 111, 110, 102, 105, 103, 77, 101, 110, 117, 0, 0, 0, 0, 50, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 124, 67, 111, 110, 102, 105, 103, 77, 101, 110, 117, 78, 111, 116, 105, 102, 105, 99, 97, 116, 105, 111, 110, 0, 0, 0, 0, 42, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 124, 68, 101, 115, 99, 114, 105, 112, 116, 105, 111, 110, 66, 111, 120, 0, 0, 0, 0, 59, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 46, 77, 97, 110, 97, 103, 101, 114, 115, 124, 67, 111, 110, 102, 105, 103, 77, 101, 110, 117, 65, 117, 100, 105, 111, 77, 97, 110, 97, 103, 101, 114, 0, 0, 0, 0, 54, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 46, 77, 97, 110, 97, 103, 101, 114, 115, 124, 67, 111, 110, 102, 105, 103, 77, 101, 110, 117, 77, 97, 110, 97, 103, 101, 114, 0, 0, 0, 0, 38, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 124, 77, 111, 100, 73, 110, 102, 111, 66, 111, 120, 0, 0, 0, 0, 35, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 124, 77, 111, 100, 76, 105, 115, 116, 0, 0, 0, 0, 39, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 124, 77, 111, 100, 76, 105, 115, 116, 73, 116, 101, 109, 0, 0, 0, 0, 41, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 124, 83, 101, 99, 116, 105, 111, 110, 72, 101, 97, 100, 101, 114, 0, 0, 0, 0, 35, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 124, 84, 111, 111, 108, 116, 105, 112, 0, 0, 0, 0, 41, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 124, 84, 111, 111, 108, 116, 105, 112, 83, 121, 115, 116, 101, 109, 0, 0, 0, 0, 42, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 124, 84, 111, 111, 108, 116, 105, 112, 84, 114, 105, 103, 103, 101, 114, 0, 0, 0, 0, 40, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 77, 111, 110, 111, 66, 101, 104, 97, 118, 105, 111, 117, 114, 115, 124, 86, 101, 114, 115, 105, 111, 110, 76, 97, 98, 101, 108, 0, 0, 0, 0, 39, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 80, 97, 116, 99, 104, 101, 115, 124, 77, 101, 110, 117, 77, 97, 110, 97, 103, 101, 114, 80, 97, 116, 99, 104, 101, 115, 0, 0, 0, 0, 44, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 80, 97, 116, 99, 104, 101, 115, 124, 81, 117, 105, 99, 107, 77, 101, 110, 117, 77, 97, 110, 97, 103, 101, 114, 80, 97, 116, 99, 104, 101, 115, 0, 0, 0, 0, 37, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 85, 116, 105, 108, 115, 124, 65, 115, 115, 101, 109, 98, 108, 121, 69, 120, 116, 101, 110, 115, 105, 111, 110, 115, 0, 0, 0, 0, 25, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 85, 116, 105, 108, 115, 124, 65, 115, 115, 101, 116, 115, 0, 0, 0, 0, 27, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 85, 116, 105, 108, 115, 124, 76, 111, 103, 85, 116, 105, 108, 115, 0, 0, 0, 0, 29, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 85, 116, 105, 108, 115, 124, 77, 101, 110, 117, 115, 85, 116, 105, 108, 115, 0, 0, 0, 0, 28, 76, 101, 116, 104, 97, 108, 67, 111, 110, 102, 105, 103, 46, 85, 116, 105, 108, 115, 124, 80, 97, 116, 104, 85, 116, 105, 108, 115 }; result.TotalFiles = 65; result.TotalTypes = 70; result.IsEditorOnly = false; return result; } } namespace LethalConfig { internal static class Configs { private enum TestEnum { None, First, Second } internal static ConfigEntry<bool> IsLethalConfigHidden { get; private set; } internal static void Initialize(ConfigFile config) { CreateConfigs(config); CreateExampleConfigs(config); } private static void CreateConfigs(ConfigFile config) { IsLethalConfigHidden = config.Bind<bool>("General", "Hide Lethal Config", false, "Hides the LethalConfig menu in the game. This setting will not show up in LethalConfig itself."); LethalConfigManager.SkipAutoGenFor((ConfigEntryBase)(object)IsLethalConfigHidden); } private static void CreateExampleConfigs(ConfigFile config) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Expected O, but got Unknown //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Expected O, but got Unknown ConfigEntry<int> configEntry = config.Bind<int>("Example", "Int Slider", 30, new ConfigDescription("This is an integer slider. You can also type a value in the input field to the right of the slider.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); ConfigEntry<float> configEntry2 = config.Bind<float>("Example", "Float Slider", 0f, new ConfigDescription("This is a float slider. You can also type a value in the input field to the right of the slider.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-1f, 1f), Array.Empty<object>())); ConfigEntry<float> configEntry3 = config.Bind<float>("Example", "Float Step Slider", 0f, new ConfigDescription("This is a float step slider. It set values in increments. You can also type a value in the input field to the right of the slider.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-1f, 1f), Array.Empty<object>())); ConfigEntry<bool> configEntry4 = config.Bind<bool>("Example", "Bool Checkbox", false, new ConfigDescription("This is a bool checkbox.", (AcceptableValueBase)null, Array.Empty<object>())); ConfigEntry<TestEnum> configEntry5 = config.Bind<TestEnum>("Example", "Enum Dropdown", TestEnum.None, new ConfigDescription("This is a enum dropdown.", (AcceptableValueBase)null, Array.Empty<object>())); ConfigEntry<string> configEntry6 = config.Bind<string>("Example", "Text Input", "Example", "This is a text input field. It can have a limit of characters too."); ConfigEntry<string> configEntry7 = config.Bind<string>("Example", "Multiline Text Input", "Example", "This is a text input field. It can have a limit of characters too."); ConfigEntry<string> configEntry8 = config.Bind<string>("Example", "Text Input Dropdown", "Two", new ConfigDescription("This is a text input with an acceptable value list.", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[3] { "One", "Two", "HL:Alyx" }), Array.Empty<object>())); ConfigEntry<int> configEntry9 = config.Bind<int>("Example", "Int Input", 50, "This is an integer input field."); ConfigEntry<float> configEntry10 = config.Bind<float>("Example", "Float Input", 0.5f, "This is a float input field."); LethalConfigManager.AddConfigItem(new IntSliderConfigItem(configEntry, requiresRestart: false)); LethalConfigManager.AddConfigItem(new FloatSliderConfigItem(configEntry2, requiresRestart: false)); LethalConfigManager.AddConfigItem(new FloatStepSliderConfigItem(configEntry3, new FloatStepSliderOptions { Step = 0.1f, RequiresRestart = false, Min = -1f, Max = 1f })); LethalConfigManager.AddConfigItem(new BoolCheckBoxConfigItem(configEntry4, requiresRestart: false)); LethalConfigManager.AddConfigItem(new EnumDropDownConfigItem<TestEnum>(configEntry5, requiresRestart: false)); LethalConfigManager.AddConfigItem(new TextInputFieldConfigItem(configEntry6, requiresRestart: false)); LethalConfigManager.AddConfigItem(new TextInputFieldConfigItem(configEntry7, new TextInputFieldOptions { NumberOfLines = 0, TrimText = true })); LethalConfigManager.AddConfigItem(new GenericButtonConfigItem("Example", "Button", "This is a test button with a callback", "Open", delegate { if (Object.op_Implicit((Object)(object)ConfigMenuManager.Instance)) { ConfigMenuManager.DisplayNotification("This is a test notification", "OK"); } })); LethalConfigManager.AddConfigItem(new IntInputFieldConfigItem(configEntry9, new IntInputFieldOptions { Max = 150 })); LethalConfigManager.AddConfigItem(new FloatInputFieldConfigItem(configEntry10, new FloatInputFieldOptions { Max = 2.5f })); LethalConfigManager.AddConfigItem(new TextDropDownConfigItem(configEntry8, new TextDropDownOptions { RequiresRestart = false })); } } public static class LethalConfigManager { private static readonly List<AutoConfigGenerator.ConfigFileAssemblyPair> CustomConfigFiles = new List<AutoConfigGenerator.ConfigFileAssemblyPair>(); private static bool _hasGeneratedMissingConfigs; internal static Dictionary<string, Mod> Mods { get; } = new Dictionary<string, Mod>(); private static Dictionary<Mod, Assembly> ModToAssemblyMap { get; } = new Dictionary<Mod, Assembly>(); internal static void AutoGenerateMissingConfigsIfNeeded() { if (_hasGeneratedMissingConfigs) { return; } Mod[] second = Mods.Values.ToArray(); IEnumerable<BaseConfigItem> existingConfigsFlat = Mods.SelectMany((KeyValuePair<string, Mod> kv) => kv.Value.ConfigItems); AutoConfigGenerator.AutoConfigItem[] array = AutoConfigGenerator.AutoGenerateConfigs(CustomConfigFiles.ToArray()); Dictionary<Mod, IEnumerable<BaseConfigItem>> dictionary = (from c in array group c.ConfigItem by ModForAssembly(c.Assembly) into kv where kv.Key != null select kv).SelectMany((IGrouping<Mod, BaseConfigItem> kv) => from c in kv.Select(delegate(BaseConfigItem c) { c.Owner = kv.Key; return c; }) where !kv.Key.EntriesToSkipAutoGen.Any((ConfigEntryPath path) => path.Matches(c)) where existingConfigsFlat.FirstOrDefault(c.IsSameConfig) == null group c by c.Owner).ToDictionary((IGrouping<Mod, BaseConfigItem> kv) => kv.Key, (IGrouping<Mod, BaseConfigItem> kv) => kv.Select((BaseConfigItem c) => c)); Mod[] array2 = dictionary.Keys.Except(second).ToArray(); Mod[] array3 = array2; foreach (Mod obj in array3) { obj.IsAutoGenerated = true; obj.ModInfo.Description += "\n*This mod entry was automatically generated as it does not use LethalConfig directly."; } foreach (KeyValuePair<Mod, IEnumerable<BaseConfigItem>> item in dictionary) { Assembly valueOrDefault = ModToAssemblyMap.GetValueOrDefault(item.Key); if (valueOrDefault == null) { continue; } foreach (BaseConfigItem item2 in item.Value) { AddConfigItemForAssembly(item2, valueOrDefault); } } LogUtils.LogInfo($"Generated {array2.Length} mod entries."); LogUtils.LogInfo($"Generated {array.Length} configs, of which {dictionary.SelectMany((KeyValuePair<Mod, IEnumerable<BaseConfigItem>> kv) => kv.Value).Count()} were missing and registered."); _hasGeneratedMissingConfigs = true; } public static void AddConfigItem(BaseConfigItem configItem) { if (AddConfigItemForAssembly(configItem, Assembly.GetCallingAssembly())) { LogUtils.LogInfo($"Registered config \"{configItem}\""); } } public static void AddConfigItem(BaseConfigItem configItem, Assembly assembly) { if (AddConfigItemForAssembly(configItem, assembly)) { LogUtils.LogInfo($"Registered config \"{configItem}\""); } } private static bool AddConfigItemForAssembly(BaseConfigItem configItem, Assembly assembly) { Mod mod = ModForAssembly(assembly); if (mod == null) { LogUtils.LogWarning("Mod for assembly not found."); return false; } configItem.Owner = mod; if (mod.ConfigItems.Any((BaseConfigItem c) => c.IsSameConfig(configItem))) { LogUtils.LogWarning($"Ignoring duplicated config \"{configItem}\""); return false; } mod.AddConfigItem(configItem); return true; } private static Mod ModForAssembly(Assembly assembly) { if (!assembly.TryGetModInfo(out var modInfo)) { return null; } if (Mods.TryGetValue(modInfo.Guid, out var value)) { return value; } Mod mod = new Mod(modInfo); Mods.Add(modInfo.Guid, mod); ModToAssemblyMap.Add(mod, assembly); return mod; } public static void SetModIcon(Sprite sprite) { if (!((Object)(object)sprite == (Object)null)) { Mod mod = ModForAssembly(Assembly.GetCallingAssembly()); if (mod != null) { mod.ModInfo.Icon = sprite; } } } public static void SetModDescription(string description) { if (description != null) { Mod mod = ModForAssembly(Assembly.GetCallingAssembly()); if (mod != null) { mod.ModInfo.Description = description; } } } public static void SkipAutoGenFor(string configSection) { ModForAssembly(Assembly.GetCallingAssembly())?.EntriesToSkipAutoGen.Add(new ConfigEntryPath(configSection, "*")); } public static void SkipAutoGenFor(ConfigEntryBase configEntryBase) { ModForAssembly(Assembly.GetCallingAssembly())?.EntriesToSkipAutoGen.Add(new ConfigEntryPath(configEntryBase.Definition.Section, configEntryBase.Definition.Key)); } public static void SkipAutoGen() { ModForAssembly(Assembly.GetCallingAssembly())?.EntriesToSkipAutoGen.Add(new ConfigEntryPath("*", "*")); } public static void QueueCustomConfigFileForAutoGeneration(ConfigFile configFile) { CustomConfigFiles.Add(new AutoConfigGenerator.ConfigFileAssemblyPair { ConfigFile = configFile, Assembly = Assembly.GetCallingAssembly() }); } } internal static class PluginInfo { public const string Guid = "ainavt.lc.lethalconfig"; public const string Name = "LethalConfig"; public const string Version = "1.4.2"; } [BepInPlugin("ainavt.lc.lethalconfig", "LethalConfig", "1.4.2")] internal class LethalConfigPlugin : BaseUnityPlugin { private static LethalConfigPlugin _instance; private static Harmony _harmony; private void Awake() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown if ((Object)(object)_instance == (Object)null) { _instance = this; } LogUtils.Init("ainavt.lc.lethalconfig"); Configs.Initialize(((BaseUnityPlugin)this).Config); if (Configs.IsLethalConfigHidden.Value) { LogUtils.LogInfo("LethalConfig is hidden and will not load."); return; } Assets.Init(); _harmony = new Harmony("ainavt.lc.lethalconfig"); _harmony.PatchAll(); LogUtils.LogInfo("LethalConfig loaded!"); } } } namespace LethalConfig.Utils { internal static class AssemblyExtensions { internal static bool TryGetModInfo(this Assembly assembly, out ModInfo modInfo) { modInfo = new ModInfo(); BepInPlugin val = assembly.FindPluginAttribute(); if (val == null) { return false; } modInfo.Name = val.Name; modInfo.Guid = val.GUID; modInfo.Version = val.Version.ToString(); return true; } private static BepInPlugin FindPluginAttribute(this Assembly assembly) { Type[] source; try { source = assembly.GetTypes(); } catch (ReflectionTypeLoadException ex) { source = ex.Types.Where((Type t) => t != null).ToArray(); } return source.Select((Type type) => ((MemberInfo)type).GetCustomAttribute<BepInPlugin>()).FirstOrDefault<BepInPlugin>((Func<BepInPlugin, bool>)((BepInPlugin plugin) => plugin != null)); } } internal static class Assets { private static AssetBundle _assetBundle; internal static GameObject ConfigMenuManagerPrefab; internal static GameObject ConfigMenuNotificationPrefab; internal static GameObject ConfigMenuPrefab; internal static GameObject ModListItemPrefab; internal static GameObject SectionHeaderPrefab; internal static GameObject IntSliderPrefab; internal static GameObject FloatSliderPrefab; internal static GameObject FloatStepSliderPrefab; internal static GameObject BoolCheckBoxPrefab; internal static GameObject EnumDropDownPrefab; internal static GameObject TextDropDownPrefab; internal static GameObject TextInputFieldPrefab; internal static GameObject IntInputFieldPrefab; internal static GameObject FloatInputFieldPrefab; internal static GameObject GenericButtonPrefab; internal static Sprite DefaultModIcon; internal static Sprite LethalConfigModIcon; internal static void Init() { _assetBundle = AssetBundle.LoadFromFile(PathUtils.PathForResourceInAssembly("ainavt_lethalconfig")); if ((Object)(object)_assetBundle == (Object)null) { LogUtils.LogError("Failed to load LethalConfig bundle."); return; } LoadAsset<GameObject>("prefabs/ConfigMenuManager.prefab", out ConfigMenuManagerPrefab); LoadAsset<GameObject>("prefabs/ConfigMenuNotification.prefab", out ConfigMenuNotificationPrefab); LoadAsset<GameObject>("prefabs/ConfigMenu.prefab", out ConfigMenuPrefab); LoadAsset<GameObject>("prefabs/ModListItem.prefab", out ModListItemPrefab); LoadAsset<GameObject>("prefabs/components/SectionHeader.prefab", out SectionHeaderPrefab); LoadAsset<GameObject>("prefabs/components/IntSliderItem.prefab", out IntSliderPrefab); LoadAsset<GameObject>("prefabs/components/FloatSliderItem.prefab", out FloatSliderPrefab); LoadAsset<GameObject>("prefabs/components/FloatStepSliderItem.prefab", out FloatStepSliderPrefab); LoadAsset<GameObject>("prefabs/components/BoolCheckBoxItem.prefab", out BoolCheckBoxPrefab); LoadAsset<GameObject>("prefabs/components/EnumDropDownItem.prefab", out EnumDropDownPrefab); LoadAsset<GameObject>("prefabs/components/TextDropDownItem.prefab", out TextDropDownPrefab); LoadAsset<GameObject>("prefabs/components/TextInputFieldItem.prefab", out TextInputFieldPrefab); LoadAsset<GameObject>("prefabs/components/IntInputFieldItem.prefab", out IntInputFieldPrefab); LoadAsset<GameObject>("prefabs/components/FloatInputFieldItem.prefab", out FloatInputFieldPrefab); LoadAsset<GameObject>("prefabs/components/GenericButtonItem.prefab", out GenericButtonPrefab); LoadAsset<Sprite>("sprite/unknown-icon.png", out DefaultModIcon); LoadAsset<Sprite>("icon.png", out LethalConfigModIcon); LogUtils.LogInfo("Finished loading assets."); } private static void LoadAsset<T>(string assetName, out T asset) where T : Object { string text = "Assets/" + assetName; asset = _assetBundle.LoadAsset<T>(text); if ((Object)(object)asset == (Object)null) { LogUtils.LogError("Failed to load asset (" + text + ")"); } } } internal static class LogUtils { private static ManualLogSource _logSource; public static void Init(string pluginGuid) { _logSource = Logger.CreateLogSource(pluginGuid); } public static void LogDebug(string message) { ManualLogSource logSource = _logSource; if (logSource != null) { logSource.LogDebug((object)message); } } public static void LogInfo(string message) { ManualLogSource logSource = _logSource; if (logSource != null) { logSource.LogInfo((object)message); } } public static void LogWarning(string message) { ManualLogSource logSource = _logSource; if (logSource != null) { logSource.LogWarning((object)message); } } public static void LogError(string message) { ManualLogSource logSource = _logSource; if (logSource != null) { logSource.LogError((object)message); } } public static void LogFatal(string message) { ManualLogSource logSource = _logSource; if (logSource != null) { logSource.LogFatal((object)message); } } } internal static class MenusUtils { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__0_0; public static Func<Button, GameObject> <>9__0_1; public static Func<GameObject, RectTransform> <>9__0_3; public static Func<RectTransform, float> <>9__0_4; public static Func<float, float, float> <>9__0_5; internal void <InjectMenu>b__0_0() { ConfigMenuManager.Instance.menuAudio.PlayConfirmSfx(); } internal GameObject <InjectMenu>b__0_1(Button b) { return ((Component)b).gameObject; } internal RectTransform <InjectMenu>b__0_3(GameObject b) { Transform transform = b.transform; return (RectTransform)(object)((transform is RectTransform) ? transform : null); } internal float <InjectMenu>b__0_4(RectTransform t) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return t.anchoredPosition.y; } internal float <InjectMenu>b__0_5(float y1, float y2) { return Mathf.Abs(y2 - y1); } } internal static void InjectMenu(Transform parentTransform, Transform mainButtonsTransform, GameObject quitButton) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Expected O, but got Unknown //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Expected O, but got Unknown //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) Object.Instantiate<GameObject>(Assets.ConfigMenuManagerPrefab, parentTransform, true).transform.localPosition = Vector3.zero; GameObject obj = Object.Instantiate<GameObject>(Assets.ConfigMenuPrefab, parentTransform, false); obj.transform.localPosition = Vector3.zero; obj.transform.localScale = Vector3.one; obj.transform.localRotation = Quaternion.identity; obj.SetActive(false); GameObject obj2 = Object.Instantiate<GameObject>(Assets.ConfigMenuNotificationPrefab, parentTransform, false); obj2.transform.localPosition = Vector3.zero; obj2.transform.localScale = Vector3.one; obj2.transform.localRotation = Quaternion.identity; obj2.SetActive(false); GameObject clonedButton = Object.Instantiate<GameObject>(quitButton, mainButtonsTransform); ((UnityEventBase)clonedButton.GetComponent<Button>().onClick).RemoveAllListeners(); clonedButton.GetComponent<Button>().onClick = new ButtonClickedEvent(); ((UnityEvent)clonedButton.GetComponent<Button>().onClick).AddListener(new UnityAction(ConfigMenuManager.ShowConfigMenu)); ButtonClickedEvent onClick = clonedButton.GetComponent<Button>().onClick; object obj3 = <>c.<>9__0_0; if (obj3 == null) { UnityAction val = delegate { ConfigMenuManager.Instance.menuAudio.PlayConfirmSfx(); }; <>c.<>9__0_0 = val; obj3 = (object)val; } ((UnityEvent)onClick).AddListener((UnityAction)obj3); ((TMP_Text)clonedButton.GetComponentInChildren<TextMeshProUGUI>()).text = "> LethalConfig"; List<GameObject> source = (from b in ((Component)mainButtonsTransform).GetComponentsInChildren<Button>() select ((Component)b).gameObject).ToList(); List<float> list = (from t in source.Where((GameObject b) => (Object)(object)b != (Object)(object)clonedButton).Select(delegate(GameObject b) { Transform transform = b.transform; return (RectTransform)(object)((transform is RectTransform) ? transform : null); }) select t.anchoredPosition.y).ToList(); float num = list.Zip(list.Skip(1), (float y1, float y2) => Mathf.Abs(y2 - y1)).Min(); foreach (GameObject item in source.Where((GameObject g) => (Object)(object)g != (Object)(object)quitButton)) { RectTransform component = item.GetComponent<RectTransform>(); component.anchoredPosition += new Vector2(0f, num); } clonedButton.GetComponent<RectTransform>().anchoredPosition = quitButton.GetComponent<RectTransform>().anchoredPosition + new Vector2(0f, num); } } internal static class PathUtils { public static string PathForResourceInAssembly(string resourceName, Assembly assembly = null) { return Path.Combine(Path.GetDirectoryName((assembly ?? Assembly.GetCallingAssembly()).Location), resourceName); } } } namespace LethalConfig.Patches { [HarmonyPatch(typeof(MenuManager))] internal class MenuManagerPatches { [HarmonyPatch("Start")] [HarmonyPostfix] public static void StartPostFix(MenuManager __instance) { ((MonoBehaviour)__instance).StartCoroutine(DelayedMainMenuInjection()); } private static IEnumerator DelayedMainMenuInjection() { yield return (object)new WaitForSeconds(0f); InjectToMainMenu(); } private static void InjectToMainMenu() { LogUtils.LogInfo("Injecting mod config menu into main menu..."); GameObject val = GameObject.Find("MenuContainer"); if (!Object.op_Implicit((Object)(object)val)) { return; } Transform val2 = val.transform.Find("MainButtons"); if (Object.op_Implicit((Object)(object)val2)) { Transform val3 = val2.Find("QuitButton"); if (Object.op_Implicit((Object)(object)val3)) { MenusUtils.InjectMenu(val.transform, val2, ((Component)val3).gameObject); } } } } [HarmonyPatch(typeof(QuickMenuManager))] internal class QuickMenuManagerPatches { [HarmonyPatch("CloseQuickMenuPanels")] [HarmonyPostfix] public static void CloseQuickMenuPanelsPostFix(QuickMenuManager __instance) { ConfigMenu componentInChildren = ((Component)__instance.menuContainer.transform).GetComponentInChildren<ConfigMenu>(true); if (Object.op_Implicit((Object)(object)componentInChildren)) { componentInChildren.Close(animated: false); } ConfigMenuNotification componentInChildren2 = ((Component)__instance.menuContainer.transform).GetComponentInChildren<ConfigMenuNotification>(true); if (Object.op_Implicit((Object)(object)componentInChildren2)) { componentInChildren2.Close(animated: false); } } [HarmonyPatch("Start")] [HarmonyPostfix] public static void StartPostFix(QuickMenuManager __instance) { LogUtils.LogInfo("Injecting mod config menu into quick menu..."); GameObject menuContainer = __instance.menuContainer; if (!Object.op_Implicit((Object)(object)menuContainer)) { return; } Transform val = menuContainer.transform.Find("MainButtons"); if (Object.op_Implicit((Object)(object)val)) { Transform val2 = val.Find("Quit"); if (Object.op_Implicit((Object)(object)val2)) { MenusUtils.InjectMenu(menuContainer.transform, val, ((Component)val2).gameObject); } } } } } namespace LethalConfig.MonoBehaviours { internal class ConfigInfoBox : MonoBehaviour { public TextMeshProUGUI configInfoText; public void SetConfigInfo(string configInfo) { ((TMP_Text)configInfoText).text = configInfo; } } internal class ConfigList : MonoBehaviour { public GameObject listContainerObject; public DescriptionBox descriptionBox; internal void LoadConfigsForMod(Mod mod) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) ClearConfigList(); foreach (IGrouping<string, BaseConfigItem> item in from c in mod.ConfigItems group c by c.Section) { GameObject obj = Object.Instantiate<GameObject>(Assets.SectionHeaderPrefab, listContainerObject.transform, true); obj.GetComponent<SectionHeader>().SetSectionName(item.Key); obj.transform.localPosition = Vector3.zero; obj.transform.localScale = Vector3.one; obj.transform.localRotation = Quaternion.identity; foreach (BaseConfigItem item2 in item) { GameObject val = item2.CreateGameObjectForConfig(); ModConfigController controller = val.GetComponent<ModConfigController>(); if (!controller.SetConfigItem(item2)) { Object.DestroyImmediate((Object)(object)val); return; } val.transform.SetParent(listContainerObject.transform); val.transform.localPosition = Vector3.zero; val.transform.localScale = Vector3.one; val.transform.localRotation = Quaternion.identity; controller.OnHoverEnter += delegate { descriptionBox.ShowConfigInfo(controller.GetDescription()); ConfigMenuManager.Instance.menuAudio.PlayHoverSfx(); }; } } } private void ClearConfigList() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) foreach (Transform item in listContainerObject.transform) { Object.Destroy((Object)(object)((Component)item).gameObject); } } } internal class ConfigMenu : MonoBehaviour { private static readonly int TriggerIdOpen = Animator.StringToHash("Open"); private static readonly int TriggerIdForceClose = Animator.StringToHash("ForceClose"); private static readonly int TriggerIdClose = Animator.StringToHash("Close"); public ConfigList configList; public Animator menuAnimator; private void Awake() { LethalConfigManager.AutoGenerateMissingConfigsIfNeeded(); } public void Open() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) AnimatorStateInfo currentAnimatorStateInfo = menuAnimator.GetCurrentAnimatorStateInfo(0); if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("ConfigMenuNormal") && !((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("ConfigMenuAppear")) { ((Component)this).gameObject.SetActive(true); menuAnimator.SetTrigger(TriggerIdOpen); ((Component)this).transform.SetAsLastSibling(); } } public void Close(bool animated = true) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) AnimatorStateInfo currentAnimatorStateInfo = menuAnimator.GetCurrentAnimatorStateInfo(0); if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("ConfigMenuClosed") || ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("ConfigMenuDisappear")) { return; } foreach (BaseConfigItem item in LethalConfigManager.Mods.SelectMany((KeyValuePair<string, Mod> m) => m.Value.ConfigItems)) { item.CancelChanges(); } UpdateAppearanceOfCurrentComponents(); if (!animated) { ((Component)this).gameObject.SetActive(false); menuAnimator.SetTrigger(TriggerIdForceClose); } else { menuAnimator.SetTrigger(TriggerIdClose); } } public void OnCloseAnimationEnd() { ((Component)this).gameObject.SetActive(false); } public void OnCancelButtonClicked() { Close(); ConfigMenuManager.Instance.menuAudio.PlayCancelSfx(); } public void OnApplyButtonClicked() { List<BaseConfigItem> list = (from c in LethalConfigManager.Mods.SelectMany((KeyValuePair<string, Mod> m) => m.Value.ConfigItems) where c.HasValueChanged select c).ToList(); List<BaseConfigItem> list2 = list.Where((BaseConfigItem c) => c.RequiresRestart).ToList(); foreach (BaseConfigItem item in list) { item.ApplyChanges(); } UpdateAppearanceOfCurrentComponents(); ConfigMenuManager.Instance.menuAudio.PlayConfirmSfx(); LogUtils.LogInfo($"Saved config values for {list.Count} items."); LogUtils.LogInfo($"Modified {list2.Count} item(s) that requires a restart."); if (list2.Count > 0) { ConfigMenuManager.DisplayNotification("Some of the modified settings may require a restart to take effect.", "OK"); } } private void UpdateAppearanceOfCurrentComponents() { ModConfigController[] componentsInChildren = ((Component)configList).GetComponentsInChildren<ModConfigController>(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].UpdateAppearance(); } } } internal class ConfigMenuNotification : MonoBehaviour { private static readonly int TriggerIdOpen = Animator.StringToHash("Open"); private static readonly int TriggerIdForceClose = Animator.StringToHash("ForceClose"); private static readonly int TriggerIdClose = Animator.StringToHash("Close"); public TextMeshProUGUI messageTextComponent; public TextMeshProUGUI buttonTextComponent; public Animator notificationAnimator; public void SetNotificationContent(string text, string button) { ((TMP_Text)messageTextComponent).text = text; ((TMP_Text)buttonTextComponent).text = "[" + button + "]"; } public void Open() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) AnimatorStateInfo currentAnimatorStateInfo = notificationAnimator.GetCurrentAnimatorStateInfo(0); if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("NotificationNormal") && !((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("NotificationAppear")) { ((Component)this).gameObject.SetActive(true); notificationAnimator.SetTrigger(TriggerIdOpen); ((Component)this).transform.SetAsLastSibling(); } } public void Close(bool animated = true) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) AnimatorStateInfo currentAnimatorStateInfo = notificationAnimator.GetCurrentAnimatorStateInfo(0); if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("NotificationClosed") && !((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("NotificationDisappear")) { if (!animated) { ((Component)this).gameObject.SetActive(false); notificationAnimator.SetTrigger(TriggerIdForceClose); } else { notificationAnimator.SetTrigger(TriggerIdClose); } } } public void OnButtonClick() { Close(); ConfigMenuManager.Instance.menuAudio.PlayConfirmSfx(); } public void OnCloseAnimationEnd() { ((Component)this).gameObject.SetActive(false); } } internal class DescriptionBox : MonoBehaviour { public ModInfoBox modInfoBox; public ConfigInfoBox configInfoBox; private void Awake() { ((Component)modInfoBox).gameObject.SetActive(false); ((Component)configInfoBox).gameObject.SetActive(false); } public void ShowConfigInfo(string configInfo) { ((Component)configInfoBox).gameObject.SetActive(true); configInfoBox.SetConfigInfo(configInfo); HideModInfo(); } public void HideConfigInfo() { ((Component)configInfoBox).gameObject.SetActive(false); } public void ShowModInfo(Mod mod) { ((Component)modInfoBox).gameObject.SetActive(true); modInfoBox.SetModInfo(mod); HideConfigInfo(); } public void HideModInfo() { ((Component)modInfoBox).gameObject.SetActive(false); } } internal class ModInfoBox : MonoBehaviour { public Image modIconImage; public TextMeshProUGUI modInfoText; public void SetModInfo(Mod mod) { modIconImage.sprite = mod.ModInfo.Icon; ((TMP_Text)modInfoText).text = $"{mod.ModInfo}"; } } internal class ModList : MonoBehaviour { public GameObject modItemPrefab; public GameObject listContainerObject; public ConfigList configList; public DescriptionBox descriptionBox; private List<ModListItem> _items; private void Awake() { _items = new List<ModListItem>(); BuildModList(); } private void BuildModList() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_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) _items.Clear(); foreach (Transform item in listContainerObject.transform) { Object.Destroy((Object)(object)((Component)item).gameObject); } foreach (Mod mod in from m in LethalConfigManager.Mods.Values orderby m.ModInfo.Guid != "ainavt.lc.lethalconfig", m.IsAutoGenerated, m.ModInfo.Name select m) { GameObject val = Object.Instantiate<GameObject>(modItemPrefab, listContainerObject.transform); val.transform.localScale = Vector3.one; val.transform.SetLocalPositionAndRotation(Vector3.zero, Quaternion.identity); ModListItem component = val.GetComponent<ModListItem>(); component.Mod = mod; component.ModSelected += ModSelected; component.OnHoverEnter += delegate { descriptionBox.ShowModInfo(mod); ConfigMenuManager.Instance.menuAudio.PlayHoverSfx(); }; component.OnHoverExit += delegate { descriptionBox.HideModInfo(); }; _items.Add(val.GetComponent<ModListItem>()); } } private void ModSelected(Mod mod) { ConfigMenuManager.Instance.menuAudio.PlayConfirmSfx(); configList.LoadConfigsForMod(mod); _items.First((ModListItem i) => i.Mod == mod).SetSelected(selected: true); foreach (ModListItem item in _items.Where((ModListItem i) => i.Mod != mod)) { item.SetSelected(selected: false); } } } internal class ModListItem : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler { public delegate void OnHoverHandler(); internal delegate void ModSelectedHandler(Mod mod); public TextMeshProUGUI textMesh; public GameObject selectedBorder; public Image modIcon; private Mod _mod; internal Mod Mod { get { return _mod; } set { _mod = value; ((TMP_Text)textMesh).text = _mod.ModInfo.Name; modIcon.sprite = _mod.ModInfo.Icon; } } public event OnHoverHandler OnHoverEnter; public event OnHoverHandler OnHoverExit; internal event ModSelectedHandler ModSelected; public void OnPointerEnter(PointerEventData eventData) { this.OnHoverEnter?.Invoke(); } public void OnPointerExit(PointerEventData eventData) { this.OnHoverExit?.Invoke(); } public void OnClick() { this.ModSelected?.Invoke(_mod); } public void SetSelected(bool selected) { selectedBorder.SetActive(selected); } public string GetDescription() { return _mod.ModInfo.Name + "\n" + _mod.ModInfo.Guid + "\n" + _mod.ModInfo.Version; } } internal class SectionHeader : MonoBehaviour { public TextMeshProUGUI textMesh; public void SetSectionName(string sectionName) { ((TMP_Text)textMesh).text = "[" + sectionName + "]"; } } internal class Tooltip : MonoBehaviour { public TextMeshProUGUI textComponent; private RectTransform _rectTransform; private Camera _uiCamera; public void SetText(string text) { ((TMP_Text)textComponent).text = text; } public void SetTarget(GameObject newTargetGameObject) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.position = newTargetGameObject.transform.position; } } internal class TooltipSystem : MonoBehaviour { private static TooltipSystem _instance; public Tooltip tooltip; private void Awake() { _instance = this; } public static void Show(string content, GameObject target) { if (!((Object)(object)_instance == (Object)null)) { ((Component)_instance.tooltip).gameObject.SetActive(true); _instance.tooltip.SetText(content); _instance.tooltip.SetTarget(target); } } public static void Hide() { if (!((Object)(object)_instance == (Object)null)) { ((Component)_instance.tooltip).gameObject.SetActive(false); } } } internal class TooltipTrigger : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler { public string tooltipText; public void OnPointerEnter(PointerEventData eventData) { TooltipSystem.Show(tooltipText, ((Component)this).gameObject); } public void OnPointerExit(PointerEventData eventData) { TooltipSystem.Hide(); } } internal class VersionLabel : MonoBehaviour { private void Start() { ((TMP_Text)((Component)this).GetComponent<TextMeshProUGUI>()).text = "LethalConfig v1.4.2"; } } } namespace LethalConfig.MonoBehaviours.Managers { internal class ConfigMenuAudioManager : MonoBehaviour { [FormerlySerializedAs("confirmSFX")] public AudioClip confirmSfx; [FormerlySerializedAs("cancelSFX")] public AudioClip cancelSfx; [FormerlySerializedAs("selectSFX")] public AudioClip selectSfx; [FormerlySerializedAs("hoverSFX")] public AudioClip hoverSfx; [FormerlySerializedAs("changeValueSFX")] public AudioClip changeValueSfx; public AudioSource audioSource; public void PlayConfirmSfx() { audioSource.PlayOneShot(confirmSfx); } public void PlayCancelSfx() { audioSource.PlayOneShot(cancelSfx); } public void PlayHoverSfx() { audioSource.PlayOneShot(hoverSfx); } public void PlaySelectSfx() { audioSource.PlayOneShot(selectSfx); } public void PlayChangeValueSfx() { audioSource.PlayOneShot(changeValueSfx); } } internal class ConfigMenuManager : MonoBehaviour { public ConfigMenuAudioManager menuAudio; public static ConfigMenuManager Instance { get; private set; } private void Awake() { Instance = this; } private void OnDestroy() { Instance = null; } public static void ShowConfigMenu() { ConfigMenu configMenu = Object.FindObjectOfType<ConfigMenu>(true); if (!Object.op_Implicit((Object)(object)configMenu)) { LogUtils.LogWarning("ConfigMenu object not found"); } else { configMenu.Open(); } } public static void DisplayNotification(string message, string button) { ConfigMenuNotification configMenuNotification = Object.FindObjectOfType<ConfigMenuNotification>(true); if (!Object.op_Implicit((Object)(object)configMenuNotification)) { LogUtils.LogWarning("Notification object not found"); return; } configMenuNotification.SetNotificationContent(message, button); configMenuNotification.Open(); EventSystem.current.SetSelectedGameObject(((Component)((Component)configMenuNotification).GetComponentInChildren<Button>()).gameObject); } } } namespace LethalConfig.MonoBehaviours.Components { internal class BoolCheckBoxController : ModConfigController<BoolCheckBoxConfigItem, bool> { public Toggle toggleComponent; public override void UpdateAppearance() { base.UpdateAppearance(); toggleComponent.SetIsOnWithoutNotify(base.ConfigItem.CurrentValue); } protected override void OnSetConfigItem() { toggleComponent.SetIsOnWithoutNotify(base.ConfigItem.CurrentValue); UpdateAppearance(); } public void OnCheckBoxValueChanged(bool value) { base.ConfigItem.CurrentValue = value; UpdateAppearance(); ConfigMenuManager.Instance.menuAudio.PlayChangeValueSfx(); } } internal class EnumDropDownController : ModConfigController { public TMP_Dropdown dropdownComponent; private List<string> _enumNames = new List<string>(); private Type _enumType; private void OnDestroy() { BaseConfigItem.OnCurrentValueChanged -= OnCurrentValueChanged; } public override string GetDescription() { return base.GetDescription() + "\n\nDefault: " + Enum.GetName(_enumType, BaseConfigItem.BoxedDefaultValue); } public override void UpdateAppearance() { base.UpdateAppearance(); int valueWithoutNotify = _enumNames.FindIndex((string e) => e == Enum.GetName(_enumType, BaseConfigItem.CurrentBoxedValue)); dropdownComponent.SetValueWithoutNotify(valueWithoutNotify); } protected override void OnSetConfigItem() { BaseConfigItem.OnCurrentValueChanged += OnCurrentValueChanged; _enumType = BaseConfigItem.BaseConfigEntry.SettingType; _enumNames = Enum.GetNames(_enumType).ToList(); dropdownComponent.ClearOptions(); dropdownComponent.AddOptions(_enumNames); int valueWithoutNotify = _enumNames.FindIndex((string e) => e == Enum.GetName(_enumType, BaseConfigItem.CurrentBoxedValue)); dropdownComponent.SetValueWithoutNotify(valueWithoutNotify); UpdateAppearance(); } public void OnDropDownValueChanged(int index) { BaseConfigItem.CurrentBoxedValue = Enum.Parse(_enumType, _enumNames[index]); UpdateAppearance(); ConfigMenuManager.Instance.menuAudio.PlayChangeValueSfx(); } private void OnCurrentValueChanged() { UpdateAppearance(); } } internal class FloatInputFieldController : ModConfigController<FloatInputFieldConfigItem, float> { public TMP_InputField textInputField; public override string GetDescription() { string text = base.GetDescription(); if (base.ConfigItem.MinValue != float.MinValue) { text += $"\nMin: {base.ConfigItem.MinValue:0.0#}"; } if (base.ConfigItem.MaxValue != float.MaxValue) { text += $"\nMax: {base.ConfigItem.MaxValue:0.0#}"; } return text; } protected override void OnSetConfigItem() { textInputField.SetTextWithoutNotify($"{base.ConfigItem.CurrentValue}"); UpdateAppearance(); } public void OnInputFieldEndEdit(string value) { if (float.TryParse(value, out var result)) { base.ConfigItem.CurrentValue = Math.Clamp(result, base.ConfigItem.MinValue, base.ConfigItem.MaxValue); } UpdateAppearance(); ConfigMenuManager.Instance.menuAudio.PlayChangeValueSfx(); } public override void UpdateAppearance() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) base.UpdateAppearance(); textInputField.SetTextWithoutNotify($"{base.ConfigItem.CurrentValue}"); ((Transform)textInputField.textComponent.rectTransform).localPosition = Vector3.zero; } } internal class FloatSliderController : ModConfigController<FloatSliderConfigItem, float> { public Slider sliderComponent; public TMP_InputField valueInputField; public override string GetDescription() { return $"{base.GetDescription()}\nMin: {base.ConfigItem.MinValue:0.0#}\nMax: {base.ConfigItem.MaxValue:0.0#}"; } protected override void OnSetConfigItem() { sliderComponent.SetValueWithoutNotify(base.ConfigItem.CurrentValue); sliderComponent.maxValue = base.ConfigItem.MaxValue; sliderComponent.minValue = base.ConfigItem.MinValue; UpdateAppearance(); } public void OnSliderValueChanged(float value) { base.ConfigItem.CurrentValue = value; UpdateAppearance(); ConfigMenuManager.Instance.menuAudio.PlayChangeValueSfx(); } public void OnInputFieldEndEdit(string value) { if (float.TryParse(value, out var result)) { base.ConfigItem.CurrentValue = Math.Clamp(result, base.ConfigItem.MinValue, base.ConfigItem.MaxValue); } UpdateAppearance(); ConfigMenuManager.Instance.menuAudio.PlayChangeValueSfx(); } public override void UpdateAppearance() { base.UpdateAppearance(); sliderComponent.SetValueWithoutNotify(base.ConfigItem.CurrentValue); valueInputField.SetTextWithoutNotify($"{base.ConfigItem.CurrentValue:0.0#}"); } } internal class FloatStepSliderController : ModConfigController<FloatStepSliderConfigItem, float> { public Slider sliderComponent; public TMP_InputField valueInputField; public override string GetDescription() { return $"{base.GetDescription()}\nMin: {base.ConfigItem.MinValue:0.0#}\nMax: {base.ConfigItem.MaxValue:0.0#}"; } protected override void OnSetConfigItem() { sliderComponent.SetValueWithoutNotify(base.ConfigItem.CurrentValue); int num = (int)MathF.Ceiling((base.ConfigItem.MaxValue - base.ConfigItem.MinValue) / MathF.Max(base.ConfigItem.Step, float.Epsilon)); sliderComponent.maxValue = num; sliderComponent.minValue = 0f; sliderComponent.wholeNumbers = true; UpdateAppearance(); } public void OnSliderValueChanged(float value) { base.ConfigItem.CurrentValue = MathF.Round(base.ConfigItem.MinValue + base.ConfigItem.Step * (float)(int)value, 4); UpdateAppearance(); ConfigMenuManager.Instance.menuAudio.PlayChangeValueSfx(); } public void OnInputFieldEndEdit(string value) { if (float.TryParse(value, out var result)) { base.ConfigItem.CurrentValue = Math.Clamp(result, base.ConfigItem.MinValue, base.ConfigItem.MaxValue); } UpdateAppearance(); ConfigMenuManager.Instance.menuAudio.PlayChangeValueSfx(); } public override void UpdateAppearance() { base.UpdateAppearance(); sliderComponent.SetValueWithoutNotify((base.ConfigItem.CurrentValue - base.ConfigItem.MinValue) / MathF.Max(base.ConfigItem.Step, float.Epsilon)); valueInputField.SetTextWithoutNotify($"{base.ConfigItem.CurrentValue:0.0#}"); } } internal class GenericButtonController : ModConfigController { public TextMeshProUGUI buttonTextComponent; private GenericButtonConfigItem ConfigItem => BaseConfigItem as GenericButtonConfigItem; public override void UpdateAppearance() { base.UpdateAppearance(); ((TMP_Text)buttonTextComponent).text = ConfigItem?.ButtonOptions?.ButtonText ?? "Button"; } protected override void OnSetConfigItem() { UpdateAppearance(); } public void OnButtonClicked() { ConfigMenuManager.Instance.menuAudio.PlayConfirmSfx(); ConfigItem?.ButtonOptions?.ButtonHandler?.Invoke(); } } internal class IntInputFieldController : ModConfigController<IntInputFieldConfigItem, int> { public TMP_InputField textInputField; public override string GetDescription() { string text = base.GetDescription(); if (base.ConfigItem.MinValue != int.MinValue) { text += $"\nMin: {base.ConfigItem.MinValue}"; } if (base.ConfigItem.MaxValue != int.MaxValue) { text += $"\nMax: {base.ConfigItem.MaxValue}"; } return text; } protected override void OnSetConfigItem() { textInputField.SetTextWithoutNotify($"{base.ConfigItem.CurrentValue}"); UpdateAppearance(); } public void OnInputFieldEndEdit(string value) { if (int.TryParse(value, out var result)) { base.ConfigItem.CurrentValue = Math.Clamp(result, base.ConfigItem.MinValue, base.ConfigItem.MaxValue); } UpdateAppearance(); ConfigMenuManager.Instance.menuAudio.PlayChangeValueSfx(); } public override void UpdateAppearance() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) base.UpdateAppearance(); textInputField.SetTextWithoutNotify($"{base.ConfigItem.CurrentValue}"); ((Transform)textInputField.textComponent.rectTransform).localPosition = Vector3.zero; } } internal class IntSliderController : ModConfigController<IntSliderConfigItem, int> { public Slider sliderComponent; public TMP_InputField valueInputField; public override string GetDescription() { return $"{base.GetDescription()}\nMin: {base.ConfigItem.MinValue}\nMax: {base.ConfigItem.MaxValue}"; } protected override void OnSetConfigItem() { sliderComponent.SetValueWithoutNotify((float)base.ConfigItem.CurrentValue); sliderComponent.maxValue = base.ConfigItem.MaxValue; sliderComponent.minValue = base.ConfigItem.MinValue; UpdateAppearance(); } public void OnSliderValueChanged(float value) { base.ConfigItem.CurrentValue = (int)value; UpdateAppearance(); ConfigMenuManager.Instance.menuAudio.PlayChangeValueSfx(); } public void OnInputFieldEndEdit(string value) { if (int.TryParse(value, out var result)) { base.ConfigItem.CurrentValue = Math.Clamp(result, base.ConfigItem.MinValue, base.ConfigItem.MaxValue); } UpdateAppearance(); ConfigMenuManager.Instance.menuAudio.PlayChangeValueSfx(); } public override void UpdateAppearance() { base.UpdateAppearance(); sliderComponent.SetValueWithoutNotify((float)base.ConfigItem.CurrentValue); valueInputField.SetTextWithoutNotify($"{base.ConfigItem.CurrentValue}"); } } internal abstract class ModConfigController : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler { public delegate void OnHoverHandler(); public TextMeshProUGUI nameTextComponent; public TooltipTrigger tooltipTrigger; private readonly List<Selectable> _selectables = new List<Selectable>(); protected BaseConfigItem BaseConfigItem; protected bool IsOnSetup; private CanModifyResult CanModify { get { if (BaseConfigItem.Options.CanModifyCallback == null) { return true; } return BaseConfigItem.Options.CanModifyCallback(); } } public event OnHoverHandler OnHoverEnter; public event OnHoverHandler OnHoverExit; protected virtual void Awake() { ((Behaviour)tooltipTrigger).enabled = false; if (_selectables.Count <= 0) { _selectables.AddRange(((Component)this).GetComponentsInChildren<Selectable>()); } } public void OnPointerEnter(PointerEventData eventData) { this.OnHoverEnter?.Invoke(); } public void OnPointerExit(PointerEventData eventData) { this.OnHoverExit?.Invoke(); } public virtual bool SetConfigItem(BaseConfigItem configItem) { BaseConfigItem = configItem; IsOnSetup = true; OnSetConfigItem(); IsOnSetup = false; if (BaseConfigItem.Options.CanModifyCallback != null) { tooltipTrigger.tooltipText = "<b>Modifying this entry is currently disabled:</b>\n<b>" + CanModify.Reason + "</b>"; } return true; } protected abstract void OnSetConfigItem(); public virtual void UpdateAppearance() { ((TMP_Text)nameTextComponent).text = (BaseConfigItem.HasValueChanged ? "* " : "") + BaseConfigItem.Name; CanModifyResult canModify = CanModify; foreach (Selectable selectable in _selectables) { selectable.interactable = canModify; } ((Behaviour)tooltipTrigger).enabled = !canModify; } public virtual void ResetToDefault() { ConfigMenuManager.Instance.menuAudio.PlayConfirmSfx(); BaseConfigItem.ChangeToDefault(); UpdateAppearance(); } public virtual string GetDescription() { string text = "<b>" + BaseConfigItem.Name + "</b>"; if (BaseConfigItem.IsAutoGenerated) { text += "\n\n<b>*This config entry was automatically generated and may require a restart*</b>"; } else if (BaseConfigItem.RequiresRestart) { text += "\n\n<b>*REQUIRES RESTART*</b>"; } return text + "\n\n" + BaseConfigItem.Description; } } internal abstract class ModConfigController<T, TV> : ModConfigController where T : BaseValueConfigItem<TV> { protected T ConfigItem => (T)BaseConfigItem; private void OnDestroy() { ConfigItem.OnCurrentValueChanged -= OnCurrentValueChanged; } public override string GetDescription() { return $"{base.GetDescription()}\n\nDefault: {ConfigItem.DefaultValue}"; } public override bool SetConfigItem(BaseConfigItem configItem) { if (!(configItem is T val)) { LogUtils.LogError("Expected config item of type " + typeof(T).Name + ", but got " + configItem.GetType().Name + " instead."); return false; } val.OnCurrentValueChanged += OnCurrentValueChanged; return base.SetConfigItem(val); } private void OnCurrentValueChanged() { UpdateAppearance(); } } internal class TextDropDownController : ModConfigController<TextDropDownConfigItem, string> { public TMP_Dropdown dropdownComponent; private List<string> _textValues = new List<string>(); public override void UpdateAppearance() { base.UpdateAppearance(); int valueWithoutNotify = _textValues.FindIndex((string e) => e == (string)BaseConfigItem.CurrentBoxedValue); dropdownComponent.SetValueWithoutNotify(valueWithoutNotify); } protected override void OnSetConfigItem() { _textValues = base.ConfigItem.Values.ToList(); dropdownComponent.ClearOptions(); dropdownComponent.AddOptions(_textValues); int valueWithoutNotify = _textValues.FindIndex((string e) => e == (string)BaseConfigItem.CurrentBoxedValue); dropdownComponent.SetValueWithoutNotify(valueWithoutNotify); UpdateAppearance(); } public void OnDropDownValueChanged(int index) { base.ConfigItem.CurrentValue = _textValues[index]; UpdateAppearance(); ConfigMenuManager.Instance.menuAudio.PlayChangeValueSfx(); } } internal class TextInputFieldController : ModConfigController<TextInputFieldConfigItem, string> { public TMP_InputField textInputField; private LayoutElement _layoutElement; protected override void Awake() { base.Awake(); _layoutElement = ((Component)this).GetComponent<LayoutElement>(); } private void Update() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (textInputField.isFocused && (int)textInputField.lineType != 0) { bool isPressed = Keyboard.current.shiftKey.isPressed; textInputField.lineType = (LineType)((!isPressed) ? 1 : 2); } } protected override void OnSetConfigItem() { textInputField.text = base.ConfigItem.CurrentValue; int num = Mathf.Clamp((base.ConfigItem.NumberOfLines <= 0) ? 4 : base.ConfigItem.NumberOfLines, 1, 4); float num2 = 16 + num * 19; _layoutElement.minHeight = num2; _layoutElement.preferredHeight = num2; textInputField.lineType = (LineType)(num != 1); textInputField.lineLimit = base.ConfigItem.NumberOfLines; UpdateAppearance(); } public void OnInputFieldEndEdit(string value) { int caretPosition = textInputField.caretPosition; if (base.ConfigItem.NumberOfLines != 1) { ((MonoBehaviour)this).StartCoroutine(RemoveNewLineFromSubmitDelayed(caretPosition)); } base.ConfigItem.CurrentValue = (base.ConfigItem.TrimText ? value.Trim() : value); UpdateAppearance(); ConfigMenuManager.Instance.menuAudio.PlayChangeValueSfx(); } public override void UpdateAppearance() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) base.UpdateAppearance(); textInputField.text = base.ConfigItem.CurrentValue; ((Transform)textInputField.textComponent.rectTransform).localPosition = Vector3.zero; } private IEnumerator RemoveNewLineFromSubmitDelayed(int caretPosition) { yield return null; textInputField.text = textInputField.text.Remove(Mathf.Clamp(caretPosition, 0, textInputField.text.Length - 1), 1); } } } namespace LethalConfig.Mods { internal class Mod { public readonly List<BaseConfigItem> ConfigItems; public readonly List<ConfigEntryPath> EntriesToSkipAutoGen; public readonly ModInfo ModInfo; public bool IsAutoGenerated; internal Mod(ModInfo modInfo) { ConfigItems = new List<BaseConfigItem>(); EntriesToSkipAutoGen = new List<ConfigEntryPath>(); ModInfo = modInfo; TryResolveIconAndDesc(); } private void TryResolveIconAndDesc() { if (ModInfo.TryGetPluginInfo(out var pluginInfo)) { string text = Path.GetFullPath(pluginInfo.Location); DirectoryInfo parent = Directory.GetParent(text); while (parent != null && !string.Equals(parent.Name, "plugins", StringComparison.OrdinalIgnoreCase)) { text = parent.FullName; parent = Directory.GetParent(text); } if (!text.EndsWith(".dll")) { string iconPath = Directory.EnumerateFiles(text, "icon.png", SearchOption.AllDirectories).FirstOrDefault(); LoadIcon(iconPath); string manifestPath = Directory.EnumerateFiles(text, "manifest.json", SearchOption.AllDirectories).FirstOrDefault(); LoadDesc(manifestPath); } } } private void LoadIcon(string iconPath) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_0045: 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) try { if (iconPath != null) { Texture2D val = new Texture2D(256, 256); if (ImageConversion.LoadImage(val, File.ReadAllBytes(iconPath), true)) { ModInfo.Icon = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f); } } } catch { } } private void LoadDesc(string manifestPath) { try { if (manifestPath != null) { ThunderstoreManifest thunderstoreManifest = JsonConvert.DeserializeObject<ThunderstoreManifest>(File.ReadAllText(manifestPath)); if (thunderstoreManifest != null) { ModInfo.Description = thunderstoreManifest.Description; } } } catch { } } internal void AddConfigItem(BaseConfigItem item) { ConfigItems.Add(item); } } internal class ModInfo { internal string Name { get; set; } internal string Guid { get; set; } internal string Version { get; set; } internal string Description { get; set; } = ""; internal Sprite Icon { get; set; } = Assets.DefaultModIcon; public override string ToString() { return "<b>" + Name + "</b>\n" + Guid + "\nv" + Version + "\n\n" + Description; } public bool TryGetPluginInfo(out PluginInfo pluginInfo) { return Chainloader.PluginInfos.TryGetValue(Guid, out pluginInfo); } } internal class ThunderstoreManifest { [JsonProperty("name")] public string Name { get; set; } [JsonProperty("version_number")] public string VersionNumber { get; set; } [JsonProperty("website_url")] public string WebsiteURL { get; set; } [JsonProperty("description")] public string Description { get; set; } [JsonProperty("dependencies")] public IList<string> Dependencies { get; set; } } } namespace LethalConfig.ConfigItems { public abstract class BaseConfigItem { internal delegate void CurrentValueChangedHandler(); private object _currentBoxedValue; internal ConfigEntryBase BaseConfigEntry { get; } internal BaseOptions Options { get; } internal bool RequiresRestart => Options.RequiresRestart; internal Mod Owner { get; set; } internal bool IsAutoGenerated { get; set; } private string UnderlyingSection { get { ConfigEntryBase baseConfigEntry = BaseConfigEntry; return ((baseConfigEntry != null) ? baseConfigEntry.Definition.Section : null) ?? string.Empty; } } private string UnderlyingName { get { ConfigEntryBase baseConfigEntry = BaseConfigEntry; return ((baseConfigEntry != null) ? baseConfigEntry.Definition.Key : null) ?? string.Empty; } } private string UnderlyingDescription { get { ConfigEntryBase baseConfigEntry = BaseConfigEntry; return ((baseConfigEntry != null) ? baseConfigEntry.Description.Description : null) ?? string.Empty; } } internal string Section => Options.Section ?? UnderlyingSection; internal string Name => Options.Name ?? UnderlyingName; internal string Description => Options.Description ?? UnderlyingDescription; private object OriginalBoxedValue { get { ConfigEntryBase baseConfigEntry = BaseConfigEntry; if (baseConfigEntry == null) { return null; } return baseConfigEntry.BoxedValue; } } internal object BoxedDefaultValue { get { ConfigEntryBase baseConfigEntry = BaseConfigEntry; if (baseConfigEntry == null) { return null; } return baseConfigEntry.DefaultValue; } } internal object CurrentBoxedValue { get { return _currentBoxedValue; } set { _currentBoxedValue = value; this.OnCurrentValueChanged?.Invoke(); } } internal bool HasValueChanged { get { object currentBoxedValue = CurrentBoxedValue; if (currentBoxedValue == null) { return false; } return !currentBoxedValue.Equals(OriginalBoxedValue); } } internal event CurrentValueChangedHandler OnCurrentValueChanged; internal BaseConfigItem(BaseOptions options) : this(null, options) { } internal BaseConfigItem(ConfigEntryBase configEntry, BaseOptions options) { BaseConfigEntry = configEntry; Options = options; CurrentBoxedValue = OriginalBoxedValue; } internal abstract GameObject CreateGameObjectForConfig(); public void ApplyChanges() { if (BaseConfigEntry != null) { BaseConfigEntry.BoxedValue = CurrentBoxedValue; } } public void CancelChanges() { CurrentBoxedValue = OriginalBoxedValue; } public void ChangeToDefault() { CurrentBoxedValue = BoxedDefaultValue; } internal virtual bool IsSameConfig(BaseConfigItem configItem) { bool num = configItem.UnderlyingSection == UnderlyingSection; bool flag = configItem.UnderlyingName == UnderlyingName; bool flag2 = configItem.Owner.ModInfo.Guid == Owner.ModInfo.Guid; return num && flag && flag2; } } public abstract class BaseValueConfigItem<T> : BaseConfigItem { private ConfigEntry<T> ConfigEntry => (ConfigEntry<T>)(object)base.BaseConfigEntry; internal T CurrentValue { get { return (T)base.CurrentBoxedValue; } set { base.CurrentBoxedValue = value; } } private T OriginalValue => ConfigEntry.Value; internal T DefaultValue => (T)((ConfigEntryBase)ConfigEntry).DefaultValue; internal BaseValueConfigItem(ConfigEntry<T> configEntry, BaseOptions options) : base((ConfigEntryBase)(object)configEntry, options) { CurrentValue = OriginalValue; if (ConfigEntry != null) { ConfigEntry.SettingChanged += OnUnderlyingEntryChanged; } } ~BaseValueConfigItem() { if (ConfigEntry != null) { ConfigEntry.SettingChanged -= OnUnderlyingEntryChanged; } } private void OnUnderlyingEntryChanged(object sender, EventArgs args) { CurrentValue = OriginalValue; } public override string ToString() { return base.Owner.ModInfo.Name + "/" + ((ConfigEntryBase)ConfigEntry).Definition.Section + "/" + ((ConfigEntryBase)ConfigEntry).Definition.Key; } } public class BoolCheckBoxConfigItem : BaseValueConfigItem<bool> { public BoolCheckBoxConfigItem(ConfigEntry<bool> configEntry) : this(configEntry, requiresRestart: true) { } public BoolCheckBoxConfigItem(ConfigEntry<bool> configEntry, bool requiresRestart) : this(configEntry, new BoolCheckBoxOptions { RequiresRestart = requiresRestart }) { } public BoolCheckBoxConfigItem(ConfigEntry<bool> configEntry, BoolCheckBoxOptions options) : base(configEntry, (BaseOptions)options) { } internal override GameObject CreateGameObjectForConfig() { return Object.Instantiate<GameObject>(Assets.BoolCheckBoxPrefab); } } public class EnumDropDownConfigItem<T> : BaseValueConfigItem<T> where T : Enum { public EnumDropDownConfigItem(ConfigEntry<T> configEntry) : this(configEntry, requiresRestart: true) { } public EnumDropDown
BepInEx/plugins/AllTheLinks-InfiniteStamina-1.0.0/InfiniteStamina.dll
Decompiled 3 months agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using InfiniteStamina.Patches; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("InfiniteStamina")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("InfiniteStamina")] [assembly: AssemblyCopyright("Copyright © 2024")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("1f3e863c-fe85-4da9-8d5d-c08079d0c2f3")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace InfiniteStamina { [BepInPlugin("AllTheLinks.InfiniteStamina", "InfiniteStamina", "1.0.0")] public class InfiniteStaminaBase : BaseUnityPlugin { private const string modGUID = "AllTheLinks.InfiniteStamina"; private const string modName = "InfiniteStamina"; private const string modVersion = "1.0.0"; private readonly Harmony harmony = new Harmony("AllTheLinks.InfiniteStamina"); private static InfiniteStaminaBase Instance; internal ManualLogSource mls; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = Logger.CreateLogSource("AllTheLinks.InfiniteStamina"); mls.LogInfo((object)"InfiniteStamina Mod running..."); harmony.PatchAll(typeof(InfiniteStaminaBase)); harmony.PatchAll(typeof(PlayerCharacterBPatch)); } } } namespace InfiniteStamina.Patches { [HarmonyPatch(typeof(PlayerControllerB))] internal class PlayerCharacterBPatch { [HarmonyPatch("Update")] [HarmonyPostfix] private static void infiniteSprintPatch(ref float ___sprintMeter) { ___sprintMeter = 1f; } } }
BepInEx/plugins/boring-InfiniteShotgunAmmo-1.0.3/InfiniteShotgunAmmo.dll
Decompiled 3 months agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")] [assembly: AssemblyCompany("InfiniteShotgunAmmo")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("A template for Lethal Company")] [assembly: AssemblyFileVersion("1.0.3.0")] [assembly: AssemblyInformationalVersion("1.0.3+43206f0475d7dae18e393eaa115cfd192399712f")] [assembly: AssemblyProduct("InfiniteShotgunAmmo")] [assembly: AssemblyTitle("InfiniteShotgunAmmo")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.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.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace InfiniteShotgunAmmo { [BepInPlugin("InfiniteShotgunAmmo", "InfiniteShotgunAmmo", "1.0.3")] public class Plugin : BaseUnityPlugin { private readonly Harmony harmony = new Harmony("InfiniteShotgunAmmo"); private static Plugin Instance; public static ManualLogSource Logger; public static ConfigEntry<int> MaxCharLength; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } Logger = ((BaseUnityPlugin)this).Logger; Logger.LogInfo((object)"Plugin InfiniteShotgunAmmo is loaded!"); harmony.PatchAll(Assembly.GetExecutingAssembly()); } } public static class PluginInfo { public const string PLUGIN_GUID = "InfiniteShotgunAmmo"; public const string PLUGIN_NAME = "InfiniteShotgunAmmo"; public const string PLUGIN_VERSION = "1.0.3"; } } namespace InfiniteShotgunAmmo.Patches { [HarmonyPatch] internal class ShotgunItemPatch { [HarmonyPatch(typeof(ShotgunItem), "ItemActivate")] [HarmonyPostfix] public static void PatchItemActivate(ShotgunItem __instance) { Plugin.Logger.LogInfo((object)("ShotgunItem::ItemActivate: " + __instance.shellsLoaded)); __instance.shellsLoaded = 999; Plugin.Logger.LogInfo((object)("ShotgunItem::ItemActivate: " + __instance.shellsLoaded)); } [HarmonyPatch(typeof(ShotgunItem), "ShootGun")] [HarmonyPostfix] public static void PatchShootGun(ShotgunItem __instance) { Plugin.Logger.LogInfo((object)("ShotgunItem::PatchShootGun: " + __instance.shellsLoaded)); __instance.shellsLoaded = 999; Plugin.Logger.LogInfo((object)("ShotgunItem::PatchShootGun: " + __instance.shellsLoaded)); } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }
BepInEx/plugins/Brew-WeightlessCompany-1.0.0/BepInEx/plugins/WeightlessCompany.dll
Decompiled 3 months agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using UnityEngine; using WeightlessCompany.Patches; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("WeightlessCompany")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("WeightlessCompany")] [assembly: AssemblyCopyright("Copyright © 2024")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("c80c0725-649f-4399-a48d-0423def480c9")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace WeightlessCompany { [BepInPlugin("Brew.WeightlessCompany", "WeightlessCompany", "1.0.0")] public class WCBase : BaseUnityPlugin { private const string modGUID = "Brew.WeightlessCompany"; private const string modName = "WeightlessCompany"; private const string modVersion = "1.0.0"; private readonly Harmony harmony = new Harmony("Brew.WeightlessCompany"); private static WCBase Instance; internal ManualLogSource mls; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = Logger.CreateLogSource("Brew.WeightlessCompany"); mls.LogInfo((object)"Weightless Company has initialised."); harmony.PatchAll(typeof(WCBase)); harmony.PatchAll(typeof(PlayerControllerBPatch)); } } } namespace WeightlessCompany.Patches { [HarmonyPatch(typeof(PlayerControllerB))] internal class PlayerControllerBPatch { [HarmonyPatch("Update")] [HarmonyPostfix] private static void updatePatch(ref float ___carryWeight) { ___carryWeight = 1f; } } }
BepInEx/plugins/Cutor-JetpackInfinite-1.0.0/JetpackInfinite.dll
Decompiled 3 months agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using OPJosMod.Patches; using Unity.Netcode; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OPJosMod")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OPJosMod")] [assembly: AssemblyCopyright("Copyright © 2024")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("70095872-b952-4e27-bbc4-3d70d0238f39")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace OPJosMod.SaferJeptack { [BepInPlugin("OpJosMod.SaferJetpack", "SaferJetpack", "1.0.0.0")] public class OpJosMod : BaseUnityPlugin { private const string modGUID = "OpJosMod.SaferJetpack"; private const string modName = "SaferJetpack"; private const string modVersion = "1.0.0.0"; private readonly Harmony harmony = new Harmony("OpJosMod.SaferJetpack"); private static OpJosMod Instance; internal ManualLogSource mls; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = Logger.CreateLogSource("OpJosMod.SaferJetpack"); mls.LogInfo((object)"SaferJetpack mod has started"); harmony.PatchAll(typeof(OpJosMod)); JetpackItemPatch.SetLogSource(mls); harmony.PatchAll(typeof(JetpackItemPatch)); } } } namespace OPJosMod.Patches { [HarmonyPatch(typeof(JetpackItem))] internal class JetpackItemPatch { private static ManualLogSource mls; public static void SetLogSource(ManualLogSource logSource) { mls = logSource; } [HarmonyPatch("Update")] [HarmonyPrefix] private static void Update(JetpackItem __instance) { //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_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)null || !((NetworkBehaviour)__instance).IsOwner || (Object)(object)((GrabbableObject)__instance).playerHeldBy != (Object)(object)GameNetworkManager.Instance.localPlayerController) { return; } if ((Object)(object)__instance != (Object)null) { FieldInfo field = typeof(JetpackItem).GetField("rayHit", BindingFlags.Instance | BindingFlags.NonPublic); FieldInfo field2 = typeof(JetpackItem).GetField("forces", BindingFlags.Instance | BindingFlags.NonPublic); FieldInfo field3 = typeof(JetpackItem).GetField("jetpackPower", BindingFlags.Instance | BindingFlags.NonPublic); FieldInfo field4 = typeof(JetpackItem).GetField("jetpackActivated", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null && field2 != null && field3 != null && field4 != null) { RaycastHit val = (RaycastHit)field.GetValue(__instance); Vector3 val2 = (Vector3)field2.GetValue(__instance); float num = (float)field3.GetValue(__instance); bool flag = (bool)field4.GetValue(__instance); ((GrabbableObject)__instance).playerHeldBy.takingFallDamage = false; ((GrabbableObject)__instance).playerHeldBy.averageVelocity = 0f; ((GrabbableObject)__instance).itemProperties.requiresBattery = false; if (flag) { num = Mathf.Clamp(num + Time.deltaTime * 10f, 0f, 500f); } else { num = Mathf.Clamp(num - Time.deltaTime * 75f, 0f, 1000f); if (((GrabbableObject)__instance).playerHeldBy.thisController.isGrounded) { num = 0f; } } val2 = Vector3.Lerp(val2, Vector3.ClampMagnitude(((Component)((GrabbableObject)__instance).playerHeldBy).transform.up * num, 400f), Time.deltaTime); if (!((GrabbableObject)__instance).playerHeldBy.isPlayerDead && Physics.Raycast(((Component)((GrabbableObject)__instance).playerHeldBy).transform.position, val2, ref val, 25f, StartOfRound.Instance.allPlayersCollideWithMask) && ((Vector3)(ref val2)).magnitude - ((RaycastHit)(ref val)).distance > 50f && ((RaycastHit)(ref val)).distance < 4f) { PlayerControllerB playerHeldBy = ((GrabbableObject)__instance).playerHeldBy; playerHeldBy.externalForces += val2; throw new Exception("SaferJetpack: Cancelling original Update method"); } } else if (mls != null) { mls.LogInfo((object)"SaferJetpack(error): couldn't find a private field"); } } else if (mls != null) { mls.LogInfo((object)"SaferJetpack(error): __instance == null"); } } } }
BepInEx/plugins/DannyVD-MonitorLabels-2.0.0/MonitorLabels.dll
Decompiled 3 months agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LethalConfig; using LethalConfig.ConfigItems; using LethalConfig.ConfigItems.Options; using Microsoft.CodeAnalysis; using MonitorLabels.BaseClasses; using MonitorLabels.Components; using MonitorLabels.Components.Tools; using MonitorLabels.Constants; using MonitorLabels.Dependencies.LethalConfig; using MonitorLabels.ExtensionMethods; using MonitorLabels.Structs; using MonitorLabels.Utils; using MonitorLabels.Utils.ModUtils; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("DannyVD")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Adds a label to the icons on the monitor for players, radar boosters, enemies and scrap")] [assembly: AssemblyFileVersion("2.0.0.0")] [assembly: AssemblyInformationalVersion("2.0.0+0bbf54eabf9e2f14bfcf5bd92e03759ea900af7d")] [assembly: AssemblyProduct("MonitorLabels")] [assembly: AssemblyTitle("MonitorLabels")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace MonitorLabels { public static class AIMapLabelManager { public static readonly Dictionary<Type, CustomLabelData> CustomAINames = new Dictionary<Type, CustomLabelData>(); public static bool TryAddNewAI(Type type, CustomLabelData labelData) { return CustomAINames.TryAdd(type, labelData); } public static bool TryAddNewAI(Type type, string label, bool showLabel = true) { return CustomAINames.TryAdd(type, new CustomLabelData(label, showLabel)); } public static void SetAI(Type type, CustomLabelData customLabelData) { CustomAINames[type] = customLabelData; } public static void SetAI(Type type, string label, bool showLabel = true) { SetAI(type, new CustomLabelData(label, showLabel)); } public static void RemoveAI(Type type) { CustomAINames.Remove(type); } public static void AddLabelToAI(EnemyAI enemyAI) { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_0060: 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) bool showLabel; string aILabel = GetAILabel(enemyAI, out showLabel); if (!showLabel) { return; } Transform mapDot = MapLabelUtil.GetMapDot(((Component)enemyAI).transform); if (mapDot == null) { LoggerUtil.LogWarning("Child MapDot cannot be found for enemy: " + ((Object)((Component)enemyAI).gameObject).name); return; } if (enemyAI is SandSpiderAI) { Vector3 localScale = mapDot.localScale; float num = Mathf.Max(new float[3] { localScale.x, localScale.y, localScale.z }); mapDot.localScale = new Vector3(num, num, num); } TMP_Text obj = MapLabelUtil.AddLabelObject(((Component)mapDot).gameObject, ConfigUtil.EnemyLabelOffset.Value); ((Graphic)obj).color = ConfigUtil.EnemyLabelColour.Value; obj.text = aILabel; } public static void UpdateAILabel(EnemyAI enemyAI) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) Transform mapDot = MapLabelUtil.GetMapDot(((Component)enemyAI).transform); if (mapDot == null) { return; } MapLabelUtil.GetRadarLabel(mapDot, out var label); if (label != null) { if (!ConfigUtil.ShowLabelOnDeadEnemies.Value) { Object.Destroy((Object)(object)((Component)label).gameObject); } else { ((Graphic)label).color = ConfigUtil.DeadEnemyLabelColour.Value; } } } private static string GetAILabel(EnemyAI enemyAI, out bool showLabel) { showLabel = true; if (!(enemyAI is BaboonBirdAI)) { if (!(enemyAI is BlobAI)) { if (!(enemyAI is CentipedeAI)) { if (!(enemyAI is CrawlerAI)) { if (!(enemyAI is DocileLocustBeesAI)) { if (!(enemyAI is DoublewingAI)) { if (!(enemyAI is DressGirlAI)) { if (!(enemyAI is FlowermanAI)) { if (!(enemyAI is ForestGiantAI)) { if (!(enemyAI is HoarderBugAI)) { if (!(enemyAI is JesterAI)) { if (!(enemyAI is LassoManAI)) { if (!(enemyAI is MaskedPlayerEnemy)) { if (!(enemyAI is MouthDogAI)) { if (!(enemyAI is NutcrackerEnemyAI)) { if (!(enemyAI is PufferAI)) { if (!(enemyAI is SandSpiderAI)) { if (!(enemyAI is SandWormAI)) { if (!(enemyAI is SpringManAI)) { if (!(enemyAI is TestEnemy)) { if (!(enemyAI is ButlerEnemyAI)) { if (!(enemyAI is RadMechAI)) { if (enemyAI is FlowerSnakeEnemy) { if (ConfigUtil.HideLabelOnSomeEnemies.Value) { showLabel = false; } return ConfigUtil.FlowerSnakeLabel.Value; } return GetUnknownAILabel(enemyAI, out showLabel); } return ConfigUtil.RadMechLabel.Value; } return ConfigUtil.ButlerLabel.Value; } return "Obunga"; } return ConfigUtil.CoilHeadLabel.Value; } if (ConfigUtil.HideLabelOnSomeEnemies.Value) { showLabel = false; } return ConfigUtil.SandWormLabel.Value; } return ConfigUtil.SpiderLabel.Value; } return ConfigUtil.SporeLizardLabel.Value; } return ConfigUtil.NutCrackerLabel.Value; } return ConfigUtil.DogLabel.Value; } return ConfigUtil.MaskedLabel.Value; } return "Lasso"; } return ConfigUtil.JesterLabel.Value; } return ConfigUtil.HoarderBugLabel.Value; } return ConfigUtil.ForestGiantLabel.Value; } return ConfigUtil.BrackenLabel.Value; } showLabel = false; return "Girl"; } if (ConfigUtil.HideLabelOnSomeEnemies.Value) { showLabel = false; } return ConfigUtil.ManticoilLabel.Value; } showLabel = false; return "Bees"; } return ConfigUtil.CrawlerLabel.Value; } return ConfigUtil.CentipedeLabel.Value; } return ConfigUtil.BlobLabel.Value; } return ConfigUtil.BaboonHawkLabel.Value; } private static string GetUnknownAILabel(EnemyAI enemyAISubclassInstance, out bool showLabel) { foreach (KeyValuePair<Type, CustomLabelData> customAIName in CustomAINames) { if (customAIName.Key.IsInstanceOfType(enemyAISubclassInstance)) { showLabel = customAIName.Value.ShowLabel; return customAIName.Value.Label; } } showLabel = true; string value = ConfigUtil.UnknownLabel.Value; if (!value.Equals(string.Empty)) { return value; } return MapLabelUtil.RemoveCloneFromString(((Object)((Component)enemyAISubclassInstance).gameObject).name).InsertSpaceBeforeCapitals(); } } [BepInPlugin("DannyVD.mods.LethalCompany.MonitorLabels", "MonitorLabels", "2.0.0")] [BepInProcess("Lethal Company.exe")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class MonitorLabelsPlugin : BaseUnityPlugin { public const string GUID = "DannyVD.mods.LethalCompany.MonitorLabels"; public const string PLUGIN_NAME = "MonitorLabels"; public const string PLUGIN_VERSION = "2.0.0"; public const string DEPENDENCY_STRING = "DannyVD-MonitorLabels-2.0.0"; private void Awake() { ConfigUtil.Initialize(((BaseUnityPlugin)this).Config); ConfigUtil.ReadConfig(); LoggerUtil.Initialize(ConfigUtil.LoggingLevel, ((BaseUnityPlugin)this).Logger); LoggerUtil.Log((LogLevel)16, "Plugin DannyVD-MonitorLabels-2.0.0 is loaded!"); PatchUtil.PatchFunctions(); DependencyUtils.CheckDependencies(); } } internal static class ObjectLabelManager { internal static void TryAddLabelToScrap(GrabbableObject item) { Transform radarIcon = item.radarIcon; if (!((Object)(object)radarIcon == (Object)null)) { AddLabelToScrap(item, ((Component)radarIcon).gameObject); } } internal static void UpdateScrapLabel(GrabbableObject item) { UpdateItemSlotLabel(item, null, null); } internal static void UpdateItemSlotLabel(GrabbableObject item, GrabbableObject firstToolInItemSlots, GrabbableObject firstToolInUseInItemSlots) { Transform radarIcon = item.radarIcon; if ((Object)(object)radarIcon == (Object)null) { return; } ContinuouslyUpdateToolLabel component = ((Component)item).GetComponent<ContinuouslyUpdateToolLabel>(); if (!((Object)(object)component != (Object)null) || !component.IsUpdating) { MapLabelUtil.GetRadarLabel(radarIcon, out var label); if (label != null) { SetScrapLabel(item, label, firstToolInItemSlots, firstToolInUseInItemSlots); } } } internal static void SetScrapLabel(GrabbableObject item, TMP_Text radarLabel, GrabbableObject firstToolInItemSlots = null, GrabbableObject firstToolInUseInItemSlots = null) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) radarLabel.text = GetScrapLabelString(item, out var labelColour, firstToolInItemSlots, firstToolInUseInItemSlots); ((Graphic)radarLabel).color = labelColour; } private static void AddLabelToScrap(GrabbableObject item, GameObject radarParent) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) bool isScrap = item.itemProperties.isScrap; TMP_Text val = MapLabelUtil.AddLabelObject(radarParent, isScrap ? ConfigUtil.ScrapLabelOffset.Value : ConfigUtil.ToolLabelOffset.Value, continuouslyUpdateRotationAndOffset: false); if (isScrap) { val.fontSize *= ConfigUtil.ScrapLabelScaleFactor.Value; } else { val.fontSize = ConfigUtil.ToolLabelFontSize.Value; } SetScrapLabel(item, val); if (item.itemProperties.requiresBattery && ConfigUtil.ShowBatteryChargeOnLabel.Value) { ((Component)item).gameObject.AddComponent<ContinuouslyUpdateToolLabel>().Initialize(item, val); } } private static string GetScrapLabelString(GrabbableObject item, out Color labelColour, GrabbableObject firstToolInItemSlots, GrabbableObject firstToolInUseInItemSlots) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0224: 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_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0207: 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_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)item == (Object)null) { labelColour = Color.white; return string.Empty; } bool flag = !item.itemProperties.isScrap; int scrapValue = item.scrapValue; if (item.isHeld) { if (flag && (Object)(object)item.playerHeldBy != (Object)null) { labelColour = ConfigUtil.CarriedToolLabelColour.Value; GrabbableObject currentlyHeldObjectServer = item.playerHeldBy.currentlyHeldObjectServer; bool flag2 = (Object)(object)currentlyHeldObjectServer != (Object)null && !currentlyHeldObjectServer.itemProperties.isScrap; if (item.isPocketed && ConfigUtil.HideToolLabelIfPocketed.Value) { if (!item.isBeingUsed || !ConfigUtil.ShowToolIfInUseAndNoOtherToolHeld.Value || flag2) { return string.Empty; } if (ConfigUtil.OnlyShow1PocketedLabel.Value) { GrabbableObject val = ((IEnumerable<GrabbableObject>)item.playerHeldBy.ItemSlots).FirstOrDefault((Func<GrabbableObject, bool>)((GrabbableObject grabbableObject) => (Object)(object)grabbableObject != (Object)null && grabbableObject.isBeingUsed)); if ((Object)(object)item != (Object)(object)val) { return string.Empty; } } } else if (item.isPocketed && ConfigUtil.OnlyShow1PocketedLabel.Value) { if (flag2 && !ConfigUtil.HideToolLabelIfInHand.Value) { return string.Empty; } if (ConfigUtil.ShowToolIfInUseAndNoOtherToolHeld.Value) { if ((Object)(object)firstToolInUseInItemSlots != (Object)null) { if ((Object)(object)firstToolInUseInItemSlots != (Object)(object)item) { return string.Empty; } } else if ((Object)(object)firstToolInItemSlots != (Object)(object)item) { return string.Empty; } } else if ((Object)(object)item != (Object)(object)firstToolInItemSlots) { return string.Empty; } } else if (!item.isPocketed && ConfigUtil.HideToolLabelIfInHand.Value) { return string.Empty; } } else if (flag) { labelColour = ConfigUtil.CarriedToolLabelColour.Value; if (ConfigUtil.HideToolLabelIfInHand.Value) { return string.Empty; } } else { labelColour = ConfigUtil.CarriedScrapLabelColour.Value; if (ConfigUtil.HideScrapLabelIfCarried.Value) { return string.Empty; } } } else if (item.isInShipRoom) { if (flag) { labelColour = ConfigUtil.InShipToolLabelColour.Value; if (ConfigUtil.HideToolLabelIfOnShip.Value) { return string.Empty; } } else { labelColour = ConfigUtil.InShipScrapLabelColour.Value; if (ConfigUtil.HideScrapLabelIfOnShip.Value) { return string.Empty; } } } else if (flag) { labelColour = ConfigUtil.ToolLabelColour.Value; } else { labelColour = ((scrapValue >= ConfigUtil.HighValueScrapThreshold.Value) ? ConfigUtil.HighValueScrapLabelColour.Value : ConfigUtil.ScrapLabelColour.Value); } if (TryGetCustomLabel(item, out var label)) { return label; } return GetFormattedScrapLabel(item, scrapValue, flag); } private static bool TryGetCustomLabel(GrabbableObject item, out string label) { label = string.Empty; if (ConfigUtil.HideScrapLabelOnNutcracker.Value && item is ShotgunItem && item.isHeldByEnemy) { return true; } return false; } private static string GetFormattedScrapLabel(GrabbableObject item, int scrapValue, bool isTool) { string scrapName = GetScrapName(item); if (isTool) { string arg = string.Empty; if (item.itemProperties.requiresBattery && ConfigUtil.ShowBatteryChargeOnLabel.Value && item.insertedBattery != null) { float num = (item.insertedBattery.empty ? 0f : item.insertedBattery.charge); arg = string.Format(ConfigUtil.ToolBatteryStringFormat.Value, num); } return string.Format(ConfigUtil.ToolLabelStringFormat.Value, scrapName, arg); } return string.Format(ConfigUtil.ScrapLabelStringFormat.Value, scrapName, scrapValue); } private static string GetScrapName(GrabbableObject item) { Item itemProperties = item.itemProperties; if (Object.op_Implicit((Object)(object)itemProperties) && !string.IsNullOrEmpty(itemProperties.itemName)) { return itemProperties.itemName; } ScanNodeProperties componentInChildren = ((Component)item).GetComponentInChildren<ScanNodeProperties>(); if (Object.op_Implicit((Object)(object)componentInChildren)) { return componentInChildren.headerText; } return MapLabelUtil.RemoveCloneFromString(((Object)((Component)item).gameObject).name).InsertSpaceBeforeCapitals(); } } internal static class Patches { [HarmonyPatch(typeof(ManualCameraRenderer), "Awake")] [HarmonyPostfix] [HarmonyPriority(200)] private static void ManualCameraRendererAwakePatch(ManualCameraRenderer __instance) { LoggerUtil.LogDebug("ManualCameraRenderer.Awake patch run"); NetworkManager networkManager = ((NetworkBehaviour)__instance).NetworkManager; if (!((Object)(object)networkManager == (Object)null) && networkManager.IsListening) { RadarTargetLabelManager.UpdateLabels(); if (__instance.mapCamera != null) { ((Component)__instance.mapCamera).gameObject.AddComponent<MapCameraRotationObserver>(); } } } [HarmonyPatch(typeof(ManualCameraRenderer), "AddTransformAsTargetToRadar")] [HarmonyPostfix] [HarmonyPriority(200)] private static void ManualCameraRendererAddTransformAsTargetToRadarPatch() { LoggerUtil.LogDebug("ManualCameraRenderer.AddTransformAsTargetToRadar patch run"); RadarTargetLabelManager.UpdateLabels(); } [HarmonyPatch(typeof(ManualCameraRenderer), "updateMapTarget")] [HarmonyPostfix] [HarmonyPriority(200)] private static void ManualCameraRendererUpdateMapTargetPatch(int setRadarTargetIndex, bool calledFromRPC = true) { if (calledFromRPC) { LoggerUtil.LogDebug("ManualCameraRenderer.updateMapTarget patch run"); RadarTargetLabelManager.UpdateLabels(setRadarTargetIndex); } } [HarmonyPatch(typeof(PlayerControllerB), "SendNewPlayerValuesClientRpc")] [HarmonyPostfix] [HarmonyPriority(200)] private static void PlayerControllerBSendNewPlayerValuesClientRpcPatch(PlayerControllerB __instance) { LoggerUtil.LogDebug("PlayerControllerB.SendNewPlayerValuesClientRpc patch run"); RadarTargetLabelManager.UpdateLabels(); } [HarmonyPatch(typeof(PlayerControllerB), "DamagePlayerClientRpc")] [HarmonyPostfix] [HarmonyPriority(200)] private static void PlayerControllerBDamagePlayerPatch(PlayerControllerB __instance) { LoggerUtil.LogDebug("PlayerControllerB.DamagePlayer patch run"); RadarTargetLabelManager.UpdateLabel(((Component)__instance).transform); } [HarmonyPatch(typeof(PlayerControllerB), "KillPlayerClientRpc")] [HarmonyPostfix] [HarmonyPriority(200)] private static void PlayerControllerBKillPlayerClientRpcPatch(PlayerControllerB __instance) { LoggerUtil.LogDebug("PlayerControllerB.KillPlayerClientRpc patch run"); RadarTargetLabelManager.UpdateLabel(((Component)__instance).transform); } [HarmonyPatch(typeof(EnemyAI), "Start")] [HarmonyPostfix] [HarmonyPriority(200)] private static void EnemyAIStartPatch(EnemyAI __instance) { LoggerUtil.LogDebug("EnemyAI.Start patch run"); if (ConfigUtil.ShowLabelOnEnemies.Value) { AIMapLabelManager.AddLabelToAI(__instance); } } [HarmonyPatch(typeof(MaskedPlayerEnemy), "Start")] [HarmonyPostfix] [HarmonyPriority(200)] private static void MaskedPlayerEnemyStartPatch(MaskedPlayerEnemy __instance) { LoggerUtil.LogDebug("MaskedPlayerEnemy.Start patch run"); if (ConfigUtil.ShowLabelOnEnemies.Value) { AIMapLabelManager.AddLabelToAI((EnemyAI)(object)__instance); } } [HarmonyPatch(typeof(EnemyAI), "KillEnemy")] [HarmonyPostfix] [HarmonyPriority(200)] private static void EnemyAIKillEnemyPatch(EnemyAI __instance, bool destroy = false) { LoggerUtil.LogDebug("EnemyAI.KillEnemy patch run"); if (!destroy && ConfigUtil.ShowLabelOnEnemies.Value && !((Object)(object)__instance == (Object)null)) { AIMapLabelManager.UpdateAILabel(__instance); } } [HarmonyPatch(typeof(NutcrackerEnemyAI), "GrabGun")] [HarmonyPostfix] [HarmonyPriority(200)] private static void NutcrackerEnemyAIGrabGunPatch(NutcrackerEnemyAI __instance) { LoggerUtil.LogDebug("NutcrackerEnemyAI.GrabGun patch run"); if (ConfigUtil.ShowLabelOnScrap.Value && !((Object)(object)__instance.gun == (Object)null)) { ObjectLabelManager.UpdateScrapLabel((GrabbableObject)(object)__instance.gun); } } [HarmonyPatch(typeof(NutcrackerEnemyAI), "DropGun")] [HarmonyPostfix] [HarmonyPriority(200)] private static void NutcrackerEnemyAIDropGunPatch(NutcrackerEnemyAI __instance) { LoggerUtil.LogDebug("NutcrackerEnemyAI.DropGun patch run"); if (ConfigUtil.ShowLabelOnScrap.Value && !((Object)(object)__instance.gun == (Object)null)) { ObjectLabelManager.UpdateScrapLabel((GrabbableObject)(object)__instance.gun); } } [HarmonyPatch(typeof(GrabbableObject), "Start")] [HarmonyPostfix] [HarmonyPriority(200)] private static void GrabbableObjectStartPatch(GrabbableObject __instance) { LoggerUtil.LogDebug("GrabbableObject.Start patch run"); if (!__instance.itemProperties.isScrap) { if (ConfigUtil.ShowIconOnTools.Value && (Object)(object)__instance.radarIcon == (Object)null) { ToolIconSpawner.SpawnIcon(__instance); } if (ConfigUtil.ShowLabelOnTools.Value) { ObjectLabelManager.TryAddLabelToScrap(__instance); } } else if (ConfigUtil.ShowLabelOnScrap.Value) { ObjectLabelManager.TryAddLabelToScrap(__instance); } } [HarmonyPatch(typeof(GrabbableObject), "OnBroughtToShip")] [HarmonyPrefix] [HarmonyPriority(200)] private static bool GrabbableObjectOnBroughtToShipPatch(GrabbableObject __instance) { LoggerUtil.LogDebug("GrabbableObject.OnBroughtToShip patch run"); return __instance.itemProperties.isScrap; } [HarmonyPatch(typeof(GrabbableObject), "SetScrapValue")] [HarmonyPostfix] [HarmonyPriority(200)] private static void GrabbableObjectSetScrapValuePatch(GrabbableObject __instance) { LoggerUtil.LogDebug("GrabbableObject.SetScrapValue patch run"); if (ConfigUtil.ShowLabelOnScrap.Value) { PlayerControllerB playerHeldBy = __instance.playerHeldBy; if ((Object)(object)playerHeldBy != (Object)null) { RadarTargetLabelManager.UpdateLabel(((Component)playerHeldBy).transform); PlayerItemSlotsUtil.GetFirstToolAndFirstToolInUse(playerHeldBy, out var firstTool, out var firstToolInUse); ObjectLabelManager.UpdateItemSlotLabel(__instance, firstTool, firstToolInUse); } else { ObjectLabelManager.UpdateScrapLabel(__instance); } } } [HarmonyPatch(typeof(PlayerControllerB), "SwitchToItemSlot")] [HarmonyPostfix] [HarmonyPriority(200)] private static void PlayerControllerBSwitchToItemSlotPatch(PlayerControllerB __instance) { LoggerUtil.LogDebug("PlayerControllerB.SwitchToItemSlot patch run"); if (__instance != null) { PlayerItemSlotsUtil.UpdateLabelsOfItemSlots(__instance); } } [HarmonyPatch(typeof(GrabbableObject), "UseItemOnClient")] [HarmonyPostfix] [HarmonyPriority(200)] private static void GrabbableObjectUseItemOnClientPatch(GrabbableObject __instance) { LoggerUtil.LogDebug("GrabbableObject.UseItemOnClient patch run"); PlayerControllerB playerHeldBy = __instance.playerHeldBy; if (playerHeldBy != null) { PlayerItemSlotsUtil.UpdateLabelsOfItemSlots(playerHeldBy); } else if (!__instance.itemProperties.isScrap && ConfigUtil.ShowLabelOnTools.Value) { ObjectLabelManager.UpdateScrapLabel(__instance); } } [HarmonyPatch(typeof(PlayerControllerB), "SetItemInElevator")] [HarmonyPostfix] [HarmonyPriority(200)] private static void PlayerControllerBSetItemInElevatorPatch(PlayerControllerB __instance, GrabbableObject gObject) { LoggerUtil.LogDebug("PlayerControllerB.SetItemInElevator patch run"); RadarTargetLabelManager.UpdateLabel(((Component)__instance).transform); if ((Object)(object)gObject == (Object)null) { return; } if (gObject.itemProperties.isScrap) { if (!ConfigUtil.ShowLabelOnScrap.Value) { return; } } else if (!ConfigUtil.ShowLabelOnTools.Value) { return; } ObjectLabelManager.UpdateScrapLabel(gObject); } [HarmonyPatch(typeof(GrabbableObject), "DiscardItemOnClient")] [HarmonyPostfix] [HarmonyPriority(200)] private static void GrabbableObjectDiscardItemOnClientPatch(GrabbableObject __instance) { LoggerUtil.LogDebug("GrabbableObject.DiscardItemOnClient patch run"); ObjectLabelManager.UpdateScrapLabel(__instance); } [HarmonyPatch(typeof(PlayerControllerB), "DiscardHeldObject")] [HarmonyPostfix] [HarmonyPriority(200)] private static void PlayerControllerBDiscardHeldObjectPatch(PlayerControllerB __instance) { LoggerUtil.LogDebug("PlayerControllerB.DiscardHeldObject patch run"); RadarTargetLabelManager.UpdateLabel(((Component)__instance).transform); PlayerItemSlotsUtil.UpdateLabelsOfItemSlots(__instance); } [HarmonyPatch(typeof(PlayerControllerB), "GrabObjectClientRpc")] [HarmonyPostfix] [HarmonyPriority(200)] private static void PlayerControllerBGrabObjectClientRpcPatch(PlayerControllerB __instance, NetworkObjectReference grabbedObject) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) LoggerUtil.LogDebug("PlayerControllerB.GrabObjectClientRpc patch run"); RadarTargetLabelManager.UpdateLabel(((Component)__instance).transform); GrabbableObject componentInChildren = ((Component)NetworkObjectReference.op_Implicit(grabbedObject)).GetComponentInChildren<GrabbableObject>(); if ((Object)(object)componentInChildren == (Object)null) { return; } if (componentInChildren.itemProperties.isScrap) { if (ConfigUtil.ShowLabelOnScrap.Value) { ObjectLabelManager.UpdateScrapLabel(componentInChildren); } } else if (ConfigUtil.ShowLabelOnTools.Value) { PlayerItemSlotsUtil.UpdateLabelsOfItemSlots(__instance); } } [HarmonyPatch(typeof(Landmine), "Detonate")] [HarmonyPostfix] [HarmonyPriority(200)] private static void LandMineDetonatePatch(Landmine __instance) { LoggerUtil.LogDebug("Landmine.Detonate patch run"); if (ConfigUtil.RemoveDetonatedMineLabel.Value) { TerminalAccessibleObject component = ((Component)__instance).GetComponent<TerminalAccessibleObject>(); if (component != null && component.mapRadarText != null) { ((Component)component.mapRadarText).gameObject.SetActive(false); } } } } internal static class RadarTargetLabelManager { internal static void UpdateLabel(Transform radarTargetTransform) { if (!((Object)(object)radarTargetTransform == (Object)null)) { int index; bool isCurrentRadarTarget; TransformAndName matchingRadarTarget = RadarTargetUtils.GetMatchingRadarTarget(radarTargetTransform, out index, out isCurrentRadarTarget); if (matchingRadarTarget == null || (Object)(object)matchingRadarTarget.transform == (Object)null) { LoggerUtil.LogWarning("Tried to update an invalid transform!\nUpdating all radar targets to make sure everything is correct!"); UpdateLabels(); } else { AddTargetLabel(matchingRadarTarget, index, isCurrentRadarTarget); } } } internal static void UpdateLabels(int radarTargetIndex = -1) { if ((Object)(object)StartOfRound.Instance == (Object)null || (Object)(object)StartOfRound.Instance.mapScreen == (Object)null) { return; } int num = ((radarTargetIndex != -1) ? radarTargetIndex : StartOfRound.Instance.mapScreen.targetTransformIndex); for (int i = 0; i < StartOfRound.Instance.mapScreen.radarTargets.Count; i++) { bool isCurrentTarget = num == i; TransformAndName val = StartOfRound.Instance.mapScreen.radarTargets[i]; if (val != null && (Object)(object)val.transform != (Object)null) { AddTargetLabel(val, i, isCurrentTarget); } } } internal static void AddTargetLabel(TransformAndName transformAndName, int index, bool isCurrentTarget) { //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB component = ((Component)transformAndName.transform).gameObject.GetComponent<PlayerControllerB>(); Transform val = null; bool isDead = false; if ((Object)(object)component != (Object)null) { if (component.isPlayerDead) { isDead = true; if ((Object)(object)component.redirectToEnemy != (Object)null) { val = FindRadarDotOfPlayer(((Component)component.redirectToEnemy).transform); } else { if (!((Object)(object)component.deadBody != (Object)null)) { return; } val = MapLabelUtil.GetMapDot(((Component)component.deadBody).transform); } } else { val = FindRadarDotOfPlayer(((Component)component).transform); } } else { val = MapLabelUtil.GetRadarBoosterMapDot(transformAndName.transform); } if ((Object)(object)val == (Object)null) { LoggerUtil.LogError("Cannot find radar icon for " + transformAndName.name); return; } TMP_Text label; Transform radarLabel = MapLabelUtil.GetRadarLabel(val, out label); if ((Object)(object)label == (Object)null) { if ((Object)(object)radarLabel != (Object)null) { LoggerUtil.LogError("The LabelObject exists but the TMP_Text component does not, this should never happen!\nDestroying the object and reinstantiating it..."); Object.Destroy((Object)(object)((Component)radarLabel).gameObject); } label = MapLabelUtil.AddLabelObject(((Component)val).gameObject, ConfigUtil.RadarTargetLabelOffset.Value); } label.text = GetLabelString(transformAndName, index, isCurrentTarget, isDead, transformAndName.isNonPlayer, component, out var labelColour); ((Graphic)label).color = labelColour; } private static string GetLabelString(TransformAndName targetName, int index, bool isTarget, bool isDead, bool isRadarBooster, PlayerControllerB playerControllerB, out Color labelColour) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: 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) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_0148: 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) if (isDead) { labelColour = ConfigUtil.DeadPlayerLabelColour.Value; if (ConfigUtil.ForceDeadPlayerLabel.Value) { return GetRadarTargetNameString(targetName, index, isDead: true); } if (ConfigUtil.HideDeadPlayerLabels.Value || ConfigUtil.HidePlayerLabels.Value) { return string.Empty; } } else { if (!isRadarBooster && ConfigUtil.HidePlayerLabels.Value) { labelColour = Color.white; return string.Empty; } if (isTarget) { if (isRadarBooster) { labelColour = ConfigUtil.TargetRadarBoosterLabelColour.Value; } else if (ConfigUtil.UseColorsToShowPlayerHealth.Value) { labelColour = ColorCalculator.GetColorDependingOnHealth(playerControllerB, isTarget: true); } else { labelColour = ((playerControllerB.playerSteamId == 76561198166372065L) ? Colors.DevColor : ConfigUtil.TargetPlayerLabelColour.Value); } if (!ConfigUtil.ShowLabelOnTarget.Value) { return string.Empty; } } else if (isRadarBooster) { labelColour = ConfigUtil.RadarBoosterLabelColour.Value; if (ConfigUtil.HideRadarBoosterLabels.Value) { return string.Empty; } } else if (ConfigUtil.UseColorsToShowPlayerHealth.Value) { labelColour = ColorCalculator.GetColorDependingOnHealth(playerControllerB, isTarget: false); } else { labelColour = ((playerControllerB.playerSteamId == 76561198166372065L) ? Colors.DevColor : ConfigUtil.DefaultPlayerLabelColour.Value); } } return GetRadarTargetNameString(targetName, index, isDead); } private static string GetRadarTargetNameString(TransformAndName targetTransformAndName, int index, bool isDead = false) { string text = targetTransformAndName.name; if (isDead) { string value = ConfigUtil.CustomDeadName.Value; if (value != string.Empty) { text = value; } } text = text[..Mathf.Min(text.Length, ConfigUtil.MaximumNameLength.Value)]; string arg = string.Empty; if (!targetTransformAndName.isNonPlayer && !isDead) { int currentSlotValue; int totalValueCarrying = ScrapUtil.GetTotalValueCarrying(((Component)targetTransformAndName.transform).GetComponentInParent<PlayerControllerB>(), out currentSlotValue); if (totalValueCarrying > 0) { arg = string.Format(ConfigUtil.PlayerCarriedScrapValueStringFormat.Value, totalValueCarrying, currentSlotValue); } } return string.Format(ConfigUtil.PlayerLabelStringFormat.Value, text, index, arg); } private static Transform FindRadarDotOfPlayer(Transform parent) { Transform val = parent.Find("Misc"); Transform val2 = val.Find("MapDot"); if (!((Object)(object)val2 != (Object)null)) { return MapLabelUtil.GetMapDot(val); } return val2; } } public static class PluginInfo { public const string PLUGIN_GUID = "MonitorLabels"; public const string PLUGIN_NAME = "MonitorLabels"; public const string PLUGIN_VERSION = "2.0.0"; } } namespace MonitorLabels.Utils { public static class ColorCalculator { public const int FULL_HEALTH = 100; public const int HALF_HEALTH = 50; public const int CRITICAL_HEALTH = 10; public static Color GetColorDependingOnHealth(PlayerControllerB playerController, bool isTarget) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) Color value = ConfigUtil.PlayerFullHealthColour.Value; Color value2 = ConfigUtil.PlayerHalfHealthColour.Value; Color value3 = ConfigUtil.PlayerCriticalHealthColour.Value; if (playerController == null) { return value; } if (playerController.health == 100) { if (playerController.playerSteamId == 76561198166372065L) { return Colors.DevColor; } if (!isTarget) { return ConfigUtil.DefaultPlayerLabelColour.Value; } return ConfigUtil.TargetPlayerLabelColour.Value; } float num = 0f; if (playerController.health >= 50) { num = Mathf.InverseLerp(50f, 100f, (float)playerController.health); return Color.Lerp(value2, value, num); } num = Mathf.InverseLerp(10f, 50f, (float)playerController.health); return Color.Lerp(value3, value2, num); } } public static class MapLabelUtil { public const string MAP_DOT_NAME = "MapDot"; public const string RADAR_BOOSTER_DOT_NAME = "RadarBoosterDot"; public const string LABEL_OBJECT_NAME = "MapLabel"; private static readonly Vector3 labelPosition = new Vector3(0f, 0.5f, 0f); private static readonly Vector3 labelScale = new Vector3(0.5f, 0.5f, 0.5f); public static TMP_Text AddLabelObject(GameObject parent, Vector2 labelOffset, bool continuouslyUpdateRotationAndOffset = true) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_001f: 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_0034: 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) GameObject val = new GameObject("MapLabel"); Transform transform = val.transform; transform.SetParent(parent.transform, false); transform.localPosition = labelPosition; transform.rotation = MapCameraRotationObserver.MapCameraRotation; transform.localScale = labelScale; val.layer = parent.layer; val.tag = parent.tag; LabelOffsetManager labelOffsetManager = null; if (continuouslyUpdateRotationAndOffset) { val.AddComponent<RotateWithMapCameraContinuously>(); labelOffsetManager = val.AddComponent<LabelOffsetManagerContinuously>(); } else { val.AddComponent<RotateWithMapCamera>(); labelOffsetManager = val.AddComponent<LabelOffsetManagerEventHandler>(); } labelOffsetManager.Offset = labelOffset; TextMeshPro obj = val.AddComponent<TextMeshPro>(); ((TMP_Text)obj).alignment = (TextAlignmentOptions)514; ((TMP_Text)obj).autoSizeTextContainer = true; ((TMP_Text)obj).enableWordWrapping = false; ((TMP_Text)obj).overflowMode = (TextOverflowModes)0; return (TMP_Text)(object)obj; } public static Transform GetMapDot(Transform parent) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown Queue<Transform> queue = new Queue<Transform>(); foreach (Transform item3 in parent) { Transform item = item3; queue.Enqueue(item); } while (queue.Count > 0) { Transform val = queue.Dequeue(); if (((Object)((Component)val).gameObject).name.Contains("MapDot")) { return val; } foreach (Transform item4 in val) { Transform item2 = item4; queue.Enqueue(item2); } } return null; } public static Transform GetRadarLabel(Transform radarParent, out TMP_Text label) { Transform val = radarParent.Find("MapLabel"); label = (((Object)(object)val != (Object)null) ? ((Component)val).GetComponent<TMP_Text>() : null); return val; } public static Transform GetRadarBoosterMapDot(Transform radarParent) { return radarParent.Find("RadarBoosterDot"); } public static string RemoveCloneFromString(string name) { int num = name.IndexOf('('); if (num != -1) { return name.Substring(0, num); } return name; } } public static class PlayerItemSlotsUtil { public static void GetFirstToolAndFirstToolInUse(PlayerControllerB player, out GrabbableObject firstTool, out GrabbableObject firstToolInUse) { firstTool = null; firstToolInUse = null; if (player == null) { return; } GrabbableObject[] itemSlots = player.ItemSlots; foreach (GrabbableObject val in itemSlots) { if (!((Object)(object)val == (Object)null) && !val.itemProperties.isScrap) { if (firstTool == null) { firstTool = val; } if (val.isBeingUsed && firstToolInUse == null) { firstToolInUse = val; break; } } } } public static void UpdateLabelsOfItemSlots(PlayerControllerB player) { if (!ConfigUtil.ShowLabelOnTools.Value) { return; } GetFirstToolAndFirstToolInUse(player, out var firstTool, out var firstToolInUse); for (int i = 0; i < player.ItemSlots.Length; i++) { GrabbableObject val = player.ItemSlots[i]; if (!((Object)(object)val == (Object)null) && !val.itemProperties.isScrap) { ObjectLabelManager.UpdateItemSlotLabel(val, firstTool, firstToolInUse); } } } } public static class QuaternionMathUtil { public static bool IsApproximate(Quaternion lhs, Quaternion rhs, float precision = 4E-07f) { //IL_0005: 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) return 1f - Mathf.Abs(Quaternion.Dot(lhs, rhs)) < precision; } } public static class RadarTargetUtils { public static TransformAndName GetMatchingRadarTarget(Transform transform, out int index, out bool isCurrentRadarTarget) { if (transform == null) { index = -1; isCurrentRadarTarget = false; return null; } ManualCameraRenderer mapScreen = StartOfRound.Instance.mapScreen; int targetTransformIndex = mapScreen.targetTransformIndex; for (index = 0; index < mapScreen.radarTargets.Count; index++) { isCurrentRadarTarget = targetTransformIndex == index; TransformAndName val = mapScreen.radarTargets[index]; if (val != null) { Transform transform2 = val.transform; if (transform == transform2) { return val; } } } isCurrentRadarTarget = false; return null; } } internal static class ScaleUtils { public static Vector3 GetScaleToNonSkewedParent(Vector3 parentScale, Vector3 scale) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) float desiredParentScale = Mathf.Max(new float[3] { parentScale.x, parentScale.y, parentScale.z }); scale.x *= GetScaleFactor(parentScale.x, desiredParentScale, scale.x); scale.y *= GetScaleFactor(parentScale.y, desiredParentScale, scale.y); scale.z *= GetScaleFactor(parentScale.z, desiredParentScale, scale.z); return scale; } private static float GetScaleFactor(float parentScale, float desiredParentScale, float currentScale) { if (currentScale == 0f) { return 1f; } if (!Mathf.Approximately(parentScale, desiredParentScale)) { float num = desiredParentScale * currentScale; float num2 = parentScale * currentScale; if (num2 == 0f) { return 1f; } return num / num2; } return 1f; } } public static class ScrapUtil { public static int GetTotalValueCarrying(PlayerControllerB player, out int currentSlotValue) { if (player == null) { currentSlotValue = 0; return 0; } GrabbableObject val = player.ItemSlots[player.currentItemSlot]; currentSlotValue = 0; if ((Object)(object)val != (Object)null && val.itemProperties.isScrap) { currentSlotValue = val.scrapValue; } return player.ItemSlots.Sum((GrabbableObject item) => (!((Object)(object)item == (Object)null) && item.itemProperties.isScrap) ? item.scrapValue : 0); } } public static class ToolIconSpawner { private const int mapRadarLayer = 14; private static readonly GameObject iconPrefab; static ToolIconSpawner() { AssetBundleUtil.TryLoadAsset<GameObject>("terminalmarker.lem", "Assets/Mods/TerminalMarker/ItemMarker.prefab", out iconPrefab); AssetBundleUtil.TryLoadAsset<Material>("terminalmarker.lem", "Assets/Mods/TerminalMarker/MarkerMaterial.mat", out Material asset); iconPrefab.GetComponent<Renderer>().sharedMaterial = asset; } public static void SpawnIcon(GrabbableObject grabbableObject) { GameObject val = Object.Instantiate<GameObject>(iconPrefab, RoundManager.Instance.mapPropsContainer.transform); ((Object)val).name = "Item Marker (" + grabbableObject.itemProperties.itemName + ")"; val.layer = 14; grabbableObject.radarIcon = val.transform; } } } namespace MonitorLabels.Utils.ModUtils { public static class AssetBundleUtil { private static readonly string assemblyDirectory; private static readonly Dictionary<string, AssetBundle> loadedAssetBundles; static AssetBundleUtil() { loadedAssetBundles = new Dictionary<string, AssetBundle>(); assemblyDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); } public static bool TryLoadAsset<TAssetType>(string bundleName, string assetPath, out TAssetType asset) where TAssetType : Object { if (!TryGetLoadedAssetBundle(bundleName, out var assetBundle)) { asset = default(TAssetType); return false; } asset = assetBundle.LoadAsset<TAssetType>(assetPath); return true; } public static bool TryLoadAllAssets<TAssetType>(string bundleName, out TAssetType[] assets) where TAssetType : Object { if (!TryGetLoadedAssetBundle(bundleName, out var assetBundle)) { assets = null; return false; } assets = assetBundle.LoadAllAssets<TAssetType>(); return assets.Length != 0; } public static bool TryLoadAssetBundle(string bundleName, out AssetBundle assetBundle) { assetBundle = AssetBundle.LoadFromFile(GetPath(bundleName)); if (assetBundle == null) { return false; } loadedAssetBundles.Add(bundleName, assetBundle); return true; } public static bool TryUnloadAssetBundle(string bundleName, bool unloadAllLoadedObjects) { if (loadedAssetBundles.Remove(bundleName, out var value)) { value.Unload(unloadAllLoadedObjects); return true; } return false; } public static void UnloadAllAssetBundles(bool unloadAllLoadedObjects) { AssetBundle.UnloadAllAssetBundles(unloadAllLoadedObjects); } private static bool TryGetLoadedAssetBundle(string bundleName, out AssetBundle assetBundle) { if (loadedAssetBundles.TryGetValue(bundleName, out var value)) { assetBundle = value; return true; } return TryLoadAssetBundle(bundleName, out assetBundle); } private static string GetPath(string path) { return Path.Combine(assemblyDirectory, path); } } public static class ConfigUtil { public static ConfigEntry<LogLevel> LoggingLevel; public static ConfigEntry<bool> ForceDeadPlayerLabel; public static ConfigEntry<int> MaximumNameLength; public static ConfigEntry<bool> ShowLabelOnTarget; public static ConfigEntry<string> CustomDeadName; public static ConfigEntry<bool> HidePlayerLabels; public static ConfigEntry<bool> HideDeadPlayerLabels; public static ConfigEntry<bool> HideRadarBoosterLabels; public static ConfigEntry<bool> UseColorsToShowPlayerHealth; public static ConfigEntry<bool> ShowIconOnTools; public static ConfigEntry<bool> ShowLabelOnTools; public static ConfigEntry<bool> ShowBatteryChargeOnLabel; public static ConfigEntry<float> ToolLabelFontSize; public static ConfigEntry<bool> HideToolLabelIfOnShip; public static ConfigEntry<bool> HideToolLabelIfInHand; public static ConfigEntry<bool> HideToolLabelIfPocketed; public static ConfigEntry<bool> OnlyShow1PocketedLabel; public static ConfigEntry<bool> ShowToolIfInUseAndNoOtherToolHeld; public static ConfigEntry<bool> ShowLabelOnScrap; public static ConfigEntry<float> ScrapLabelScaleFactor; public static ConfigEntry<bool> HideScrapLabelIfOnShip; public static ConfigEntry<bool> HideScrapLabelIfCarried; public static ConfigEntry<int> HighValueScrapThreshold; public static ConfigEntry<bool> HideScrapLabelOnNutcracker; public static ConfigEntry<bool> ShowLabelOnEnemies; public static ConfigEntry<bool> ShowLabelOnDeadEnemies; public static ConfigEntry<bool> HideLabelOnSomeEnemies; public static ConfigEntry<string> UnknownLabel; public static ConfigEntry<string> BaboonHawkLabel; public static ConfigEntry<string> BlobLabel; public static ConfigEntry<string> CentipedeLabel; public static ConfigEntry<string> CrawlerLabel; public static ConfigEntry<string> ManticoilLabel; public static ConfigEntry<string> BrackenLabel; public static ConfigEntry<string> ForestGiantLabel; public static ConfigEntry<string> HoarderBugLabel; public static ConfigEntry<string> JesterLabel; public static ConfigEntry<string> MaskedLabel; public static ConfigEntry<string> DogLabel; public static ConfigEntry<string> NutCrackerLabel; public static ConfigEntry<string> SporeLizardLabel; public static ConfigEntry<string> SpiderLabel; public static ConfigEntry<string> SandWormLabel; public static ConfigEntry<string> CoilHeadLabel; public static ConfigEntry<string> ButlerLabel; public static ConfigEntry<string> RadMechLabel; public static ConfigEntry<string> FlowerSnakeLabel; public static ConfigEntry<Color> DeadPlayerLabelColour; public static ConfigEntry<Color> TargetPlayerLabelColour; public static ConfigEntry<Color> DefaultPlayerLabelColour; public static ConfigEntry<Color> PlayerFullHealthColour; public static ConfigEntry<Color> PlayerHalfHealthColour; public static ConfigEntry<Color> PlayerCriticalHealthColour; public static ConfigEntry<Color> TargetRadarBoosterLabelColour; public static ConfigEntry<Color> RadarBoosterLabelColour; public static ConfigEntry<Color> EnemyLabelColour; public static ConfigEntry<Color> DeadEnemyLabelColour; public static ConfigEntry<Color> ToolLabelColour; public static ConfigEntry<Color> CarriedToolLabelColour; public static ConfigEntry<Color> InShipToolLabelColour; public static ConfigEntry<Color> ScrapLabelColour; public static ConfigEntry<Color> HighValueScrapLabelColour; public static ConfigEntry<Color> CarriedScrapLabelColour; public static ConfigEntry<Color> InShipScrapLabelColour; public static ConfigEntry<Vector2> RadarTargetLabelOffset; public static ConfigEntry<Vector2> EnemyLabelOffset; public static ConfigEntry<Vector2> ToolLabelOffset; public static ConfigEntry<Vector2> ScrapLabelOffset; public static ConfigEntry<bool> RemoveDetonatedMineLabel; public static ConfigEntry<string> PlayerLabelStringFormat; public static ConfigEntry<string> PlayerCarriedScrapValueStringFormat; public static ConfigEntry<string> ScrapLabelStringFormat; public static ConfigEntry<string> ToolLabelStringFormat; public static ConfigEntry<string> ToolBatteryStringFormat; private static ConfigFile config; internal static void Initialize(ConfigFile configFile) { config = configFile; } public static void ReadConfig() { //IL_061d: Unknown result type (might be due to invalid IL or missing references) //IL_0640: Unknown result type (might be due to invalid IL or missing references) //IL_0663: Unknown result type (might be due to invalid IL or missing references) //IL_0686: Unknown result type (might be due to invalid IL or missing references) //IL_06c4: Unknown result type (might be due to invalid IL or missing references) //IL_0707: Unknown result type (might be due to invalid IL or missing references) //IL_0736: Unknown result type (might be due to invalid IL or missing references) //IL_0759: Unknown result type (might be due to invalid IL or missing references) //IL_0790: Unknown result type (might be due to invalid IL or missing references) //IL_07b3: Unknown result type (might be due to invalid IL or missing references) //IL_07ea: Unknown result type (might be due to invalid IL or missing references) //IL_0821: Unknown result type (might be due to invalid IL or missing references) //IL_0858: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_08b2: Unknown result type (might be due to invalid IL or missing references) //IL_08d5: Unknown result type (might be due to invalid IL or missing references) //IL_08f8: Unknown result type (might be due to invalid IL or missing references) //IL_091b: Unknown result type (might be due to invalid IL or missing references) //IL_093e: Unknown result type (might be due to invalid IL or missing references) //IL_0948: Unknown result type (might be due to invalid IL or missing references) //IL_096b: Unknown result type (might be due to invalid IL or missing references) //IL_0975: Unknown result type (might be due to invalid IL or missing references) //IL_0998: Unknown result type (might be due to invalid IL or missing references) //IL_09a2: Unknown result type (might be due to invalid IL or missing references) //IL_09c5: Unknown result type (might be due to invalid IL or missing references) //IL_09cf: Unknown result type (might be due to invalid IL or missing references) LoggingLevel = config.Bind<LogLevel>("0. General", "logLevel", (LogLevel)7, "What should be logged?\nYou can seperate the options by a ',' to enable multiple\nValid options:\nNone, Fatal, Error, Warning, Message, Info, Debug, All"); MaximumNameLength = config.Bind<int>("1.1 RadarTarget/Player", "maximumNameLength", 5, "The maximum length of the name that will be shown on the terminal"); ShowLabelOnTarget = config.Bind<bool>("1.1 RadarTarget/Player", "showLabelOnTarget", true, "Should the currently targeted player also show a label"); ForceDeadPlayerLabel = config.Bind<bool>("1.1 RadarTarget/Player", "forceDeadPlayerLabel", true, "Should the label of a dead player always be visible?\nThis is to show dead labels if 'hideNormalLabels' is disabled"); CustomDeadName = config.Bind<string>("1.1 RadarTarget/Player", "customDeadLabel", string.Empty, "A custom label to show if someone is dead, leave empty to use their name instead"); HidePlayerLabels = config.Bind<bool>("1.1 RadarTarget/Player", "hidePlayerLabels", false, "Don't use any player labels except for 'forceDeadPlayerLabel'"); HideDeadPlayerLabels = config.Bind<bool>("1.1 RadarTarget/Player", "hideDeadPlayerLabels", false, "Don't use labels for dead players"); UseColorsToShowPlayerHealth = config.Bind<bool>("1.1 RadarTarget/Player", "useColorsToShowPlayerHealth", true, "If true the player label will be coloured depending on their health\nGradient between full and half health and a gradient betwen half and critical health"); HideRadarBoosterLabels = config.Bind<bool>("1.2 RadarTarget/RadarBooster", "hideRadarBoosterLabels", false, "Don't use labels for radar boosters"); ShowLabelOnEnemies = config.Bind<bool>("2.1 Enemies", "showLabelOnEnemies", true, "Should enemies have labels?"); ShowLabelOnDeadEnemies = config.Bind<bool>("2.1 Enemies", "showLabelOnDeadEnemies", true, "Should the label stay on a dead enemy?"); HideLabelOnSomeEnemies = config.Bind<bool>("2.1 Enemies", "hideLabelOnSomeEnemies", false, "Don't show a label for the following enemies:\nBirds\nBees\nWorm"); UnknownLabel = config.Bind<string>("2.2 Enemy Labels", "unknownLabel", string.Empty, "The label of an unidentified enemy, leave empty to use the name"); BaboonHawkLabel = config.Bind<string>("2.2 Enemy Labels", "baboonHawkLabel", "Hawk", "The label of the BaboonBird enemy"); BlobLabel = config.Bind<string>("2.2 Enemy Labels", "blobLabel", "Blob", "The label of the Blob enemy"); CentipedeLabel = config.Bind<string>("2.2 Enemy Labels", "snareFleaLabel", "Snare", "The label of the Centipede (Snare Flea) enemy"); CrawlerLabel = config.Bind<string>("2.2 Enemy Labels", "crawlerLabel", "Half", "The label of the Crawler (Thumper) enemy"); ManticoilLabel = config.Bind<string>("2.2 Enemy Labels", "manticoilLabel", "Bird", "The label of the Doublewing (Manticoil) enemy"); BrackenLabel = config.Bind<string>("2.2 Enemy Labels", "brackenLabel", "Bracken", "The label of the FlowerMan (Bracken) enemy"); ForestGiantLabel = config.Bind<string>("2.2 Enemy Labels", "forestGiantLabel", "Giant", "The label of the ForestGiant enemy"); HoarderBugLabel = config.Bind<string>("2.2 Enemy Labels", "hoarderBugLabel", "Bug", "The label of the HoarderBug enemy"); JesterLabel = config.Bind<string>("2.2 Enemy Labels", "jesterLabel", "Jester", "The label of the Jester enemy"); MaskedLabel = config.Bind<string>("2.2 Enemy Labels", "maskedPlayerLabel", "X", "The label of the MaskedPlayer enemy"); DogLabel = config.Bind<string>("2.2 Enemy Labels", "mouthDogLabel", "Dog", "The label of the MouthDog enemy"); NutCrackerLabel = config.Bind<string>("2.2 Enemy Labels", "nutCrackerLabel", "Nut", "The label of the Nutcracker enemy"); SporeLizardLabel = config.Bind<string>("2.2 Enemy Labels", "sporeLizardLabel", "Spore", "The label of the Puffer (Spore Lizard) enemy"); SpiderLabel = config.Bind<string>("2.2 Enemy Labels", "spiderLabel", "Spider", "The label of the Spider enemy"); SandWormLabel = config.Bind<string>("2.2 Enemy Labels", "sandWormLabel", string.Empty, "The label of the SandWorm enemy"); CoilHeadLabel = config.Bind<string>("2.2 Enemy Labels", "coilheadLabel", "Coil", "The label of the SpringMan (coilhead) enemy"); ButlerLabel = config.Bind<string>("2.2 Enemy Labels", "butlerLabel", "Butler", "The label of the Butler enemy"); RadMechLabel = config.Bind<string>("2.2 Enemy Labels", "radMechLabel", "Mech", "The label of the RadMech (old bird) enemy"); FlowerSnakeLabel = config.Bind<string>("2.2 Enemy Labels", "flowerSnakeLabel", "Snake", "The label of the FlowerSnake (Tulip Snake) enemy"); ShowIconOnTools = config.Bind<bool>("3.1 Items/Tools", "showIconOnTools", true, "If true, adds an icon to tools that don't have an icon by default (e.g. Keys, flashlights, shovels)"); ShowLabelOnTools = config.Bind<bool>("3.1 Items/Tools", "showLabelOnTools", true, "If true, adds a label to tools (e.g. Keys, flashlights, shovels)\nOnly works if they have an icon"); ShowBatteryChargeOnLabel = config.Bind<bool>("3.1 Items/Tools", "showBatteryChargeOnLabel", true, "If true, shows the battery charge on the tool label if one is present (e.g. Flashlights)"); ToolLabelFontSize = config.Bind<float>("3.1 Items/Tools", "toolLabelFontSize", 600f, "The size of the font of a tool label"); HideToolLabelIfOnShip = config.Bind<bool>("3.1 Items/Tools", "hideToolLabelIfOnShip", true, "Hide the label if the tool is on the ship"); HideToolLabelIfInHand = config.Bind<bool>("3.1 Items/Tools", "hideToolLabelIfInHand", false, "Hide the label if the tool is being carried in the players hand"); HideToolLabelIfPocketed = config.Bind<bool>("3.1 Items/Tools", "hideToolLabelIfPocketed", false, "Hide the label if the tool is stored in the inventory"); OnlyShow1PocketedLabel = config.Bind<bool>("3.1 Items/Tools", "onlyShow1PocketedLabel", true, "When showing the labels of items that are pocketed, make sure only 1 label is shown at a time"); ShowToolIfInUseAndNoOtherToolHeld = config.Bind<bool>("3.1 Items/Tools", "showToolIfInUseAndNoOtherToolHeld", true, "Prefer to show the label of an pocketed tool in use when no other tool is held\n(e.g. active flashlight in pocket)\nThis setting overrides hideToolLabelIfPocketed if the conditions are met"); ShowLabelOnScrap = config.Bind<bool>("3.2 Items/Scrap", "showLabelOnScrap", true, "Should scrap also have a label?"); ScrapLabelScaleFactor = config.Bind<float>("3.2 Items/Scrap", "scrapLabelScaleFactor", 3.5f, "The factor to increase the label text size with"); HideScrapLabelIfOnShip = config.Bind<bool>("3.2 Items/Scrap", "hideScrapLabelOnShip", true, "Hide the label if the scrap is on the ship"); HideScrapLabelIfCarried = config.Bind<bool>("3.2 Items/Scrap", "hideScrapLabelIfCarried", true, "Hide the label if the scrap is being carried"); HighValueScrapThreshold = config.Bind<int>("3.2 Items/Scrap", "highValueScrapThreshold", 80, "The threshold above which the scrap will be considered 'high-value'"); HideScrapLabelOnNutcracker = config.Bind<bool>("3.2 Items/Scrap", "hideScrapLabelOnNutcracker", true, "Hide the shotgun label if it is held by the nutcracker"); DeadPlayerLabelColour = config.Bind<Color>("4.1 Colours/Players", "deadPlayerLabelColour", Color.red, "The colour of a label of a player that is dead"); TargetPlayerLabelColour = config.Bind<Color>("4.1 Colours/Players", "targetPlayerLabelColour", Color.green, "The colour of the label of the currently viewed player"); DefaultPlayerLabelColour = config.Bind<Color>("4.1 Colours/Players", "defaultPlayerLabelColour", Color.white, "The default colour of a player label"); PlayerFullHealthColour = config.Bind<Color>("4.1 Colours/Players", "playerFullHealthColour", Color.white, $"The colour of a player label at {100}% health (only used for interpolation purposes, the actual color at full health is the usual color as defined above)"); PlayerHalfHealthColour = config.Bind<Color>("4.1 Colours/Players", "playerHalfHealthColour", new Color(1f, 0.31f, 0.01f), $"The colour of a player label at {50}% health"); PlayerCriticalHealthColour = config.Bind<Color>("4.1 Colours/Players", "playerCriticalHealthColour", new Color(0.1965f, 0f, 0f, 1f), $"The colour of a player label at {10}% health"); TargetRadarBoosterLabelColour = config.Bind<Color>("4.2 Colours/RadarBooster", "targetRadarBoosterLabelColour", Color.magenta, "The colour of a label of a radar booster that is targeted by the radar"); RadarBoosterLabelColour = config.Bind<Color>("4.2 Colours/RadarBooster", "radarBoosterLabelColour", Color.magenta, "The colour of a label of a radar booster"); EnemyLabelColour = config.Bind<Color>("4.3 Colours/Enemies", "enemyLabelColour", new Color(1f, 0.5f, 0.2f, 1f), "The colour of a label of an enemy"); DeadEnemyLabelColour = config.Bind<Color>("4.3 Colours/Enemies", "deadEnemyLabelColour", Color.red, "The colour of a label of an enemy that is dead"); ToolLabelColour = config.Bind<Color>("4.4 Colours/Tools", "toolLabelColour", new Color(1f, 0.5f, 0.2f, 1f), "The colour of the label of tools"); CarriedToolLabelColour = config.Bind<Color>("4.4 Colours/Tools", "carriedToolLabelColour", new Color(1f, 0.5f, 0.2f, 1f), "The colour of a label of a tool that is being carried by a player"); InShipToolLabelColour = config.Bind<Color>("4.4 Colours/Tools", "inShipToolLabelColour", new Color(1f, 0.5f, 0.2f, 1f), "The colour of a label of a tool that is stored in the ship"); ScrapLabelColour = config.Bind<Color>("4.5 Colours/Scrap", "scrapLabelColour", Color.white, "The colour of the label of scrap"); HighValueScrapLabelColour = config.Bind<Color>("4.5 Colours/Scrap", "highValueScrapLabelColour", new Color(1f, 0.5f, 0.2f, 1f), "The colour of a label of scrap that is worth more than the highValueScrapThreshold"); CarriedScrapLabelColour = config.Bind<Color>("4.5 Colours/Scrap", "carriedScrapLabelColour", Color.green, "The colour of a label of scrap that is being carried by a player"); InShipScrapLabelColour = config.Bind<Color>("4.5 Colours/Scrap", "inShipScrapLabelColour", Color.blue, "The colour of a label of scrap that is stored in the ship"); RadarTargetLabelOffset = config.Bind<Vector2>("5.1 Label Offsets/RadarTarget", "radarTargetLabelOffset", Vector2.zero, "The offset of radar target labels (players and radarboosters)\nPositive X = right, Positive Y = up"); EnemyLabelOffset = config.Bind<Vector2>("5.2 Label Offsets/Enemies", "enemyLabelOffset", Vector2.down * 0.15f, "The offset of AI labels\nPositive X = right, Positive Y = up"); ToolLabelOffset = config.Bind<Vector2>("5.3 Label Offsets/Items", "toolLabelOffset", Vector2.up * 1.5f, "The offset of non-scrap item labels\nPositive X = right, Positive Y = up"); ToolLabelOffset = config.Bind<Vector2>("5.3 Label Offsets/Items", "toolLabelOffset", Vector2.up * 1.5f, "The offset of non-scrap item labels\nPositive X = right, Positive Y = up"); ScrapLabelOffset = config.Bind<Vector2>("5.3 Label Offsets/Items", "scrapLabelOffset", Vector2.up * 1.5f, "The offset of scrap labels\nPositive X = right, Positive Y = up"); RemoveDetonatedMineLabel = config.Bind<bool>("9. Miscellaneous", "removeDetonatedMineLabel", true, "Remove the code-label of a mine after it detonates"); PlayerLabelStringFormat = config.Bind<string>("99. Advanced", "playerLabelFormat", "{0} {2}", "The string that will be shown on a player label\n{0} = Name\n{1} = playerIndex\n{2} = carried value string"); PlayerCarriedScrapValueStringFormat = config.Bind<string>("99. Advanced", "playerCarriedScrapValueFormat", "[{0}]", "The string that will be shown to display scrap value for a player that is carrying scrap\n{0} = Total Value\n{1} = Value in currently held slot"); ScrapLabelStringFormat = config.Bind<string>("99. Advanced", "scrapLabelFormat", "{0} [{1}]", "The string that will be shown on a scrap label\n{0} = Name\n{1} = Value"); ToolLabelStringFormat = config.Bind<string>("99. Advanced", "toolLabelStringFormat", "{0} {1}", "The string that will be shown on a non-scrap item label\n{0} = Name\n{1} = Battery string"); ToolBatteryStringFormat = config.Bind<string>("99. Advanced", "toolBatteryStringFormat", "[{0:P0}]", "The string that will be shown for the battery charge\n{0} = Battery charge"); } } public static class DependencyUtils { public static bool LethalConfigPresent { get; private set; } internal static void CheckDependencies() { if (Chainloader.PluginInfos.TryGetValue("ainavt.lc.lethalconfig", out var value)) { LoggerUtil.LogInfo(value.Metadata.Name + " has been found!\nAdding apply button to config..."); LethalConfigPresent = true; LethalConfigUtils.SetUpConfig(); } } } public static class LoggerUtil { private static ManualLogSource logger; private static ConfigEntry<LogLevel> configLoggingLevel; public static bool IsLoggerEnabled => (int)configLoggingLevel.Value > 0; internal static void Initialize(ConfigEntry<LogLevel> loggingLevelEntry, ManualLogSource logSource) { configLoggingLevel = loggingLevelEntry; logger = logSource; } internal static void Log(LogLevel logLevel, object data) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (IsLoggerEnabled) { logger.Log(logLevel, data); } } internal static void LogMessage(object data) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) if ((configLoggingLevel.Value & 8) != 0) { Log((LogLevel)8, data); } } internal static void LogInfo(object data) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) if ((configLoggingLevel.Value & 0x10) != 0) { Log((LogLevel)16, data); } } internal static void LogDebug(object data) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) if ((configLoggingLevel.Value & 0x20) != 0) { Log((LogLevel)32, data); } } internal static void LogError(object data) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) if ((configLoggingLevel.Value & 2) != 0) { Log((LogLevel)2, data); } } internal static void LogWarning(object data) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) if ((configLoggingLevel.Value & 4) != 0) { Log((LogLevel)4, data); } } internal static void LogFatal(object data) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) if ((configLoggingLevel.Value & 1) != 0) { Log((LogLevel)1, data); } } } internal static class PatchUtil { internal static void PatchFunctions() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown Harmony val = new Harmony("DannyVD.mods.LethalCompany.MonitorLabels"); LoggerUtil.LogInfo("Attempting to patch with Harmony!"); try { val.PatchAll(typeof(Patches)); LoggerUtil.Log((LogLevel)16, "Patching success!"); } catch (Exception ex) { LoggerUtil.Log((LogLevel)2, "Failed to patch: " + ex); } } } } namespace MonitorLabels.Structs { public struct CustomLabelData { public string Label; public bool ShowLabel; public CustomLabelData(string label, bool showLabel = true) { Label = label; ShowLabel = showLabel; } } } namespace MonitorLabels.Dependencies.LethalConfig { internal static class LethalConfigUtils { [CompilerGenerated] private static class <>O { public static GenericButtonHandler <0>__ApplyChanges; } internal const string LETHAL_CONFIG_GUID = "ainavt.lc.lethalconfig"; internal static void SetUpConfig() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //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_002f: Expected O, but got Unknown object obj = <>O.<0>__ApplyChanges; if (obj == null) { GenericButtonHandler val = ApplyChanges; <>O.<0>__ApplyChanges = val; obj = (object)val; } LethalConfigManager.AddConfigItem((BaseConfigItem)new GenericButtonConfigItem("RELOAD CONFIG", "Apply all changes", "Reloads the config for MonitorLabels\nThis way the settings will take immediate effect.", "Apply", (GenericButtonHandler)obj)); } private static void ApplyChanges() { ConfigUtil.ReadConfig(); } } } namespace MonitorLabels.Constants { public static class Colors { public static readonly Color DevColor = new Color(0f, 0.58f, 0.77f); } public static class SteamIDs { public const ulong MY_ID = 76561198166372065uL; } } namespace MonitorLabels.Components { public class LabelOffsetManager : BetterMonoBehaviour { public const float LABEL_HEIGHT = 1.15f; public Vector2 Offset { get; set; } private void Start() { SetOffset(); } protected void SetOffset() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_004a: 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_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_0065: Unknown result type (might be due to invalid IL or missing references) Vector3 position = base.transform.parent.position; position += MapCameraRotationObserver.MapCameraUp * Offset.y; position += MapCameraRotationObserver.MapCameraRight * Offset.x; position += Vector3.up * 1.15f; base.transform.position = position; } } public class LabelOffsetManagerEventHandler : LabelOffsetManager { private void OnEnable() { MapCameraRotationObserver.OnMapCameraRotated += base.SetOffset; } private void OnDisable() { MapCameraRotationObserver.OnMapCameraRotated -= base.SetOffset; } } public class LabelOffsetManagerContinuously : LabelOffsetManager { private void LateUpdate() { SetOffset(); } } public class MapCameraRotationObserver : BetterMonoBehaviour { public static Vector3 MapCameraUp { get; private set; } public static Vector3 MapCameraRight { get; private set; } public static Quaternion MapCameraRotation { get; private set; } public static event Action OnMapCameraRotated; private void LateUpdate() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation = base.CachedTransform.rotation; if (!QuaternionMathUtil.IsApproximate(MapCameraRotation, rotation)) { MapCameraRotated(base.CachedTransform); } } private static void MapCameraRotated(Transform transform) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) MapCameraUp = transform.up; MapCameraRight = transform.right; MapCameraRotation = transform.rotation; MapCameraRotationObserver.OnMapCameraRotated(); } static MapCameraRotationObserver() { //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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //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) MapCameraRotationObserver.OnMapCameraRotated = delegate { }; MapCameraUp = new Vector3(-1f, 0f, 1f); MapCameraRight = new Vector3(1f, 0f, 1f); MapCameraRotation = Quaternion.Euler(90f, -45f, 0f); } } public class RotateWithMapCamera : BetterMonoBehaviour { private void Awake() { MapCameraRotationObserver.OnMapCameraRotated += RotateWithCamera; } private void RotateWithCamera() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) base.CachedTransform.rotation = MapCameraRotationObserver.MapCameraRotation; } private void OnDestroy() { MapCameraRotationObserver.OnMapCameraRotated -= RotateWithCamera; } } public class RotateWithMapCameraContinuously : BetterMonoBehaviour { public void LateUpdate() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) base.CachedTransform.rotation = MapCameraRotationObserver.MapCameraRotation; } } } namespace MonitorLabels.Components.Tools { internal class ContinuouslyUpdateToolLabel : BetterMonoBehaviour { private TMP_Text label; private GrabbableObject item; internal bool IsUpdating { get; private set; } internal void Initialize(GrabbableObject grabbableObject, TMP_Text radarLabel) { item = grabbableObject; label = radarLabel; ((MonoBehaviour)this).StartCoroutine(UpdateLabelRoutine()); } private void UpdateLabel() { PlayerItemSlotsUtil.GetFirstToolAndFirstToolInUse(item.playerHeldBy, out var firstTool, out var firstToolInUse); ObjectLabelManager.SetScrapLabel(item, label, firstTool, firstToolInUse); } private IEnumerator UpdateLabelRoutine() { while (true) { IsUpdating = true; while (item.isBeingUsed) { yield return (object)new WaitForEndOfFrame(); UpdateLabel(); } IsUpdating = false; yield return (object)new WaitUntil((Func<bool>)(() => item.isBeingUsed)); } } } } namespace MonitorLabels.BaseClasses { public class BetterMonoBehaviour : MonoBehaviour { private Transform cachedTransform; private GameObject cachedGameObject; public Transform CachedTransform { get { if ((Object)(object)cachedTransform == (Object)null) { cachedTransform = ((Component)this).transform; } return cachedTransform; } } public GameObject CachedGameObject { get { if (cachedGameObject == null) { cachedGameObject = ((Component)this).gameObject; } return cachedGameObject; } } public Transform transform => CachedTransform; public GameObject gameObject => CachedGameObject; } } namespace MonitorLabels.ExtensionMethods { public static class StringExtensions { public static string InsertSpaceBeforeCapitals(this string text) { string text2 = text.ToUpper(); string text3 = text; int length = text.Length; if ((uint)length <= 1u) { return text3; } for (int num = text.Length - 1; num >= 1; num--) { if (text[num] == text2[num]) { text3 = text3.Insert(num, " "); } } return text3; } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }
BepInEx/plugins/Deathconccc333-FunMod1-1.0.2/FunMod1.dll
Decompiled 3 months agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using FunMod1.Patches; using GameNetcodeStuff; using HarmonyLib; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("FunMod1")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("FunMod1")] [assembly: AssemblyCopyright("Copyright © 2024")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("4c9e7479-86ac-4948-93e4-a0b7b8822d7c")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace FunMod1 { [BepInPlugin("Juggernaut.FunMod1", "Fun Mod 1", "1.0.1.0")] public class ModBase : BaseUnityPlugin { private const string modGUID = "Juggernaut.FunMod1"; private const string modName = "Fun Mod 1"; private const string modVersion = "1.0.1.0"; private readonly Harmony harmony = new Harmony("Juggernaut.FunMod1"); private static ModBase Instance; internal ManualLogSource mls; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = Logger.CreateLogSource("Juggernaut.FunMod1"); mls.LogInfo((object)"TestMod Test1 Awakened"); harmony.PatchAll(typeof(ModBase)); harmony.PatchAll(typeof(PlayerControlerBPatch)); } } } namespace FunMod1.Patches { [HarmonyPatch(typeof(PlayerControllerB))] internal class PlayerControlerBPatch { private static int jumpCount; [HarmonyPatch("Jump_performed")] [HarmonyPrefix] public static bool Jump_performed_Prefix(PlayerControllerB __instance) { if ((GameNetworkManager.Instance?.localPlayerController?.isTypingChat).GetValueOrDefault()) { Debug.Log((object)"Player is typing in the chat. Cannot jump."); return false; } if (!__instance.thisController.isGrounded || true) { PerformCustomJump(__instance); jumpCount++; return false; } return true; } private static void PerformCustomJump(PlayerControllerB instance) { Traverse.Create((object)instance).Field("playerSlidingTimer").SetValue((object)0f); Traverse.Create((object)instance).Field("isJumping").SetValue((object)true); ((MonoBehaviour)instance).StartCoroutine("PlayerJump"); } [HarmonyPatch(typeof(PlayerControllerB), "ResetFallGravity")] [HarmonyPrefix] public static void ResetFallGravity_Prefix(PlayerControllerB instance) { jumpCount = 0; } [HarmonyPatch("Update")] [HarmonyPostfix] public static void InfiniteSprintPatch(ref PlayerControllerB __instance) { if (!((Object)(object)__instance == (Object)null)) { __instance.sprintMeter = Mathf.Clamp(__instance.sprintMeter + 0.08f, 0f, 1f); } } } }
BepInEx/plugins/Hackattack242-Infinite_Ship_Boombox-1.1.0/BepInEx/Plugins/Infinite_Ship_Boombox.dll
Decompiled 3 months agousing System; using System.CodeDom.Compiler; using System.Configuration; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("Infinite_Ship_Boombox")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Infinite_Ship_Boombox")] [assembly: AssemblyCopyright("Copyright © 2024")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("e0a916cc-8fd9-4509-a7f3-4c2f13ede14e")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace Infinite_Ship_Boombox { [BepInPlugin("Hackattack242.Infinite_Ship_Boombox", "Infinite_Ship_Boombox", "1.1.0")] public class Infinite_ship_boombox_base : BaseUnityPlugin { private const string mod_GUID = "Hackattack242.Infinite_Ship_Boombox"; private const string mod_name = "Infinite_Ship_Boombox"; private const string mod_version = "1.1.0"; private readonly Harmony harmony = new Harmony("Hackattack242.Infinite_Ship_Boombox"); private static Infinite_ship_boombox_base Instance; private ManualLogSource logger; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } logger = Logger.CreateLogSource("Infinite_Ship_Boombox"); logger.LogInfo((object)"Infinite Ship Boombox has awoken"); harmony.PatchAll(); } internal static void LogDebug(string message) { Instance.Log(message, (LogLevel)32); } internal static void LogInfo(string message) { Instance.Log(message, (LogLevel)16); } internal static void LogWarning(string message) { Instance.Log(message, (LogLevel)4); } internal static void LogError(string message) { Instance.Log(message, (LogLevel)2); } internal static void LogError(Exception ex) { Instance.Log(ex.Message + "\n" + ex.StackTrace, (LogLevel)2); } private void Log(string message, LogLevel logLevel) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) logger.Log(logLevel, (object)message); } } } namespace Infinite_Ship_Boombox.Properties { [CompilerGenerated] [GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.9.0.0")] internal sealed class Settings : ApplicationSettingsBase { private static Settings defaultInstance = (Settings)(object)SettingsBase.Synchronized((SettingsBase)(object)new Settings()); public static Settings Default => defaultInstance; } } namespace Infinite_Ship_Boombox.Patches { [HarmonyPatch(typeof(BoomboxItem))] internal class Infinite_ship_boombox { [HarmonyPatch("Update")] [HarmonyPrefix] private static void patch_func(ref bool ___isInShipRoom, ref Item ___itemProperties, ref PlayerControllerB ___playerHeldBy) { if (___isInShipRoom || ((Object)(object)___playerHeldBy != (Object)null && ___playerHeldBy.isInHangarShipRoom)) { ___itemProperties.requiresBattery = false; } else { ___itemProperties.requiresBattery = true; } } [HarmonyPatch("Update")] [HarmonyPostfix] private static void patch_func(ref Item ___itemProperties) { ___itemProperties.requiresBattery = true; } } }
BepInEx/plugins/kotoky-InfiniteShotgunReload-1.1.0/InfiniteShotgunReload.dll
Decompiled 3 months agousing System; using System.Collections; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: AssemblyCompany("InfiniteShotgunReload")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("A template for Lethal Company")] [assembly: AssemblyFileVersion("1.1.0.0")] [assembly: AssemblyInformationalVersion("1.1.0+116900fb37dae8472eeb6c359d90d5e267e6d181")] [assembly: AssemblyProduct("InfiniteShotgunReload")] [assembly: AssemblyTitle("InfiniteShotgunReload")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace InfiniteShotgunReload { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("InfiniteShotgunReload", "InfiniteShotgunReload", "1.1.0")] public class Plugin : BaseUnityPlugin { private void Awake() { ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin InfiniteShotgunReload is loaded!"); if (Chainloader.PluginInfos.ContainsKey("Hypick.BetterShotgun")) { ((BaseUnityPlugin)this).Logger.LogWarning((object)"BetterShotgun is installed, use the ReloadNoLimit config option instead and uninstall this mod."); } else { Harmony.CreateAndPatchAll(typeof(ShotgunPatch), "InfiniteShotgunReload"); } } } [HarmonyPatch(typeof(ShotgunItem))] public class ShotgunPatch { [HarmonyPatch("ItemInteractLeftRight")] [HarmonyPostfix] public static void ItemInteractLeftRightPatch(ShotgunItem __instance, bool right) { if (right && !__instance.isReloading && __instance.shellsLoaded >= 2) { __instance.StartReloadGun(); } } [HarmonyPatch("ShootGun")] [HarmonyPrefix] [HarmonyPriority(600)] public static void SaveShellsPatch(ShotgunItem __instance, out int __state) { __state = __instance.shellsLoaded; } [HarmonyPatch("ShootGun")] [HarmonyPostfix] public static void ShootGunPatch(ShotgunItem __instance, int __state) { __instance.shellsLoaded = Math.Max(0, __state - 1); } [HarmonyPatch("reloadGunAnimation")] [HarmonyPrefix] public static bool ReloadGunAnimationPatch(ShotgunItem __instance, ref IEnumerator __result) { __result = ReloadGunAnimationPatchCoroutine(__instance); return false; } private static IEnumerator ReloadGunAnimationPatchCoroutine(ShotgunItem __instance) { __instance.isReloading = true; if (__instance.shellsLoaded <= 0) { ((GrabbableObject)__instance).playerHeldBy.playerBodyAnimator.SetBool("ReloadShotgun", true); ((Renderer)__instance.shotgunShellLeft).enabled = false; ((Renderer)__instance.shotgunShellRight).enabled = false; } else { ((GrabbableObject)__instance).playerHeldBy.playerBodyAnimator.SetBool("ReloadShotgun2", true); ((Renderer)__instance.shotgunShellRight).enabled = false; } yield return (object)new WaitForSeconds(0.3f); __instance.gunAudio.PlayOneShot(__instance.gunReloadSFX); __instance.gunAnimator.SetBool("Reloading", true); __instance.ReloadGunEffectsServerRpc(true); yield return (object)new WaitForSeconds(0.95f); ((Renderer)__instance.shotgunShellInHand).enabled = true; __instance.shotgunShellInHandTransform.SetParent(((GrabbableObject)__instance).playerHeldBy.leftHandItemTarget); __instance.shotgunShellInHandTransform.localPosition = new Vector3(-0.0555f, 0.1469f, -0.0655f); __instance.shotgunShellInHandTransform.localEulerAngles = new Vector3(-1.956f, 143.856f, -16.427f); yield return (object)new WaitForSeconds(0.95f); ((GrabbableObject)__instance).playerHeldBy.DestroyItemInSlotAndSync(__instance.ammoSlotToUse); __instance.ammoSlotToUse = -1; __instance.shellsLoaded++; ((Renderer)__instance.shotgunShellLeft).enabled = true; if (__instance.shellsLoaded >= 2) { ((Renderer)__instance.shotgunShellRight).enabled = true; } ((Renderer)__instance.shotgunShellInHand).enabled = false; __instance.shotgunShellInHandTransform.SetParent(((Component)__instance).transform); yield return (object)new WaitForSeconds(0.45f); __instance.gunAudio.PlayOneShot(__instance.gunReloadFinishSFX); __instance.gunAnimator.SetBool("Reloading", false); ((GrabbableObject)__instance).playerHeldBy.playerBodyAnimator.SetBool("ReloadShotgun", false); ((GrabbableObject)__instance).playerHeldBy.playerBodyAnimator.SetBool("ReloadShotgun2", false); __instance.isReloading = false; __instance.ReloadGunEffectsServerRpc(false); } } public static class PluginInfo { public const string PLUGIN_GUID = "InfiniteShotgunReload"; public const string PLUGIN_NAME = "InfiniteShotgunReload"; public const string PLUGIN_VERSION = "1.1.0"; } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }
BepInEx/plugins/NMSL-GodShovel-0.0.4/DeathShovel.dll
Decompiled 3 months agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using HarmonyLib; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("DeathShovel")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("DeathShovel")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("ed49b4f9-dc97-411a-b2bc-ef6ec7f89bc8")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace DeathShovel { [BepInPlugin("Ccode.DeathShovel", "DeathShovel", "0.0.1")] public class Plugin : BaseUnityPlugin { private const string MyGuid = "Ccode.DeathShovel"; private const string PluginName = "DeathShovel"; private const string VersionString = "0.0.1"; private static readonly Harmony Harmony = new Harmony("Ccode.DeathShovel"); public static ManualLogSource Log; public void Awake() { Harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"DeathShovel 0.0.1 loaded."); Log = ((BaseUnityPlugin)this).Logger; } } } namespace DeathShovel.Patches.Items { [HarmonyPatch(typeof(GrabbableObject), "Start")] internal class GrabbableObjectPatch { public static void Prefix(GrabbableObject __instance) { if (((object)__instance).GetType() == typeof(Shovel)) { Shovel val = (Shovel)(object)((__instance is Shovel) ? __instance : null); val.shovelHitForce = 99; } } } [HarmonyPatch(typeof(Shovel), "SwingShovel")] internal class ShovelPatch { public static void Prefix(Shovel __instance, bool cancel = false) { Plugin.Log.LogInfo((object)__instance.shovelHitForce); } } }
BepInEx/plugins/the_croods-RemoverOfFog-1.0.2/FogRemover.dll
Decompiled 3 months agousing System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using FogRemover.Components; using HarmonyLib; using UnityEngine; using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("GreenScreenMoon")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("GreenScreenMoon")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("3ec81793-8592-4289-9a5f-5ceb8ab8ce91")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace FogRemover { [BepInPlugin("grug.lethalcompany.fogremover", "Remove fog", "0.1.0.0")] public class FogRemover : BaseUnityPlugin { public const string modGUID = "grug.lethalcompany.fogremover"; public const string modName = "Remove fog"; public const string modVersion = "0.1.0.0"; private readonly Harmony harmony = new Harmony("grug.lethalcompany.fogremover"); public static ManualLogSource mls; private static FogRemover instance; public static GameObject bruh; public static ConfigEntry<bool> disableAll; public void Awake() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown disableAll = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "All fog disable?", false, "This may cause major amounts of lag. use at your own risk"); mls = ((BaseUnityPlugin)this).Logger; if ((Object)(object)instance == (Object)null) { instance = this; } if ((Object)(object)bruh == (Object)null) { bruh = new GameObject("FogRemoverHolder"); Object.DontDestroyOnLoad((Object)(object)bruh); ((Object)bruh).hideFlags = (HideFlags)61; bruh.AddComponent<RemoveFog>(); } } } } namespace FogRemover.Components { internal class RemoveFog : MonoBehaviour { public Volume vol; public Fog fog; public void Awake() { FogRemover.mls.LogInfo((object)"Removing fog..."); if (FogRemover.disableAll.Value) { ((MonoBehaviour)this).InvokeRepeating("MassFogRemoval", 10f, 0.3f); } } public void Update() { if ((Object)(object)vol == (Object)null) { foreach (Volume item in Object.FindObjectsOfType<Volume>().ToList()) { if (((Object)((Component)item).gameObject).name == "VolumeMain") { vol = item; } } if ((Object)(object)fog == (Object)null && (Object)(object)vol != (Object)null) { vol.sharedProfile.TryGet<Fog>(ref fog); } } if ((Object)(object)fog != (Object)null && ((VolumeParameter<bool>)(object)fog.enabled).value) { FogRemoval(fog); FogRemover.mls.LogInfo((object)"Fog removed"); } } public void MassFogRemoval() { Fog val = default(Fog); foreach (Volume item in Object.FindObjectsOfType<Volume>().ToList()) { if (item.sharedProfile.TryGet<Fog>(ref val)) { FogRemoval(val); } } } public void FogRemoval(Fog fog) { if ((Object)(object)fog != (Object)null && ((VolumeParameter<bool>)(object)fog.enabled).value) { ((VolumeParameter<bool>)(object)fog.enabled).value = false; ((VolumeParameter)fog.enabled).overrideState = false; ((VolumeComponent)fog).active = false; FogRemover.mls.LogInfo((object)"Fog removed"); } } } }