Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of MaybeMaskedMasked v1.0.0
BepInEx/plugins/MaybeMaskedMasked.dll
Decompiled 6 months 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 BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LethalConfig; using LethalConfig.ConfigItems; using LethalConfig.ConfigItems.Options; using MaybeMaskedMasked.Integrations; using MaybeMaskedMasked.Networking; using Microsoft.CodeAnalysis; using Unity.Collections; using Unity.Netcode; 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("MaybeMaskedMasked")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Adds a configurable chance that a Masked will spawn without a mask.")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+916db4c2ef23f449d97294f2f1f26435f0b63716")] [assembly: AssemblyProduct("MaybeMaskedMasked")] [assembly: AssemblyTitle("MaybeMaskedMasked")] [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] internal sealed class ParamCollectionAttribute : 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 MaybeMaskedMasked { public enum ModEnum { None, First, Second, Third } public class ModConfig { public SyncedEntry<int> MaskChance; public ModConfig(ConfigFile config) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown config.SaveOnConfigSet = false; MaskChance = config.BindSynced("General", "MaskChance", 50, new ConfigDescription("Percent chance for a Masked to be wearing a mask.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); ((Dictionary<ConfigDefinition, string>)AccessTools.Property(typeof(ConfigFile), "OrphanedEntries").GetValue(config)).Clear(); config.Save(); config.SaveOnConfigSet = true; } } [BepInPlugin("MaybeMaskedMasked", "MaybeMaskedMasked", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Logger { get; private set; } public static Plugin Instance { get; private set; } public static ModConfig ModConfig { get; private set; } internal void Awake() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Instance != (Object)null)) { Instance = this; Logger = ((BaseUnityPlugin)this).Logger; ModConfig = new ModConfig(((BaseUnityPlugin)this).Config); InitSoftDependencyIntegrations(); new Harmony("MaybeMaskedMasked").PatchAll(); Logger.LogInfo((object)"MaybeMaskedMasked loaded successfully."); } } private void InitSoftDependencyIntegrations() { if (Chainloader.PluginInfos.ContainsKey("ainavt.lc.lethalconfig")) { LethalConfigIntegration.Initialize(); } } } public static class PluginInfo { public const string PLUGIN_GUID = "MaybeMaskedMasked"; public const string PLUGIN_NAME = "MaybeMaskedMasked"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace MaybeMaskedMasked.Patches { [HarmonyPatch] internal class MaskedPatch { [CompilerGenerated] private sealed class <HideMasks>d__3 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public MaskedPlayerEnemy entity; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <HideMasks>d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: { <>1__state = -1; GameObject[] maskTypes = entity.maskTypes; for (int i = 0; i < maskTypes.Length; i++) { maskTypes[i].SetActive(false); } <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; } case 1: { <>1__state = -1; GameObject[] maskTypes = entity.maskTypes; for (int i = 0; i < maskTypes.Length; i++) { maskTypes[i].SetActive(false); } return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <ShowMask>d__2 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public MaskedPlayerEnemy entity; public int maskId; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ShowMask>d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; case 1: <>1__state = -1; try { if (entity.maskTypes.All((GameObject x) => !x.activeSelf)) { entity.maskTypes[maskId].SetActive(true); entity.maskTypeIndex = maskId; } } catch { Plugin.Logger.LogWarning((object)"Unable to verify mask status. This may be caused by an incompatible version of the game, or another mod."); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static Random random; [HarmonyPatch(typeof(MaskedPlayerEnemy), "Start")] [HarmonyPrefix] public static void MaskedSpawnPatch(MaskedPlayerEnemy __instance) { int value = Plugin.ModConfig.MaskChance.Value; int num = random.Next(0, 100); if (value > num) { try { int maskId = Math.Max(0, Array.FindIndex(__instance.maskTypes, (GameObject x) => x.activeSelf)); ((MonoBehaviour)__instance).StartCoroutine(ShowMask(__instance, maskId)); return; } catch { Plugin.Logger.LogWarning((object)"Unable to verify mask status. This may be caused by an incompatible version of the game."); return; } } ((MonoBehaviour)__instance).StartCoroutine(HideMasks(__instance)); } [IteratorStateMachine(typeof(<ShowMask>d__2))] private static IEnumerator ShowMask(MaskedPlayerEnemy entity, int maskId) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ShowMask>d__2(0) { entity = entity, maskId = maskId }; } [IteratorStateMachine(typeof(<HideMasks>d__3))] private static IEnumerator HideMasks(MaskedPlayerEnemy entity) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <HideMasks>d__3(0) { entity = entity }; } [HarmonyPatch(typeof(RoundManager), "ResetEnemySpawningVariables")] [HarmonyPostfix] public static void StartOfRoundRandomizer(RoundManager __instance) { random = new Random(__instance.playersManager.randomMapSeed + 3708); } } } namespace MaybeMaskedMasked.Networking { public interface ISyncable { int GetSize(); void ResetValue(); void SetFromReader(FastBufferReader reader); void WriteToWriter(FastBufferWriter writer); } [HarmonyPatch] public static class PlayerConnectionPatch { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static HandleNamedMessageDelegate <>9__1_0; internal void <ConnectClientToPlayerObject>b__1_0(ulong clientId, FastBufferReader reader) { SyncedEntries.SendAllToClient(clientId); } } private const string MessageName = "MaybeMaskedMasked.Connect"; [HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")] [HarmonyPostfix] public static void ConnectClientToPlayerObject() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown CustomMessagingManager customMessagingManager = NetworkManager.Singleton.CustomMessagingManager; if (NetworkManager.Singleton.IsServer) { SyncedEntries.ResetToLocalConfig(); object obj = <>c.<>9__1_0; if (obj == null) { HandleNamedMessageDelegate val = delegate(ulong clientId, FastBufferReader reader) { SyncedEntries.SendAllToClient(clientId); }; <>c.<>9__1_0 = val; obj = (object)val; } customMessagingManager.RegisterNamedMessageHandler("MaybeMaskedMasked.Connect", (HandleNamedMessageDelegate)obj); return; } SyncedEntries.BeginListening(); FastBufferWriter val2 = default(FastBufferWriter); ((FastBufferWriter)(ref val2))..ctor(0, (Allocator)2, -1); try { customMessagingManager.SendNamedMessage("MaybeMaskedMasked.Connect", 0uL, val2, (NetworkDelivery)3); } finally { ((IDisposable)(FastBufferWriter)(ref val2)).Dispose(); } } [HarmonyPatch(typeof(GameNetworkManager), "StartDisconnect")] [HarmonyPostfix] public static void PlayerLeave() { SyncedEntries.StopListening(); } } public static class SyncedEntries { [CompilerGenerated] private static class <>O { public static HandleNamedMessageDelegate <0>__ReadPayload; } [CompilerGenerated] private sealed class <Broadcast>d__8 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <Broadcast>d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSecondsRealtime(0.05f); <>1__state = 1; return true; case 1: { <>1__state = -1; if (!Object.op_Implicit((Object)(object)NetworkManager.Singleton) || !NetworkManager.Singleton.IsServer || NetworkManager.Singleton.ConnectedClientsList.Count <= 1) { _isBroadcasting = false; return false; } KeyValuePair<byte, ISyncable>[] payload = AllEntries.Where((KeyValuePair<byte, ISyncable> x) => UnsyncedEntries.Contains(x.Key)).ToArray(); SendPayload("MaybeMaskedMasked.ConfigSync", payload, NetworkManager.Singleton.ConnectedClientsIds); UnsyncedEntries.Clear(); _isBroadcasting = false; return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static byte _idGen = 0; private const string SyncMessage = "MaybeMaskedMasked.ConfigSync"; private static readonly Dictionary<byte, ISyncable> AllEntries = new Dictionary<byte, ISyncable>(); private static readonly HashSet<byte> UnsyncedEntries = new HashSet<byte>(); private static bool _isBroadcasting = false; private static SyncedEntry<T> Add<T>(SyncedEntry<T> item) { byte id = _idGen++; AllEntries.Add(id, item); item.Entry.SettingChanged += delegate { ConfigEntryChanged(id, item); }; return item; } private static void ConfigEntryChanged<T>(byte key, SyncedEntry<T> item) { if (!Object.op_Implicit((Object)(object)NetworkManager.Singleton) || !NetworkManager.Singleton.IsConnectedClient) { item.Value = item.Entry.Value; } else if (NetworkManager.Singleton.IsServer) { ScheduleBroadcastFor(key, item); } } private static void ScheduleBroadcastFor<T>(byte id, SyncedEntry<T> item) { item.Value = item.Entry.Value; if (NetworkManager.Singleton.ConnectedClientsList.Count > 1) { UnsyncedEntries.Add(id); if (!_isBroadcasting) { _isBroadcasting = true; ((MonoBehaviour)NetworkManager.Singleton).StartCoroutine(Broadcast()); } } } [IteratorStateMachine(typeof(<Broadcast>d__8))] private static IEnumerator Broadcast() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <Broadcast>d__8(0); } public static void SendAllToClient(ulong clientId) { SendPayload("MaybeMaskedMasked.ConfigSync", AllEntries, new <>z__ReadOnlySingleElementList<ulong>(clientId)); } private static void SendPayload(string messageName, IEnumerable<KeyValuePair<byte, ISyncable>> payload, [ParamCollection] IEnumerable<ulong> clients) { //IL_0055: 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) int num = payload.Sum((KeyValuePair<byte, ISyncable> item) => 1 + item.Value.GetSize()); FastBufferWriter val = default(FastBufferWriter); ((FastBufferWriter)(ref val))..ctor(num, (Allocator)2, -1); try { foreach (KeyValuePair<byte, ISyncable> item in payload) { ((FastBufferWriter)(ref val)).WriteByteSafe(item.Key); item.Value.WriteToWriter(val); } foreach (ulong client in clients) { if (client != NetworkManager.Singleton.LocalClientId) { NetworkManager.Singleton.CustomMessagingManager.SendNamedMessage(messageName, client, val, (NetworkDelivery)3); } } } finally { ((IDisposable)(FastBufferWriter)(ref val)).Dispose(); } } public static bool BeginListening() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown NetworkManager singleton = NetworkManager.Singleton; if (((singleton != null) ? singleton.CustomMessagingManager : null) == null) { return false; } CustomMessagingManager customMessagingManager = NetworkManager.Singleton.CustomMessagingManager; object obj = <>O.<0>__ReadPayload; if (obj == null) { HandleNamedMessageDelegate val = ReadPayload; <>O.<0>__ReadPayload = val; obj = (object)val; } customMessagingManager.RegisterNamedMessageHandler("MaybeMaskedMasked.ConfigSync", (HandleNamedMessageDelegate)obj); return true; } private static void ReadPayload(ulong clientId, FastBufferReader reader) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)NetworkManager.Singleton) && !NetworkManager.Singleton.IsServer) { byte key = default(byte); while (((FastBufferReader)(ref reader)).TryBeginRead(1)) { ((FastBufferReader)(ref reader)).ReadByteSafe(ref key); AllEntries[key].SetFromReader(reader); } } } public static void ResetToLocalConfig() { foreach (ISyncable value in AllEntries.Values) { value.ResetValue(); } } public static void StopListening(bool resetToLocalConfig = true) { if (resetToLocalConfig) { ResetToLocalConfig(); } UnsyncedEntries.Clear(); NetworkManager singleton = NetworkManager.Singleton; if (((singleton != null) ? singleton.CustomMessagingManager : null) != null) { NetworkManager.Singleton.CustomMessagingManager.UnregisterNamedMessageHandler("MaybeMaskedMasked.ConfigSync"); } } public static SyncedEntry<int> BindSynced(this ConfigFile config, string section, string key, int value, ConfigDescription description) { return Add(new SyncedEntry<int>(config.Bind<int>(section, key, value, description), (int _) => 4, delegate(FastBufferReader reader) { //IL_0006: 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) int result = default(int); ((FastBufferReader)(ref reader)).ReadValueSafe<int>(ref result, default(ForPrimitives)); return result; }, delegate(FastBufferWriter writer, int value) { //IL_0006: 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) ((FastBufferWriter)(ref writer)).WriteValueSafe<int>(ref value, default(ForPrimitives)); })); } public static SyncedEntry<float> BindSynced(this ConfigFile config, string section, string key, float value, ConfigDescription description) { return Add(new SyncedEntry<float>(config.Bind<float>(section, key, value, description), (float _) => 4, delegate(FastBufferReader reader) { //IL_0006: 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) float result = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref result, default(ForPrimitives)); return result; }, delegate(FastBufferWriter writer, float value) { //IL_0006: 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) ((FastBufferWriter)(ref writer)).WriteValueSafe<float>(ref value, default(ForPrimitives)); })); } public static SyncedEntry<bool> BindSynced(this ConfigFile config, string section, string key, bool value, ConfigDescription description) { return Add(new SyncedEntry<bool>(config.Bind<bool>(section, key, value, description), (bool _) => 1, delegate(FastBufferReader reader) { //IL_0006: 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) bool result = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref result, default(ForPrimitives)); return result; }, delegate(FastBufferWriter writer, bool value) { //IL_0006: 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) ((FastBufferWriter)(ref writer)).WriteValueSafe<bool>(ref value, default(ForPrimitives)); })); } public static SyncedEntry<string> BindSynced(this ConfigFile config, string section, string key, string value, ConfigDescription description) { return Add(new SyncedEntry<string>(config.Bind<string>(section, key, value, description), (string value) => FastBufferWriter.GetWriteSize(value, false), delegate(FastBufferReader reader) { string result = default(string); ((FastBufferReader)(ref reader)).ReadValueSafe(ref result, false); return result; }, delegate(FastBufferWriter writer, string value) { ((FastBufferWriter)(ref writer)).WriteValueSafe(value, false); })); } public static SyncedEntry<T> BindSynced<T>(this ConfigFile config, string section, string key, T value, ConfigDescription description) where T : Enum { return Add(new SyncedEntry<T>(config.Bind<T>(section, key, value, description), (T _) => 4, delegate(FastBufferReader reader) { //IL_0006: 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) int num2 = default(int); ((FastBufferReader)(ref reader)).ReadValueSafe<int>(ref num2, default(ForPrimitives)); return (T)(object)num2; }, delegate(FastBufferWriter writer, T value) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) int num = Convert.ToInt32(value); ((FastBufferWriter)(ref writer)).WriteValueSafe<int>(ref num, default(ForPrimitives)); })); } } public class SyncedEntry<T> : ISyncable { private readonly Func<FastBufferReader, T> read; private readonly Action<FastBufferWriter, T> write; public ConfigEntry<T> Entry; public Action<T, T> OnChanged; public readonly Func<T, int> calcSize; public T Value { get { return <Value>k__BackingField; } set { T arg = <Value>k__BackingField; <Value>k__BackingField = value; OnChanged?.Invoke(arg, value); } } public SyncedEntry(ConfigEntry<T> entry, Func<T, int> calcSize, Func<FastBufferReader, T> read, Action<FastBufferWriter, T> write) { Entry = entry; Value = entry.Value; this.calcSize = calcSize; this.read = read; this.write = write; } public int GetSize() { return calcSize(Value); } public void ResetValue() { Value = Entry.Value; } public void SetFromReader(FastBufferReader reader) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Value = read(reader); } public void WriteToWriter(FastBufferWriter writer) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) write(writer, Value); } } } namespace MaybeMaskedMasked.Integrations { internal static class LethalConfigIntegration { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void Initialize() { Plugin.Logger.LogInfo((object)"LethalConfig detected — integrating MaybeMaskedMasked config."); RegisterAll(); } private static void RegisterAll() { RegisterSlider(Plugin.ModConfig.MaskChance.Entry); } private static void RegisterInput(ConfigEntry<int> entry) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown IntInputFieldOptions val = new IntInputFieldOptions { RequiresRestart = false }; LethalConfigManager.AddConfigItem((BaseConfigItem)new IntInputFieldConfigItem(entry, val)); } private static void RegisterSlider(ConfigEntry<int> entry) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown IntSliderOptions val = new IntSliderOptions { RequiresRestart = false }; LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(entry, val)); } private static void RegisterSlider(ConfigEntry<float> entry) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown FloatSliderOptions val = new FloatSliderOptions { RequiresRestart = false }; LethalConfigManager.AddConfigItem((BaseConfigItem)new FloatSliderConfigItem(entry, val)); } private static void RegisterCheckbox(ConfigEntry<bool> entry) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(entry, false)); } private static void RegisterDropdown(ConfigEntry<ModEnum> entry) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown EnumDropDownOptions val = new EnumDropDownOptions { RequiresRestart = false }; LethalConfigManager.AddConfigItem((BaseConfigItem)(object)new EnumDropDownConfigItem<ModEnum>(entry, val)); } private static void RegisterTextInput(ConfigEntry<string> entry) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown LethalConfigManager.AddConfigItem((BaseConfigItem)new TextInputFieldConfigItem(entry, false)); } } } [CompilerGenerated] internal sealed class <>z__ReadOnlySingleElementList<T> : IEnumerable, ICollection, IList, IEnumerable<T>, IReadOnlyCollection<T>, IReadOnlyList<T>, ICollection<T>, IList<T> { private sealed class Enumerator : IDisposable, IEnumerator, IEnumerator<T> { object IEnumerator.Current => _item; T IEnumerator<T>.Current => _item; public Enumerator(T item) { _item = item; } bool IEnumerator.MoveNext() { if (!_moveNextCalled) { return _moveNextCalled = true; } return false; } void IEnumerator.Reset() { _moveNextCalled = false; } void IDisposable.Dispose() { } } int ICollection.Count => 1; bool ICollection.IsSynchronized => false; object ICollection.SyncRoot => this; object IList.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } set { throw new NotSupportedException(); } } bool IList.IsFixedSize => true; bool IList.IsReadOnly => true; int IReadOnlyCollection<T>.Count => 1; T IReadOnlyList<T>.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } } int ICollection<T>.Count => 1; bool ICollection<T>.IsReadOnly => true; T IList<T>.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } set { throw new NotSupportedException(); } } public <>z__ReadOnlySingleElementList(T item) { _item = item; } IEnumerator IEnumerable.GetEnumerator() { return new Enumerator(_item); } void ICollection.CopyTo(Array array, int index) { array.SetValue(_item, index); } int IList.Add(object value) { throw new NotSupportedException(); } void IList.Clear() { throw new NotSupportedException(); } bool IList.Contains(object value) { return EqualityComparer<T>.Default.Equals(_item, (T)value); } int IList.IndexOf(object value) { if (!EqualityComparer<T>.Default.Equals(_item, (T)value)) { return -1; } return 0; } void IList.Insert(int index, object value) { throw new NotSupportedException(); } void IList.Remove(object value) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } IEnumerator<T> IEnumerable<T>.GetEnumerator() { return new Enumerator(_item); } void ICollection<T>.Add(T item) { throw new NotSupportedException(); } void ICollection<T>.Clear() { throw new NotSupportedException(); } bool ICollection<T>.Contains(T item) { return EqualityComparer<T>.Default.Equals(_item, item); } void ICollection<T>.CopyTo(T[] array, int arrayIndex) { array[arrayIndex] = _item; } bool ICollection<T>.Remove(T item) { throw new NotSupportedException(); } int IList<T>.IndexOf(T item) { if (!EqualityComparer<T>.Default.Equals(_item, item)) { return -1; } return 0; } void IList<T>.Insert(int index, T item) { throw new NotSupportedException(); } void IList<T>.RemoveAt(int index) { throw new NotSupportedException(); } }