Decompiled source of Insane Company Modpack v1.1.2
BepInEx/plugins/AlwaysPickup.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using HarmonyLib; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyCompany("AlwaysPickup")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("AlwaysPickup")] [assembly: AssemblyTitle("AlwaysPickup")] [assembly: AssemblyVersion("1.0.0.0")] namespace AlwaysPickup; [BepInPlugin("NutNutty.AlwaysPickup", "Always Pickup", "1.0.0")] public class AlwaysPickup : BaseUnityPlugin { public void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) new Harmony("AlwaysPickup").PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Always Pickup plugin loaded!"); } } [HarmonyPatch(typeof(GrabbableObject))] public class GrabbableObjectPatch { [HarmonyTranspiler] [HarmonyPatch("Start")] private static IEnumerable<CodeInstruction> TranspileGrabbableObject(IEnumerable<CodeInstruction> instructions) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown return new CodeMatcher(instructions, (ILGenerator)null).MatchForward(false, Array.Empty<CodeMatch>()).InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[4] { new CodeInstruction(OpCodes.Ldarg_0, (object)null), new CodeInstruction(OpCodes.Ldfld, (object)AccessTools.Field(typeof(GrabbableObject), "itemProperties")), new CodeInstruction(OpCodes.Ldc_I4_1, (object)null), new CodeInstruction(OpCodes.Stfld, (object)AccessTools.Field(typeof(Item), "canBeGrabbedBeforeGameStart")) }).InstructionEnumeration(); } }
BepInEx/plugins/BetterClock.dll
Decompiled a year agousing System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using GameNetcodeStuff; using HarmonyLib; using TMPro; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("BetterClock")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("BetterClock")] [assembly: AssemblyCopyright("Copyright © BlueAmulet 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("de27b4d1-820d-4505-a953-6001420281e4")] [assembly: AssemblyFileVersion("1.0.3")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.3.0")] namespace BetterClock { [BepInPlugin("BlueAmulet.BetterClock", "BetterClock", "1.0.3")] public class BetterClock : BaseUnityPlugin { internal const string Name = "BetterClock"; internal const string Author = "BlueAmulet"; internal const string ID = "BlueAmulet.BetterClock"; internal const string Version = "1.0.3"; public void Awake() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) Settings.InitConfig(((BaseUnityPlugin)this).Config); Harmony val = new Harmony("BlueAmulet.BetterClock"); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Applying Harmony patches"); val.PatchAll(Assembly.GetExecutingAssembly()); int num = 0; foreach (MethodBase patchedMethod in val.GetPatchedMethods()) { ((BaseUnityPlugin)this).Logger.LogInfo((object)("Patched " + patchedMethod.DeclaringType.Name + "." + patchedMethod.Name)); num++; } ((BaseUnityPlugin)this).Logger.LogInfo((object)(num + " patches applied")); } } internal static class Settings { internal static ConfigEntry<bool> compact; internal static ConfigEntry<bool> leadingZero; internal static ConfigEntry<bool> darkZero; internal static ConfigEntry<bool> fasterUpdate; internal static ConfigEntry<bool> raiseClock; internal static ConfigEntry<bool> hours24; internal static ConfigEntry<bool> properTime; internal static ConfigEntry<float> visibilityShip; internal static ConfigEntry<float> visibilityOutside; internal static ConfigEntry<float> visibilityInside; internal static ConfigEntry<float> visibilityOverride; internal static ConfigEntry<KeyboardShortcut> overrideKeybind; internal static ConfigEntry<bool> overrideToggle; public static void InitConfig(ConfigFile config) { //IL_0144: Unknown result type (might be due to invalid IL or missing references) compact = config.Bind<bool>("Clock", "CompactClock", true, "Makes the clock more compact"); leadingZero = config.Bind<bool>("Clock", "LeadingZero", true, "Adds a leading zero to hours before 10"); darkZero = config.Bind<bool>("Clock", "DarkZero", true, "Leading zeros are dark"); fasterUpdate = config.Bind<bool>("Clock", "FasterUpdate", true, "Update the clock more often"); raiseClock = config.Bind<bool>("Clock", "RaiseClock", true, "Raise the clock near the top of the screen"); hours24 = config.Bind<bool>("Clock", "24Hours", false, "Use 24 hour time"); properTime = config.Bind<bool>("Clock", "ProperTime", true, "Fix time formatting caused by the game or other mods"); visibilityShip = config.Bind<float>("Clock", "VisibilityShip", 1f, "Visibility of clock inside ship"); visibilityOutside = config.Bind<float>("Clock", "VisibilityOutside", 1f, "Visibility of clock outside"); visibilityInside = config.Bind<float>("Clock", "VisibilityInside", 0.25f, "Visibility of clock inside factory"); visibilityOverride = config.Bind<float>("Clock", "VisibilityOverride", 1f, "Visibility when using override keybind"); overrideKeybind = config.Bind<KeyboardShortcut>("Clock", "OverrideKeybind", KeyboardShortcut.Empty, "Keybind to trigger visibility override"); overrideToggle = config.Bind<bool>("Clock", "OverrideToggle", false, "Switch the override keybind between toggle or hold"); } } } namespace BetterClock.Patches { [HarmonyPatch(typeof(HUDManager))] internal static class ClockPatch { private static int lastTime = -1; private static bool overrideDisplay = false; [HarmonyPostfix] [HarmonyPatch("Awake")] public static void PostfixAwake(ref HUDManager __instance) { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_008f: Unknown result type (might be due to invalid IL or missing references) if (!Settings.compact.Value) { return; } Transform parent = ((TMP_Text)__instance.clockNumber).transform.parent; if (Settings.raiseClock.Value) { Dictionary<string, PluginInfo> pluginInfos = Chainloader.PluginInfos; if (pluginInfos.ContainsKey("SolosRingCompass") || pluginInfos.ContainsKey("LineCompassPlugin")) { parent.localPosition += new Vector3(0f, 20f, 0f); } else { parent.localPosition += new Vector3(0f, 40f, 0f); } } RectTransform component = ((Component)parent).GetComponent<RectTransform>(); component.sizeDelta = new Vector2(component.sizeDelta.x, 50f); ((TMP_Text)__instance.clockNumber).enableWordWrapping = false; RectTransform component2 = ((Component)__instance.clockIcon).GetComponent<RectTransform>(); component2.sizeDelta *= 0.6f; if (!Settings.hours24.Value) { Transform transform = ((TMP_Text)__instance.clockNumber).transform; transform.localPosition += new Vector3(10f, -1f, 0f); Transform transform2 = ((Component)__instance.clockIcon).transform; transform2.localPosition += new Vector3(-25f, -2f, 0f); } } [HarmonyPrefix] [HarmonyPatch("SetClockVisible")] public static bool PrefixVisible(ref HUDManager __instance) { //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) KeyboardShortcut value = Settings.overrideKeybind.Value; if (Settings.overrideToggle.Value) { if (((KeyboardShortcut)(ref value)).IsDown()) { overrideDisplay = !overrideDisplay; } } else { overrideDisplay = ((KeyboardShortcut)(ref value)).IsPressed(); } if (overrideDisplay) { __instance.Clock.targetAlpha = Settings.visibilityOverride.Value; return false; } GameNetworkManager instance = GameNetworkManager.Instance; PlayerControllerB val = null; if ((Object)(object)instance != (Object)null) { val = instance.localPlayerController; } if ((Object)(object)val != (Object)null) { if (val.isInHangarShipRoom) { __instance.Clock.targetAlpha = Settings.visibilityShip.Value; } else if (val.isInsideFactory) { __instance.Clock.targetAlpha = Settings.visibilityInside.Value; } else { __instance.Clock.targetAlpha = Settings.visibilityOutside.Value; } return false; } return true; } [HarmonyPostfix] [HarmonyPatch("SetClock")] public static void PostfixSetClock(ref HUDManager __instance, ref float timeNormalized, ref float numberOfHours) { int num = (int)(timeNormalized * (60f * numberOfHours)) + 360; int num2 = num / 60 % 24; int num3 = num % 60; string text = ((!Settings.hours24.Value) ? ((TMP_Text)__instance.clockNumber).text : $"{num2}:{num3:00}"); if (Settings.properTime.Value) { if (text.Length >= 3 && text[0] == '0' && text[2] == ':') { text = text.Substring(1); } else if (text.StartsWith("24:")) { text = "0:" + text.Substring(3); } if (text.StartsWith("0:") && text.EndsWith("M")) { text = "12:" + text.Substring(2); } if (num2 < 12 && text.EndsWith("PM")) { text = text.Substring(0, text.Length - 2) + "AM"; } else if (num2 >= 12 && text.EndsWith("AM")) { text = text.Substring(0, text.Length - 2) + "PM"; } } if (Settings.compact.Value) { text = text.Replace('\n', ' ').Replace(" ", " "); } if (Settings.leadingZero.Value && (text.Length <= 4 || text.Length == 7)) { text = ((!Settings.darkZero.Value) ? ("0" + text) : ("<color=#602000>0</color>" + text)); } ((TMP_Text)__instance.clockNumber).text = text; } [HarmonyPostfix] [HarmonyPatch(typeof(TimeOfDay))] [HarmonyPatch("MoveTimeOfDay")] public static void PostfixMoveTimeOfDay(ref TimeOfDay __instance, ref float ___changeHUDTimeInterval) { if (Settings.fasterUpdate.Value) { int num = (int)(__instance.normalizedTimeOfDay * (60f * (float)__instance.numberOfHours)); if (num != lastTime) { lastTime = num; HUDManager.Instance.SetClock(__instance.normalizedTimeOfDay, (float)__instance.numberOfHours, true); ___changeHUDTimeInterval = 0f; } } } } }
BepInEx/plugins/BetterStamina.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BetterStamina.Config; using GameNetcodeStuff; using HarmonyLib; using Unity.Collections; 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("BetterStamina")] [assembly: AssemblyDescription("Mod made by flipf17")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("BetterStamina")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("1c42022e-b386-4342-baf0-67de1b7529e2")] [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 BetterStamina { [BepInPlugin("FlipMods.BetterStamina", "BetterStamina", "1.3.2")] public class Plugin : BaseUnityPlugin { private Harmony _harmony; public static Plugin instance; private void Awake() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown instance = this; ConfigSettings.BindConfigSettings(); _harmony = new Harmony("BetterStamina"); _harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"BetterStamina loaded"); } public static void Log(string message) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)message); } public static void LogError(string message) { ((BaseUnityPlugin)instance).Logger.LogError((object)message); } } public static class PluginInfo { public const string PLUGIN_GUID = "FlipMods.BetterStamina"; public const string PLUGIN_NAME = "BetterStamina"; public const string PLUGIN_VERSION = "1.3.2"; } } namespace BetterStamina.Patches { [HarmonyPatch] public class PlayerPatcher { private static float currentSprintMeter; [HarmonyPatch(typeof(PlayerControllerB), "Update")] [HarmonyPrefix] public static void UpdateStaminaPrefix(PlayerControllerB __instance) { if (((NetworkBehaviour)__instance).IsOwner && __instance.isPlayerControlled) { currentSprintMeter = __instance.sprintMeter; } } [HarmonyPatch(typeof(PlayerControllerB), "Update")] [HarmonyPostfix] public static void UpdateStaminaPostfix(PlayerControllerB __instance) { if (((NetworkBehaviour)__instance).IsOwner && __instance.isPlayerControlled) { float num = __instance.sprintMeter - currentSprintMeter; if (num < 0f) { __instance.sprintMeter = Mathf.Max(currentSprintMeter + num * ConfigSync.instance.staminaConsumptionMultiplier, 0f); } else if (num > 0f) { __instance.sprintMeter = Mathf.Min(currentSprintMeter + num * ConfigSync.instance.staminaRegenMultiplier, 1f); } } } [HarmonyPatch(typeof(PlayerControllerB), "LateUpdate")] [HarmonyPrefix] public static void LateUpdatePrefix(PlayerControllerB __instance) { if (((NetworkBehaviour)__instance).IsOwner && __instance.isPlayerControlled) { currentSprintMeter = __instance.sprintMeter; } } [HarmonyPatch(typeof(PlayerControllerB), "LateUpdate")] [HarmonyPostfix] public static void LateUpdateStaminaPostfix(PlayerControllerB __instance) { if (((NetworkBehaviour)__instance).IsOwner && __instance.isPlayerControlled) { float num = __instance.sprintMeter - currentSprintMeter; if (num < 0f) { __instance.sprintMeter = Mathf.Max(currentSprintMeter + num * ConfigSync.instance.staminaConsumptionMultiplier, 0f); } else if (num > 0f) { __instance.sprintMeter = Mathf.Min(currentSprintMeter + num * ConfigSync.instance.staminaRegenMultiplier, 1f); } } } [HarmonyPatch(typeof(PlayerControllerB), "Jump_performed")] [HarmonyPrefix] public static void JumpPerformedPrefix(PlayerControllerB __instance) { if (((NetworkBehaviour)__instance).IsOwner && __instance.isPlayerControlled) { currentSprintMeter = __instance.sprintMeter; } } [HarmonyPatch(typeof(PlayerControllerB), "Jump_performed")] [HarmonyPostfix] public static void JumpPerformedPostfix(PlayerControllerB __instance) { if (((NetworkBehaviour)__instance).IsOwner && __instance.isPlayerControlled) { float num = __instance.sprintMeter - currentSprintMeter; if (num < 0f) { __instance.sprintMeter = Mathf.Max(new float[1] { currentSprintMeter + num * ConfigSync.instance.jumpStaminaConsumptionMultiplier }); } } } [HarmonyPatch(typeof(PlayerControllerB), "Update")] [HarmonyTranspiler] public static IEnumerable<CodeInstruction> SpoofWeightValuesUpdate(IEnumerable<CodeInstruction> instructions) { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown List<CodeInstruction> list = new List<CodeInstruction>(instructions); FieldInfo field = typeof(PlayerControllerB).GetField("carryWeight", BindingFlags.Instance | BindingFlags.Public); MethodInfo method = typeof(PlayerPatcher).GetMethod("GetAdjustedWeight", BindingFlags.Static | BindingFlags.Public); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Ldfld && (FieldInfo)list[i].operand == field) { list[i] = new CodeInstruction(OpCodes.Call, (object)method); list.RemoveAt(i - 1); } } return list.AsEnumerable(); } [HarmonyPatch(typeof(PlayerControllerB), "LateUpdate")] [HarmonyTranspiler] public static IEnumerable<CodeInstruction> SpoofWeightValuesLateUpdate(IEnumerable<CodeInstruction> instructions) { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown List<CodeInstruction> list = new List<CodeInstruction>(instructions); FieldInfo field = typeof(PlayerControllerB).GetField("carryWeight", BindingFlags.Instance | BindingFlags.Public); MethodInfo method = typeof(PlayerPatcher).GetMethod("GetAdjustedWeight", BindingFlags.Static | BindingFlags.Public); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Ldfld && (FieldInfo)list[i].operand == field) { list[i] = new CodeInstruction(OpCodes.Call, (object)method); list.RemoveAt(i - 1); } } return list.AsEnumerable(); } public static float GetAdjustedWeight() { return Mathf.Max(((Object)(object)StartOfRound.Instance.localPlayerController != (Object)null) ? (StartOfRound.Instance.localPlayerController.carryWeight * ConfigSync.instance.carryWeightPenaltyMultiplier) : 1f, 1f); } } } namespace BetterStamina.Config { [Serializable] public static class ConfigSettings { public static ConfigEntry<float> staminaRegenMultiplierConfig; public static ConfigEntry<float> staminaConsumptionMultiplierConfig; public static ConfigEntry<float> jumpStaminaConsumptionMultiplierConfig; public static ConfigEntry<float> carryWeightPenaltyMultiplierConfig; public static ConfigEntry<float> movementSpeedMultiplierConfig; public static void BindConfigSettings() { Plugin.Log("BindingConfigs"); staminaRegenMultiplierConfig = ((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("BetterStamina", "StaminaRegenMultiplier", 1.5f, "Multiplier for how fast your stamina regens."); staminaConsumptionMultiplierConfig = ((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("BetterStamina", "StaminaConsumptionMultiplier", 0.75f, "Multiplier for how much stamina drains while sprinting."); jumpStaminaConsumptionMultiplierConfig = ((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("BetterStamina", "JumpStaminaConsumptionMultiplier", 0.75f, "Multiplier for how much stamina jumping consumes."); carryWeightPenaltyMultiplierConfig = ((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("BetterStamina", "CarryWeightPenaltyMultiplier", 0.5f, "Multiplier for how much your speed/stamina consumption are affected by weight."); movementSpeedMultiplierConfig = ((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("BetterStamina", "MovementSpeedMultiplier", 1f, "Player movement speed multiplier."); } } [Serializable] [HarmonyPatch] public class ConfigSync { public static ConfigSync defaultConfig; public static ConfigSync instance; public static PlayerControllerB localPlayerController; public static bool isSynced = false; private static float defaultMovementSpeed = 4.6f; public float staminaRegenMultiplier = 1f; public float staminaConsumptionMultiplier = 1f; public float jumpStaminaConsumptionMultiplier = 1f; public float carryWeightPenaltyMultiplier = 1f; public float movementSpeedMultiplier = 1f; public static void BuildDefaultConfigSync() { instance = new ConfigSync(); } public static void BuildServerConfigSync() { if (defaultConfig == null) { defaultConfig = new ConfigSync(); defaultConfig.staminaRegenMultiplier = ConfigSettings.staminaRegenMultiplierConfig.Value; defaultConfig.staminaConsumptionMultiplier = ConfigSettings.staminaConsumptionMultiplierConfig.Value; defaultConfig.jumpStaminaConsumptionMultiplier = ConfigSettings.jumpStaminaConsumptionMultiplierConfig.Value; defaultConfig.carryWeightPenaltyMultiplier = ConfigSettings.carryWeightPenaltyMultiplierConfig.Value; defaultConfig.movementSpeedMultiplier = ConfigSettings.movementSpeedMultiplierConfig.Value; instance = defaultConfig; } } [HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")] [HarmonyPostfix] public static void InitializeLocalPlayer(PlayerControllerB __instance) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown localPlayerController = __instance; if (NetworkManager.Singleton.IsServer) { BuildServerConfigSync(); NetworkManager.Singleton.CustomMessagingManager.RegisterNamedMessageHandler("BetterStamina-OnRequestConfigSync", new HandleNamedMessageDelegate(OnReceiveConfigSyncRequest)); OnLocalClientConfigSync(); } else { isSynced = false; BuildDefaultConfigSync(); NetworkManager.Singleton.CustomMessagingManager.RegisterNamedMessageHandler("BetterStamina-OnReceiveConfigSync", new HandleNamedMessageDelegate(OnReceiveConfigSync)); RequestConfigSync(); } } public static void RequestConfigSync() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) if (NetworkManager.Singleton.IsClient) { Plugin.Log("Sending config sync request to server."); FastBufferWriter val = default(FastBufferWriter); ((FastBufferWriter)(ref val))..ctor(4, (Allocator)2, -1); NetworkManager.Singleton.CustomMessagingManager.SendNamedMessage("BetterStamina-OnRequestConfigSync", 0uL, val, (NetworkDelivery)3); } else { Plugin.LogError("Failed to send config sync request."); } } public static void OnReceiveConfigSyncRequest(ulong clientId, FastBufferReader reader) { //IL_0053: 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_007c: Unknown result type (might be due to invalid IL or missing references) if (NetworkManager.Singleton.IsServer) { Plugin.Log("Receiving config sync request from client with id: " + clientId + ". Sending config sync to client."); byte[] array = SerializeConfigToByteArray(instance); FastBufferWriter val = default(FastBufferWriter); ((FastBufferWriter)(ref val))..ctor(array.Length + 4, (Allocator)2, -1); int num = array.Length; ((FastBufferWriter)(ref val)).WriteValueSafe<int>(ref num, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteBytesSafe(array, -1, 0); NetworkManager.Singleton.CustomMessagingManager.SendNamedMessage("BetterStamina-OnReceiveConfigSync", clientId, val, (NetworkDelivery)3); } } public static void OnReceiveConfigSync(ulong clientId, FastBufferReader reader) { //IL_0014: 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) if (((FastBufferReader)(ref reader)).TryBeginRead(4)) { int num = default(int); ((FastBufferReader)(ref reader)).ReadValueSafe<int>(ref num, default(ForPrimitives)); if (((FastBufferReader)(ref reader)).TryBeginRead(num)) { Plugin.Log("Receiving config sync from server."); byte[] data = new byte[num]; ((FastBufferReader)(ref reader)).ReadBytesSafe(ref data, num, 0); instance = DeserializeFromByteArray(data); OnLocalClientConfigSync(); } else { Plugin.LogError("Error receiving sync from server."); } } else { Plugin.LogError("Error receiving bytes length."); } } public static void OnLocalClientConfigSync() { localPlayerController.movementSpeed = defaultMovementSpeed * instance.movementSpeedMultiplier; isSynced = true; } public static byte[] SerializeConfigToByteArray(ConfigSync config) { BinaryFormatter binaryFormatter = new BinaryFormatter(); MemoryStream memoryStream = new MemoryStream(); binaryFormatter.Serialize(memoryStream, config); return memoryStream.ToArray(); } public static ConfigSync DeserializeFromByteArray(byte[] data) { MemoryStream serializationStream = new MemoryStream(data); BinaryFormatter binaryFormatter = new BinaryFormatter(); return (ConfigSync)binaryFormatter.Deserialize(serializationStream); } } }
BepInEx/plugins/BuyableShotgunShells.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.Diagnostics; 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.Logging; using HarmonyLib; using LethalLib.Modules; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyCompany("BuyableShotgunShells")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyCopyright("Copyright © 2023 MegaPiggy")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("BuyableShotgunShells")] [assembly: AssemblyTitle("BuyableShotgunShells")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace BuyableShotgunShells { [BepInPlugin("MegaPiggy.BuyableShotgunShells", "Buyable Shotgun Shells", "1.0.1")] public class BuyableShotgunShells : BaseUnityPlugin { private const string modGUID = "MegaPiggy.BuyableShotgunShells"; private const string modName = "Buyable Shotgun Shells"; private const string modVersion = "1.0.1"; private readonly Harmony harmony = new Harmony("MegaPiggy.BuyableShotgunShells"); private static BuyableShotgunShells Instance; public int ShellPrice; public bool added; private static ManualLogSource LoggerInstance => ((BaseUnityPlugin)Instance).Logger; public List<Item> AllItems => Resources.FindObjectsOfTypeAll<Item>().Concat(Object.FindObjectsByType<Item>((FindObjectsInactive)1, (FindObjectsSortMode)1)).ToList(); public Item ShotgunShell => ((IEnumerable<Item>)AllItems).FirstOrDefault((Func<Item, bool>)((Item item) => ((Object)item).name == "GunAmmo")); private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } harmony.PatchAll(); ShellPrice = ((BaseUnityPlugin)this).Config.Bind<int>("Prices", "ShotgunShellPrice", 20, "Credits needed to buy shotgun shells").Value; SceneManager.sceneLoaded += OnSceneLoaded; ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Buyable Shotgun Shells is loaded with version 1.0.1!"); } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { if (!added && ((Scene)(ref scene)).name == "MainMenu") { added = true; ShotgunShell.itemName = "Shells"; Items.RegisterShopItem(ShotgunShell, ShellPrice); } } } }
BepInEx/plugins/FPSSpectate.dll
Decompiled a year 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.Logging; using GameNetcodeStuff; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("FPSSpectate")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("FPS spectate camera")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+ada41809ef3e18d1ac6f547212c170f1debd12d4")] [assembly: AssemblyProduct("FPSSpectate")] [assembly: AssemblyTitle("FPSSpectate")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace FPSSpectate { [BepInPlugin("5Bit.FPSSpectate", "FPSSpectate", "1.0.0")] public class FPSSpectate : BaseUnityPlugin { private const string modGUID = "5Bit.FPSSpectate"; private const string modName = "FPSSpectate"; private const string modVersion = "1.0.0"; private readonly Harmony harmony = new Harmony("5Bit.FPSSpectate"); private static FPSSpectate Instance; internal static ManualLogSource mls; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = Logger.CreateLogSource("5Bit.FPSSpectate"); harmony.PatchAll(); } } public static class PluginInfo { public const string PLUGIN_GUID = "FPSSpectate"; public const string PLUGIN_NAME = "FPSSpectate"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace FPSSpectate.Patches { [HarmonyPatch(typeof(PlayerControllerB))] internal class FPSSpectatePatch { private const float SPECTATE_OFFSET = 1.5f; private static bool firstPerson = true; private static bool debounced = false; [HarmonyPatch("LateUpdate")] [HarmonyPostfix] private static void LateUpdate(PlayerControllerB __instance) { //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) if (((ButtonControl)Keyboard.current.vKey).wasPressedThisFrame && !debounced) { firstPerson = !firstPerson; debounced = true; } if (((ButtonControl)Keyboard.current.vKey).wasReleasedThisFrame) { debounced = false; } if ((Object)(object)__instance.spectatedPlayerScript != (Object)null && firstPerson) { Transform transform = ((Component)__instance.spectateCameraPivot).transform; Transform transform2 = ((Component)__instance.spectatedPlayerScript.visorCamera).transform; Vector3 position = transform2.position; Vector3 forward = transform2.forward; transform.position = position + ((Vector3)(ref forward)).normalized * 1.5f; transform.rotation = transform2.rotation; } } } }
BepInEx/plugins/HideChat.dll
Decompiled a year 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; 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("HideChat")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("HideChat")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("fa900f4d-71b1-433a-ad23-a10fc53dc3d8")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace HideChat { [BepInPlugin("Miodec.HideChat", "Hide Chat", "1.0.0")] public class HidePlayerNames : BaseUnityPlugin { private const string modGUID = "Miodec.HideChat"; private const string modName = "Hide Chat"; private const string modVersion = "1.0.0"; private static HidePlayerNames Instance; internal ManualLogSource mls; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = Logger.CreateLogSource("Miodec.HideChat"); mls.LogDebug((object)"hidechat is awake"); Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null); } } } namespace HideChat.Patches { [HarmonyPatch(typeof(HUDManager))] internal class HUDManagerPatch { [HarmonyPatch("OpenMenu_performed")] [HarmonyPatch("SubmitChat_performed")] [HarmonyPatch("AddChatMessage")] [HarmonyPostfix] public static void FadeToNothing(ref HUDManager __instance) { __instance.PingHUDElement(__instance.Chat, 5f, 1f, 0f); } } }
BepInEx/plugins/HideModList.dll
Decompiled a year 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 HarmonyLib; using Microsoft.CodeAnalysis; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("HideModList")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Hides the LC api modlist info")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("HideModList")] [assembly: AssemblyTitle("HideModList")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace HideModList { [HarmonyPatch(typeof(HUDManager), "DisplayTip")] public static class DisplayTipPatch { public static bool Prefix(HUDManager __instance, string headerText, string bodyText, bool isWarning = false, bool useSave = false, string prefsKey = "LC_Tip1") { if (headerText.StartsWith("Mod List")) { return false; } return true; } } [BepInPlugin("HideModList", "HideModList", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown Harmony val = new Harmony("plugin.HideModList"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin HideModList is loaded!"); } } public static class PluginInfo { public const string PLUGIN_GUID = "HideModList"; public const string PLUGIN_NAME = "HideModList"; public const string PLUGIN_VERSION = "1.0.0"; } }
BepInEx/plugins/IntroTweaks.dll
Decompiled a year agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Threading.Tasks; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using IntroTweaks.Core; using IntroTweaks.Utils; using Microsoft.CodeAnalysis; using TMPro; using UnityEngine; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.6", FrameworkDisplayName = "")] [assembly: AssemblyCompany("IntroTweaks")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Seamless skipping of Lethal Company intro/menu screens.")] [assembly: AssemblyFileVersion("1.4.1.0")] [assembly: AssemblyInformationalVersion("1.4.1+b403cdf67ce1f6c35ef90e76df10874ec29de4f5")] [assembly: AssemblyProduct("IntroTweaks")] [assembly: AssemblyTitle("IntroTweaks")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.4.1.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] internal sealed class IsReadOnlyAttribute : Attribute { } [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 IntroTweaks { [BepInPlugin("io.github.IntroTweaks", "IntroTweaks", "1.4.1")] public class Plugin : BaseUnityPlugin { internal static string SelectedMode; private Harmony patcher; private static bool menuLoaded; internal static ManualLogSource Logger { get; private set; } public static PluginConfig Config { get; private set; } public static bool ModInstalled(string name) { return Chainloader.PluginInfos.Values.Any((PluginInfo p) => p.Metadata.GUID.ToLower().Contains(name) || p.Metadata.Name.ToLower() == name.ToLower()); } private void Awake() { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown Logger = ((BaseUnityPlugin)this).Logger; Config = new PluginConfig(((BaseUnityPlugin)this).Config); if (!PluginEnabled(logDisabled: true)) { return; } SceneManager.sceneLoaded += SceneLoaded; if (Config.SKIP_SPLASH_SCREENS) { Task.Run((Action)SkipSplashScreen); } Config.InitBindings(); SelectedMode = Config.AUTO_SELECT_MODE.ToLower(); try { patcher = new Harmony("io.github.IntroTweaks"); patcher.PatchAll(); Logger.LogInfo((object)"Plugin loaded."); } catch (Exception ex) { Logger.LogError((object)ex); } } public bool PluginEnabled(bool logDisabled = false) { bool pLUGIN_ENABLED = Config.PLUGIN_ENABLED; if (!pLUGIN_ENABLED && logDisabled) { Logger.LogInfo((object)"IntroTweaks disabled globally."); } return pLUGIN_ENABLED; } private void SkipSplashScreen() { Logger.LogDebug((object)"Skipping splash screens. Ew."); while (!menuLoaded) { SplashScreen.Stop((StopBehavior)0); } } private void SceneLoaded(Scene scene, LoadSceneMode _) { switch (((Scene)(ref scene)).name) { case "InitScene": case "InitSceneLaunchOptions": case "MainMenu": menuLoaded = true; break; } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "IntroTweaks"; public const string PLUGIN_NAME = "IntroTweaks"; public const string PLUGIN_VERSION = "1.4.1"; } } namespace IntroTweaks.Utils { internal class DisplayUtil { public static List<DisplayInfo> Displays { get; private set; } = new List<DisplayInfo>(); internal static void Move(int displayIndex) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) Screen.GetDisplayLayout(Displays); int num = Displays.IndexOf(Screen.mainWindowDisplayInfo); if (displayIndex != num) { MoveWindowAsync(displayIndex); } } private static async void MoveWindowAsync(int index) { await MoveWindowTask(index); } private static async Task MoveWindowTask(int index) { if (index >= Displays.Count) { await Task.CompletedTask; Plugin.Logger.LogDebug((object)"Display index out of bounds for current layout!"); return; } DisplayInfo val = Displays[index]; Vector2Int zero = Vector2Int.zero; if ((int)Screen.fullScreenMode != 3) { ((Vector2Int)(ref zero)).x = ((Vector2Int)(ref zero)).x + val.width / 2; ((Vector2Int)(ref zero)).y = ((Vector2Int)(ref zero)).y + val.height / 2; } AsyncOperation operation = Screen.MoveMainWindowTo(ref val, zero); while (operation.progress < 1f) { await Task.Yield(); } Plugin.Logger.LogDebug((object)("Game moved to display: " + Displays[index].name)); } } internal class RectUtil { internal static void ResetAnchoredPos(RectTransform rect) { //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) rect.anchoredPosition = Vector2.zero; rect.anchoredPosition3D = Vector3.zero; } internal static void ResetPivot(RectTransform rect) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) rect.pivot = Vector2.zero; } internal static void ResetSizeDelta(RectTransform rect) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) rect.sizeDelta = Vector2.zero; } internal static void EditOffsets(RectTransform rect, Vector2 max, Vector2 min) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) rect.offsetMax = max; rect.offsetMin = min; } internal static void EditAnchors(RectTransform rect, Vector2 max, Vector2 min) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) rect.anchorMax = max; rect.anchorMin = min; } internal static void AnchorToBottom(RectTransform rect) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) ResetSizeDelta(rect); ResetAnchoredPos(rect); EditAnchors(rect, new Vector2(0.5f, 0f), new Vector2(0.5f, 0f)); EditOffsets(rect, new Vector2(0f, 0f), new Vector2(0f, 0f)); ((Transform)rect).localRotation = Quaternion.identity; ((Transform)rect).localPosition = new Vector3(0f, -205f, 0f); } } } namespace IntroTweaks.Patches { [HarmonyPatch(typeof(InitializeGame))] internal class InitializeGamePatch { [HarmonyPrefix] [HarmonyPatch("Start")] private static void DisableBootAnimation(ref bool __runOriginal) { int gAME_STARTUP_DISPLAY = Plugin.Config.GAME_STARTUP_DISPLAY; if (gAME_STARTUP_DISPLAY >= 0) { DisplayUtil.Move(gAME_STARTUP_DISPLAY); } if (Plugin.Config.SKIP_BOOT_ANIMATION) { SceneManager.LoadScene("MainMenu"); __runOriginal = false; } } } [HarmonyPatch(typeof(MenuManager))] internal class MenuManagerPatch { public static Color32 DARK_ORANGE = new Color32((byte)175, (byte)115, (byte)0, byte.MaxValue); private static GameObject activateCosmetics; internal static Transform MenuContainer = null; internal static Transform MenuPanel = null; internal static GameObject VersionNum = null; private static MenuManager Instance; public static int gameVer { get; private set; } public static TextMeshProUGUI versionText { get; private set; } internal static void TryReplaceVersionText() { if (Plugin.Config.CUSTOM_VERSION_TEXT && Object.op_Implicit((Object)(object)VersionNum) && Object.op_Implicit((Object)(object)MenuPanel)) { GameObject obj = Object.Instantiate<GameObject>(VersionNum, MenuPanel); ((Object)obj).name = "VersionNumberText"; versionText = InitTextMesh(obj.GetComponent<TextMeshProUGUI>()); RectUtil.AnchorToBottom(((Component)versionText).gameObject.GetComponent<RectTransform>()); VersionNum.SetActive(false); } } [HarmonyPostfix] [HarmonyPatch("Start")] private static void Init(MenuManager __instance) { Instance = __instance; ((MonoBehaviour)Instance).StartCoroutine(PatchMenuDelayed()); } private static IEnumerator PatchMenuDelayed() { yield return (object)new WaitForSeconds(0f); GameObject obj = GameObject.Find("MenuContainer"); MenuContainer = ((obj != null) ? obj.transform : null); Transform menuContainer = MenuContainer; MenuPanel = ((menuContainer != null) ? menuContainer.Find("MainButtons") : null); Transform menuContainer2 = MenuContainer; object versionNum; if (menuContainer2 == null) { versionNum = null; } else { Transform obj2 = menuContainer2.Find("VersionNum"); versionNum = ((obj2 != null) ? ((Component)obj2).gameObject : null); } VersionNum = (GameObject)versionNum; PatchMenu(); } private static void PatchMenu() { //IL_012f: 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_019c: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) try { if (Plugin.Config.FIX_MENU_PANELS) { FixPanelAlignment(MenuPanel); FixPanelAlignment(MenuContainer.Find("LobbyHostSettings")); FixPanelAlignment(MenuContainer.Find("LobbyList")); FixPanelAlignment(MenuContainer.Find("LoadingScreen")); Plugin.Logger.LogDebug((object)"Fixed menu panel alignment."); } IEnumerable<GameObject> buttons = from b in ((Component)MenuPanel).GetComponentsInChildren<Button>(true) select ((Component)b).gameObject; if (Plugin.Config.ALIGN_MENU_BUTTONS) { AlignButtons(buttons); } if (Plugin.Config.REMOVE_CREDITS_BUTTON) { RemoveCreditsButton(buttons); } bool changeRenderMode = Plugin.Config.FIX_MENU_CANVAS; if (Plugin.ModInstalled("MoreCompany")) { Plugin.Logger.LogDebug((object)"MoreCompany found! Edits have been made to UI elements."); changeRenderMode = false; GameObject obj = GameObject.Find("GlobalScale"); obj.GetComponentInParent<Canvas>().pixelPerfect = true; GameObject gameObject = ((Component)obj.transform.Find("CosmeticsScreen")).gameObject; Transform transform = ((Component)gameObject.transform.Find("SpinAreaButton")).transform; transform.localScale = new Vector3(0.48f, 0.55f, 0.46f); transform.position = new Vector3(421.65f, 245.7f, 200f); Transform transform2 = ((Component)gameObject.transform.Find("ExitButton")).transform; Transform transform3 = FindInParent(gameObject, "ActivateButton").transform; activateCosmetics = ((Component)transform3).gameObject; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(424.06f, 241.65f, 166.2f); Vector3 position = (transform3.position = val); transform2.position = position; transform2.SetAsLastSibling(); ((Component)gameObject.transform.Find("CosmeticsHolderBorder")).transform.localScale = new Vector3(2.4f, 2.1f, 1f); Transform transform4 = ((Component)Instance.menuButtons.transform.Find("HeaderImage")).transform; transform4.localScale = new Vector3(5f, 5f, 5f); Vector3 position2 = default(Vector3); ((Vector3)(ref position2))..ctor(1093.05f, 647.79f, -35.33f); transform4.position = position2; } TweakCanvasSettings(Instance.menuButtons, changeRenderMode); } catch (Exception arg) { Plugin.Logger.LogError((object)$"Error occurred in Start patch. SAJ.\n{arg}"); } if (Plugin.Config.REMOVE_NEWS_PANEL) { Instance.NewsPanel.SetActive(false); } if (Plugin.Config.REMOVE_LAN_WARNING) { Instance.lanWarningContainer.SetActive(false); } if (Plugin.Config.REMOVE_LAUNCHED_IN_LAN) { TextMeshProUGUI launchedInLanModeText = Instance.launchedInLanModeText; GameObject val3 = ((launchedInLanModeText != null) ? ((Component)launchedInLanModeText).gameObject : null); if (Object.op_Implicit((Object)(object)val3)) { val3.SetActive(false); } } if (Plugin.Config.AUTO_SELECT_HOST) { Instance.ClickHostButton(); } } [HarmonyPostfix] [HarmonyPatch("Update")] private static void UpdatePatch(MenuManager __instance) { bool activeSelf = __instance.menuButtons.activeSelf; if ((Object)(object)versionText == (Object)null) { TryReplaceVersionText(); return; } ((TMP_Text)versionText).text = ((TMP_Text)versionText).text.Replace("$VERSION", gameVer.ToString()); GameObject gameObject = ((Component)versionText).gameObject; if (!gameObject.activeSelf && activeSelf) { gameObject.SetActive(true); } } [HarmonyPrefix] [HarmonyPatch("ClickHostButton")] private static void DisableMenuOnHost(MenuManager __instance) { __instance.menuButtons.SetActive(false); if (Plugin.Config.CUSTOM_VERSION_TEXT) { ((Component)versionText).gameObject.SetActive(false); } } private static TextMeshProUGUI InitTextMesh(TextMeshProUGUI tmp) { int gameVersionNum = GameNetworkManager.Instance.gameVersionNum; gameVer = Mathf.Abs(Plugin.Config.VERSION_TEXT_FORMAT.ToLower().Equals("short") ? (gameVersionNum - 16440) : gameVersionNum); ((TMP_Text)tmp).text = Plugin.Config.VERSION_TEXT; ((TMP_Text)tmp).fontSize = Mathf.Clamp(Plugin.Config.VERSION_TEXT_SIZE, 10f, 40f); ((TMP_Text)tmp).alignment = (TextAlignmentOptions)514; TweakTextSettings(tmp); return tmp; } private static void TweakTextSettings(TextMeshProUGUI tmp, bool overflow = true, bool wordWrap = false) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) if (overflow) { ((TMP_Text)tmp).overflowMode = (TextOverflowModes)0; } ((TMP_Text)tmp).enableWordWrapping = wordWrap; ((TMP_Text)tmp).faceColor = DARK_ORANGE; } private static void TweakCanvasSettings(GameObject panel, bool changeRenderMode) { Canvas componentInParent = panel.GetComponentInParent<Canvas>(); componentInParent.pixelPerfect = true; if (changeRenderMode) { componentInParent.renderMode = (RenderMode)0; } } private static void FixPanelAlignment(Transform panel) { //IL_0021: 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) RectTransform component = ((Component)panel).gameObject.GetComponent<RectTransform>(); RectUtil.ResetSizeDelta(component); RectUtil.ResetAnchoredPos(component); RectUtil.EditOffsets(component, new Vector2(-20f, -25f), new Vector2(20f, 25f)); FixScale(((Component)panel).gameObject); } internal static void FixScale(GameObject obj) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) obj.transform.localScale = new Vector3(1.02f, 1.06f, 1.02f); } private static void RemoveCreditsButton(IEnumerable<GameObject> buttons) { //IL_005d: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) GameObject obj = buttons.First((GameObject b) => ((Object)b).name == "QuitButton"); GameObject val = buttons.First((GameObject b) => ((Object)b).name == "Credits"); val.SetActive(false); obj.transform.localPosition = val.transform.localPosition; foreach (GameObject button in buttons) { if (Object.op_Implicit((Object)(object)button) && !((Object)(object)button == (Object)(object)val)) { Vector3 localPosition = button.transform.localPosition; button.transform.localPosition = new Vector3(localPosition.x, localPosition.y - 45f, localPosition.z); } } Plugin.Logger.LogDebug((object)"Removed credits button."); } private static void AlignButtons(IEnumerable<GameObject> buttons) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) Vector3 localPosition = ((Transform)buttons.First((GameObject b) => ((Object)b).name == "HostButton").GetComponent<RectTransform>()).localPosition; foreach (GameObject button in buttons) { if (Object.op_Implicit((Object)(object)button)) { RectTransform component = button.GetComponent<RectTransform>(); int num = (Plugin.Config.REMOVE_CREDITS_BUTTON ? 20 : (-5)); ((Transform)component).localPosition = new Vector3(localPosition.x + 20f, ((Transform)component).localPosition.y + (float)num, localPosition.z); TextMeshProUGUI componentInChildren = button.GetComponentInChildren<TextMeshProUGUI>(); FixScale(((Component)componentInChildren).gameObject); TweakTextSettings(componentInChildren); ((TMP_Text)componentInChildren).fontSize = 15f; ((TMP_Text)componentInChildren).wordSpacing = ((TMP_Text)componentInChildren).wordSpacing - 25f; RectTransform component2 = ((Component)componentInChildren).gameObject.GetComponent<RectTransform>(); RectUtil.ResetAnchoredPos(component2); RectUtil.ResetSizeDelta(component2); RectUtil.EditOffsets(component2, Vector2.zero, new Vector2(5f, 0f)); } } Plugin.Logger.LogDebug((object)"Aligned menu buttons."); } private static GameObject GetButton(Transform panel, string name) { try { return ((Component)panel.Find(name)).gameObject; } catch (Exception arg) { if (name != "ModSettingsButton") { Plugin.Logger.LogError((object)$"Error getting button: {name}\n{arg}"); } return null; } } private static GameObject FindInParent(GameObject obj, string name) { Transform parent = obj.transform.parent; try { return ((Component)parent.Find(name)).gameObject; } catch (Exception arg) { Plugin.Logger.LogError((object)$"Error finding '{name}' in: {((Object)parent).name}\n{arg}"); return null; } } } [HarmonyPatch(typeof(PreInitSceneScript))] internal class PreSceneInitPatch { [HarmonyPostfix] [HarmonyPatch("Start")] private static void FinishedFirstLaunch() { IngamePlayerSettings instance = IngamePlayerSettings.Instance; if (instance != null) { instance.SetPlayerFinishedLaunchOptions(); } } [HarmonyPostfix] [HarmonyPatch("SkipToFinalSetting")] internal static void SkipToSelectedMode(PreInitSceneScript __instance, ref bool ___choseLaunchOption) { if (!(Plugin.SelectedMode != "online") || !(Plugin.SelectedMode != "lan")) { CollectionExtensions.Do<GameObject>((IEnumerable<GameObject>)__instance.LaunchSettingsPanels, (Action<GameObject>)delegate(GameObject panel) { panel.SetActive(false); }); __instance.currentLaunchSettingPanel = 0; ((TMP_Text)__instance.headerText).text = ""; ((Component)__instance.blackTransition).gameObject.SetActive(false); __instance.continueButton.gameObject.SetActive(false); ___choseLaunchOption = true; __instance.mainAudio.PlayOneShot(__instance.selectSFX); SceneManager.LoadScene((Plugin.SelectedMode == "online") ? "InitScene" : "InitSceneLANMode"); } } } [HarmonyPatch(typeof(StartOfRound))] internal class StartOfRoundPatch { [HarmonyPrefix] [HarmonyPatch("PlayFirstDayShipAnimation")] private static bool DisableSpeaker() { return !Plugin.Config.DISABLE_FIRST_DAY_SFX; } } } namespace IntroTweaks.Core { public struct Category { public static Category GENERAL => new Category("0 >> General << 0"); public static Category INTRO_TWEAKS => new Category("1 >> Intro << 1"); public static Category MENU_TWEAKS => new Category("2 >> Main Menu << 2"); public static Category VERSION_TEXT => new Category("3 >> Custom Version Text << 3"); public static Category MISC => new Category("4 >> Miscellaneous << 4"); public string Value { get; private set; } private Category(string value) { Value = value; } } public class PluginConfig { private readonly ConfigFile configFile; public bool PLUGIN_ENABLED { get; private set; } public bool SKIP_SPLASH_SCREENS { get; private set; } public bool SKIP_BOOT_ANIMATION { get; private set; } public string AUTO_SELECT_MODE { get; private set; } public bool AUTO_SELECT_HOST { get; private set; } public bool ALIGN_MENU_BUTTONS { get; private set; } public bool FIX_MENU_CANVAS { get; private set; } public bool FIX_MENU_PANELS { get; private set; } public bool REMOVE_LAN_WARNING { get; private set; } public bool REMOVE_LAUNCHED_IN_LAN { get; private set; } public bool REMOVE_NEWS_PANEL { get; private set; } public bool REMOVE_CREDITS_BUTTON { get; private set; } public bool CUSTOM_VERSION_TEXT { get; private set; } public string VERSION_TEXT { get; private set; } public string VERSION_TEXT_FORMAT { get; private set; } public float VERSION_TEXT_SIZE { get; private set; } public bool DISABLE_FIRST_DAY_SFX { get; private set; } public int GAME_STARTUP_DISPLAY { get; private set; } public PluginConfig(ConfigFile cfg) { configFile = cfg; PLUGIN_ENABLED = NewEntry("bEnabled", defaultVal: true, "Enable or disable the plugin globally."); SKIP_SPLASH_SCREENS = NewEntry(Category.INTRO_TWEAKS, "bSkipSplashScreens", defaultVal: true, "Skips those pesky Unity and Zeekers startup logos!"); } private T NewEntry<T>(string key, T defaultVal, string desc) { return NewEntry(Category.GENERAL, key, defaultVal, desc); } private T NewEntry<T>(Category category, string key, T defaultVal, string desc) { return configFile.Bind<T>(category.Value, key, defaultVal, desc).Value; } public void InitBindings() { SKIP_BOOT_ANIMATION = NewEntry(Category.INTRO_TWEAKS, "bSkipBootAnimation", defaultVal: true, "If the loading animation (booting OS) should be skipped."); AUTO_SELECT_MODE = NewEntry(Category.INTRO_TWEAKS, "sAutoSelectMode", "ONLINE", "Which mode to automatically enter into after the splash screen.\nValid options: ONLINE, LAN, OFF"); AUTO_SELECT_HOST = NewEntry(Category.INTRO_TWEAKS, "bAutoSelectHost", defaultVal: false, "Whether the 'Host' button is automatically selected when the Online/LAN menu loads."); ALIGN_MENU_BUTTONS = NewEntry(Category.MENU_TWEAKS, "bAlignMenuButtons", defaultVal: true, "If the main menu buttons should align with each other."); FIX_MENU_CANVAS = NewEntry(Category.MENU_TWEAKS, "bFixMenuCanvas", defaultVal: true, "Whether the main menu canvas should have its settings corrected.\nMay cause overlapping issues, only turn it on if you aren't using other menu mods."); FIX_MENU_PANELS = NewEntry(Category.MENU_TWEAKS, "bFixMenuPanels", defaultVal: true, "The main menu panels (host, servers, loading screen) all have anchoring, offset and sizing issues.\nThis option helps solve them and improve the look of the menu.\n\nMAY BREAK SOME MODS."); REMOVE_LAN_WARNING = NewEntry(Category.MENU_TWEAKS, "bRemoveLanWarning", defaultVal: true, "Hides the warning popup when hosting a LAN session."); REMOVE_LAUNCHED_IN_LAN = NewEntry(Category.MENU_TWEAKS, "bRemoveLaunchedInLanText", defaultVal: true, "Hides the 'Launched in LAN mode' text below the Quit button."); REMOVE_NEWS_PANEL = NewEntry(Category.MENU_TWEAKS, "bRemoveNewsPanel", defaultVal: false, "Hides the panel that displays news such as game updates."); REMOVE_CREDITS_BUTTON = NewEntry(Category.MENU_TWEAKS, "bRemoveCreditsButton", defaultVal: true, "Hides the 'Credits' button on the main menu. The other buttons are automatically adjusted."); CUSTOM_VERSION_TEXT = NewEntry(Category.VERSION_TEXT, "bCustomVersionText", defaultVal: true, "Whether to replace the game's version text with a custom alternative."); VERSION_TEXT = NewEntry(Category.VERSION_TEXT, "sVersionText", "v$VERSION\n[MODDED]", "Replace the game's version text with this custom text in the main menu.\nTo insert the version number, use the $VERSION syntax. E.g. Ver69 would be Ver$VERSION"); VERSION_TEXT_FORMAT = NewEntry(Category.VERSION_TEXT, "sVersionTextFormat", "FULL", "Determines how to display game version number.\nValid options: FULL, SHORT"); VERSION_TEXT_SIZE = NewEntry(Category.VERSION_TEXT, "fVersionTextSize", 20f, "The font size of the version text. Min = 10, Max = 40."); DISABLE_FIRST_DAY_SFX = NewEntry(Category.MISC, "bDisableFirstDaySFX", defaultVal: false, "Toggles the first day ship speaker SFX."); GAME_STARTUP_DISPLAY = NewEntry(Category.MISC, "iGameStartupDisplay", 0, "The index of the monitor to display the game on when starting.\nYou can find these indexes in your Windows display settings.\nDefaults to 0 (main monitor)."); } } internal static class Metadata { public const string GUID = "io.github.IntroTweaks"; public const string NAME = "IntroTweaks"; public const string VERSION = "1.4.1"; } }
BepInEx/plugins/LC_LandminesForAll.dll
Decompiled a year agousing System; 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.Logging; using HarmonyLib; using LC_LandminesForAll.Patches; using LC_LandminesForAll.Utils; 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: AssemblyCompany("LC_LandminesForAll")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Templete")] [assembly: AssemblyFileVersion("1.0.1.0")] [assembly: AssemblyInformationalVersion("1.0.1+d2a1d9af8893c2a3098c4da244d009911438c0a4")] [assembly: AssemblyProduct("LC_LandminesForAll")] [assembly: AssemblyTitle("LC_LandminesForAll")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.1.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 LC_LandminesForAll { public class MyPluginInfo { public const string PLUGIN_GUID = "sakura.lc.landminesforall"; public const string PLUGIN_NAME = "LandminesForAll"; public const string PLUGIN_VERSION = "1.0.1"; } [BepInPlugin("sakura.lc.landminesforall", "LandminesForAll", "1.0.1")] public class Plugin : BaseUnityPlugin { private Harmony _harmony; internal static ManualLogSource Logger; public static string ThisPluginFolder => Path.Combine(Paths.PluginPath, "Sakura-LandminesForAll"); private void Awake() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown Logger = ((BaseUnityPlugin)this).Logger; _harmony = new Harmony("sakura.lc.landminesforall"); _harmony.PatchAll(typeof(LandminePatch)); Logger.LogInfo((object)"Plugin sakura.lc.landminesforall is loaded!"); } } public static class PluginInfo { public const string PLUGIN_GUID = "LC_LandminesForAll"; public const string PLUGIN_NAME = "LC_LandminesForAll"; public const string PLUGIN_VERSION = "1.0.1"; } } namespace LC_LandminesForAll.Utils { internal static class ReflectionUtils { public static void SetPrivateField<T>(this T instance, string fieldName, object value) { typeof(T).GetField(fieldName, BindingFlags.Instance | BindingFlags.NonPublic).SetValue(instance, value); } public static void SetPrivateProperty<T>(this T instance, string propertyName, object value) { typeof(T).GetProperty(propertyName, BindingFlags.Instance | BindingFlags.NonPublic).SetValue(instance, value); } public static void SetPrivateStaticField<T>(string fieldName, object value) { typeof(T).GetField(fieldName, BindingFlags.Static | BindingFlags.NonPublic).SetValue(null, value); } public static void SetPrivateStaticProperty<T>(string propertyName, object value) { typeof(T).GetProperty(propertyName, BindingFlags.Static | BindingFlags.NonPublic).SetValue(null, value); } public static T GetPrivateField<T>(this object instance, string fieldName) { return (T)instance.GetType().GetField(fieldName, BindingFlags.Instance | BindingFlags.NonPublic).GetValue(instance); } public static T GetPrivateProperty<T>(this object instance, string propertyName) { return (T)instance.GetType().GetProperty(propertyName, BindingFlags.Instance | BindingFlags.NonPublic).GetValue(instance); } public static T GetPrivateStaticField<T>(string fieldName) { return (T)typeof(T).GetField(fieldName, BindingFlags.Static | BindingFlags.NonPublic).GetValue(null); } public static T GetPrivateStaticProperty<T>(string propertyName) { return (T)typeof(T).GetProperty(propertyName, BindingFlags.Static | BindingFlags.NonPublic).GetValue(null); } public static void InvokePrivateMethod<T>(this T instance, string methodName, params object[] parameters) { instance.GetType().GetMethod(methodName, BindingFlags.Instance | BindingFlags.NonPublic).Invoke(instance, parameters); } public static void InvokePrivateStaticMethod<T>(string methodName, params object[] parameters) { typeof(T).GetMethod(methodName, BindingFlags.Static | BindingFlags.NonPublic).Invoke(null, parameters); } public static T CreatePrivateInstance<T>(params object[] parameters) { return (T)Activator.CreateInstance(typeof(T), BindingFlags.Instance | BindingFlags.NonPublic, null, parameters, null); } public static T CreatePrivateStaticInstance<T>(params object[] parameters) { return (T)Activator.CreateInstance(typeof(T), BindingFlags.Static | BindingFlags.NonPublic, null, parameters, null); } } } namespace LC_LandminesForAll.Patches { [HarmonyPatch(typeof(Landmine))] internal class LandminePatch { private const int LineOfSightLayer = 18; private const int EnemyLayer = 19; [HarmonyPatch("Start")] [HarmonyPostfix] private static void Start(Landmine __instance) { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) BoxCollider val = ((IEnumerable<BoxCollider>)((Component)__instance).GetComponents<BoxCollider>()).FirstOrDefault((Func<BoxCollider, bool>)((BoxCollider x) => ((Collider)x).isTrigger)); if ((Object)(object)val == (Object)null) { Plugin.Logger.LogError((object)$"Could not find mine trigger collider on mine at {((Component)__instance).transform.position}"); return; } BoxCollider obj = ((Component)__instance).gameObject.AddComponent<BoxCollider>(); ((Collider)obj).isTrigger = true; obj.size = val.size * 2f; obj.center = val.center; ((Collider)obj).enabled = true; ((Collider)obj).includeLayers = LayerMask.op_Implicit(524288); } private static void TriggerDebounce(Landmine __instance) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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) Transform closestEnemyForLogging = GetClosestEnemyForLogging(__instance); Plugin.Logger.LogDebug((object)$"Triggering debounce on mine at {((Component)__instance).transform.position} with closest enemy at {closestEnemyForLogging.position} at {Vector3.Distance(((Component)__instance).transform.position, ((Component)closestEnemyForLogging).transform.position)} units away."); __instance.SetPrivateField<Landmine>("pressMineDebounceTimer", 0.5f); __instance.PressMineServerRpc(); } private static void TriggerMineExplosion(Landmine __instance) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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) Transform closestEnemyForLogging = GetClosestEnemyForLogging(__instance); Plugin.Logger.LogDebug((object)$"Triggering debounce on mine at {((Component)__instance).transform.position} with closest enemy at {closestEnemyForLogging.position} at {Vector3.Distance(((Component)__instance).transform.position, ((Component)closestEnemyForLogging).transform.position)} units away."); __instance.InvokePrivateMethod<Landmine>("TriggerMineOnLocalClientByExiting", Array.Empty<object>()); } private static Transform GetClosestEnemyForLogging(Landmine __instance) { //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_0011: 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_0025: 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_0046: 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_006d: Unknown result type (might be due to invalid IL or missing references) LayerMask val = LayerMask.op_Implicit(524288); RaycastHit[] array = Physics.SphereCastAll(((Component)__instance).transform.position, 10000f, Vector3.up, 0f, LayerMask.op_Implicit(val)); Transform result = null; float num = float.MaxValue; RaycastHit[] array2 = array; for (int i = 0; i < array2.Length; i++) { RaycastHit val2 = array2[i]; if (((Component)((RaycastHit)(ref val2)).collider).CompareTag("Enemy")) { float num2 = Vector3.Distance(((Component)__instance).transform.position, ((RaycastHit)(ref val2)).transform.position); if (num2 < num) { num = num2; result = ((RaycastHit)(ref val2)).transform; } } } return result; } [HarmonyPatch("OnTriggerEnter")] [HarmonyPrefix] private static bool OnTriggerEnter(Landmine __instance, Collider other) { if (__instance.hasExploded || __instance.GetPrivateField<float>("pressMineDebounceTimer") > 0f) { return true; } if (((Component)other).CompareTag("Enemy")) { TriggerDebounce(__instance); return false; } return true; } [HarmonyPatch("OnTriggerExit")] [HarmonyPrefix] private static bool OnTriggerExit(Landmine __instance, Collider other) { if (__instance.hasExploded || __instance.GetPrivateField<float>("pressMineDebounceTimer") > 0f) { return true; } if (((Component)other).CompareTag("Enemy")) { TriggerMineExplosion(__instance); return false; } return true; } } }
BepInEx/plugins/LC_Masked_Fix.dll
Decompiled a year 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; using LC_MIMICFIX.Patches; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("LC_MIMICFIX")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("LC_MIMICFIX")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("52a8c306-f1df-46d3-a634-8db137e227d7")] [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 LC_MIMICFIX { [BepInPlugin("kuba6000.LC_MimicFixMod", "LC_Masked_Fix", "0.0.2")] public class LC_MimicFixMod : BaseUnityPlugin { private const string ModGUID = "kuba6000.LC_MimicFixMod"; private const string ModName = "LC_Masked_Fix"; private const string ModVersion = "0.0.2"; private readonly Harmony harmony = new Harmony("kuba6000.LC_MimicFixMod"); public static LC_MimicFixMod instance; internal ManualLogSource log; private void Awake() { instance = this; log = Logger.CreateLogSource("kuba6000.LC_MimicFixMod"); log.LogInfo((object)"Mimic Fix Awaken!"); log.LogInfo((object)"V47/48/49 - Fixes red screen overlay / vomit screen after the kill is inturrupted"); log.LogInfo((object)"V45 - Fixes stuck screen after interrupting the kill animation"); log.LogInfo((object)"Patching MaskedPlayerEnemy"); harmony.PatchAll(typeof(LC_MimicFixMod)); harmony.PatchAll(typeof(MaskedPlayerEnemyPatch)); } } } namespace LC_MIMICFIX.Patches { [HarmonyPatch(typeof(MaskedPlayerEnemy))] internal class MaskedPlayerEnemyPatch { [HarmonyPatch("CancelSpecialAnimationWithPlayer")] [HarmonyPrefix] private static bool CancelSpecialAnimationWithPlayerPatch(MaskedPlayerEnemy __instance) { if ((Object)(object)((EnemyAI)__instance).inSpecialAnimationWithPlayer == (Object)(object)GameNetworkManager.Instance.localPlayerController) { LC_MimicFixMod.instance.log.LogInfo((object)"Removing biohazardDamage animation"); HUDManager.Instance.HUDAnimator.SetBool("biohazardDamage", false); HUDManager.Instance.HideHUD(true); HUDManager.Instance.HideHUD(false); } __instance.FinishKillAnimation(false); ((EnemyAI)__instance).inSpecialAnimationWithPlayer = null; return false; } } }
BepInEx/plugins/LC_Optim.dll
Decompiled a year agousing System; using System.Collections.Generic; 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 UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("LC_Optim")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Source moment")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("LC_Optim")] [assembly: AssemblyTitle("LC_Optim")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace LC_Optim; [BepInPlugin("mnc.fixcentipedelag", "FixCentipedeLag", "2023.12.7")] public class Plugin : BaseUnityPlugin { private Harmony thisHarmony; private static Dictionary<int, ulong> instanceMap = new Dictionary<int, ulong>(); private static ulong deadtimer = 100uL; private static ManualLogSource Log; private static ConfigEntry<bool> configShowDebug; private static void Debug(object data, LogLevel logLevel = 16) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (configShowDebug.Value) { Log.Log(logLevel, data); } } private void Awake() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown configShowDebug = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enable debug printing", true, "Enabling this will show debug info in console, e.g. when a new centipede gets tracked or removed."); thisHarmony = new Harmony("mnc.fixcentipedelag"); thisHarmony.Patch((MethodBase)typeof(CentipedeAI).GetMethod("DoAIInterval"), new HarmonyMethod(typeof(Plugin), "RemoveLagCentipede", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); Debug("Registered the patch method", (LogLevel)4); Log = ((BaseUnityPlugin)this).Logger; } public static void RemoveLagCentipede(CentipedeAI __instance) { if (((EnemyAI)__instance).TargetClosestPlayer(1.5f, false, 70f)) { return; } int instanceID = ((Object)__instance).GetInstanceID(); ulong num = (ulong)Time.frameCount; if (!instanceMap.ContainsKey(instanceID)) { instanceMap.Add(instanceID, num); Debug($"Tracked {instanceID}", (LogLevel)16); return; } ulong num2 = instanceMap[instanceID]; if (num - num2 <= deadtimer) { ((EnemyAI)__instance).KillEnemy(true); instanceMap.Remove(instanceID); Debug($"Removed centipede at {instanceID}", (LogLevel)16); } else { instanceMap[instanceID] = num; } } public void OnDestroy() { thisHarmony.UnpatchSelf(); } } internal class PluginMetadata { public const string PLUGIN_GUID = "mnc.fixcentipedelag"; public const string PLUGIN_NAME = "FixCentipedeLag"; public const string PLUGIN_VERSION = "2023.12.7"; } public static class MyPluginInfo { public const string PLUGIN_GUID = "LC_Optim"; public const string PLUGIN_NAME = "LC_Optim"; public const string PLUGIN_VERSION = "1.0.0"; }
BepInEx/plugins/LethalLoudnessMeter.dll
Decompiled a year 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 LethalLoudnessMeter.Patches; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("LoudnessMeter")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("LoudnessMeter")] [assembly: AssemblyCopyright("Copyright © extraes 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("368a271e-98d6-48f8-981e-60df5875ea73")] [assembly: AssemblyFileVersion("1.0.1")] [assembly: TargetFramework(".NETFramework,Version=v4.6", FrameworkDisplayName = ".NET Framework 4.6")] [assembly: AssemblyVersion("1.0.1.0")] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace LethalLoudnessMeter { internal static class BuildInfo { public const string GUID = "xyz.extraes.lethalLoudness"; public const string NAME = "LoudnessMeter"; public const string SHORT_NAME = "LoudMeter"; public const string VERSION = "1.0.1"; public const string AUTHOR = "extraes"; } internal static class LMUtils { public static MethodInfo AsInfo<T>(T dele) where T : Delegate { return dele.Method; } public static HarmonyMethod ToHarmony<T>(T dele) where T : Delegate { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new HarmonyMethod(AsInfo(dele)); } } [BepInPlugin("xyz.extraes.lethalLoudness", "LoudMeter", "1.0.1")] public sealed class LoudnessMeterPlugin : BaseUnityPlugin { private Image volumeImg; private Collider playersCollider; private float accumulatedVolume; public static LoudnessMeterPlugin Instance { get; private set; } public static ManualLogSource Log { get { //IL_001a: Unknown result type (might be due to invalid IL or missing references) LoudnessMeterPlugin instance = Instance; return (ManualLogSource)(((object)((instance != null) ? ((BaseUnityPlugin)instance).Logger : null)) ?? ((object)new ManualLogSource("LoudMeter"))); } } public bool NeedsSnatchedImage => (Object)(object)volumeImg == (Object)null; internal static Harmony Harmony { get; private set; } static LoudnessMeterPlugin() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown Log.LogMessage((object)"Initializing Lethal Loudness Meter..."); Stopwatch stopwatch = Stopwatch.StartNew(); Harmony = new Harmony("xyz.extraes.lethalLoudness"); Harmony.PatchAll(); FootstepPatches.Init(); ItemPatches.Init(); Log.LogInfo((object)("Initialized LethalLoudness in " + stopwatch.ElapsedMilliseconds + "ms")); } private void Awake() { Instance = this; Object.DontDestroyOnLoad((Object)(object)this); PlayAudibleNoisePatch.noisePlayed = (Action<Vector3, float, float>)Delegate.Combine(PlayAudibleNoisePatch.noisePlayed, new Action<Vector3, float, float>(NoisePlayed)); } private void NoisePlayed(Vector3 pos, float range, float vol) { //IL_0057: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)GameNetworkManager.Instance == (Object)null || (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null) { return; } if ((Object)(object)playersCollider == (Object)null) { playersCollider = ((Component)GameNetworkManager.Instance.localPlayerController).GetComponent<Collider>(); } if (playersCollider.enabled) { Vector3 val = playersCollider.ClosestPoint(pos); if (!(Vector3.Distance(pos, val) > 0.3f)) { accumulatedVolume += vol; } } } private void Update() { if ((Object)(object)GameNetworkManager.Instance == (Object)null || (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null) { return; } if ((Object)(object)volumeImg == (Object)null && accumulatedVolume != 0f) { Log.LogError((object)"Volume image wasn't found! Wha?"); return; } if (volumeImg.fillAmount < accumulatedVolume) { volumeImg.fillAmount = Mathf.Clamp(accumulatedVolume, 0.05f, 1f); } else { float fillAmount = volumeImg.fillAmount; float num = Mathf.Clamp(accumulatedVolume, 0.01f, 1f); float num2 = Mathf.Clamp(Time.deltaTime * 3f, 0f, 1f); volumeImg.fillAmount = Mathf.Lerp(fillAmount, num, num2); } accumulatedVolume = 0f; } private void OnDestroy() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) Log.LogError((object)"Creating new GameObject to host LoudnessMeter..."); new GameObject("LMP").AddComponent<LoudnessMeterPlugin>(); } public void SetVolumeImage(Image img) { if ((Object)(object)volumeImg != (Object)null) { Log.LogWarning((object)"Volume img isn't null but you're replacing it? Whar?"); } volumeImg = img; } } } namespace LethalLoudnessMeter.Patches { internal static class FootstepPatches { public static void Init() { MethodInfo methodInfo = AccessTools.DeclaredMethod(typeof(PlayerControllerB), "PlayFootstepServer", (Type[])null, (Type[])null); MethodInfo methodInfo2 = AccessTools.DeclaredMethod(typeof(PlayerControllerB), "PlayFootstepLocal", (Type[])null, (Type[])null); HarmonyMethod val = LMUtils.ToHarmony<Action<PlayerControllerB>>(FootstepServer); HarmonyMethod val2 = LMUtils.ToHarmony<Action<PlayerControllerB>>(FootstepLocal); LoudnessMeterPlugin.Harmony.Patch((MethodBase)methodInfo, (HarmonyMethod)null, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); LoudnessMeterPlugin.Harmony.Patch((MethodBase)methodInfo2, (HarmonyMethod)null, val2, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } private static void FootstepServer(PlayerControllerB __instance) { } private static void FootstepLocal(PlayerControllerB __instance) { } } internal static class ItemPatches { public static void Init() { } } [HarmonyPatch(typeof(DisplayPlayerMicVolume), "Awake")] internal static class MicVolumeSnatcher { public static void Postfix(DisplayPlayerMicVolume __instance) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) GameObject obj = Object.Instantiate<GameObject>(((Component)__instance.volumeMeterImage).gameObject); Image component = obj.GetComponent<Image>(); RectTransform val = (RectTransform)obj.transform; CanvasRenderer canvasRenderer = ((Graphic)component).canvasRenderer; GameObject val2 = GameObject.Find("Systems/UI/Canvas/IngamePlayerHUD/BottomLeftCorner"); ((Transform)val).SetParent(val2.transform, true); val.anchoredPosition3D = new Vector3(-10f, 40f, 0f); ((Transform)val).localScale = new Vector3(15f, 15f, 15f); canvasRenderer.SetAlpha(4f); component.fillAmount = 1f; LoudnessMeterPlugin.Log.LogMessage((object)"Snatched mic volume!"); LoudnessMeterPlugin.Instance.SetVolumeImage(component); } } [HarmonyPatch(typeof(RoundManager), "PlayAudibleNoise")] internal static class PlayAudibleNoisePatch { public static Action<Vector3, float, float> noisePlayed; public static void Postfix(Vector3 noisePosition, float noiseRange, float noiseLoudness) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) noisePlayed?.Invoke(noisePosition, noiseRange, noiseLoudness); } } [HarmonyPatch(typeof(HUDManager), "Awake")] internal static class SettingsPanelActivator { public static void Postfix() { Transform obj = GameObject.Find("Systems/UI/Canvas").transform.Find("QuickMenu"); Transform val = obj.Find("SettingsPanel"); ((Component)obj).gameObject.SetActive(true); ((Component)val).gameObject.SetActive(true); ((Component)val).gameObject.SetActive(false); ((Component)obj).gameObject.SetActive(false); LoudnessMeterPlugin.Log.LogMessage((object)"Toggled QuickMenu -> SettingsPanel successfully"); } } }
BepInEx/plugins/LetMeLookDown.dll
Decompiled a year agousing System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using GameNetcodeStuff; 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("LetMeLookDown")] [assembly: AssemblyDescription("Mod made by flipf17")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("LetMeLookDown")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("a9c88d54-8f01-44a7-be0d-bd61d38aadcb")] [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 LetMeLookDown { [BepInPlugin("FlipMods.LetMeLookDown", "LetMeLookDown", "1.0.1")] public class Plugin : BaseUnityPlugin { private Harmony _harmony; private static Plugin instance; public static float maxAngle = 80f; private void Awake() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown _harmony = new Harmony("LetMeLookDown"); _harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"LetMeLookDown mod loaded"); instance = this; } public static void Log(string message) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)message); } } public static class PluginInfo { public const string PLUGIN_GUID = "FlipMods.LetMeLookDown"; public const string PLUGIN_NAME = "LetMeLookDown"; public const string PLUGIN_VERSION = "1.0.1"; } } namespace LetMeLookDown.Patches { [HarmonyPatch] internal class AdjustSmoothLookingPatcher { [HarmonyPatch(typeof(PlayerControllerB), "CalculateSmoothLookingInput")] private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { List<CodeInstruction> list = new List<CodeInstruction>(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Ldc_R4 && (float)list[i].operand == 60f) { list[i].operand = Plugin.maxAngle; break; } } return list.AsEnumerable(); } } [HarmonyPatch] internal class AdjustNormalLookingPatcher { [HarmonyPatch(typeof(PlayerControllerB), "CalculateNormalLookingInput")] private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { List<CodeInstruction> list = new List<CodeInstruction>(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Ldc_R4 && (float)list[i].operand == 60f) { list[i].operand = Plugin.maxAngle; break; } } return list.AsEnumerable(); } } }
BepInEx/plugins/MoreSuits.dll
Decompiled a year agousing System; 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 HarmonyLib; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("MoreSuits")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("A mod that adds more suit options to Lethal Company")] [assembly: AssemblyFileVersion("1.4.1.0")] [assembly: AssemblyInformationalVersion("1.4.1")] [assembly: AssemblyProduct("MoreSuits")] [assembly: AssemblyTitle("MoreSuits")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.4.1.0")] [module: UnverifiableCode] namespace MoreSuits; [BepInPlugin("x753.More_Suits", "More Suits", "1.4.1")] public class MoreSuitsMod : BaseUnityPlugin { [HarmonyPatch(typeof(StartOfRound))] internal class StartOfRoundPatch { [HarmonyPatch("Start")] [HarmonyPrefix] private static void StartPatch(ref StartOfRound __instance) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_067c: Unknown result type (might be due to invalid IL or missing references) //IL_0681: Unknown result type (might be due to invalid IL or missing references) //IL_0687: Unknown result type (might be due to invalid IL or missing references) //IL_068c: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Expected O, but got Unknown //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Expected O, but got Unknown //IL_0598: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Expected O, but got Unknown try { if (SuitsAdded) { return; } int count = __instance.unlockablesList.unlockables.Count; UnlockableItem val = new UnlockableItem(); int num = 0; for (int i = 0; i < __instance.unlockablesList.unlockables.Count; i++) { UnlockableItem val2 = __instance.unlockablesList.unlockables[i]; if (!((Object)(object)val2.suitMaterial != (Object)null) || !val2.alreadyUnlocked) { continue; } val = val2; List<string> list = Directory.GetDirectories(Paths.PluginPath, "moresuits", SearchOption.AllDirectories).ToList(); List<string> list2 = new List<string>(); List<string> list3 = new List<string>(); List<string> list4 = DisabledSuits.ToLower().Replace(".png", "").Split(',') .ToList(); List<string> list5 = new List<string>(); if (!LoadAllSuits) { foreach (string item2 in list) { if (File.Exists(Path.Combine(item2, "!less-suits.txt"))) { string[] collection = new string[9] { "glow", "kirby", "knuckles", "luigi", "mario", "minion", "skeleton", "slayer", "smile" }; list5.AddRange(collection); break; } } } foreach (string item3 in list) { if (item3 != "") { string[] files = Directory.GetFiles(item3, "*.png"); string[] files2 = Directory.GetFiles(item3, "*.matbundle"); list2.AddRange(files); list3.AddRange(files2); } } list3.Sort(); list2.Sort(); try { foreach (string item4 in list3) { Object[] array = AssetBundle.LoadFromFile(item4).LoadAllAssets(); foreach (Object val3 in array) { if (val3 is Material) { Material item = (Material)val3; customMaterials.Add(item); } } } } catch (Exception ex) { Debug.Log((object)("Something went wrong with More Suits! Could not load materials from asset bundle(s). Error: " + ex)); } foreach (string item5 in list2) { if (list4.Contains(Path.GetFileNameWithoutExtension(item5).ToLower())) { continue; } string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); if (list5.Contains(Path.GetFileNameWithoutExtension(item5).ToLower()) && item5.Contains(directoryName)) { continue; } UnlockableItem val4; Material val5; if (Path.GetFileNameWithoutExtension(item5).ToLower() == "default") { val4 = val; val5 = val4.suitMaterial; } else { val4 = JsonUtility.FromJson<UnlockableItem>(JsonUtility.ToJson((object)val)); val5 = Object.Instantiate<Material>(val4.suitMaterial); } byte[] array2 = File.ReadAllBytes(item5); Texture2D val6 = new Texture2D(2, 2); ImageConversion.LoadImage(val6, array2); val5.mainTexture = (Texture)(object)val6; val4.unlockableName = Path.GetFileNameWithoutExtension(item5); try { string path = Path.Combine(Path.GetDirectoryName(item5), "advanced", val4.unlockableName + ".json"); if (File.Exists(path)) { string[] array3 = File.ReadAllLines(path); for (int j = 0; j < array3.Length; j++) { string[] array4 = array3[j].Trim().Split(':'); if (array4.Length != 2) { continue; } string text = array4[0].Trim('"', ' ', ','); string text2 = array4[1].Trim('"', ' ', ','); if (text2.Contains(".png")) { byte[] array5 = File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(item5), "advanced", text2)); Texture2D val7 = new Texture2D(2, 2); ImageConversion.LoadImage(val7, array5); val5.SetTexture(text, (Texture)(object)val7); continue; } if (text == "PRICE" && int.TryParse(text2, out var result)) { try { val4 = AddToRotatingShop(val4, result, __instance.unlockablesList.unlockables.Count); } catch (Exception ex2) { Debug.Log((object)("Something went wrong with More Suits! Could not add a suit to the rotating shop. Error: " + ex2)); } continue; } switch (text2) { case "KEYWORD": val5.EnableKeyword(text); continue; case "DISABLEKEYWORD": val5.DisableKeyword(text); continue; case "SHADERPASS": val5.SetShaderPassEnabled(text, true); continue; case "DISABLESHADERPASS": val5.SetShaderPassEnabled(text, false); continue; } float result2; Vector4 vector; if (text == "SHADER") { Shader shader = Shader.Find(text2); val5.shader = shader; } else if (text == "MATERIAL") { foreach (Material customMaterial in customMaterials) { if (((Object)customMaterial).name == text2) { val5 = Object.Instantiate<Material>(customMaterial); val5.mainTexture = (Texture)(object)val6; break; } } } else if (float.TryParse(text2, out result2)) { val5.SetFloat(text, result2); } else if (TryParseVector4(text2, out vector)) { val5.SetVector(text, vector); } } } } catch (Exception ex3) { Debug.Log((object)("Something went wrong with More Suits! Error: " + ex3)); } val4.suitMaterial = val5; if (val4.unlockableName.ToLower() != "default") { if (num == MaxSuits) { Debug.Log((object)"Attempted to add a suit, but you've already reached the max number of suits! Modify the config if you want more."); continue; } __instance.unlockablesList.unlockables.Add(val4); num++; } } SuitsAdded = true; break; } UnlockableItem val8 = JsonUtility.FromJson<UnlockableItem>(JsonUtility.ToJson((object)val)); val8.alreadyUnlocked = false; val8.hasBeenMoved = false; val8.placedPosition = Vector3.zero; val8.placedRotation = Vector3.zero; val8.unlockableType = 753; while (__instance.unlockablesList.unlockables.Count < count + MaxSuits) { __instance.unlockablesList.unlockables.Add(val8); } } catch (Exception ex4) { Debug.Log((object)("Something went wrong with More Suits! Error: " + ex4)); } } [HarmonyPatch("PositionSuitsOnRack")] [HarmonyPrefix] private static bool PositionSuitsOnRackPatch(ref StartOfRound __instance) { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) List<UnlockableSuit> source = Object.FindObjectsOfType<UnlockableSuit>().ToList(); source = source.OrderBy((UnlockableSuit suit) => suit.syncedSuitID.Value).ToList(); int num = 0; foreach (UnlockableSuit item in source) { AutoParentToShip component = ((Component)item).gameObject.GetComponent<AutoParentToShip>(); component.overrideOffset = true; float num2 = 0.18f; if (MakeSuitsFitOnRack && source.Count > 13) { num2 /= (float)Math.Min(source.Count, 20) / 12f; } component.positionOffset = new Vector3(-2.45f, 2.75f, -8.41f) + __instance.rightmostSuitPosition.forward * num2 * (float)num; component.rotationOffset = new Vector3(0f, 90f, 0f); num++; } return false; } } private const string modGUID = "x753.More_Suits"; private const string modName = "More Suits"; private const string modVersion = "1.4.1"; private readonly Harmony harmony = new Harmony("x753.More_Suits"); private static MoreSuitsMod Instance; public static bool SuitsAdded = false; public static string DisabledSuits; public static bool LoadAllSuits; public static bool MakeSuitsFitOnRack; public static int MaxSuits; public static List<Material> customMaterials = new List<Material>(); private static TerminalNode cancelPurchase; private static TerminalKeyword buyKeyword; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } DisabledSuits = ((BaseUnityPlugin)this).Config.Bind<string>("General", "Disabled Suit List", "UglySuit751.png,UglySuit752.png,UglySuit753.png", "Comma-separated list of suits that shouldn't be loaded").Value; LoadAllSuits = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Ignore !less-suits.txt", false, "If true, ignores the !less-suits.txt file and will attempt to load every suit, except those in the disabled list. This should be true if you're not worried about having too many suits.").Value; MakeSuitsFitOnRack = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Make Suits Fit on Rack", true, "If true, squishes the suits together so more can fit on the rack.").Value; MaxSuits = ((BaseUnityPlugin)this).Config.Bind<int>("General", "Max Suits", 100, "The maximum number of suits to load. If you have more, some will be ignored.").Value; harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin More Suits is loaded!"); } private static UnlockableItem AddToRotatingShop(UnlockableItem newSuit, int price, int unlockableID) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Expected O, but got Unknown //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Expected O, but got Unknown //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Expected O, but got Unknown Terminal val = Object.FindObjectOfType<Terminal>(); for (int i = 0; i < val.terminalNodes.allKeywords.Length; i++) { if (((Object)val.terminalNodes.allKeywords[i]).name == "Buy") { buyKeyword = val.terminalNodes.allKeywords[i]; break; } } newSuit.alreadyUnlocked = false; newSuit.hasBeenMoved = false; newSuit.placedPosition = Vector3.zero; newSuit.placedRotation = Vector3.zero; newSuit.shopSelectionNode = ScriptableObject.CreateInstance<TerminalNode>(); ((Object)newSuit.shopSelectionNode).name = newSuit.unlockableName + "SuitBuy1"; newSuit.shopSelectionNode.creatureName = newSuit.unlockableName + " suit"; newSuit.shopSelectionNode.displayText = "You have requested to order " + newSuit.unlockableName + " suits.\nTotal cost of item: [totalCost].\n\nPlease CONFIRM or DENY.\n\n"; newSuit.shopSelectionNode.clearPreviousText = true; newSuit.shopSelectionNode.shipUnlockableID = unlockableID; newSuit.shopSelectionNode.itemCost = price; newSuit.shopSelectionNode.overrideOptions = true; CompatibleNoun val2 = new CompatibleNoun(); val2.noun = ScriptableObject.CreateInstance<TerminalKeyword>(); val2.noun.word = "confirm"; val2.noun.isVerb = true; val2.result = ScriptableObject.CreateInstance<TerminalNode>(); ((Object)val2.result).name = newSuit.unlockableName + "SuitBuyConfirm"; val2.result.creatureName = ""; val2.result.displayText = "Ordered " + newSuit.unlockableName + " suits! Your new balance is [playerCredits].\n\n"; val2.result.clearPreviousText = true; val2.result.shipUnlockableID = unlockableID; val2.result.buyUnlockable = true; val2.result.itemCost = price; val2.result.terminalEvent = ""; CompatibleNoun val3 = new CompatibleNoun(); val3.noun = ScriptableObject.CreateInstance<TerminalKeyword>(); val3.noun.word = "deny"; val3.noun.isVerb = true; if ((Object)(object)cancelPurchase == (Object)null) { cancelPurchase = ScriptableObject.CreateInstance<TerminalNode>(); } val3.result = cancelPurchase; ((Object)val3.result).name = "MoreSuitsCancelPurchase"; val3.result.displayText = "Cancelled order.\n"; newSuit.shopSelectionNode.terminalOptions = (CompatibleNoun[])(object)new CompatibleNoun[2] { val2, val3 }; TerminalKeyword val4 = ScriptableObject.CreateInstance<TerminalKeyword>(); ((Object)val4).name = newSuit.unlockableName + "Suit"; val4.word = newSuit.unlockableName.ToLower() + " suit"; val4.defaultVerb = buyKeyword; CompatibleNoun val5 = new CompatibleNoun(); val5.noun = val4; val5.result = newSuit.shopSelectionNode; List<CompatibleNoun> list = buyKeyword.compatibleNouns.ToList(); list.Add(val5); buyKeyword.compatibleNouns = list.ToArray(); List<TerminalKeyword> list2 = val.terminalNodes.allKeywords.ToList(); list2.Add(val4); list2.Add(val2.noun); list2.Add(val3.noun); val.terminalNodes.allKeywords = list2.ToArray(); return newSuit; } public static bool TryParseVector4(string input, out Vector4 vector) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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) vector = Vector4.zero; string[] array = input.Split(','); if (array.Length == 4 && float.TryParse(array[0], out var result) && float.TryParse(array[1], out var result2) && float.TryParse(array[2], out var result3) && float.TryParse(array[3], out var result4)) { vector = new Vector4(result, result2, result3, result4); return true; } return false; } }
BepInEx/plugins/NoSellLimit.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; 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("NoSellLimit")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Remove the limit of items that can be placed on the deposit desk")] [assembly: AssemblyFileVersion("1.0.1.0")] [assembly: AssemblyInformationalVersion("1.0.1")] [assembly: AssemblyProduct("NoSellLimit")] [assembly: AssemblyTitle("NoSellLimit")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.1.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace NoSellLimit { [BepInPlugin("viviko.NoSellLimit", "NoSellLimit", "1.0.1")] public class NoSellLimit : BaseUnityPlugin { [HarmonyPatch(typeof(DepositItemsDesk))] [HarmonyPatch("PlaceItemOnCounter")] public static class PlaceItemOnCounterPatch { private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Expected O, but got Unknown //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Expected O, but got Unknown //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) CodeMatch[] array = (CodeMatch[])(object)new CodeMatch[7] { new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldarg_0), (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => CodeInstructionExtensions.LoadsField(i, AccessTools.Field(typeof(DepositItemsDesk), "deskObjectsContainer"), false)), (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Callvirt), (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldlen), (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Conv_I4), (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldc_I4_S), (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Bge), (string)null) }; CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); val.Start(); val.MatchForward(false, array); val.SetOpcodeAndAdvance(OpCodes.Nop); val.RemoveInstructions(array.Length - 1); return val.Instructions(); } } private const string modGUID = "viviko.NoSellLimit"; private const string modName = "NoSellLimit"; private const string modVersion = "1.0.1"; private readonly Harmony harmony = new Harmony("viviko.NoSellLimit"); private static NoSellLimit Instance; public static ManualLogSource mls; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = Logger.CreateLogSource("NoSellLimit"); harmony.PatchAll(); mls.LogInfo((object)"Plugin NoSellLimit is loaded!"); } } internal static class GeneratedPluginInfo { public const string Identifier = "viviko.NoSellLimit"; public const string Name = "NoSellLimit"; public const string Version = "1.0.1"; } } namespace System.Diagnostics.CodeAnalysis { [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class ExperimentalAttribute : Attribute { public string DiagnosticId { get; } public string? UrlFormat { get; set; } public ExperimentalAttribute(string diagnosticId) { DiagnosticId = diagnosticId; } } [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)] [ExcludeFromCodeCoverage] internal sealed class MemberNotNullAttribute : Attribute { public string[] Members { get; } public MemberNotNullAttribute(string member) { Members = new string[1] { member }; } public MemberNotNullAttribute(params string[] members) { Members = members; } } [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)] [ExcludeFromCodeCoverage] internal sealed class MemberNotNullWhenAttribute : Attribute { public bool ReturnValue { get; } public string[] Members { get; } public MemberNotNullWhenAttribute(bool returnValue, string member) { ReturnValue = returnValue; Members = new string[1] { member }; } public MemberNotNullWhenAttribute(bool returnValue, params string[] members) { ReturnValue = returnValue; Members = members; } } [AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class SetsRequiredMembersAttribute : Attribute { } [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class StringSyntaxAttribute : Attribute { public const string CompositeFormat = "CompositeFormat"; public const string DateOnlyFormat = "DateOnlyFormat"; public const string DateTimeFormat = "DateTimeFormat"; public const string EnumFormat = "EnumFormat"; public const string GuidFormat = "GuidFormat"; public const string Json = "Json"; public const string NumericFormat = "NumericFormat"; public const string Regex = "Regex"; public const string TimeOnlyFormat = "TimeOnlyFormat"; public const string TimeSpanFormat = "TimeSpanFormat"; public const string Uri = "Uri"; public const string Xml = "Xml"; public string Syntax { get; } public object?[] Arguments { get; } public StringSyntaxAttribute(string syntax) { Syntax = syntax; Arguments = new object[0]; } public StringSyntaxAttribute(string syntax, params object?[] arguments) { Syntax = syntax; Arguments = arguments; } } [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class UnscopedRefAttribute : Attribute { } } namespace System.Runtime.Versioning { [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class RequiresPreviewFeaturesAttribute : Attribute { public string? Message { get; } public string? Url { get; set; } public RequiresPreviewFeaturesAttribute() { } public RequiresPreviewFeaturesAttribute(string? message) { Message = message; } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class CallerArgumentExpressionAttribute : Attribute { public string ParameterName { get; } public CallerArgumentExpressionAttribute(string parameterName) { ParameterName = parameterName; } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class CollectionBuilderAttribute : Attribute { public Type BuilderType { get; } public string MethodName { get; } public CollectionBuilderAttribute(Type builderType, string methodName) { BuilderType = builderType; MethodName = methodName; } } [AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class CompilerFeatureRequiredAttribute : Attribute { public const string RefStructs = "RefStructs"; public const string RequiredMembers = "RequiredMembers"; public string FeatureName { get; } public bool IsOptional { get; set; } public CompilerFeatureRequiredAttribute(string featureName) { FeatureName = featureName; } } [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class InterpolatedStringHandlerArgumentAttribute : Attribute { public string[] Arguments { get; } public InterpolatedStringHandlerArgumentAttribute(string argument) { Arguments = new string[1] { argument }; } public InterpolatedStringHandlerArgumentAttribute(params string[] arguments) { Arguments = arguments; } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class InterpolatedStringHandlerAttribute : Attribute { } [EditorBrowsable(EditorBrowsableState.Never)] [ExcludeFromCodeCoverage] internal static class IsExternalInit { } [AttributeUsage(AttributeTargets.Method, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class ModuleInitializerAttribute : Attribute { } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class RequiredMemberAttribute : Attribute { } [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] [EditorBrowsable(EditorBrowsableState.Never)] [ExcludeFromCodeCoverage] internal sealed class RequiresLocationAttribute : Attribute { } [AttributeUsage(AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Event | AttributeTargets.Interface, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class SkipLocalsInitAttribute : Attribute { } }
BepInEx/plugins/PushToMute.dll
Decompiled a year 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; using PushToMute.Patches; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("PushToMute")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("PushToMute")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("faaa231e-a5f3-481d-a1d9-f1f5799855fc")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace PushToMute { [BepInPlugin("Baba.PushToMute", "PushToMute", "1.0.0")] public class PTMModBase : BaseUnityPlugin { private const string modGUID = "Baba.PushToMute"; private const string modName = "PushToMute"; private const string modVersion = "1.0.0"; private readonly Harmony harmony = new Harmony("Baba.PushToMute"); private static PTMModBase Instance; internal ManualLogSource mls; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = Logger.CreateLogSource("Baba.PushToMute"); harmony.PatchAll(typeof(PTMModBase)); harmony.PatchAll(typeof(UpdatePatch)); harmony.PatchAll(typeof(InGamePlayerSettingsPatch)); mls.LogInfo((object)"Push To Mute successfully loaded!"); } } } namespace PushToMute.Patches { [HarmonyPatch(typeof(StartOfRound), "Update")] internal class UpdatePatch { private static void Postfix(StartOfRound __instance) { if ((Object)(object)__instance.voiceChatModule != (Object)null && !IngamePlayerSettings.Instance.settings.pushToTalk) { __instance.voiceChatModule.IsMuted = IngamePlayerSettings.Instance.playerInput.actions.FindAction("VoiceButton", false).IsPressed(); } } } [HarmonyPatch(typeof(IngamePlayerSettings))] internal class InGamePlayerSettingsPatch { [HarmonyPatch("SetMicPushToTalk")] [HarmonyPostfix] private static void SetMicPushToTalkPatch(IngamePlayerSettings __instance) { if (!__instance.unsavedSettings.pushToTalk) { __instance.SetSettingsOptionsText((SettingsOptionType)3, "MODE: Push to mute"); } } [HarmonyPatch("UpdateMicPushToTalkButton")] [HarmonyPostfix] private static void UpdateMicPushToTalkButtonPatch(IngamePlayerSettings __instance) { if (!__instance.settings.pushToTalk) { __instance.SetSettingsOptionsText((SettingsOptionType)3, "MODE: Push to mute"); } } } }
BepInEx/plugins/ShipLoot.dll
Decompiled a year agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using HarmonyLib; using TMPro; using UnityEngine; using UnityEngine.InputSystem; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("ShipLoot")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyProduct("ShipLoot")] [assembly: AssemblyCopyright("Copyright © tinyhoot 2023")] [assembly: ComVisible(false)] [assembly: AssemblyFileVersion("1.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace ShipLoot { [BepInPlugin("com.github.tinyhoot.ShipLoot", "ShipLoot", "1.0")] internal class ShipLoot : BaseUnityPlugin { public const string GUID = "com.github.tinyhoot.ShipLoot"; public const string NAME = "ShipLoot"; public const string VERSION = "1.0"; internal static ManualLogSource Log; private void Awake() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) Log = ((BaseUnityPlugin)this).Logger; new Harmony("com.github.tinyhoot.ShipLoot").PatchAll(Assembly.GetExecutingAssembly()); } } } namespace ShipLoot.Patches { [HarmonyPatch] internal class HudManagerPatcher { private static GameObject _totalCounter; private static TextMeshProUGUI _textMesh; private static float _displayTimeLeft; private const float DisplayTime = 5f; [HarmonyPrefix] [HarmonyPatch(typeof(HUDManager), "PingScan_performed")] private static void OnScan(HUDManager __instance, CallbackContext context) { if (!((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null) && ((CallbackContext)(ref context)).performed && __instance.CanPlayerScan() && !(__instance.playerPingingScan > -0.5f) && (StartOfRound.Instance.inShipPhase || GameNetworkManager.Instance.localPlayerController.isInHangarShipRoom)) { if (!Object.op_Implicit((Object)(object)_totalCounter)) { CopyValueCounter(); } float num = CalculateLootValue(); ((TMP_Text)_textMesh).text = $"SHIP: ${num:F0}"; _displayTimeLeft = 5f; if (!_totalCounter.activeSelf) { ((MonoBehaviour)GameNetworkManager.Instance).StartCoroutine(ShipLootCoroutine()); } } } private static IEnumerator ShipLootCoroutine() { _totalCounter.SetActive(true); while (_displayTimeLeft > 0f) { float displayTimeLeft = _displayTimeLeft; _displayTimeLeft = 0f; yield return (object)new WaitForSeconds(displayTimeLeft); } _totalCounter.SetActive(false); } private static float CalculateLootValue() { List<GrabbableObject> list = (from obj in GameObject.Find("/Environment/HangarShip").GetComponentsInChildren<GrabbableObject>() where ((Object)obj).name != "ClipboardManual" && ((Object)obj).name != "StickyNoteItem" select obj).ToList(); ShipLoot.Log.LogDebug((object)"Calculating total ship scrap value."); CollectionExtensions.Do<GrabbableObject>((IEnumerable<GrabbableObject>)list, (Action<GrabbableObject>)delegate(GrabbableObject scrap) { ShipLoot.Log.LogDebug((object)$"{((Object)scrap).name} - ${scrap.scrapValue}"); }); return list.Sum((GrabbableObject scrap) => scrap.scrapValue); } private static void CopyValueCounter() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_008d: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.Find("/Systems/UI/Canvas/IngamePlayerHUD/BottomMiddle/ValueCounter"); if (!Object.op_Implicit((Object)(object)val)) { ShipLoot.Log.LogError((object)"Failed to find ValueCounter object to copy!"); } _totalCounter = Object.Instantiate<GameObject>(val.gameObject, val.transform.parent, false); _totalCounter.transform.Translate(0f, 1f, 0f); Vector3 localPosition = _totalCounter.transform.localPosition; _totalCounter.transform.localPosition = new Vector3(localPosition.x + 50f, -50f, localPosition.z); _textMesh = _totalCounter.GetComponentInChildren<TextMeshProUGUI>(); } } }
BepInEx/plugins/VoiceHUD.dll
Decompiled a year agousing System; using System.Diagnostics; using System.IO; 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 Dissonance; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.UI; using VoiceHUD.Configuration; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("VoiceHUD")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Displays push-to-talk icon on voice activation")] [assembly: AssemblyFileVersion("1.0.1.0")] [assembly: AssemblyInformationalVersion("1.0.1+f1e0a0cfa0a629002418c9e0aa3a753676e33192")] [assembly: AssemblyProduct("VoiceHUD")] [assembly: AssemblyTitle("VoiceHUD")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.1.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 VoiceHUD { [BepInPlugin("5Bit.VoiceHUD", "VoiceHUD", "1.0.4")] public class VoiceHUD : BaseUnityPlugin { private const string modGUID = "5Bit.VoiceHUD"; private const string modName = "VoiceHUD"; private const string modVersion = "1.0.4"; private readonly Harmony harmony = new Harmony("5Bit.VoiceHUD"); private static VoiceHUD Instance; internal static ManualLogSource mls; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = Logger.CreateLogSource("5Bit.VoiceHUD"); Config.Init(); harmony.PatchAll(); } } public static class PluginInfo { public const string PLUGIN_GUID = "VoiceHUD"; public const string PLUGIN_NAME = "VoiceHUD"; public const string PLUGIN_VERSION = "1.0.1"; } } namespace VoiceHUD.Patches { [HarmonyPatch(typeof(HUDManager))] internal class VoiceHUDPatch { private static Color Start = new Color(0f, 255f, 0f, 255f); private static Color Center = new Color(165f, 255f, 0f, 255f); private static Color End = new Color(255f, 0f, 0f, 255f); [HarmonyPatch("Update")] [HarmonyPostfix] private static void Update() { //IL_00ab: Unknown result type (might be due to invalid IL or missing references) if (!IngamePlayerSettings.Instance.settings.micEnabled || IngamePlayerSettings.Instance.settings.pushToTalk || (Object)(object)StartOfRound.Instance.voiceChatModule == (Object)null) { return; } VoicePlayerState val = StartOfRound.Instance.voiceChatModule.FindPlayer(StartOfRound.Instance.voiceChatModule.LocalPlayerName); if (val.IsSpeaking) { float num = Mathf.Clamp(val.Amplitude * 35f, 0f, 1f); if (Config.ColorsEnabled) { ((Graphic)HUDManager.Instance.PTTIcon).color = GetColorByVolume(num * 100f); } ((Behaviour)HUDManager.Instance.PTTIcon).enabled = num > 0.01f; } } public static Color GetColorByVolume(float volume) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (volume < 20f) { return Start; } if (volume > 70f) { return End; } return Center; } } } namespace VoiceHUD.Configuration { internal static class Config { private const string CONFIG_FILE_NAME = "VoiceHUD.cfg"; private static ConfigFile config; private static ConfigEntry<bool> colorsEnabled; public static bool ColorsEnabled => colorsEnabled.Value; public static void Init() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown string text = Path.Combine(Paths.ConfigPath, "VoiceHUD.cfg"); config = new ConfigFile(text, true); colorsEnabled = config.Bind<bool>("Config", "Colors enabled", false, "Change icon color based on volume."); } } }