using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using GlobalEnums; using InControl; using Md.MappableKey; using Md.UIManager; using Md.UnityEngine.UI.MenuOptionHorizontal; using Md.UnityEngine.UI.MenuSelectable; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoDetour; using MonoDetour.Cil; using MonoDetour.DetourTypes; using MonoDetour.HookGen; using MonoDetour.Reflection.Unspeakable; using MonoMod.Cil; using MonoMod.Utils; using Silksong.ModMenu.Elements; using Silksong.ModMenu.Internal; using Silksong.ModMenu.Models; using Silksong.ModMenu.Plugin; using Silksong.ModMenu.Screens; using Silksong.ModMenu.Util; using Silksong.UnityHelper.Extensions; using TeamCherry.Localization; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; [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("Silksong.ModMenu")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("API for modifying Silksong menus")] [assembly: AssemblyFileVersion("0.7.5.0")] [assembly: AssemblyInformationalVersion("0.7.5+f30ad8e0339d74506da1da904e1bd335f8a567f7")] [assembly: AssemblyProduct("Silksong.ModMenu")] [assembly: AssemblyTitle("ModMenu")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/silksong-modding/Silksong.ModMenu")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.7.5.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [CompilerGenerated] internal sealed class <>z__ReadOnlyArray : IEnumerable, ICollection, IList, IEnumerable, IReadOnlyCollection, IReadOnlyList, ICollection, IList { int ICollection.Count => _items.Length; bool ICollection.IsSynchronized => false; object ICollection.SyncRoot => this; object IList.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } bool IList.IsFixedSize => true; bool IList.IsReadOnly => true; int IReadOnlyCollection.Count => _items.Length; T IReadOnlyList.this[int index] => _items[index]; int ICollection.Count => _items.Length; bool ICollection.IsReadOnly => true; T IList.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } public <>z__ReadOnlyArray(T[] items) { _items = items; } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)_items).GetEnumerator(); } void ICollection.CopyTo(Array array, int index) { ((ICollection)_items).CopyTo(array, index); } int IList.Add(object value) { throw new NotSupportedException(); } void IList.Clear() { throw new NotSupportedException(); } bool IList.Contains(object value) { return ((IList)_items).Contains(value); } int IList.IndexOf(object value) { return ((IList)_items).IndexOf(value); } 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 IEnumerable.GetEnumerator() { return ((IEnumerable)_items).GetEnumerator(); } void ICollection.Add(T item) { throw new NotSupportedException(); } void ICollection.Clear() { throw new NotSupportedException(); } bool ICollection.Contains(T item) { return ((ICollection)_items).Contains(item); } void ICollection.CopyTo(T[] array, int arrayIndex) { ((ICollection)_items).CopyTo(array, arrayIndex); } bool ICollection.Remove(T item) { throw new NotSupportedException(); } int IList.IndexOf(T item) { return ((IList)_items).IndexOf(item); } void IList.Insert(int index, T item) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } } [CompilerGenerated] internal sealed class <>z__ReadOnlyList : IEnumerable, ICollection, IList, IEnumerable, IReadOnlyCollection, IReadOnlyList, ICollection, IList { int ICollection.Count => _items.Count; bool ICollection.IsSynchronized => false; object ICollection.SyncRoot => this; object IList.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } bool IList.IsFixedSize => true; bool IList.IsReadOnly => true; int IReadOnlyCollection.Count => _items.Count; T IReadOnlyList.this[int index] => _items[index]; int ICollection.Count => _items.Count; bool ICollection.IsReadOnly => true; T IList.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } public <>z__ReadOnlyList(List items) { _items = items; } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)_items).GetEnumerator(); } void ICollection.CopyTo(Array array, int index) { ((ICollection)_items).CopyTo(array, index); } int IList.Add(object value) { throw new NotSupportedException(); } void IList.Clear() { throw new NotSupportedException(); } bool IList.Contains(object value) { return ((IList)_items).Contains(value); } int IList.IndexOf(object value) { return ((IList)_items).IndexOf(value); } 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 IEnumerable.GetEnumerator() { return ((IEnumerable)_items).GetEnumerator(); } void ICollection.Add(T item) { throw new NotSupportedException(); } void ICollection.Clear() { throw new NotSupportedException(); } bool ICollection.Contains(T item) { return _items.Contains(item); } void ICollection.CopyTo(T[] array, int arrayIndex) { _items.CopyTo(array, arrayIndex); } bool ICollection.Remove(T item) { throw new NotSupportedException(); } int IList.IndexOf(T item) { return _items.IndexOf(item); } void IList.Insert(int index, T item) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } } [CompilerGenerated] internal sealed class <>z__ReadOnlySingleElementList : IEnumerable, ICollection, IList, IEnumerable, IReadOnlyCollection, IReadOnlyList, ICollection, IList { private sealed class Enumerator : IDisposable, IEnumerator, IEnumerator { object IEnumerator.Current => _item; T IEnumerator.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.Count => 1; T IReadOnlyList.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } } int ICollection.Count => 1; bool ICollection.IsReadOnly => true; T IList.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.Default.Equals(_item, (T)value); } int IList.IndexOf(object value) { if (!EqualityComparer.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 IEnumerable.GetEnumerator() { return new Enumerator(_item); } void ICollection.Add(T item) { throw new NotSupportedException(); } void ICollection.Clear() { throw new NotSupportedException(); } bool ICollection.Contains(T item) { return EqualityComparer.Default.Equals(_item, item); } void ICollection.CopyTo(T[] array, int arrayIndex) { array[arrayIndex] = _item; } bool ICollection.Remove(T item) { throw new NotSupportedException(); } int IList.IndexOf(T item) { if (!EqualityComparer.Default.Equals(_item, item)) { return -1; } return 0; } void IList.Insert(int index, T item) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [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; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class ExtensionMarkerAttribute : Attribute { private readonly string k__BackingField; public string Name => k__BackingField; public ExtensionMarkerAttribute(string name) { k__BackingField = name; } } } 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.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.Constructor | AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class OverloadResolutionPriorityAttribute : Attribute { public int Priority { get; } public OverloadResolutionPriorityAttribute(int priority) { Priority = priority; } } [AttributeUsage(AttributeTargets.Parameter, Inherited = true, AllowMultiple = false)] [ExcludeFromCodeCoverage] internal sealed class ParamCollectionAttribute : 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 { } } namespace System.Diagnostics.CodeAnalysis { [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class ConstantExpectedAttribute : Attribute { public object? Min { get; set; } public object? Max { get; set; } } [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 Md.MappableKey { internal static class AbortRebind { public delegate void PrefixSignature(MappableKey self); public delegate ReturnFlow ControlFlowPrefixSignature(MappableKey self); public delegate void PostfixSignature(MappableKey self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(MappableKey).GetMethod("AbortRebind", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("MappableKey", "AbortRebind"); } } internal static class OnDisable { public delegate void PrefixSignature(MappableKey self); public delegate ReturnFlow ControlFlowPrefixSignature(MappableKey self); public delegate void PostfixSignature(MappableKey self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(MappableKey).GetMethod("OnDisable", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("MappableKey", "OnDisable"); } } internal static class ListenForNewButton { public delegate void PrefixSignature(MappableKey self); public delegate ReturnFlow ControlFlowPrefixSignature(MappableKey self); public delegate void PostfixSignature(MappableKey self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(MappableKey).GetMethod("ListenForNewButton", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("MappableKey", "ListenForNewButton"); } } internal static class OnCancel { public delegate void PrefixSignature(MappableKey self, ref BaseEventData eventData); public delegate ReturnFlow ControlFlowPrefixSignature(MappableKey self, ref BaseEventData eventData); public delegate void PostfixSignature(MappableKey self, ref BaseEventData eventData); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(MappableKey).GetMethod("OnCancel", (BindingFlags)(-1), null, new Type[1] { typeof(BaseEventData) }, null) ?? throw new MissingMethodException("MappableKey", "OnCancel"); } } internal static class OnEnable { public delegate void PrefixSignature(MappableKey self); public delegate ReturnFlow ControlFlowPrefixSignature(MappableKey self); public delegate void PostfixSignature(MappableKey self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(MappableKey).GetMethod("OnEnable", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("MappableKey", "OnEnable"); } } internal static class SetupRefs { public delegate void PrefixSignature(MappableKey self); public delegate ReturnFlow ControlFlowPrefixSignature(MappableKey self); public delegate void PostfixSignature(MappableKey self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(MappableKey).GetMethod("SetupRefs", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("MappableKey", "SetupRefs"); } } internal static class Start { public delegate void PrefixSignature(MappableKey self); public delegate ReturnFlow ControlFlowPrefixSignature(MappableKey self); public delegate void PostfixSignature(MappableKey self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(MappableKey).GetMethod("Start", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("MappableKey", "Start"); } } internal static class OnSubmit { public delegate void PrefixSignature(MappableKey self, ref BaseEventData eventData); public delegate ReturnFlow ControlFlowPrefixSignature(MappableKey self, ref BaseEventData eventData); public delegate void PostfixSignature(MappableKey self, ref BaseEventData eventData); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(MappableKey).GetMethod("OnSubmit", (BindingFlags)(-1), null, new Type[1] { typeof(BaseEventData) }, null) ?? throw new MissingMethodException("MappableKey", "OnSubmit"); } } } namespace Md.UIManager { internal static class _EmergencyReturnToMainMenu_d__221 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__221, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__221'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__221", "MoveNext"); } } } internal static class _FadeInCanvasGroup_d__276 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__276, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__276'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__276", "MoveNext"); } } } internal static class _FadeInCanvasGroupAlpha_d__277 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__277, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__277'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__277", "MoveNext"); } } } internal static class _FadeInSprite_d__280 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__280, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__280'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__280", "MoveNext"); } } } internal static class _FadeOutCanvasGroup_d__278 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__278, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__278'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__278", "MoveNext"); } } } internal static class _FadeOutSprite_d__281 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__281, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__281'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__281", "MoveNext"); } } } internal static class _GoBackToSaveProfiles_d__224 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__224, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__224'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__224", "MoveNext"); } } } internal static class _GoToAchievementsMenu_d__212 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__212, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__212'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__212", "MoveNext"); } } } internal static class _GoToAdvancedControllerMenu_d__204 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__204, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__204'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__204", "MoveNext"); } } } internal static class _GoToAdvancedVideoMenu_d__208 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__208, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__208'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__208", "MoveNext"); } } } internal static class _GoToAudioMenu_d__206 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__206, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__206'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__206", "MoveNext"); } } } internal static class _GoToBrightnessMenu_d__210 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__210, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__210'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__210", "MoveNext"); } } } internal static class _GoToControllerMenu_d__202 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__202, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__202'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__202", "MoveNext"); } } } internal static class _GoToEngageMenu_d__194 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__194, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__194'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__194", "MoveNext"); } } } internal static class _GoToExtrasContentMenu_d__214 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__214, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__214'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__214", "MoveNext"); } } } internal static class _GoToExtrasMenu_d__213 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__213, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__213'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__213", "MoveNext"); } } } internal static class _GoToGameOptionsMenu_d__211 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__211, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__211'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__211", "MoveNext"); } } } internal static class _GoToKeyboardMenu_d__205 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__205, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__205'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__205", "MoveNext"); } } } internal static class _GoToMainMenu_d__195 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__195, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__195'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__195", "MoveNext"); } } } internal static class _GoToMenuCredits_d__223 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__223, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__223'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__223", "MoveNext"); } } } internal static class _GoToOptionsMenu_d__201 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__201, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__201'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__201", "MoveNext"); } } } internal static class _GoToOverscanMenu_d__209 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__209, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__209'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__209", "MoveNext"); } } } internal static class _GoToPauseMenu_d__222 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__222, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__222'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__222", "MoveNext"); } } } internal static class _GoToPlayModeMenu_d__219 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__219, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__219'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__219", "MoveNext"); } } } internal static class _GoToProfileMenu_d__196 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__196, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__196'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__196", "MoveNext"); } } } internal static class _GoToQuitGamePrompt_d__215 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__215, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__215'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__215", "MoveNext"); } } } internal static class _GoToRemapControllerMenu_d__203 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__203, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__203'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__203", "MoveNext"); } } } internal static class _GoToResolutionPrompt_d__217 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__217, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__217'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__217", "MoveNext"); } } } internal static class _GoToReturnMenuPrompt_d__216 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__216, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__216'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__216", "MoveNext"); } } } internal static class _GoToVideoMenu_d__207 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__207, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__207'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__207", "MoveNext"); } } } internal static class _HideCurrentMenu_d__265 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__265, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__265'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__265", "MoveNext"); } } } internal static class _HideMenu_d__268 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__268, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__268'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__268", "MoveNext"); } } } internal static class _HideSaveProfileMenu_d__270 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__270, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__270'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__270", "MoveNext"); } } } internal static class _LeaveExitToMenuPrompt_d__218 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__218, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__218'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__218", "MoveNext"); } } } internal static class _PrepareSaveFilesInOrder_d__200 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__200, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__200'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__200", "MoveNext"); } } } internal static class _ReturnToMainMenu_d__220 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__220, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__220'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__220", "MoveNext"); } } } internal static class _ShowMenu_d__266 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate ReturnFlow ControlFlowPrefixSignature(object self, ref bool returnValue); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UIManager+d__266, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UIManager+d__266'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager+d__266", "MoveNext"); } } } internal static class Awake { public delegate void PrefixSignature(UIManager self); public delegate ReturnFlow ControlFlowPrefixSignature(UIManager self); public delegate void PostfixSignature(UIManager self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(UIManager).GetMethod("Awake", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager", "Awake"); } } internal static class SetupRefs { public delegate void PrefixSignature(UIManager self); public delegate ReturnFlow ControlFlowPrefixSignature(UIManager self); public delegate void PostfixSignature(UIManager self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(UIManager).GetMethod("SetupRefs", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager", "SetupRefs"); } } internal static class Start { public delegate void PrefixSignature(UIManager self); public delegate ReturnFlow ControlFlowPrefixSignature(UIManager self); public delegate void PostfixSignature(UIManager self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(UIManager).GetMethod("Start", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager", "Start"); } } internal static class HideCurrentMenu { public delegate void PrefixSignature(UIManager self); public delegate ReturnFlow ControlFlowPrefixSignature(UIManager self, ref IEnumerator returnValue); public delegate void PostfixSignature(UIManager self, ref IEnumerator returnValue); public delegate void PrefixMoveNextSignature(SpeakableEnumerator self); public delegate ReturnFlow ControlFlowPrefixMoveNextSignature(SpeakableEnumerator self, ref bool continueEnumeration); public delegate void PostfixMoveNextSignature(SpeakableEnumerator self, ref bool continueEnumeration); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MonoDetourHook PrefixMoveNext(PrefixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefixMoveNext(ControlFlowPrefixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook PostfixMoveNext(PostfixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHookMoveNext(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook((MethodBase)StateMachineTarget(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(UIManager).GetMethod("HideCurrentMenu", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager", "HideCurrentMenu"); } public static MethodInfo StateMachineTarget() { return Extensions.GetStateMachineTarget((MethodInfo)Target()); } } internal static class ShowMenu { public delegate void PrefixSignature(UIManager self, ref MenuScreen menu); public delegate ReturnFlow ControlFlowPrefixSignature(UIManager self, ref MenuScreen menu, ref IEnumerator returnValue); public delegate void PostfixSignature(UIManager self, ref MenuScreen menu, ref IEnumerator returnValue); public delegate void PrefixMoveNextSignature(SpeakableEnumerator self); public delegate ReturnFlow ControlFlowPrefixMoveNextSignature(SpeakableEnumerator self, ref bool continueEnumeration); public delegate void PostfixMoveNextSignature(SpeakableEnumerator self, ref bool continueEnumeration); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MonoDetourHook PrefixMoveNext(PrefixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefixMoveNext(ControlFlowPrefixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook PostfixMoveNext(PostfixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHookMoveNext(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook((MethodBase)StateMachineTarget(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(UIManager).GetMethod("ShowMenu", (BindingFlags)(-1), null, new Type[1] { typeof(MenuScreen) }, null) ?? throw new MissingMethodException("UIManager", "ShowMenu"); } public static MethodInfo StateMachineTarget() { return Extensions.GetStateMachineTarget((MethodInfo)Target()); } } internal static class HideMenu { public delegate void PrefixSignature(UIManager self, ref MenuScreen menu, ref bool disable); public delegate ReturnFlow ControlFlowPrefixSignature(UIManager self, ref MenuScreen menu, ref bool disable, ref IEnumerator returnValue); public delegate void PostfixSignature(UIManager self, ref MenuScreen menu, ref bool disable, ref IEnumerator returnValue); public delegate void PrefixMoveNextSignature(SpeakableEnumerator self); public delegate ReturnFlow ControlFlowPrefixMoveNextSignature(SpeakableEnumerator self, ref bool continueEnumeration); public delegate void PostfixMoveNextSignature(SpeakableEnumerator self, ref bool continueEnumeration); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MonoDetourHook PrefixMoveNext(PrefixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefixMoveNext(ControlFlowPrefixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook PostfixMoveNext(PostfixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHookMoveNext(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook((MethodBase)StateMachineTarget(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(UIManager).GetMethod("HideMenu", (BindingFlags)(-1), null, new Type[2] { typeof(MenuScreen), typeof(bool) }, null) ?? throw new MissingMethodException("UIManager", "HideMenu"); } public static MethodInfo StateMachineTarget() { return Extensions.GetStateMachineTarget((MethodInfo)Target()); } } internal static class HideMenuInstant { public delegate void PrefixSignature(UIManager self, ref MenuScreen menu); public delegate ReturnFlow ControlFlowPrefixSignature(UIManager self, ref MenuScreen menu); public delegate void PostfixSignature(UIManager self, ref MenuScreen menu); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(UIManager).GetMethod("HideMenuInstant", (BindingFlags)(-1), null, new Type[1] { typeof(MenuScreen) }, null) ?? throw new MissingMethodException("UIManager", "HideMenuInstant"); } } internal static class UIGoBack { public delegate void PrefixSignature(UIManager self); public delegate ReturnFlow ControlFlowPrefixSignature(UIManager self, ref bool returnValue); public delegate void PostfixSignature(UIManager self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(UIManager).GetMethod("UIGoBack", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager", "UIGoBack"); } } internal static class OnDestroy { public delegate void PrefixSignature(UIManager self); public delegate ReturnFlow ControlFlowPrefixSignature(UIManager self); public delegate void PostfixSignature(UIManager self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(UIManager).GetMethod("OnDestroy", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UIManager", "OnDestroy"); } } internal static class HighlightSelectableNoSound { public delegate void PrefixSignature(ref Selectable selectable); public delegate ReturnFlow ControlFlowPrefixSignature(ref Selectable selectable); public delegate void PostfixSignature(ref Selectable selectable); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(UIManager).GetMethod("HighlightSelectableNoSound", (BindingFlags)(-1), null, new Type[1] { typeof(Selectable) }, null) ?? throw new MissingMethodException("UIManager", "HighlightSelectableNoSound"); } } } namespace Md.GameManager { internal static class PausedEvent { internal static class Invoke { public delegate void PrefixSignature(PausedEvent self, ref bool isPaused); public delegate void PostfixSignature(PausedEvent self, ref bool isPaused); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(PausedEvent).GetMethod("Invoke", (BindingFlags)(-1), null, new Type[1] { typeof(bool) }, null) ?? throw new MissingMethodException("GameManager+PausedEvent", "Invoke"); } } } internal static class GameStateEvent { internal static class Invoke { public delegate void PrefixSignature(GameStateEvent self, ref GameState gameState); public delegate void PostfixSignature(GameStateEvent self, ref GameState gameState); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(GameStateEvent).GetMethod("Invoke", (BindingFlags)(-1), null, new Type[1] { typeof(GameState) }, null) ?? throw new MissingMethodException("GameManager+GameStateEvent", "Invoke"); } } } internal static class BossLoad { internal static class Invoke { public delegate void PrefixSignature(BossLoad self); public delegate void PostfixSignature(BossLoad self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(BossLoad).GetMethod("Invoke", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+BossLoad", "Invoke"); } } } internal static class EnterSceneEvent { internal static class Invoke { public delegate void PrefixSignature(EnterSceneEvent self); public delegate void PostfixSignature(EnterSceneEvent self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(EnterSceneEvent).GetMethod("Invoke", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+EnterSceneEvent", "Invoke"); } } } internal static class SceneTransitionFinishEvent { internal static class Invoke { public delegate void PrefixSignature(SceneTransitionFinishEvent self); public delegate void PostfixSignature(SceneTransitionFinishEvent self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(SceneTransitionFinishEvent).GetMethod("Invoke", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+SceneTransitionFinishEvent", "Invoke"); } } } internal static class SceneTransitionBeganDelegate { internal static class Invoke { public delegate void PrefixSignature(SceneTransitionBeganDelegate self, ref SceneLoad sceneLoad); public delegate void PostfixSignature(SceneTransitionBeganDelegate self, ref SceneLoad sceneLoad); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(SceneTransitionBeganDelegate).GetMethod("Invoke", (BindingFlags)(-1), null, new Type[1] { typeof(SceneLoad) }, null) ?? throw new MissingMethodException("GameManager+SceneTransitionBeganDelegate", "Invoke"); } } } internal static class _BeginSceneTransitionRoutine_d__239 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("GameManager+d__239, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__239'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__239", "MoveNext"); } } } internal static class _FadeSceneInWithDelay_d__266 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("GameManager+d__266, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__266'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__266", "MoveNext"); } } } internal static class _FreezeMoment_d__468 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("GameManager+d__468, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__468'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__468", "MoveNext"); } } } internal static class _FreezeMomentGC_d__469 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("GameManager+d__469, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__469'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__469", "MoveNext"); } } } internal static class _LoadFirstScene_d__356 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("GameManager+d__356, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__356'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__356", "MoveNext"); } } } internal static class _LoadGameFromUIRoutine_d__442 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("GameManager+d__442, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__442'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__442", "MoveNext"); } } } internal static class _LoadGameFromUIRoutine_d__443 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("GameManager+d__443, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__443'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__443", "MoveNext"); } } } internal static class _LoadSceneAdditive_d__348 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("GameManager+d__348, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__348'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__348", "MoveNext"); } } } internal static class _PauseGameToggle_d__461 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("GameManager+d__461, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__461'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__461", "MoveNext"); } } } internal static class _PauseGameToggleByMenu_d__460 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("GameManager+d__460, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__460'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__460", "MoveNext"); } } } internal static class _PlayerDead_d__245 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("GameManager+d__245, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__245'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__245", "MoveNext"); } } } internal static class _PlayerDeadFromHazard_d__246 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("GameManager+d__246, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__246'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__246", "MoveNext"); } } } internal static class _QuitGame_d__483 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("GameManager+d__483, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__483'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__483", "MoveNext"); } } } internal static class _ReturnToMainMenu_d__479 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("GameManager+d__479, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__479'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__479", "MoveNext"); } } } internal static class _RunContinueGame_d__474 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("GameManager+d__474, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__474'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__474", "MoveNext"); } } } internal static class _RunStartNewGame_d__472 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("GameManager+d__472, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__472'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__472", "MoveNext"); } } } internal static class _SetTimeScale_d__463 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("GameManager+d__463, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__463'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__463", "MoveNext"); } } } internal static class _SetTimeScale_d__465 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("GameManager+d__465, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__465'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__465", "MoveNext"); } } } internal static class _SkipCutsceneNoMash_d__381 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("GameManager+d__381, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__381'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__381", "MoveNext"); } } } internal static class _TransitionScene_d__242 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("GameManager+d__242, Assembly-CSharp") ?? throw new Exception("Missing Type: 'GameManager+d__242'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+d__242", "MoveNext"); } } } internal static class Awake { public delegate void PrefixSignature(GameManager self); public delegate void PostfixSignature(GameManager self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(GameManager).GetMethod("Awake", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager", "Awake"); } } internal static class OnDisable { public delegate void PrefixSignature(GameManager self); public delegate void PostfixSignature(GameManager self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(GameManager).GetMethod("OnDisable", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager", "OnDisable"); } } internal static class SceneLoadInfo { internal new static class ToString { public delegate void PrefixSignature(SceneLoadInfo self); public delegate void PostfixSignature(SceneLoadInfo self, ref string returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(SceneLoadInfo).GetMethod("ToString", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager+SceneLoadInfo", "ToString"); } } } internal static class Start { public delegate void PrefixSignature(GameManager self); public delegate void PostfixSignature(GameManager self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(GameManager).GetMethod("Start", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager", "Start"); } } internal static class OnDestroy { public delegate void PrefixSignature(GameManager self); public delegate void PostfixSignature(GameManager self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(GameManager).GetMethod("OnDestroy", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("GameManager", "OnDestroy"); } } } namespace Md.UnityEngine.UI.MenuOptionHorizontal { internal static class Awake { public delegate void PrefixSignature(MenuOptionHorizontal self); public delegate ReturnFlow ControlFlowPrefixSignature(MenuOptionHorizontal self); public delegate void PostfixSignature(MenuOptionHorizontal self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(MenuOptionHorizontal).GetMethod("Awake", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UnityEngine.UI.MenuOptionHorizontal", "Awake"); } } internal static class OnDisable { public delegate void PrefixSignature(MenuOptionHorizontal self); public delegate ReturnFlow ControlFlowPrefixSignature(MenuOptionHorizontal self); public delegate void PostfixSignature(MenuOptionHorizontal self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(MenuOptionHorizontal).GetMethod("OnDisable", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UnityEngine.UI.MenuOptionHorizontal", "OnDisable"); } } internal static class UpdateText { public delegate void PrefixSignature(MenuOptionHorizontal self); public delegate ReturnFlow ControlFlowPrefixSignature(MenuOptionHorizontal self); public delegate void PostfixSignature(MenuOptionHorizontal self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(MenuOptionHorizontal).GetMethod("UpdateText", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UnityEngine.UI.MenuOptionHorizontal", "UpdateText"); } } internal static class MoveOption { public delegate void PrefixSignature(MenuOptionHorizontal self, ref MoveDirection dir); public delegate ReturnFlow ControlFlowPrefixSignature(MenuOptionHorizontal self, ref MoveDirection dir, ref bool returnValue); public delegate void PostfixSignature(MenuOptionHorizontal self, ref MoveDirection dir, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(MenuOptionHorizontal).GetMethod("MoveOption", (BindingFlags)(-1), null, new Type[1] { typeof(MoveDirection) }, null) ?? throw new MissingMethodException("UnityEngine.UI.MenuOptionHorizontal", "MoveOption"); } } internal static class OnEnable { public delegate void PrefixSignature(MenuOptionHorizontal self); public delegate ReturnFlow ControlFlowPrefixSignature(MenuOptionHorizontal self); public delegate void PostfixSignature(MenuOptionHorizontal self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(MenuOptionHorizontal).GetMethod("OnEnable", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UnityEngine.UI.MenuOptionHorizontal", "OnEnable"); } } internal static class OnSubmit { public delegate void PrefixSignature(MenuOptionHorizontal self, ref BaseEventData eventData); public delegate ReturnFlow ControlFlowPrefixSignature(MenuOptionHorizontal self, ref BaseEventData eventData); public delegate void PostfixSignature(MenuOptionHorizontal self, ref BaseEventData eventData); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(MenuOptionHorizontal).GetMethod("OnSubmit", (BindingFlags)(-1), null, new Type[1] { typeof(BaseEventData) }, null) ?? throw new MissingMethodException("UnityEngine.UI.MenuOptionHorizontal", "OnSubmit"); } } } namespace Md.UnityEngine.UI.MenuSelectable { internal static class OnSelectedEvent { internal static class Invoke { public delegate void PrefixSignature(OnSelectedEvent self, ref MenuSelectable self1); public delegate void PostfixSignature(OnSelectedEvent self, ref MenuSelectable self1); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(OnSelectedEvent).GetMethod("Invoke", (BindingFlags)(-1), null, new Type[1] { typeof(MenuSelectable) }, null) ?? throw new MissingMethodException("UnityEngine.UI.MenuSelectable+OnSelectedEvent", "Invoke"); } } } internal static class _ValidateDeselect_d__33 { internal static class MoveNext { public delegate void PrefixSignature(object self); public delegate void PostfixSignature(object self, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return (Type.GetType("UnityEngine.UI.MenuSelectable+d__33, Assembly-CSharp") ?? throw new Exception("Missing Type: 'UnityEngine.UI.MenuSelectable+d__33'")).GetMethod("MoveNext", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UnityEngine.UI.MenuSelectable+d__33", "MoveNext"); } } } internal static class Awake { public delegate void PrefixSignature(MenuSelectable self); public delegate void PostfixSignature(MenuSelectable self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(MenuSelectable).GetMethod("Awake", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UnityEngine.UI.MenuSelectable", "Awake"); } } internal static class OnCancel { public delegate void PrefixSignature(MenuSelectable self, ref BaseEventData eventData); public delegate void PostfixSignature(MenuSelectable self, ref BaseEventData eventData); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(MenuSelectable).GetMethod("OnCancel", (BindingFlags)(-1), null, new Type[1] { typeof(BaseEventData) }, null) ?? throw new MissingMethodException("UnityEngine.UI.MenuSelectable", "OnCancel"); } } internal static class OnEnable { public delegate void PrefixSignature(MenuSelectable self); public delegate void PostfixSignature(MenuSelectable self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(MenuSelectable).GetMethod("OnEnable", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UnityEngine.UI.MenuSelectable", "OnEnable"); } } internal static class Start { public delegate void PrefixSignature(MenuSelectable self); public delegate void PostfixSignature(MenuSelectable self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(MenuSelectable).GetMethod("Start", (BindingFlags)(-1), null, Array.Empty(), null) ?? throw new MissingMethodException("UnityEngine.UI.MenuSelectable", "Start"); } } internal static class ValidateDeselect { public delegate void PrefixSignature(MenuSelectable self, ref BaseEventData eventData); public delegate void PostfixSignature(MenuSelectable self, ref BaseEventData eventData, ref IEnumerator returnValue); public delegate void PrefixMoveNextSignature(SpeakableEnumerator self); public delegate void PostfixMoveNextSignature(SpeakableEnumerator self, ref bool continueEnumeration); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MonoDetourHook PrefixMoveNext(PrefixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook PostfixMoveNext(PostfixMoveNextSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook((MethodBase)StateMachineTarget(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHookMoveNext(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook((MethodBase)StateMachineTarget(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(MenuSelectable).GetMethod("ValidateDeselect", (BindingFlags)(-1), null, new Type[1] { typeof(BaseEventData) }, null) ?? throw new MissingMethodException("UnityEngine.UI.MenuSelectable", "ValidateDeselect"); } public static MethodInfo StateMachineTarget() { return Extensions.GetStateMachineTarget((MethodInfo)Target()); } } internal static class OnSelect { public delegate void PrefixSignature(MenuSelectable self, ref BaseEventData eventData); public delegate void PostfixSignature(MenuSelectable self, ref BaseEventData eventData); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook(Target(), (Delegate)hook, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(MenuSelectable).GetMethod("OnSelect", (BindingFlags)(-1), null, new Type[1] { typeof(BaseEventData) }, null) ?? throw new MissingMethodException("UnityEngine.UI.MenuSelectable", "OnSelect"); } } } namespace MonoDetour.HookGen { internal static class DefaultMonoDetourManager { internal static MonoDetourManager Instance { get; } = New(); internal static MonoDetourManager New() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown return new MonoDetourManager(typeof(DefaultMonoDetourManager).Assembly.GetName().Name); } } [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class, AllowMultiple = true, Inherited = false)] internal class MonoDetourTargetsAttribute(Type? targetType = null) : Attribute(), IMonoDetourTargets { public Type? TargetType { get; } = targetType; public bool IncludeNestedTypes { get; set; } = true; public string[]? Members { get; set; } public string[]? MemberNamePrefixes { get; set; } public string[]? MemberNameSuffixes { get; set; } public bool GenerateControlFlowVariants { get; set; } } } namespace BepInEx { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] internal sealed class BepInAutoPluginAttribute : Attribute { public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace BepInEx.Preloader.Core.Patching { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] internal sealed class PatcherAutoPluginAttribute : Attribute { public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace Silksong.ModMenu { [MonoDetourTargets(typeof(UIManager), GenerateControlFlowVariants = true)] [BepInPlugin("org.silksong-modding.modmenu", "ModMenu", "0.7.5")] public class ModMenuPlugin : BaseUnityPlugin { private static ModMenuPlugin? instance; private static AbstractMenuScreen? modsMenu; public const string Id = "org.silksong-modding.modmenu"; public static string Name => "ModMenu"; public static string Version => "0.7.5"; private void Awake() { MonoDetourManager.InvokeHookInitializers(typeof(ModMenuPlugin).Assembly); instance = this; } internal static void LogWarning(string message) { if ((Object)(object)instance != (Object)null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)message); } else { Debug.LogWarning((object)message); } } internal static void LogError(string message) { if ((Object)(object)instance != (Object)null) { ((BaseUnityPlugin)instance).Logger.LogError((object)message); } else { Debug.LogError((object)message); } } internal static void FlushLogs() { foreach (ILogListener listener in Logger.Listeners) { DiskLogListener val = (DiskLogListener)(object)((listener is DiskLogListener) ? listener : null); if (val != null) { val.LogWriter.Flush(); } } } private static void ModifyUICanvas(UIManager self) { //IL_0071: 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: Expected O, but got Unknown MenuPrefabs.Load(self); MenuScreen optionsMenuScreen = self.optionsMenuScreen; TextButton textButton = new TextButton("Mods") { OnSubmit = delegate { MenuScreenNavigation.Show(GetModsMenu()); } }; textButton.SetGameObjectParent(UnityExtensions.FindChild(((Component)optionsMenuScreen).gameObject, "Content")); MenuButtonList component = ((Component)optionsMenuScreen).gameObject.GetComponent(); List list = component.entries.ToList(); list.Insert(5, new Entry { selectable = (Selectable)(object)textButton.MenuButton }); component.entries = list.ToArray(); } private static AbstractMenuScreen GetModsMenu() { if (modsMenu != null) { return modsMenu; } PaginatedMenuScreenBuilder paginatedMenuScreenBuilder = new PaginatedMenuScreenBuilder("Mods"); paginatedMenuScreenBuilder.AddRange(Registry.GenerateAllMenuElements()); PaginatedMenuScreen menu = paginatedMenuScreenBuilder.Build(); modsMenu = menu; menu.OnDispose += delegate { if (modsMenu == menu) { modsMenu = null; } }; return menu; } [MonoDetourHookInitialize] private static void Hook() { Md.UIManager.Awake.Postfix(ModifyUICanvas); } } public static class Registry { public delegate SelectableElement MenuElementGenerator(); private static readonly List<(string, MenuElementGenerator)> modMenuGenerators = new List<(string, MenuElementGenerator)>(); public static void AddModMenu(string name, MenuElementGenerator generator) { modMenuGenerators.Add((name ?? throw new ArgumentNullException("name"), generator ?? throw new ArgumentNullException("generator"))); } internal static IEnumerable GenerateAllMenuElements() { List<(LocalizedText, SelectableElement)> allElements = new List<(LocalizedText, SelectableElement)>(); foreach (var modMenuGenerator in modMenuGenerators) { var (name, gen) = modMenuGenerator; ExceptionUtil.Try(delegate { SelectableElement item = gen(); allElements.Add((name, item)); }, "Failed generating '" + name + "'"); } foreach (KeyValuePair pluginInfo in Chainloader.PluginInfos) { BaseUnityPlugin instance = pluginInfo.Value.Instance; if ((Object)(object)instance == (Object)null) { continue; } ExceptionUtil.Try(delegate { if (PluginRegistry.GenerateMenuElement(instance, out LocalizedText name2, out SelectableElement menuElement)) { allElements.Add((name2, menuElement)); } }, "Error generating mod menu for " + pluginInfo.Value.Metadata.Name); } List list = new List(); list.AddRange(from p in allElements orderby p.Item1.Text select p.Item2); return new <>z__ReadOnlyList(list); } } } namespace Silksong.ModMenu.Util { public class EventSuppressor { private class Lease : IDisposable { private readonly EventSuppressor parent; public Lease(EventSuppressor parent) { this.parent = parent; parent.suppressors++; } public void Dispose() { parent.suppressors--; } } private int suppressors; public bool Suppressed => suppressors > 0; public IDisposable Suppress() { return new Lease(this); } } public static class SelectableUtil { [SpecialName] public sealed class $83B99EAA77DA0CB6AABA4E7EFE0CCCCA { [SpecialName] public static class $E278C33082B89C3DDFFCF51CF385D9B6 { } [ExtensionMarker("$E278C33082B89C3DDFFCF51CF385D9B6")] public void SetNavUp(Selectable target) { throw new NotSupportedException(); } [ExtensionMarker("$E278C33082B89C3DDFFCF51CF385D9B6")] public void ClearNavUp() { throw new NotSupportedException(); } [ExtensionMarker("$E278C33082B89C3DDFFCF51CF385D9B6")] public void SetNavLeft(Selectable target) { throw new NotSupportedException(); } [ExtensionMarker("$E278C33082B89C3DDFFCF51CF385D9B6")] public void ClearNavLeft() { throw new NotSupportedException(); } [ExtensionMarker("$E278C33082B89C3DDFFCF51CF385D9B6")] public void SetNavRight(Selectable target) { throw new NotSupportedException(); } [ExtensionMarker("$E278C33082B89C3DDFFCF51CF385D9B6")] public void ClearNavRight() { throw new NotSupportedException(); } [ExtensionMarker("$E278C33082B89C3DDFFCF51CF385D9B6")] public void SetNavDown(Selectable target) { throw new NotSupportedException(); } [ExtensionMarker("$E278C33082B89C3DDFFCF51CF385D9B6")] public void ClearNavDown() { throw new NotSupportedException(); } [ExtensionMarker("$E278C33082B89C3DDFFCF51CF385D9B6")] public void ClearNav() { throw new NotSupportedException(); } } private static readonly int hideHash = Animator.StringToHash("hide"); private static readonly int showHash = Animator.StringToHash("show"); private static Navigation Explicit(this Navigation self) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) Navigation result = self; ((Navigation)(ref result)).mode = (Mode)4; ((Navigation)(ref result)).wrapAround = false; return result; } public static void SetNavUp(this Selectable self, Selectable target) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) Navigation navigation = self.navigation.Explicit(); ((Navigation)(ref navigation)).selectOnUp = target; self.navigation = navigation; } public static void ClearNavUp(this Selectable self) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) Navigation navigation = self.navigation.Explicit(); ((Navigation)(ref navigation)).selectOnUp = null; self.navigation = navigation; } public static void SetNavLeft(this Selectable self, Selectable target) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) Navigation navigation = self.navigation.Explicit(); ((Navigation)(ref navigation)).selectOnLeft = target; self.navigation = navigation; } public static void ClearNavLeft(this Selectable self) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) Navigation navigation = self.navigation.Explicit(); ((Navigation)(ref navigation)).selectOnLeft = null; self.navigation = navigation; } public static void SetNavRight(this Selectable self, Selectable target) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) Navigation navigation = self.navigation.Explicit(); ((Navigation)(ref navigation)).selectOnRight = target; self.navigation = navigation; } public static void ClearNavRight(this Selectable self) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) Navigation navigation = self.navigation.Explicit(); ((Navigation)(ref navigation)).selectOnRight = null; self.navigation = navigation; } public static void SetNavDown(this Selectable self, Selectable target) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) Navigation navigation = self.navigation.Explicit(); ((Navigation)(ref navigation)).selectOnDown = target; self.navigation = navigation; } public static void ClearNavDown(this Selectable self) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) Navigation navigation = self.navigation.Explicit(); ((Navigation)(ref navigation)).selectOnDown = null; self.navigation = navigation; } public static void ClearNav(this Selectable self) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) Navigation navigation = default(Navigation); ((Navigation)(ref navigation)).mode = (Mode)4; ((Navigation)(ref navigation)).wrapAround = false; self.navigation = navigation; } public static void ForceSelect(this Selectable self) { UIManager.HighlightSelectableNoSound(self); Animator[] componentsInChildren = ((Component)self).GetComponentsInChildren(); foreach (Animator val in componentsInChildren) { if (Extensions.HasParameter(val, hideHash, (AnimatorControllerParameterType?)null)) { val.ResetTrigger(hideHash); } if (Extensions.HasParameter(val, showHash, (AnimatorControllerParameterType?)null)) { val.SetTrigger(showHash); } } } public static bool IsSelected(this Selectable self) { return (Object)(object)EventSystem.current.currentSelectedGameObject == (Object)(object)((Component)self).gameObject; } } } namespace Silksong.ModMenu.Screens { public abstract class AbstractMenuScreen : MenuDisposable { internal class Marker : MonoBehaviour { internal AbstractMenuScreen? AbstractMenuScreen; } public readonly GameObject Container; public readonly MenuScreen MenuScreen; public readonly Text TitleText; public readonly GameObject ControlsPane; public readonly MenuButton BackButton; private readonly VisibilityManager visibility = new VisibilityManager(DefaultVisibility: true) { VisibleSelf = false }; public bool AllowGoBack = true; public SelectOnShowBehaviour SelectOnShowBehaviour = SelectOnShowBehaviour.ForgetBackwards; private SelectableElement? lastSelected; public event Action? OnShow; public event Action? OnGoBack; public event Action? OnHide; protected AbstractMenuScreen(LocalizedText title) { Container = MenuPrefabs.Get().NewCustomMenu(title); MenuScreen = Container.GetComponent(); TitleText = UnityExtensions.FindChild(Container, "Title").GetComponent(); ControlsPane = UnityExtensions.FindChild(Container, "Controls"); BackButton = UnityExtensions.FindChild(ControlsPane, "ApplyButton").GetComponent(); ((Component)BackButton).gameObject.GetComponent().SetCallback(InvokeOnGoBack); ((Component)MenuScreen).gameObject.AddComponent().AbstractMenuScreen = this; MenuScreen.backButton = BackButton; UnityExtensions.GetOrAddComponent(Container).Action += Dispose; LateUpdateHelper orAddComponent = UnityExtensions.GetOrAddComponent(Container); orAddComponent.OnLateUpdate += UpdateLayout; orAddComponent.OnLateUpdate += UpdateLastSelected; LocalizedTextExtensions.set_LocalizedText(TitleText, title); } protected abstract void UpdateLayout(); protected void AddChild(IMenuEntity entity) { entity.Visibility.SetParent(visibility); entity.SetGameObjectParent(Container); } protected abstract IEnumerable AllEntities(); protected virtual Selectable SelectOnShow(MenuScreenNavigation.NavigationType navigationType) { return (Selectable)(SelectOnShowBehaviour switch { SelectOnShowBehaviour.AlwaysForget => GetDefaultSelectable(), SelectOnShowBehaviour.ForgetBackwards => (navigationType == MenuScreenNavigation.NavigationType.Forwards) ? GetDefaultSelectable() : GetLastSelectableOrDefault(), SelectOnShowBehaviour.NeverForget => GetLastSelectableOrDefault(), _ => GetDefaultSelectable(), }); } internal void InvokeOnShow(MenuScreenNavigation.NavigationType navigationType) { visibility.VisibleSelf = true; ((MonoBehaviour)UIManager.instance).StartCoroutine(SelectDelayed(SelectOnShow(navigationType))); this.OnShow?.Invoke(navigationType); } private void UpdateLastSelected() { SelectableElement selectableElement = AllEntities().SelectMany((IMenuEntity e) => e.AllElements()).OfType().FirstOrDefault((SelectableElement s) => s.IsSelected); if (selectableElement != null) { lastSelected = selectableElement; } } private IEnumerator SelectDelayed(Selectable selectable) { yield return (object)new WaitUntil((Func)(() => ((Component)selectable).gameObject.activeInHierarchy)); selectable.ForceSelect(); } internal void InvokeOnGoBack() { if (!ExceptionUtil.Try(delegate { this.OnGoBack?.Invoke(); }, "Custom GoBack action failed") || AllowGoBack) { MenuScreenNavigation.GoBack(); } } internal void InvokeOnHide(MenuScreenNavigation.NavigationType navigationType) { this.OnHide?.Invoke(navigationType); visibility.VisibleSelf = false; } protected abstract SelectableElement? GetDefaultSelectableInternal(); private Selectable GetDefaultSelectable() { SelectableElement defaultSelectableInternal = GetDefaultSelectableInternal(); if (defaultSelectableInternal == null || !IMenuEntityExtensions.get_Visible(defaultSelectableInternal) || !defaultSelectableInternal.Interactable) { return (Selectable)(object)BackButton; } return defaultSelectableInternal.SelectableComponent; } protected Selectable GetLastSelectableOrDefault() { if (lastSelected == null || !IMenuEntityExtensions.get_Visible(lastSelected) || !lastSelected.Interactable) { return GetDefaultSelectable(); } return lastSelected.SelectableComponent; } } public class BasicMenuScreen : AbstractMenuScreen { [CompilerGenerated] private INavigableMenuEntity k__BackingField; public Vector2 Anchor = SpacingConstants.TOP_CENTER_ANCHOR; public INavigableMenuEntity Content { get { return k__BackingField; } set { if (value == null) { throw new ArgumentNullException("Content"); } if (k__BackingField != value) { k__BackingField?.ClearParents(); } k__BackingField = value; AddChild(k__BackingField); } } public BasicMenuScreen(LocalizedText title, INavigableMenuEntity content) : base(title) { //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) Content = content; } public void ClearContent() { Content = new VerticalGroup(); } protected override IEnumerable AllEntities() { return new <>z__ReadOnlySingleElementList(Content); } protected override SelectableElement? GetDefaultSelectableInternal() { return Content.GetDefaultSelectable(); } protected override void UpdateLayout() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Content.UpdateLayout(Anchor); SelectableWrapper selectableWrapper = new SelectableWrapper((Selectable)(object)BackButton); selectableWrapper.ClearNeighbors(); Content.SetNeighborDown((Selectable)(object)BackButton); Content.SetNeighborUp((Selectable)(object)BackButton); if (Content.GetNeighborDown(out Selectable selectable)) { selectableWrapper.SetNeighborDown(selectable); } if (Content.GetNeighborUp(out selectable)) { selectableWrapper.SetNeighborUp(selectable); } } } public enum HistoryMode { Add, Replace } [MonoDetourTargets(typeof(GameManager))] [MonoDetourTargets(typeof(UIManager), GenerateControlFlowVariants = true)] public static class MenuScreenNavigation { public enum NavigationType { Forwards, Backwards } private class NavigationTypeContext(NavigationType navigationType) { internal readonly NavigationType NavigationType = navigationType; } private static (MainMenuState, MenuScreen)? lastBaseMenuScreen; private static readonly Stack history = new Stack(); public static AbstractMenuScreen? CurrentModMenuScreen { get { if (history.Count <= 0) { return null; } return history.Peek(); } } public static void Show(AbstractMenuScreen customMenuScreen, HistoryMode historyMode = HistoryMode.Add) { if (history.Count == 0) { CaptureBaseMenuState(); } else if (history.Peek() == customMenuScreen) { return; } UIManager ui = UIManager.instance; ((MonoBehaviour)ui).StartCoroutine(Routine()); IEnumerator Routine() { yield return ((MonoBehaviour)ui).StartCoroutine(HideCurrentMenu(NavigationType.Forwards)); customMenuScreen.InvokeOnShow(NavigationType.Forwards); yield return ((MonoBehaviour)ui).StartCoroutine(ui.ShowMenu(customMenuScreen.MenuScreen)); if (historyMode == HistoryMode.Replace && history.Count > 0) { history.Pop(); } history.Push(customMenuScreen); } } public static void GoBack(int count = 1) { int[] arr = new int[1] { count }; GoBackWhile((AbstractMenuScreen _) => --arr[0] >= 0); } public static void GoBackTo(AbstractMenuScreen customMenuScreen) { GoBackWhile((AbstractMenuScreen c) => c != customMenuScreen); } public static void GoBackWhile(Func filter) { AbstractMenuScreen toHide = null; bool flag = false; while (history.Count > 0 && filter(history.Peek())) { toHide = history.Pop(); flag = true; } UIManager ui; if (flag) { ui = UIManager.instance; ((MonoBehaviour)ui).StartCoroutine(Routine()); } IEnumerator Routine() { yield return ((MonoBehaviour)ui).StartCoroutine(ui.HideMenu(toHide.MenuScreen, true).WithContext(new NavigationTypeContext(NavigationType.Backwards))); if (history.Count > 0) { history.Peek().InvokeOnShow(NavigationType.Backwards); yield return ((MonoBehaviour)ui).StartCoroutine(ui.ShowMenu(history.Peek().MenuScreen)); } else if (lastBaseMenuScreen.HasValue) { (MainMenuState, MenuScreen) value = lastBaseMenuScreen.Value; MainMenuState state = value.Item1; MenuScreen item = value.Item2; lastBaseMenuScreen = null; yield return ((MonoBehaviour)ui).StartCoroutine(ui.ShowMenu(item)); ui.menuState = state; } else { ModMenuPlugin.LogWarning("Navigation error; going back to Options"); yield return ((MonoBehaviour)ui).StartCoroutine(ui.ShowMenu(ui.optionsMenuScreen)); ui.menuState = (MainMenuState)2; } } } private static void CaptureBaseMenuState() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) UIManager instance = UIManager.instance; MainMenuState menuState = instance.menuState; MenuScreen activeMenuScreen = instance.GetActiveMenuScreen(); if ((Object)(object)activeMenuScreen != (Object)null) { lastBaseMenuScreen = (menuState, activeMenuScreen); } } private static IEnumerator HideCurrentMenu(NavigationType navigationType) { return UIManager.instance.HideCurrentMenu().WithContext(new NavigationTypeContext(navigationType)); } private static ReturnFlow OverrideUIGoBack(UIManager self, ref bool returnValue) { if (history.Count != 0) { history.Peek().InvokeOnGoBack(); returnValue = true; return (ReturnFlow)1; } return (ReturnFlow)0; } private static void OnHideMenu(MenuScreen menuScreen) { AbstractMenuScreen.Marker marker = default(AbstractMenuScreen.Marker); if (!((Component)menuScreen).gameObject.TryGetComponent(ref marker)) { return; } AbstractMenuScreen abstractMenuScreen = marker.AbstractMenuScreen; if (abstractMenuScreen == null) { return; } if (ThreadLocalContext.Get(out var value)) { abstractMenuScreen.InvokeOnHide(value.navigationType); if (value.navigationType == NavigationType.Backwards && history.Count > 0 && history.Peek() == abstractMenuScreen) { history.Pop(); } } else { abstractMenuScreen.InvokeOnHide(NavigationType.Backwards); history.Clear(); } } private static ReturnFlow PrefixHideCurrentMenu(UIManager self, ref IEnumerator returnValue) { AbstractMenuScreen screen; if (history.Count != 0) { screen = history.Peek(); returnValue = Routine(); return (ReturnFlow)1; } return (ReturnFlow)0; IEnumerator Routine() { UIManager ui = UIManager.instance; ui.isFadingMenu = true; yield return ((MonoBehaviour)ui).StartCoroutine(ui.HideMenu(screen.MenuScreen, true).PropagateContext()); ui.isFadingMenu = false; } } private static void PostfixHideMenu(UIManager self, ref MenuScreen menuScreen, ref bool disable, ref IEnumerator returnValue) { MenuScreen localCopy = menuScreen; returnValue = returnValue.Append(delegate { OnHideMenu(localCopy); }); } private static void PostfixHideMenuInstant(UIManager self, ref MenuScreen menuScreen) { OnHideMenu(menuScreen); } private static void PrefixUIOnDestroy(UIManager self) { if (history.Count > 0) { UIManager.instance.HideMenuInstant(history.Peek().MenuScreen); } } [MonoDetourHookInitialize] private static void Hook() { UIGoBack.ControlFlowPrefix(OverrideUIGoBack); Md.UIManager.HideCurrentMenu.ControlFlowPrefix(PrefixHideCurrentMenu); HideMenu.Postfix(PostfixHideMenu); HideMenuInstant.Postfix(PostfixHideMenuInstant); OnDestroy.Prefix(PrefixUIOnDestroy); } } public class PaginatedMenuScreen : AbstractMenuScreen { private readonly IndexedList pages = new IndexedList(); private readonly IntRangeChoiceModel pageNumberModel; private readonly ChoiceElement pageNumberElement; public Vector2 Anchor = SpacingConstants.TOP_CENTER_ANCHOR; public int PageNumber { get { return pageNumberModel.Value; } set { pageNumberModel.Value = value; } } public int PageCount => pages.Count; private INavigableMenuEntity? ActivePage { get { if (pages.Count <= 0) { return null; } return pages[PageNumber]; } } public PaginatedMenuScreen(LocalizedText title) : base(title) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) pageNumberModel = new IntRangeChoiceModel(0, 0, 0) { Circular = true, DisplayFn = (int i) => $"{i + 1}" }; pageNumberModel.OnValueChanged += delegate { UpdateLayout(); }; pageNumberElement = new ChoiceElement("Page", pageNumberModel); pageNumberElement.SetGameObjectParent(ControlsPane); Vector2 anchoredPosition = ((Component)BackButton).GetComponent().anchoredPosition; pageNumberElement.RectTransform.SetAnchoredPosition(anchoredPosition); anchoredPosition.y -= SpacingConstants.VSPACE_MEDIUM; ((Component)BackButton).GetComponent().SetAnchoredPosition(anchoredPosition); UpdateLayout(); } protected override IEnumerable AllEntities() { return pages.Concat(new <>z__ReadOnlySingleElementList(pageNumberElement)); } public void AddPage(INavigableMenuEntity page) { pages.Add(page); AddChild(page); } public void AddPages(IEnumerable pages) { foreach (INavigableMenuEntity page in pages) { AddPage(page); } } public void InsertPage(int index, INavigableMenuEntity page) { pages.Insert(index, page); AddChild(page); } public bool RemovePage(INavigableMenuEntity page) { if (!pages.Remove(page)) { return false; } page.ClearParents(); return true; } public void RemoveAt(int index) { if (pages.TryRemoveAt(index, out INavigableMenuEntity item)) { item.ClearParents(); } } protected override SelectableElement? GetDefaultSelectableInternal() { return ActivePage?.GetDefaultSelectable(); } protected override void UpdateLayout() { //IL_0088: Unknown result type (might be due to invalid IL or missing references) if (pages.Count == 0) { return; } pageNumberModel.ResetParams(0, pages.Count - 1, pageNumberElement.Value); IMenuEntityExtensions.set_VisibleSelf(pageNumberElement, pages.Count > 1); for (int i = 0; i < pages.Count; i++) { IMenuEntityExtensions.set_VisibleSelf(pages[i], i == PageNumber); } ActivePage?.UpdateLayout(Anchor); List list = new List(1) { ActivePage }; if (pages.Count > 1) { list.Add(pageNumberElement); } list.Add(new SelectableWrapper((Selectable)(object)BackButton)); foreach (INavigable item in list) { item.ClearNeighbors(); } foreach (var (self, self2) in list.CircularPairs()) { if (self.GetNeighborUp(out Selectable selectable)) { self2.SetNeighborUp(selectable); } if (self2.GetNeighborDown(out selectable)) { self.SetNeighborDown(selectable); } } } } public class PaginatedMenuScreenBuilder(LocalizedText title, int pageSize = 8) { private readonly LocalizedText title = title; private readonly int pageSize = pageSize; private readonly List menuElements = new List(); public Vector2 Anchor = SpacingConstants.TOP_CENTER_ANCHOR; public float VerticalSpacing = SpacingConstants.VSPACE_MEDIUM; public void Add(MenuElement menuElement) { menuElements.Add(menuElement); } public void AddRange(IEnumerable menuElements) { this.menuElements.AddRange(menuElements); } public PaginatedMenuScreen Build() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) PaginatedMenuScreen paginatedMenuScreen = new PaginatedMenuScreen(title) { Anchor = Anchor }; foreach (List item in menuElements.Partition(pageSize)) { VerticalGroup verticalGroup = new VerticalGroup { VerticalSpacing = VerticalSpacing }; verticalGroup.AddRange(item); paginatedMenuScreen.AddPage(verticalGroup); } return paginatedMenuScreen; } } public class ScrollingMenuScreen : BasicMenuScreen { public ScrollingPane ScrollPane => (ScrollingPane)base.Content; public new VerticalGroup Content => (VerticalGroup)ScrollPane.Content; public ScrollingMenuScreen(LocalizedText title) : base(title, new ScrollingPane(new VerticalGroup())) { } public void Add(MenuElement menuElement) { Content.Add(menuElement); } public void AddRange(IEnumerable menuElements) { Content.AddRange(menuElements); } } public enum SelectOnShowBehaviour { AlwaysForget, ForgetBackwards, NeverForget } public class SimpleMenuScreen : BasicMenuScreen { public new VerticalGroup Content => (VerticalGroup)base.Content; public SimpleMenuScreen(string title) : base(title, new VerticalGroup()) { } public void Add(MenuElement menuElement) { Content.Add(menuElement); } public void AddRange(IEnumerable menuElements) { Content.AddRange(menuElements); } } } namespace Silksong.ModMenu.Plugin { public class ConfigEntryFactory { public delegate bool MenuElementGenerator(ConfigEntryBase entry, [MaybeNullWhen(false)] out MenuElement menuElement); private record ElementTreeNode { public readonly List<(string path, MenuElement element)> Elements = new List<(string, MenuElement)>(); public int TotalElements; } private static readonly List defaultGenerators = new List(17) { GenerateCustomElement, GenerateKeyCodeElement, GenerateEnumChoiceElement, GenerateAcceptableValuesChoiceElement, GenerateBoolElement, GenerateSByteElement, GenerateByteElement, GenerateShortElement, GenerateUShortElement, GenerateIntElement, GenerateUIntElement, GenerateLongElement, GenerateULongElement, GenerateFloatElement, GenerateDoubleElement, GenerateStringElement, GenerateColorElement }; public readonly List Generators = defaultGenerators.ToList(); public bool GenerateSubgroups; public int MinSubgroupSize = 2; public static void AddDefaultGenerator(MenuElementGenerator generator) { defaultGenerators.Add(generator ?? throw new ArgumentNullException("generator")); } private static IEnumerable SubgroupsFromConfig(ConfigDefinition config) { return config.Section.Split('.').Concat(config.Key.Split('.')).Select(LocalizedText.Raw); } protected virtual IEnumerable GetSubgroupNames(ConfigEntryBase config, MenuElement menuElement) { IEnumerable enumerable = config.Description.Tags.OfType().FirstOrDefault()?.Subgroups; IEnumerable enumerable2 = enumerable; if (enumerable2 == null) { if (!GenerateSubgroups) { return Array.Empty(); } enumerable2 = SubgroupsFromConfig(config.Definition); } return enumerable2; } private static void FindFirstNonEmptyChild(ref TreeNode tree, List keys) { while (tree.Value.TotalElements <= 1 && tree.Subtrees.Count == 1) { var (item, treeNode2) = (KeyValuePair>)(ref tree.Subtrees.First()); keys.Add(item); tree = treeNode2; } } private List<(string, MenuElement)> BuildSubtreeElements(LocalizedText menuName, List subpageNames, TreeNode tree) { if (tree.Value.TotalElements < MinSubgroupSize) { List<(string, MenuElement)> list = new List<(string, MenuElement)>(); tree.ForEachPostfix(delegate(IReadOnlyList keys, TreeNode t) { list.AddRange(t.Value.Elements); }); list.Sort(((string, MenuElement) a, (string, MenuElement) b) => a.Item1.CompareTo(b.Item1)); return list; } string item = string.Join(".", subpageNames.Select((LocalizedText n) => n.Canonical)); AbstractMenuScreen screen = BuildSubtreeScreen(menuName, subpageNames, tree); TextButton item2 = new TextButton(subpageNames.Last()) { OnSubmit = delegate { MenuScreenNavigation.Show(screen); } }; return new List<(string, MenuElement)>(1) { (item, item2) }; } private AbstractMenuScreen BuildSubtreeScreen(LocalizedText menuName, List subpageNames, TreeNode tree) { List<(string, MenuElement)> list = tree.Value.Elements.ToList(); int count = subpageNames.Count; foreach (KeyValuePair> subtree in tree.Subtrees) { TreeNode tree2 = subtree.Value; subpageNames.Add(subtree.Key); FindFirstNonEmptyChild(ref tree2, subpageNames); list.AddRange(BuildSubtreeElements(menuName, subpageNames, tree2)); subpageNames.RemoveRange(count, subpageNames.Count - count); } return ArrangeScreen(list.OrderBy<(string, MenuElement), string>(((string path, MenuElement element) e) => e.path).ToList(), subpageNames.LastOrDefault() ?? menuName); } protected virtual AbstractMenuScreen ArrangeScreen(List<(string path, MenuElement element)> elements, LocalizedText menuName) { PaginatedMenuScreenBuilder paginatedMenuScreenBuilder = new PaginatedMenuScreenBuilder(menuName); paginatedMenuScreenBuilder.AddRange(elements.Select<(string, MenuElement), MenuElement>(((string path, MenuElement element) e) => e.element)); return paginatedMenuScreenBuilder.Build(); } public virtual bool GenerateEntryButton(LocalizedText name, BaseUnityPlugin plugin, [MaybeNullWhen(false)] out SelectableElement selectableElement) { AbstractMenuScreen menuScreen; return GenerateEntryButton(name, plugin.Config, out menuScreen, out selectableElement); } public virtual bool GenerateEntryButton(LocalizedText name, ConfigFile config, [MaybeNullWhen(false)] out AbstractMenuScreen menuScreen, [MaybeNullWhen(false)] out SelectableElement selectableElement) { TreeNode tree = new TreeNode(); foreach (KeyValuePair item in ((IEnumerable>)config).OrderBy((KeyValuePair e) => e.Key.Key)) { if (GenerateMenuElement(item.Value, out MenuElement menuElement)) { IEnumerable subgroupNames = GetSubgroupNames(item.Value, menuElement); tree[subgroupNames].Value.Elements.Add((item.Key.Key, menuElement)); } } tree.ForEachPostfix(delegate(IReadOnlyList _, TreeNode treeNode) { treeNode.Value.TotalElements = treeNode.Value.Elements.Count + treeNode.Subtrees.Values.Select((TreeNode t) => (t.Value.TotalElements >= MinSubgroupSize) ? 1 : t.Value.TotalElements).Sum(); }); if (tree.Value.TotalElements == 0) { menuScreen = null; selectableElement = null; return false; } List list = new List(); FindFirstNonEmptyChild(ref tree, list); AbstractMenuScreen menu = BuildSubtreeScreen(name, list, tree); menuScreen = menu; selectableElement = new TextButton(name) { OnSubmit = delegate { MenuScreenNavigation.Show(menu); } }; return true; } public virtual bool GenerateMenuElement(ConfigEntryBase entry, [MaybeNullWhen(false)] out MenuElement menuElement) { foreach (MenuElementGenerator generator in Generators) { if (generator(entry, out menuElement)) { return true; } } menuElement = null; return false; } public static bool GenerateCustomElement(ConfigEntryBase entry, [MaybeNullWhen(false)] out MenuElement menuElement) { object[] tags = entry.Description.Tags; for (int i = 0; i < tags.Length; i++) { if (tags[i] is MenuElementGenerator menuElementGenerator && menuElementGenerator(entry, out menuElement)) { return true; } } menuElement = null; return false; } public static bool GenerateKeyCodeElement(ConfigEntryBase entry, [MaybeNullWhen(false)] out MenuElement menuElement) { if (!(entry is ConfigEntry entry2)) { menuElement = null; return false; } KeyBindElement keyBindElement = new KeyBindElement(entry.LabelName()); keyBindElement.SynchronizeWith(entry2); menuElement = keyBindElement; return true; } public static bool GenerateEnumChoiceElement(ConfigEntryBase entry, [MaybeNullWhen(false)] out MenuElement menuElement) { menuElement = null; if (!entry.SettingType.IsEnum) { return false; } if (!ChoiceModels.TryForEnum(entry.SettingType, out ListChoiceModel model)) { return false; } ChoiceElement choiceElement = new ChoiceElement(entry.LabelName(), model, entry.DescriptionLine()); choiceElement.SynchronizeRawWith(entry); menuElement = choiceElement; return true; } private static bool ExtractAcceptableValues(ConfigEntryBase entry, [MaybeNullWhen(false)] out Array values) { values = null; AcceptableValueBase acceptableValues = entry.Description.AcceptableValues; if (acceptableValues == null) { return false; } Type type = typeof(AcceptableValueList<>).MakeGenericType(acceptableValues.ValueType); if (type.IsInstanceOfType(acceptableValues)) { PropertyInfo property = type.GetProperty("AcceptableValues", BindingFlags.Instance | BindingFlags.Public); values = property.GetValue(acceptableValues) as Array; return true; } values = null; return false; } public static bool GenerateAcceptableValuesChoiceElement(ConfigEntryBase entry, [MaybeNullWhen(false)] out MenuElement menuElement) { menuElement = null; if (!ExtractAcceptableValues(entry, out Array values) || values.Length == 0) { return false; } LocalizedText label = entry.LabelName(); Array array = values; List list = new List(array.Length); foreach (object item in array) { list.Add(item); } ChoiceElement choiceElement = new ChoiceElement(label, ChoiceModels.ForValues(list), entry.DescriptionLine()); choiceElement.SynchronizeRawWith(entry); menuElement = choiceElement; return true; } public static bool GenerateBoolElement(ConfigEntryBase entry, [MaybeNullWhen(false)] out MenuElement menuElement) { if (!(entry is ConfigEntry val)) { menuElement = null; return false; } ChoiceElement choiceElement = new ChoiceElement(((ConfigEntryBase)(object)val).LabelName(), ChoiceModels.ForBool(), ((ConfigEntryBase)(object)val).DescriptionLine()); choiceElement.SynchronizeWith(val); menuElement = choiceElement; return true; } public static bool GenerateSByteElement(ConfigEntryBase entry, [MaybeNullWhen(false)] out MenuElement menuElement) { if (!(entry is ConfigEntry entry2)) { menuElement = null; return false; } ParserTextModel model = ((entry.Description.AcceptableValues is AcceptableValueRange val) ? TextModels.ForSignedBytes(val.MinValue, val.MaxValue) : TextModels.ForSignedBytes()); TextInput textInput = new TextInput(entry.LabelName(), model, entry.DescriptionLine()); textInput.SynchronizeWith(entry2); menuElement = textInput; return true; } public static bool GenerateByteElement(ConfigEntryBase entry, [MaybeNullWhen(false)] out MenuElement menuElement) { if (!(entry is ConfigEntry entry2)) { menuElement = null; return false; } ParserTextModel model = ((entry.Description.AcceptableValues is AcceptableValueRange val) ? TextModels.ForBytes(val.MinValue, val.MaxValue) : TextModels.ForBytes()); TextInput textInput = new TextInput(entry.LabelName(), model, entry.DescriptionLine()); textInput.SynchronizeWith(entry2); menuElement = textInput; return true; } public static bool GenerateShortElement(ConfigEntryBase entry, [MaybeNullWhen(false)] out MenuElement menuElement) { if (!(entry is ConfigEntry entry2)) { menuElement = null; return false; } ParserTextModel model = ((entry.Description.AcceptableValues is AcceptableValueRange val) ? TextModels.ForShorts(val.MinValue, val.MaxValue) : TextModels.ForShorts()); TextInput textInput = new TextInput(entry.LabelName(), model, entry.DescriptionLine()); textInput.SynchronizeWith(entry2); menuElement = textInput; return true; } public static bool GenerateUShortElement(ConfigEntryBase entry, [MaybeNullWhen(false)] out MenuElement menuElement) { if (!(entry is ConfigEntry entry2)) { menuElement = null; return false; } ParserTextModel model = ((entry.Description.AcceptableValues is AcceptableValueRange val) ? TextModels.ForUnsignedShorts(val.MinValue, val.MaxValue) : TextModels.ForUnsignedShorts()); TextInput textInput = new TextInput(entry.LabelName(), model, entry.DescriptionLine()); textInput.SynchronizeWith(entry2); menuElement = textInput; return true; } public static bool GenerateIntElement(ConfigEntryBase entry, [MaybeNullWhen(false)] out MenuElement menuElement) { if (!(entry is ConfigEntry entry2)) { menuElement = null; return false; } ParserTextModel model = ((entry.Description.AcceptableValues is AcceptableValueRange val) ? TextModels.ForIntegers(val.MinValue, val.MaxValue) : TextModels.ForIntegers()); TextInput textInput = new TextInput(entry.LabelName(), model, entry.DescriptionLine()); textInput.SynchronizeWith(entry2); menuElement = textInput; return true; } public static bool GenerateUIntElement(ConfigEntryBase entry, [MaybeNullWhen(false)] out MenuElement menuElement) { if (!(entry is ConfigEntry entry2)) { menuElement = null; return false; } ParserTextModel model = ((entry.Description.AcceptableValues is AcceptableValueRange val) ? TextModels.ForUnsignedIntegers(val.MinValue, val.MaxValue) : TextModels.ForUnsignedIntegers()); TextInput textInput = new TextInput(entry.LabelName(), model, entry.DescriptionLine()); textInput.SynchronizeWith(entry2); menuElement = textInput; return true; } public static bool GenerateLongElement(ConfigEntryBase entry, [MaybeNullWhen(false)] out MenuElement menuElement) { if (!(entry is ConfigEntry entry2)) { menuElement = null; return false; } ParserTextModel model = ((entry.Description.AcceptableValues is AcceptableValueRange val) ? TextModels.ForLongs(val.MinValue, val.MaxValue) : TextModels.ForLongs()); TextInput textInput = new TextInput(entry.LabelName(), model, entry.DescriptionLine()); textInput.SynchronizeWith(entry2); menuElement = textInput; return true; } public static bool GenerateULongElement(ConfigEntryBase entry, [MaybeNullWhen(false)] out MenuElement menuElement) { if (!(entry is ConfigEntry entry2)) { menuElement = null; return false; } ParserTextModel model = ((entry.Description.AcceptableValues is AcceptableValueRange val) ? TextModels.ForUnsignedLongs(val.MinValue, val.MaxValue) : TextModels.ForUnsignedLongs()); TextInput textInput = new TextInput(entry.LabelName(), model, entry.DescriptionLine()); textInput.SynchronizeWith(entry2); menuElement = textInput; return true; } public static bool GenerateFloatElement(ConfigEntryBase entry, [MaybeNullWhen(false)] out MenuElement menuElement) { if (!(entry is ConfigEntry entry2)) { menuElement = null; return false; } ParserTextModel model = ((entry.Description.AcceptableValues is AcceptableValueRange val) ? TextModels.ForFloats(val.MinValue, val.MaxValue) : TextModels.ForFloats()); TextInput textInput = new TextInput(entry.LabelName(), model, entry.DescriptionLine()); textInput.SynchronizeWith(entry2); menuElement = textInput; return true; } public static bool GenerateDoubleElement(ConfigEntryBase entry, [MaybeNullWhen(false)] out MenuElement menuElement) { if (!(entry is ConfigEntry entry2)) { menuElement = null; return false; } ParserTextModel model = ((entry.Description.AcceptableValues is AcceptableValueRange val) ? TextModels.ForDoubles(val.MinValue, val.MaxValue) : TextModels.ForDoubles()); TextInput textInput = new TextInput(entry.LabelName(), model, entry.DescriptionLine()); textInput.SynchronizeWith(entry2); menuElement = textInput; return true; } public static bool GenerateStringElement(ConfigEntryBase entry, [MaybeNullWhen(false)] out MenuElement menuElement) { if (!(entry is ConfigEntry entry2)) { menuElement = null; return false; } TextInput textInput = new TextInput(entry.LabelName(), TextModels.ForStrings(), entry.DescriptionLine()); textInput.SynchronizeWith(entry2); menuElement = textInput; return true; } public static bool GenerateColorElement(ConfigEntryBase entry, [MaybeNullWhen(false)] out MenuElement menuElement) { if (!(entry is ConfigEntry entry2)) { menuElement = null; return false; } ColorInput colorInput = new ColorInput(entry.LabelName(), entry.DescriptionLine()) { Format = ((entry.Description.AcceptableValues is RGBColorValues) ? ColorInput.InputFormat.RGB : ColorInput.InputFormat.RGBA) }; colorInput.SynchronizeWith(entry2); menuElement = colorInput; return true; } } public static class ConfigEntryFactoryExtensions { public static void SynchronizeRawWith(this BaseSelectableValueElement element, ConfigEntryBase entry) { IBaseValueModel model = element.RawModel; model.SetRawValue(entry.BoxedValue); model.OnRawValueChanged += delegate(object o) { entry.BoxedValue = o; }; entry.ConfigFile.SettingChanged += handler; element.OnDispose += delegate { entry.ConfigFile.SettingChanged -= handler; }; void handler(object _, SettingChangedEventArgs args) { if (args.ChangedSetting == entry) { model.SetRawValue(args.ChangedSetting.BoxedValue); } } } public static void SynchronizeWith(this SelectableValueElement element, ConfigEntry entry) { IValueModel model = element.Model; model.SetValue(entry.Value); model.OnValueChanged += delegate(T v) { entry.Value = v; }; entry.SettingChanged += handler; element.OnDispose += delegate { entry.SettingChanged -= handler; }; void handler(object _, EventArgs args) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) model.SetValue((T)((SettingChangedEventArgs)args).ChangedSetting.BoxedValue); } } public static string LabelName(this ConfigEntryBase self) { return self.Definition.Key.UnCamelCase().Truncate(50); } public static string DescriptionLine(this ConfigEntryBase self) { return self.Description.Description.FirstLine(150); } } public record ConfigEntrySubgroup { public readonly IReadOnlyList Subgroups; public ConfigEntrySubgroup(IEnumerable subgroups) { List list = new List(); list.AddRange(subgroups); Subgroups = new <>z__ReadOnlyList(list); } public ConfigEntrySubgroup(LocalizedText name1, params LocalizedText[] otherNames) { int num = 0; LocalizedText[] array = new LocalizedText[1 + otherNames.Length]; array[num] = name1; num++; ReadOnlySpan readOnlySpan = new ReadOnlySpan(otherNames); readOnlySpan.CopyTo(new Span(array).Slice(num, readOnlySpan.Length)); num += readOnlySpan.Length; Subgroups = new <>z__ReadOnlyArray(array); } } public interface IModMenuCustomElement : IModMenuInterface { SelectableElement BuildCustomElement(); } public interface IModMenuCustomMenu : IModMenuInterface { AbstractMenuScreen BuildCustomMenu(); } public interface IModMenuInterface { LocalizedText ModMenuName() { BepInPlugin? customAttribute = ((MemberInfo)GetType()).GetCustomAttribute(); return ((customAttribute != null) ? customAttribute.Name : null) ?? "###UNKNOWN###"; } } public interface IModMenuNestedMenu : IModMenuInterface { int MinSubgroupSize() { return 2; } } public interface IModMenuToggle : IModMenuInterface { bool ModMenuGetEnabled(); void ModMenuSetEnabled(bool enabled); string ModMenuDescription() { return ""; } } public static class MenuElementGenerators { public static ConfigEntryFactory.MenuElementGenerator CreateRightDescGenerator(bool includeSettingDescription = true) { return gen; bool gen(ConfigEntryBase entry, [MaybeNullWhen(false)] out MenuElement element) { if (!entry.SettingType.IsEnum) { element = null; return false; } if (!ChoiceModels.TryForEnum(entry.SettingType, out ListChoiceModel model)) { element = null; return false; } Dictionary descriptionLookup = model.Values.ToDictionary((object t) => t, (object t) => LocalizedText.Raw(string.Empty)); bool flag = false; foreach (object value in model.Values) { if (TryGetDescription(entry.SettingType.GetField(value.ToString(), BindingFlags.Static | BindingFlags.Public), out LocalizedText descText)) { descriptionLookup[value] = descText; flag = true; } } if (!flag) { element = null; return false; } string text = (includeSettingDescription ? entry.DescriptionLine() : string.Empty); DynamicDescriptionChoiceElement dynamicDescriptionChoiceElement = new DynamicDescriptionChoiceElement(entry.LabelName(), model, text, (object t) => descriptionLookup[t]); dynamicDescriptionChoiceElement.SynchronizeRawWith(entry); element = dynamicDescriptionChoiceElement; return true; } } private static bool TryGetDescription(FieldInfo enumField, [NotNullWhen(true)] out LocalizedText? descText) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) LocalizedDescriptionAttribute customAttribute = enumField.GetCustomAttribute(); if (customAttribute != null) { descText = LocalizedText.Key(new LocalisedString(customAttribute.SheetTitle, customAttribute.Key)); return true; } DescriptionAttribute customAttribute2 = enumField.GetCustomAttribute(); if (customAttribute2 != null) { descText = customAttribute2.Description; return true; } descText = null; return false; } public static ConfigEntryFactory.MenuElementGenerator CreateIntSliderGenerator() { return gen; static bool gen(ConfigEntryBase entry, [MaybeNullWhen(false)] out MenuElement menuElement) { menuElement = null; if (!(entry is ConfigEntry val)) { return false; } if (!(((ConfigEntryBase)val).Description.AcceptableValues is AcceptableValueRange val2)) { return false; } IntSliderModel model = new IntSliderModel(val2.MinValue, val2.MaxValue); SliderElement sliderElement = new SliderElement(((ConfigEntryBase)(object)val).LabelName(), model); sliderElement.SynchronizeWith(val); menuElement = sliderElement; return true; } } } public delegate bool PluginHandler(IModMenuInterface plugin, [MaybeNullWhen(false)] out SelectableElement menuElement); public static class PluginRegistry { private static readonly List registeredHandlers = new List(4) { HandleType(GenerateCustomElement), HandleType(GenerateCustomMenu), GenerateNestedMenu, HandleType(GenerateToggle) }; public static void AddHandler(PluginHandler handler) { registeredHandlers.Add(handler); } public static PluginHandler HandleType(Func generator) where T : IModMenuInterface { return Handler; bool Handler(IModMenuInterface plugin, [MaybeNullWhen(false)] out SelectableElement menuElement) { if (plugin is T arg) { menuElement = generator(arg); return true; } menuElement = null; return false; } } internal static bool GenerateMenuElement(BaseUnityPlugin plugin, out LocalizedText name, [MaybeNullWhen(false)] out SelectableElement menuElement) { if (((object)plugin).GetType().IgnoreForModMenu()) { name = ""; menuElement = null; return false; } name = plugin.Info.Metadata.Name.UnCamelCase(); if (plugin is IModMenuInterface modMenuInterface) { name = modMenuInterface.ModMenuName(); foreach (PluginHandler registeredHandler in registeredHandlers) { if (registeredHandler(modMenuInterface, out menuElement)) { return true; } } } return new ConfigEntryFactory().GenerateEntryButton(name, plugin, out menuElement); } private static SelectableElement GenerateCustomElement(IModMenuCustomElement plugin) { return plugin.BuildCustomElement(); } private static SelectableElement GenerateCustomMenu(IModMenuCustomMenu plugin) { AbstractMenuScreen menu = plugin.BuildCustomMenu(); return new TextButton(plugin.ModMenuName()) { OnSubmit = delegate { MenuScreenNavigation.Show(menu); } }; } private static bool GenerateNestedMenu(IModMenuInterface plugin, [MaybeNullWhen(false)] out SelectableElement menuElement) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown if (!(plugin is IModMenuNestedMenu modMenuNestedMenu)) { menuElement = null; return false; } return new ConfigEntryFactory { GenerateSubgroups = true, MinSubgroupSize = modMenuNestedMenu.MinSubgroupSize() }.GenerateEntryButton(plugin.ModMenuName(), (BaseUnityPlugin)plugin, out menuElement); } private static SelectableElement GenerateToggle(IModMenuToggle plugin) { ChoiceElement choiceElement = new ChoiceElement(plugin.ModMenuName(), ChoiceModels.ForBool("Disabled", "Enabled"), plugin.ModMenuDescription()); choiceElement.Value = plugin.ModMenuGetEnabled(); choiceElement.OnValueChanged += plugin.ModMenuSetEnabled; return choiceElement; } } public class RGBColorValues : AcceptableValueBase { public RGBColorValues() : base(typeof(Color)) { } public override object Clamp(object value) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) Color val = (Color)((value is Color val2) ? val2 : default(Color)); val.a = 1f; return val; } public override bool IsValid(object value) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (value is Color val) { return val.a == 1f; } return false; } public override string ToDescriptionString() { return "# Acceptable values: color codes from 000000FF to FFFFFFFF"; } } } namespace Silksong.ModMenu.Models { public abstract class AbstractValueModel : IValueModel, IBaseValueModel, IDisplayable { public T Value { get { return GetValue(); } set { if (!SetValue(value)) { throw new ArgumentException($"Invalid value: {value}"); } } } public event Action? OnValueChanged; private event Action? OnObjectValueChangedImpl; event Action? IBaseValueModel.OnRawValueChanged { add { OnObjectValueChangedImpl += value; } remove { OnObjectValueChangedImpl -= value; } } protected AbstractValueModel() { OnValueChanged += delegate(T o) { this.OnObjectValueChangedImpl?.Invoke(o); }; } protected AbstractValueModel(T value) : this() { Value = value; } protected void InvokeOnValueChanged() { this.OnValueChanged?.Invoke(GetValue()); } public abstract T GetValue(); public abstract bool SetValue(T value); public virtual LocalizedText DisplayString() { return $"{GetValue()}"; } } [AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] public class ModMenuNameAttribute(string customName) : Attribute() { public string CustomName => customName; } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] public class ModMenuIgnoreAttribute : Attribute { } internal static class AttributeExtensions { internal static bool IgnoreForModMenu(this MemberInfo self) { if (self.GetCustomAttribute() == null) { return self.GetCustomAttributes(inherit: true).Any((object attr) => attr.GetType().Name == "ModMenuIgnoreAttribute"); } return true; } } [AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] public class LocalizedDescriptionAttribute(string sheetTitle, string key) : Attribute() { public string SheetTitle => sheetTitle; public string Key => key; } public static class ChoiceModels { public static ListChoiceModel ForBool(string falseName, string trueName) { return ForNamedValues(new <>z__ReadOnlyArray<(bool, string)>(new(bool, string)[2] { (false, falseName), (true, trueName) })); } public static ListChoiceModel ForBool() { //IL_0013: 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) return ForLocalizedValues(new <>z__ReadOnlyArray<(bool, LocalizedText)>(new(bool, LocalizedText)[2] { (false, (LocalizedText)new LocalisedString("MainMenu", "MOH_OFF")), (true, (LocalizedText)new LocalisedString("MainMenu", "MOH_ON")) })); } public static bool TryForEnum(Type enumType, [MaybeNullWhen(false)] out ListChoiceModel model) { ReadOnlyDictionary readOnlyDictionary = EnumUtil.StringsForType(enumType); HashSet hashSet = new HashSet(); List<(T, string)> list = new List<(T, string)>(); foreach (object enumValue in enumType.GetEnumValues()) { if (readOnlyDictionary.TryGetValue(enumValue, out var value) && hashSet.Add(enumValue)) { T item = (T)enumValue; list.Add((item, value)); } } if (list.Count == 0) { model = null; return false; } model = ForNamedValues(list); return true; } public static bool TryForEnum([MaybeNullWhen(false)] out ListChoiceModel model) where T : Enum { return TryForEnum(typeof(T), out model); } public static ListChoiceModel ForEnum() where T : Enum { if (!TryForEnum(out ListChoiceModel model)) { throw new ArgumentException("Enum " + typeof(T).FullName + " is empty."); } return model; } public static ListChoiceModel ForNamedValues(IEnumerable<(T, string)> values) { return ForLocalizedValues(values.Select<(T, string), (T, LocalizedText)>(((T, string) x) => ((T, LocalizedText))(x.Item1, x.Item2))); } public static ListChoiceModel ForLocalizedValues(IEnumerable<(T, LocalizedText)> values) { List list = new List(); List names = new List(); foreach (var (item, item2) in values) { list.Add(item); names.Add(item2); } return new ListChoiceModel(list) { DisplayFn = (int idx, T _) => names[idx] }; } public static ListChoiceModel ForValues(List values) { return new ListChoiceModel(values); } } public delegate LocalizedText IndexedToString(int index, T item); public interface IBaseChoiceModel : IDisplayable { bool MoveLeft(); bool MoveRight(); } public interface IBaseValueModel : IDisplayable { object RawValue { get { return GetRawValue(); } set { if (!SetRawValue(value)) { throw new ArgumentException($"Invalid value: {value}"); } } } event Action? OnRawValueChanged; object GetRawValue(); bool SetRawValue(object value); } public interface IChoiceModel : IValueModel, IBaseValueModel, IDisplayable, IBaseChoiceModel { } public interface IDisplayable { LocalizedText DisplayString(); } public class IntRangeChoiceModel : AbstractValueModel, IChoiceModel, IValueModel, IBaseValueModel, IDisplayable, IBaseChoiceModel { public bool Circular; private int value; public Func? DisplayFn; public int Minimum { get; private set; } public int Maximum { get; private set; } public IntRangeChoiceModel(int min, int max, int value) { ResetParamsInternal(min, max, value); } public void ResetParams(int min, int max, int value) { int num = this.value; ResetParamsInternal(min, max, value); if (this.value != num) { InvokeOnValueChanged(); } } public override int GetValue() { return value; } public bool MoveLeft() { if (value == Minimum) { if (!Circular) { return false; } value = Maximum; } else { value--; } InvokeOnValueChanged(); return true; } public bool MoveRight() { if (value == Maximum) { if (!Circular) { return false; } value = Minimum; } else { value++; } InvokeOnValueChanged(); return true; } public override bool SetValue(int value) { if (this.value == value) { return true; } if (value < Minimum || value > Maximum) { return false; } this.value = value; InvokeOnValueChanged(); return true; } public override LocalizedText DisplayString() { return DisplayFn?.Invoke(GetValue()) ?? ((LocalizedText)$"{GetValue()}"); } private void ResetParamsInternal(int min, int max, int value) { if (max < min) { throw new ArgumentException(string.Format("{0} ({1}) must be <= than {2} ({3})", "min", min, "max", max)); } Minimum = min; Maximum = max; this.value = Math.Clamp(value, min, max); } } public class IntSliderModel : SliderModel { public IntSliderModel(int min, int max) : base(min, max) { } protected override bool GetIndex(int value, out int index) { index = value; if (value >= MinimumIndex) { return value <= MaximumIndex; } return false; } protected override int GetValue(int index) { return index; } } public interface ITextModel : IValueModel, IBaseValueModel, IDisplayable { bool IsTextValid { get; } string TextValue { get; set; } event Action? OnTextValueChanged; string GetTextValue(); void SetTextValue(string value); } public interface IValueModel : IBaseValueModel, IDisplayable { T Value { get; set; } event Action? OnValueChanged; T GetValue(); object IBaseValueModel.GetRawValue() { return GetValue(); } bool SetValue(T value); bool IBaseValueModel.SetRawValue(object value) { if (value is T value2) { return SetValue(value2); } return false; } } public class LinearFloatSliderModel : SliderModel { public readonly float MinimumValue; public readonly float MaximumValue; public readonly int Ticks; public LinearFloatSliderModel(float min, float max, int ticks) : base(0, ticks - 1) { if (ticks < 2) { throw new ArgumentException(string.Format("{0} ({1}) must be at least 2", "ticks", ticks)); } if (MathF.Abs(max - min) < 1E-06f) { throw new ArgumentException(string.Format("{0} ({1}) and {2} ({3}) are too close.", "min", min, "max", max)); } MinimumValue = min; MaximumValue = max; Ticks = ticks; } protected override float GetValue(int index) { return MinimumValue + (MaximumValue - MinimumValue) * ((float)index * 1f / (float)(Ticks - 1)); } protected override bool GetIndex(float value, out int index) { index = -1; float minimumValue = MinimumValue; float num = MaximumValue; float num2 = minimumValue; bool flag = MinimumValue > MaximumValue; if (flag) { float num3 = num; num = num2; num2 = num3; } if (value < num2 || value > num) { return false; } float num4 = (value - num2) * (float)(Ticks - 1) / (num - num2); index = Mathf.RoundToInt(num4); if (flag) { index = Ticks - 1 - index; } return true; } protected override LocalizedText DefaultDisplayString(int index, float item) { return $"{item:0.###}"; } } public class ListChoiceModel : AbstractValueModel, IChoiceModel, IValueModel, IBaseValueModel, IDisplayable, IBaseChoiceModel { public bool Circular; private int _index; public IndexedToString? DisplayFn; public IReadOnlyList Values { get; private set; } public int Count => Values.Count; public int Index { get { return _index; } set { if (value < 0 || value >= Values.Count) { throw new IndexOutOfRangeException($"Index ({value}) out of range: [0, {Values.Count})"); } if (_index != value) { _index = value; InvokeOnValueChanged(); } } } public ListChoiceModel(List values) { if (values.Count <= 0) { throw new ArgumentException("Empty list"); } Values = new <>z__ReadOnlyArray(values.ToArray()); Circular = true; base..ctor(); } public void UpdateValues(List newValues, int selectedIndex) { if (newValues.Count == 0) { throw new ArgumentException("newValues cannot be empty"); } if (selectedIndex < 0 || selectedIndex >= newValues.Count) { throw new ArgumentOutOfRangeException(string.Format("{0} ({1}) is out of range: [0, {2})", "selectedIndex", selectedIndex, newValues.Count)); } Values = new <>z__ReadOnlyArray(newValues.ToArray()); _index = selectedIndex; InvokeOnValueChanged(); } public override T GetValue() { return Values[Index]; } public override bool SetValue(T value) { if (EqualityComparer.Default.Equals(value, GetValue())) { return true; } for (int i = 0; i < Count; i++) { if (EqualityComparer.Default.Equals(Values[i], value)) { Index = i; return true; } } return false; } public bool MoveLeft() { return Move(-1); } public bool MoveRight() { return Move(1); } public override LocalizedText DisplayString() { return (DisplayFn ?? new IndexedToString(DefaultDisplayString))(Index, GetValue()); } protected virtual LocalizedText DefaultDisplayString(int index, T item) { return $"{item}"; } private bool Move(int delta) { int num = Index + delta; if (num < 0) { num = (Circular ? (num % Count + Count) : 0); } if (num >= Count) { num = (Circular ? (num % Count) : (Count - 1)); } if (Index == num) { return false; } Index = num; return true; } } public class ListSliderModel : SliderModel { private readonly T[] items = items.ToArray(); public ListSliderModel(List items) : base(0, items.Count - 1) { } protected override bool GetIndex(T value, out int index) { index = Array.IndexOf(items, value); return index >= 0; } protected override T GetValue(int index) { return items[index]; } } public class ParserTextModel : ITextModel, IValueModel, IBaseValueModel, IDisplayable { public delegate bool Parse(string text, out T value); public delegate bool Unparse(T value, out string text); private readonly Parse parser; private readonly Unparse unparser; private readonly T defaultValue; private string text; private T value; public Func ConstraintFn = (T _) => true; public bool IsTextValid { get; private set; } public T Value { get { return value; } set { if (!SetValue(value)) { throw new ArgumentException(string.Format("{0}: {1}", "value", value)); } } } public string TextValue { get { return text; } set { SetTextValue(value); } } public event Action? OnTextValueChanged; public event Action? OnValueChanged; public event Action? OnRawValueChanged; public ParserTextModel(Parse parser, Unparse unparser, T defaultValue = default(T)) { this.parser = parser; this.unparser = unparser; this.defaultValue = defaultValue; text = ""; value = defaultValue; SetValue(defaultValue); } public string GetTextValue() { return text; } public void SetTextValue(string value) { if (!(text == value)) { text = value; IsTextValid = parser(value, out var val) && ConstraintFn(val); if (!IsTextValid) { val = defaultValue; } if (!EqualityComparer.Default.Equals(this.value, val)) { this.value = val; this.OnValueChanged?.Invoke(this.value); this.OnRawValueChanged?.Invoke(this.value); } this.OnTextValueChanged?.Invoke(text); } } public T GetValue() { return Value; } public bool SetValue(T value) { if (EqualityComparer.Default.Equals(this.value, value)) { return true; } if (!unparser(value, out var text) || !ConstraintFn(value)) { return false; } IsTextValid = true; this.value = value; bool num = text != this.text; if (num) { this.text = text; } this.OnValueChanged?.Invoke(value); this.OnRawValueChanged?.Invoke(value); if (num) { this.OnTextValueChanged?.Invoke(this.text); } return true; } public LocalizedText DisplayString() { return text; } } public abstract class SliderModel : AbstractValueModel { public readonly int MinimumIndex; public readonly int MaximumIndex; private int _index; public IndexedToString? DisplayFn; public int Index { get { return _index; } set { if (value < MinimumIndex || value > MaximumIndex) { throw new ArgumentOutOfRangeException($"SelectedIndex ({value}) out of range: [{MinimumIndex}, {MaximumIndex}]"); } if (_index != value) { _index = value; InvokeOnValueChanged(); } } } protected SliderModel(int min, int max) { if (max <= min) { throw new ArgumentException($"Min ({min}) should be < Max ({max})"); } MinimumIndex = min; MaximumIndex = max; Index = min; } protected abstract T GetValue(int index); protected abstract bool GetIndex(T value, out int index); public override T GetValue() { return GetValue(Index); } public override bool SetValue(T value) { if (!GetIndex(value, out var index)) { return false; } if (index < MinimumIndex || index > MaximumIndex) { return false; } Index = index; return true; } public override LocalizedText DisplayString() { return (DisplayFn ?? new IndexedToString(DefaultDisplayString))(Index, GetValue()); } protected virtual LocalizedText DefaultDisplayString(int index, T item) { return $"{item}"; } } public static class SliderModels { public static LinearFloatSliderModel ForFloats(float min, float max, int ticks) { return new LinearFloatSliderModel(min, max, ticks); } public static IntSliderModel ForInts(int min, int max) { return new IntSliderModel(min, max); } public static ListSliderModel ForNamedValues(IEnumerable<(T, string)> values) { List list = new List(); List names = new List(); foreach (var (item, item2) in values) { list.Add(item); names.Add(item2); } return new ListSliderModel(list) { DisplayFn = (int idx, T _) => names[idx] }; } public static ListSliderModel ForValues(List values) { return new ListSliderModel(values); } } public static class TextModels { private static readonly Color INVALID_COLOR = new Color(-1f, -1f, -1f, -1f); public static ParserTextModel ForStrings() { return new ParserTextModel(DefaultUnparse, DefaultUnparse); } public static ParserTextModel ForSignedBytes() { return new ParserTextModel(sbyte.TryParse, DefaultUnparse, 0); } public static ParserTextModel ForSignedBytes(sbyte min, sbyte max) { ParserTextModel parserTextModel = ForSignedBytes(); parserTextModel.ConstraintFn = RangeConstraint(min, max); return parserTextModel; } public static ParserTextModel ForBytes() { return new ParserTextModel(byte.TryParse, DefaultUnparse, 0); } public static ParserTextModel ForBytes(byte min, byte max) { ParserTextModel parserTextModel = ForBytes(); parserTextModel.ConstraintFn = RangeConstraint(min, max); return parserTextModel; } public static ParserTextModel ForShorts() { return new ParserTextModel(short.TryParse, DefaultUnparse, 0); } public static ParserTextModel ForShorts(short min, short max) { ParserTextModel parserTextModel = ForShorts(); parserTextModel.ConstraintFn = RangeConstraint(min, max); return parserTextModel; } public static ParserTextModel ForUnsignedShorts() { return new ParserTextModel(ushort.TryParse, DefaultUnparse, 0); } public static ParserTextModel ForUnsignedShorts(ushort min, ushort max) { ParserTextModel parserTextModel = ForUnsignedShorts(); parserTextModel.ConstraintFn = RangeConstraint(min, max); return parserTextModel; } public static ParserTextModel ForIntegers() { return new ParserTextModel(int.TryParse, DefaultUnparse, 0); } public static ParserTextModel ForIntegers(int min, int max) { ParserTextModel parserTextModel = ForIntegers(); parserTextModel.ConstraintFn = RangeConstraint(min, max); return parserTextModel; } public static ParserTextModel ForUnsignedIntegers() { return new ParserTextModel(uint.TryParse, DefaultUnparse, 0u); } public static ParserTextModel ForUnsignedIntegers(uint min, uint max) { ParserTextModel parserTextModel = ForUnsignedIntegers(); parserTextModel.ConstraintFn = RangeConstraint(min, max); return parserTextModel; } public static ParserTextModel ForLongs() { return new ParserTextModel(long.TryParse, DefaultUnparse, 0L); } public static ParserTextModel ForLongs(long min, long max) { ParserTextModel parserTextModel = ForLongs(); parserTextModel.ConstraintFn = RangeConstraint(min, max); return parserTextModel; } public static ParserTextModel ForUnsignedLongs() { return new ParserTextModel(ulong.TryParse, DefaultUnparse, 0uL); } public static ParserTextModel ForUnsignedLongs(ulong min, ulong max) { ParserTextModel parserTextModel = ForUnsignedLongs(); parserTextModel.ConstraintFn = RangeConstraint(min, max); return parserTextModel; } public static ParserTextModel ForFloats() { return new ParserTextModel(float.TryParse, DefaultUnparse, 0f); } public static ParserTextModel ForFloats(float min, float max) { ParserTextModel parserTextModel = ForFloats(); parserTextModel.ConstraintFn = RangeConstraint(min, max); return parserTextModel; } public static ParserTextModel ForDoubles() { return new ParserTextModel(double.TryParse, DefaultUnparse, 0.0); } public static ParserTextModel ForDoubles(double min, double max) { ParserTextModel parserTextModel = ForDoubles(); parserTextModel.ConstraintFn = RangeConstraint(min, max); return parserTextModel; } private static bool DefaultUnparse(T value, out string text) { text = $"{value}"; return true; } private static Func RangeConstraint(T min, T max) where T : IComparable { return Check; bool Check(T value) { if (Comparer.Default.Compare(value, min) < 0) { return false; } if (Comparer.Default.Compare(value, max) > 0) { return false; } return true; } } public static ParserTextModel ForHexColors() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) return new ParserTextModel(HexParser, HexUnparser, INVALID_COLOR); } private static bool HexParser(string x, out Color c) { //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) if (x.Length != 8 || !x.Substring(6, 2).TryParseHex(out var n)) { n = byte.MaxValue; } if ((x.Length == 6 || x.Length == 8) && x.Substring(0, 2).TryParseHex(out var n2) && x.Substring(2, 2).TryParseHex(out var n3) && x.Substring(4, 2).TryParseHex(out var n4)) { c = Color32.op_Implicit(new Color32(n2, n3, n4, n)); return true; } if (x.Length == 3 && $"{x[0]}{x[0]}".TryParseHex(out n2) && $"{x[1]}{x[1]}".TryParseHex(out n3) && $"{x[2]}{x[2]}".TryParseHex(out n4)) { c = Color32.op_Implicit(new Color32(n2, n3, n4, n)); return true; } c = INVALID_COLOR; return false; } private static bool HexUnparser(Color c, out string x) { //IL_0007: 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) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_004f: 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_006b: Unknown result type (might be due to invalid IL or missing references) if (!Enumerable.Range(0, 3).Any((int i) => ((Color)(ref c))[i] < 0f || 1f < ((Color)(ref c))[i])) { Color32 val = Color32.op_Implicit(c); x = $"{val.r:X2}{val.g:X2}{val.b:X2}{val.a:X2}"; return true; } x = "###"; return false; } } public class ValueModel(T value) : AbstractValueModel() { private T value = value; public override T GetValue() { return value; } public override bool SetValue(T value) { if (EqualityComparer.Default.Equals(this.value, value)) { return true; } this.value = value; InvokeOnValueChanged(); return true; } } } namespace Silksong.ModMenu.Internal { internal static class CollectionsUtil { internal static IEnumerable WhereNonNull(this IEnumerable self) { return self.Where((T t) => t != null); } internal static IEnumerable WhereNonNull(this IEnumerable self, Func predicate) { return self.Where((T t) => t != null && predicate(t)); } internal static bool TryGetMin(this IEnumerable self, [MaybeNullWhen(false)] out T min) where T : IComparable { min = default(T); bool flag = true; foreach (T item in self) { if (flag) { min = item; flag = false; } else if (item.CompareTo(min) <= 0) { min = item; } } return !flag; } internal static IEnumerable MedianOutwards(this IEnumerable self) { IReadOnlyList list = self as IReadOnlyList; if (list == null) { List list2 = new List(); list2.AddRange(self); list = new <>z__ReadOnlyList(list2); } if (list.Count == 0) { yield break; } int num = list.Count / 2; int low = num - 1; int high = num + 1; while (low >= 0 || high < list.Count) { if (low >= 0) { yield return list[low]; low--; } if (high < list.Count) { yield return list[high]; high++; } } } private static IEnumerable<(T, T)> Pairs(this IEnumerable self, bool circular) { IEnumerator iter = self.GetEnumerator(); if (iter.MoveNext()) { T first = iter.Current; bool flag = false; T item = iter.Current; while (iter.MoveNext()) { T next = iter.Current; yield return (item, next); item = next; flag = true; } if (flag && circular) { yield return (item, first); } } } internal static IEnumerable<(T, T)> Pairs(this IEnumerable self) { return self.Pairs(circular: false); } internal static IEnumerable<(T, T)> CircularPairs(this IEnumerable self) { return self.Pairs(circular: true); } internal static IEnumerable> Partition(this IEnumerable self, int size) { if (size < 1) { throw new ArgumentException(string.Format("{0} ({1}) < 1", "size", size)); } IEnumerator iter = self.GetEnumerator(); List next; do { next = new List(); for (int i = 0; i < size; i++) { if (!iter.MoveNext()) { break; } next.Add(iter.Current); } if (next.Count > 0) { yield return next; } } while (next.Count >= size); } } internal class CustomInputField : InputField { private static readonly HashSet navigationCodes = new HashSet { (KeyCode)273, (KeyCode)274, (KeyCode)276, (KeyCode)275 }; private RectTransform? textRect; private readonly Event processingEvent = new Event(); private void Awake() { //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_0046: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_009a: Unknown result type (might be due to invalid IL or missing references) ((Selectable)this).Awake(); textRect = ((Component)((InputField)this).textComponent).gameObject.GetComponent(); ((InputField)this).textComponent.alignment = (TextAnchor)5; RectTransform? obj = textRect; Vector2 anchorMin = textRect.anchorMin; anchorMin.x = 1f; obj.anchorMin = anchorMin; RectTransform? obj2 = textRect; anchorMin = textRect.anchorMax; anchorMin.x = 1f; obj2.anchorMax = anchorMin; RectTransform? obj3 = textRect; anchorMin = textRect.pivot; anchorMin.x = 1f; obj3.pivot = anchorMin; textRect.anchoredPosition = Vector2.zero; } private void Update() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)textRect)) { textRect.sizeDelta = new Vector2(Mathf.Max(200f, ((InputField)this).preferredWidth), 0f); } } private bool AllSelected() { if (((InputField)this).caretPositionInternal == ((InputField)this).text.Length) { return ((InputField)this).caretSelectPositionInternal == 0; } return false; } public override void OnUpdateSelected(BaseEventData eventData) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Invalid comparison between Unknown and I4 //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Invalid comparison between Unknown and I4 //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (!((InputField)this).isFocused) { return; } bool flag = AllSelected(); bool flag2 = false; while (Event.PopEvent(processingEvent)) { if ((int)processingEvent.rawType == 4) { flag2 = true; if (flag && navigationCodes.Contains(processingEvent.keyCode)) { flag2 = false; ((InputField)this).DeactivateInputField(); break; } if ((int)((InputField)this).KeyPressed(processingEvent) == 1) { ((InputField)this).DeactivateInputField(); break; } } if ((int)processingEvent.type <= 14) { string commandName = processingEvent.commandName; if (commandName != null && commandName == "SelectAll") { ((InputField)this).SelectAll(); flag2 = true; } } } if (flag2) { ((InputField)this).UpdateLabel(); } if (!flag) { ((AbstractEventData)eventData).Use(); } } } internal class CustomMappableKey : MenuButton, ISubmitHandler, IEventSystemHandler, IPointerClickHandler, ICancelHandler { private static readonly HashSet unmappableKeys = new HashSet { new KeyBindingSource((Key[])(object)new Key[1] { (Key)13 }), new KeyBindingSource((Key[])(object)new Key[1] { (Key)72 }), new KeyBindingSource((Key[])(object)new Key[1] { (Key)97 }), new KeyBindingSource((Key[])(object)new Key[1] { (Key)7 }), new KeyBindingSource((Key[])(object)new Key[1] { (Key)11 }) }; private bool isListening; private readonly KeyBindingSourceListener listener = new KeyBindingSourceListener(); [CompilerGenerated] private IValueModel? k__BackingField; internal Text? KeymapText { get; private set; } internal Image? KeymapImage { get; private set; } internal IValueModel? KeyCodeModel { get { return k__BackingField; } set { if (k__BackingField != value) { IValueModel? valueModel = k__BackingField; if (valueModel != null) { valueModel.OnValueChanged -= OnKeyCodeChanged; } k__BackingField = value; IValueModel? valueModel2 = k__BackingField; if (valueModel2 != null) { valueModel2.OnValueChanged += OnKeyCodeChanged; } ShowCurrentKeyCode(); } } } private KeyOrMouseBinding CurrentBinding { get { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) int num; if (!isListening) { IValueModel? keyCodeModel = KeyCodeModel; num = (int)KeyCodeUtil.ToKey((KeyCode)((keyCodeModel != null) ? ((int)keyCodeModel.Value) : 0)); } else { num = 0; } return new KeyOrMouseBinding((Key)num); } } private static UIButtonSkins UIButtonSkins => GameManager.instance.ui.uiButtonSkins; internal static CustomMappableKey Replace(MappableKey src) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) AnimationTriggers animationTriggers = ((Selectable)src).animationTriggers; ColorBlock colors = ((Selectable)src).colors; Image keymapSprite = src.keymapSprite; Text keymapText = src.keymapText; Animator leftCursor = ((MenuSelectable)src).leftCursor; VibrationDataAsset menuCancelVibration = ((MenuSelectable)src).menuCancelVibration; VibrationDataAsset menuSubmitVibration = ((MenuSelectable)src).menuSubmitVibration; Animator rightCursor = ((MenuSelectable)src).rightCursor; GameObject gameObject = ((Component)src).gameObject; Object.DestroyImmediate((Object)(object)src); using (gameObject.TempInactive()) { CustomMappableKey customMappableKey = gameObject.AddComponent(); ((Selectable)customMappableKey).animationTriggers = animationTriggers; ((MenuButton)customMappableKey).buttonType = (MenuButtonType)0; ((MenuSelectable)customMappableKey).cancelAction = (CancelAction)0; ((Selectable)customMappableKey).colors = colors; ((MenuSelectable)customMappableKey).DontPlaySelectSound = true; customMappableKey.KeymapImage = keymapSprite; customMappableKey.KeymapText = keymapText; ((MenuSelectable)customMappableKey).leftCursor = leftCursor; ((MenuSelectable)customMappableKey).menuCancelVibration = menuCancelVibration; ((MenuSelectable)customMappableKey).menuSubmitVibration = menuSubmitVibration; ((MenuSelectable)customMappableKey).playSubmitSound = true; ((MenuSelectable)customMappableKey).prevSelectedObject = gameObject; ((MenuSelectable)customMappableKey).rightCursor = rightCursor; ((Selectable)customMappableKey).transition = (Transition)0; ((MenuSelectable)customMappableKey).uiAudioPlayer = UIManager.instance.uiAudioPlayer; return customMappableKey; } } private void OnKeyCodeChanged(KeyCode keyCode) { ShowCurrentKeyCode(); } private void OnDisable() { if (isListening) { AbortRebind(); } ((Selectable)this).OnDisable(); } private void ListenForNewButton() { if (!isListening && !((Object)(object)KeymapText == (Object)null) && !((Object)(object)KeymapImage == (Object)null)) { ((Selectable)this).interactable = false; isListening = true; listener.Reset(); ShowCurrentKeyCode(); } } private static bool GetKey(KeyBindingSource keyBinding, out Key key) { //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_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected I4, but got Unknown List list = new List(); int num = 0; while (true) { int num2 = num; KeyCombo control = keyBinding.Control; if (num2 >= ((KeyCombo)(ref control)).IncludeCount) { break; } control = keyBinding.Control; Key include = ((KeyCombo)(ref control)).GetInclude(num); if ((int)include != 0) { list.Add(include); } num++; } if (list.Count == 1) { key = (Key)(int)list[0]; return true; } key = (Key)0; return false; } private void Update() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0068: 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) if (!isListening) { return; } BindingSource val = listener.Listen(new BindingListenOptions { IncludeKeys = true, IncludeModifiersAsFirstClassKeys = true }, InputManager.ActiveDevice); KeyBindingSource val2 = (KeyBindingSource)(object)((val is KeyBindingSource) ? val : null); if (val2 != null && !unmappableKeys.Contains(val2) && GetKey(val2, out var key)) { isListening = false; ((Selectable)this).interactable = true; IValueModel? keyCodeModel = KeyCodeModel; if (keyCodeModel != null) { keyCodeModel.Value = KeyCodeUtil.ToKeyCode(key); } ShowCurrentKeyCode(); } else if (val != (BindingSource)null) { AbortRebind(); } } public void ShowCurrentKeyCode() { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Invalid comparison between Unknown and I4 //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Invalid comparison between Unknown and I4 //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)KeymapText == (Object)null || (Object)(object)KeymapImage == (Object)null) { return; } UIButtonSkins uIButtonSkins = UIButtonSkins; if (isListening) { KeymapImage.sprite = UIButtonSkins.blankKey; KeymapText.text = Language.Get("KEYBOARD_PRESSKEY", "MainMenu"); KeymapText.fontSize = 46; KeymapText.alignment = (TextAnchor)5; KeymapText.horizontalOverflow = (HorizontalWrapMode)1; ((Component)KeymapText).GetComponent().AlignText(); return; } if (KeyOrMouseBinding.IsNone(CurrentBinding)) { KeymapImage.sprite = uIButtonSkins.blankKey; KeymapText.text = Language.Get("KEYBOARD_UNMAPPED", "MainMenu"); KeymapText.fontSize = 46; KeymapText.alignment = (TextAnchor)5; KeymapText.resizeTextForBestFit = false; KeymapText.horizontalOverflow = (HorizontalWrapMode)1; ((Component)KeymapText).GetComponent().AlignText(); return; } ButtonSkin buttonSkinFor = uIButtonSkins.GetButtonSkinFor(((object)CurrentBinding/*cast due to .constrained prefix*/).ToString()); KeymapImage.sprite = (((Object)(object)buttonSkinFor.sprite != (Object)null) ? buttonSkinFor.sprite : uIButtonSkins.blankKey); KeymapText.text = buttonSkinFor.symbol; if ((int)buttonSkinFor.skinType == 1) { KeymapText.fontSize = 46; KeymapText.alignment = (TextAnchor)4; ((Graphic)KeymapText).rectTransform.anchoredPosition = new Vector2(32f, ((Graphic)KeymapText).rectTransform.anchoredPosition.y); ((Graphic)KeymapText).rectTransform.SetSizeWithCurrentAnchors((Axis)0, 65f); KeymapText.resizeTextForBestFit = true; KeymapText.resizeTextMinSize = 20; KeymapText.resizeTextMaxSize = 46; KeymapText.horizontalOverflow = (HorizontalWrapMode)0; } else if ((int)buttonSkinFor.skinType == 2) { KeymapText.fontSize = 40; KeymapText.alignment = (TextAnchor)4; ((Graphic)KeymapText).rectTransform.anchoredPosition = new Vector2(4f, ((Graphic)KeymapText).rectTransform.anchoredPosition.y); ((Graphic)KeymapText).rectTransform.SetSizeWithCurrentAnchors((Axis)0, 137f); KeymapText.resizeTextForBestFit = false; KeymapText.horizontalOverflow = (HorizontalWrapMode)0; } else { KeymapText.alignment = uIButtonSkins.labelAlignment; } ((Component)KeymapText).GetComponent().AlignTextKeymap(); } internal void AbortRebind() { if (isListening && !((Object)(object)KeymapText == (Object)null) && !((Object)(object)KeymapImage == (Object)null)) { ((Selectable)this).interactable = true; isListening = false; ShowCurrentKeyCode(); } } public void OnSubmit(BaseEventData eventData) { ListenForNewButton(); } public void OnPointerClick(PointerEventData eventData) { ListenForNewButton(); } public void OnCancel(BaseEventData eventData) { if (isListening) { AbortRebind(); } else { ((MenuSelectable)this).OnCancel(eventData); } } } [MonoDetourTargets(typeof(MenuOptionHorizontal), GenerateControlFlowVariants = true)] [RequireComponent(typeof(MenuOptionHorizontal))] internal class CustomMenuOptionHorizontal : MonoBehaviour { private MenuOptionHorizontal? orig; internal IBaseChoiceModel? Model; private void Awake() { orig = ((Component)this).GetComponent(); UpdateText(); } internal void UpdateText() { if (!((Object)(object)orig == (Object)null)) { LocalizedTextExtensions.set_LocalizedText(orig.optionText, Model?.DisplayString() ?? ((LocalizedText)"???")); FixVerticalAlign val = default(FixVerticalAlign); if (((Component)orig.optionText).TryGetComponent(ref val)) { val.AlignText(); } } } private bool MoveOption(MoveDirection dir) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Invalid comparison between Unknown and I4 if (Model == null) { return false; } if ((int)dir != 0) { if ((int)dir != 2) { return false; } if (!Model.MoveRight()) { return false; } } else if (!Model.MoveLeft()) { return false; } if ((Object)(object)orig != (Object)null && (Object)(object)((MenuSelectable)orig).uiAudioPlayer != (Object)null) { ((MenuSelectable)orig).uiAudioPlayer.PlaySlider(); } return true; } private static ReturnFlow OverrideMoveOption(MenuOptionHorizontal self, ref MoveDirection dir, ref bool returnValue) { CustomMenuOptionHorizontal customMenuOptionHorizontal = default(CustomMenuOptionHorizontal); if (((Component)self).TryGetComponent(ref customMenuOptionHorizontal)) { returnValue = customMenuOptionHorizontal.MoveOption(dir); return (ReturnFlow)1; } return (ReturnFlow)0; } private static ReturnFlow OverrideUpdateText(MenuOptionHorizontal self) { CustomMenuOptionHorizontal customMenuOptionHorizontal = default(CustomMenuOptionHorizontal); if (((Component)self).TryGetComponent(ref customMenuOptionHorizontal)) { customMenuOptionHorizontal.UpdateText(); return (ReturnFlow)1; } return (ReturnFlow)0; } [MonoDetourHookInitialize] private static void Hook() { Md.UnityEngine.UI.MenuOptionHorizontal.MoveOption.ControlFlowPrefix(OverrideMoveOption); Md.UnityEngine.UI.MenuOptionHorizontal.UpdateText.ControlFlowPrefix(OverrideUpdateText); } } internal class CustomScrollRect : ScrollRect { public override void OnScroll(PointerEventData data) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_0026: Unknown result type (might be due to invalid IL or missing references) if (((ScrollRect)this).horizontal) { if (((ScrollRect)this).vertical) { data.scrollDelta *= new Vector2(-1f, 1f); } else { data.scrollDelta *= -1f; } } ((ScrollRect)this).OnScroll(data); } } internal static class EnumUtil { private static readonly Dictionary> enumStrings = new Dictionary>(); internal static ReadOnlyDictionary StringsForType(Type enumType) { if (!enumType.IsEnum) { throw new ArgumentException(enumType.Name + " is not an Enumeration"); } if (enumStrings.TryGetValue(enumType, out ReadOnlyDictionary value)) { return value; } Dictionary> dictionary = new Dictionary>(); FieldInfo[] fields = enumType.GetFields(BindingFlags.Static | BindingFlags.Public); foreach (FieldInfo fieldInfo in fields) { object rawConstantValue = fieldInfo.GetRawConstantValue(); if (dictionary.TryGetValue(rawConstantValue, out var value2)) { value2.Add(fieldInfo); continue; } dictionary.Add(rawConstantValue, new List(1) { fieldInfo }); } Dictionary dictionary2 = new Dictionary(); foreach (object enumValue in enumType.GetEnumValues()) { object key = Convert.ChangeType(enumValue, enumType.GetEnumUnderlyingType()); if (!dictionary.TryGetValue(key, out var value3)) { continue; } string text = null; string text2 = null; foreach (FieldInfo item in value3) { if (!item.IgnoreForModMenu()) { if (text2 == null) { text2 = item.GetCustomAttribute()?.CustomName; } if (text2 == null && text == null) { text = item.Name.UnCamelCase(); } } } if (text2 != null || text != null) { dictionary2[enumValue] = text2 ?? text; } } ReadOnlyDictionary readOnlyDictionary = new ReadOnlyDictionary(dictionary2); enumStrings.Add(enumType, readOnlyDictionary); return readOnlyDictionary; } internal static ArgumentException UnsupportedEnum(this T self) where T : Enum { return new ArgumentException($"Unsupported: {self}"); } } internal static class EventTriggerUtil { internal static void SetCallback(this EventTrigger self, Action callback) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown TriggerEvent val = new TriggerEvent(); ((UnityEvent)(object)val).AddListener((UnityAction)delegate { ExceptionUtil.Try(callback, "Button callback failed"); }); foreach (Entry trigger in self.triggers) { trigger.callback = val; } } internal static void SetCallback(this Slider self, Action callback) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown SliderEvent val = new SliderEvent(); ((UnityEvent)(object)val).AddListener((UnityAction)delegate(float v) { ExceptionUtil.Try(delegate { callback(v); }, "Slider callback failed"); }); self.onValueChanged = val; } } internal static class ExceptionUtil { internal static bool Try(Action cb, string header) { try { cb(); return true; } catch (Exception arg) { ModMenuPlugin.LogError($"{header}: {arg}"); return false; } } } internal static class GameObjectUtil { private class InactiveScope : IDisposable { private readonly bool prevActiveSelf; private readonly GameObject gameObject; internal InactiveScope(GameObject gameObject) { prevActiveSelf = gameObject.activeSelf; this.gameObject = gameObject; gameObject.SetActive(false); } public void Dispose() { gameObject.SetActive(prevActiveSelf); } } [SpecialName] public sealed class $5E80EE1F91F68F4C0C8D9D82C38C5E67 { [SpecialName] public static class $1A1AFF2B09359573B832DD8E22F4371A { } [ExtensionMarker("$1A1AFF2B09359573B832DD8E22F4371A")] internal RectTransform RectTransform { [ExtensionMarker("$1A1AFF2B09359573B832DD8E22F4371A")] get { throw new NotSupportedException(); } } [ExtensionMarker("$1A1AFF2B09359573B832DD8E22F4371A")] internal void DestroyAllChildren() { throw new NotSupportedException(); } } internal static void DestroyAllChildren(this GameObject self) { for (int num = self.transform.childCount - 1; num >= 0; num--) { GameObject gameObject = ((Component)self.transform.GetChild(num)).gameObject; gameObject.transform.SetParent((Transform)null); Object.Destroy((Object)(object)gameObject); } } internal static RectTransform get_RectTransform(GameObject self) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return (RectTransform)self.transform; } internal static IDisposable TempInactive(this GameObject self) { return new InactiveScope(self); } } internal static class IEnumeratorUtil { internal static IEnumerator WithContext(this IEnumerator self, T context) where T : class { return Modified(); IEnumerator Modified() { while (true) { bool flag = false; object obj = null; using (ThreadLocalContext.Set(context)) { flag = self.MoveNext(); if (flag) { obj = self.Current; } } if (!flag) { break; } yield return obj; } } } internal static IEnumerator PropagateContext(this IEnumerator self) where T : class { if (!ThreadLocalContext.Get(out var value)) { return self; } return self.WithContext(value); } internal static IEnumerator Append(this IEnumerator self, Action action) { return Modified(); IEnumerator Modified() { while (self.MoveNext()) { yield return self.Current; } action(); } } } internal class IndexedList : IList, ICollection, IEnumerable, IEnumerable { private readonly List list = new List(); private readonly Dictionary lookup = new Dictionary(); public T this[int index] { get { return list[index]; } set { if (index < 0 || index >= list.Count) { throw new IndexOutOfRangeException($"{index} (Count: {list.Count})"); } if (lookup.TryGetValue(value, out var value2)) { if (value2 != index) { throw new ArgumentException("Item already elsewhere in list"); } } else { lookup.Remove(list[index]); list[index] = value; lookup[value] = index; } } } public int Count => list.Count; public bool IsReadOnly => false; public void Add(T item) { if (lookup.ContainsKey(item)) { throw new ArgumentException("Item already exists"); } list.Add(item); lookup[item] = list.Count - 1; } public void Clear() { list.Clear(); lookup.Clear(); } public bool Contains(T item) { return lookup.ContainsKey(item); } public void CopyTo(T[] array, int arrayIndex) { list.CopyTo(array, arrayIndex); } public IEnumerator GetEnumerator() { return list.GetEnumerator(); } public int IndexOf(T item) { if (!lookup.TryGetValue(item, out var value)) { return -1; } return value; } public void Insert(int index, T item) { if (lookup.TryGetValue(item, out var value)) { if (index != value) { throw new ArgumentException("Item already exists"); } } else { list.Insert(index, item); UpdateIndex(index); } } public bool Remove(T item) { if (!lookup.TryGetValue(item, out var value)) { return false; } RemoveAt(value); return true; } public void RemoveAt(int index) { TryRemoveAt(index, out var _); } public bool TryRemoveAt(int index, [MaybeNullWhen(false)] out T item) { item = default(T); if (index < 0 || index >= list.Count) { return false; } item = list[index]; list.RemoveAt(index); lookup.Remove(item); UpdateIndex(index); return true; } IEnumerator IEnumerable.GetEnumerator() { return list.GetEnumerator(); } private void UpdateIndex(int from) { for (int i = from; i < list.Count; i++) { lookup[list[i]] = i; } } } internal static class KeyCodeUtil { internal static KeyCode ToKeyCode(Key key) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Expected I4, but got Unknown //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_0404: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_0424: Unknown result type (might be due to invalid IL or missing references) //IL_042c: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_044c: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0473: Unknown result type (might be due to invalid IL or missing references) //IL_047b: Unknown result type (might be due to invalid IL or missing references) //IL_0483: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_0493: Unknown result type (might be due to invalid IL or missing references) //IL_049b: Unknown result type (might be due to invalid IL or missing references) //IL_04a3: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_04c3: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_04d6: Unknown result type (might be due to invalid IL or missing references) //IL_04e1: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: Unknown result type (might be due to invalid IL or missing references) //IL_04f7: Unknown result type (might be due to invalid IL or missing references) //IL_0502: Unknown result type (might be due to invalid IL or missing references) //IL_050d: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_0523: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0539: Unknown result type (might be due to invalid IL or missing references) //IL_0544: Unknown result type (might be due to invalid IL or missing references) //IL_054f: Unknown result type (might be due to invalid IL or missing references) //IL_055a: Unknown result type (might be due to invalid IL or missing references) //IL_0565: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Unknown result type (might be due to invalid IL or missing references) //IL_057b: Unknown result type (might be due to invalid IL or missing references) //IL_0586: Unknown result type (might be due to invalid IL or missing references) //IL_0591: Unknown result type (might be due to invalid IL or missing references) //IL_059c: Unknown result type (might be due to invalid IL or missing references) //IL_05a7: Unknown result type (might be due to invalid IL or missing references) //IL_05b2: Unknown result type (might be due to invalid IL or missing references) //IL_05bd: Unknown result type (might be due to invalid IL or missing references) //IL_05c8: Unknown result type (might be due to invalid IL or missing references) //IL_05d3: Unknown result type (might be due to invalid IL or missing references) //IL_05de: Unknown result type (might be due to invalid IL or missing references) //IL_05e9: Unknown result type (might be due to invalid IL or missing references) //IL_05f1: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_0607: Unknown result type (might be due to invalid IL or missing references) //IL_0612: Unknown result type (might be due to invalid IL or missing references) //IL_061d: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_062d: Unknown result type (might be due to invalid IL or missing references) //IL_0632: Unknown result type (might be due to invalid IL or missing references) //IL_0637: Unknown result type (might be due to invalid IL or missing references) //IL_063c: Unknown result type (might be due to invalid IL or missing references) //IL_0641: Unknown result type (might be due to invalid IL or missing references) //IL_0646: Unknown result type (might be due to invalid IL or missing references) //IL_064b: Unknown result type (might be due to invalid IL or missing references) //IL_0650: Unknown result type (might be due to invalid IL or missing references) //IL_0655: Unknown result type (might be due to invalid IL or missing references) //IL_065a: Unknown result type (might be due to invalid IL or missing references) //IL_065f: Unknown result type (might be due to invalid IL or missing references) //IL_0664: Unknown result type (might be due to invalid IL or missing references) //IL_0669: Unknown result type (might be due to invalid IL or missing references) //IL_066e: Unknown result type (might be due to invalid IL or missing references) //IL_0673: Unknown result type (might be due to invalid IL or missing references) //IL_0678: Unknown result type (might be due to invalid IL or missing references) //IL_067d: Unknown result type (might be due to invalid IL or missing references) //IL_0682: 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_0691: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_069a: Unknown result type (might be due to invalid IL or missing references) return (KeyCode)((int)key switch { 0 => 0, 1 => 304, 2 => 308, 3 => 310, 4 => 306, 5 => 304, 6 => 308, 7 => 310, 8 => 306, 9 => 303, 10 => 307, 11 => 309, 12 => 305, 13 => 27, 14 => 282, 15 => 283, 16 => 284, 17 => 285, 18 => 286, 19 => 287, 20 => 288, 21 => 289, 22 => 290, 23 => 291, 24 => 292, 25 => 293, 26 => 48, 27 => 49, 28 => 50, 29 => 51, 30 => 52, 31 => 53, 32 => 54, 33 => 55, 34 => 56, 35 => 57, 36 => 97, 37 => 98, 38 => 99, 39 => 100, 40 => 101, 41 => 102, 42 => 103, 43 => 104, 44 => 105, 45 => 106, 46 => 107, 47 => 108, 48 => 109, 49 => 110, 50 => 111, 51 => 112, 52 => 113, 53 => 114, 54 => 115, 55 => 116, 56 => 117, 57 => 118, 58 => 119, 59 => 120, 60 => 121, 61 => 122, 62 => 96, 63 => 45, 64 => 61, 65 => 8, 66 => 9, 67 => 91, 68 => 93, 69 => 92, 70 => 59, 71 => 39, 72 => 13, 73 => 44, 74 => 46, 75 => 47, 76 => 32, 77 => 277, 78 => 127, 79 => 278, 80 => 279, 81 => 280, 82 => 281, 83 => 276, 84 => 275, 85 => 273, 86 => 274, 87 => 256, 88 => 257, 89 => 258, 90 => 259, 91 => 260, 92 => 261, 93 => 262, 94 => 263, 95 => 264, 96 => 265, 97 => 300, 98 => 267, 99 => 268, 100 => 269, 101 => 270, 102 => 271, 103 => 266, 104 => 12, 105 => 272, 106 => 294, 107 => 295, 108 => 296, 109 => 313, 110 => 301, 111 => 33, 112 => 126, 113 => 64, 114 => 35, 115 => 36, 116 => 37, 117 => 94, 118 => 38, 119 => 42, 120 => 40, 121 => 41, 122 => 95, 123 => 43, 124 => 123, 125 => 125, 126 => 124, 127 => 58, 128 => 34, 129 => 60, 130 => 62, 131 => 63, _ => 0, }); } internal static Key ToKey(KeyCode keyCode) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_07fe: Expected I4, but got Unknown //IL_0834: Unknown result type (might be due to invalid IL or missing references) //IL_1184: Unknown result type (might be due to invalid IL or missing references) //IL_083c: Unknown result type (might be due to invalid IL or missing references) //IL_084c: Unknown result type (might be due to invalid IL or missing references) //IL_0854: Unknown result type (might be due to invalid IL or missing references) //IL_085c: Unknown result type (might be due to invalid IL or missing references) //IL_0863: Unknown result type (might be due to invalid IL or missing references) //IL_086b: Unknown result type (might be due to invalid IL or missing references) //IL_0873: Unknown result type (might be due to invalid IL or missing references) //IL_0a13: Unknown result type (might be due to invalid IL or missing references) //IL_0a1e: Unknown result type (might be due to invalid IL or missing references) //IL_0a26: Unknown result type (might be due to invalid IL or missing references) //IL_0a2e: Unknown result type (might be due to invalid IL or missing references) //IL_0a36: Unknown result type (might be due to invalid IL or missing references) //IL_0a3e: Unknown result type (might be due to invalid IL or missing references) //IL_0a46: Unknown result type (might be due to invalid IL or missing references) //IL_0a4e: Unknown result type (might be due to invalid IL or missing references) //IL_0a56: Unknown result type (might be due to invalid IL or missing references) //IL_0a5e: Unknown result type (might be due to invalid IL or missing references) //IL_0a66: Unknown result type (might be due to invalid IL or missing references) //IL_0a6e: Unknown result type (might be due to invalid IL or missing references) //IL_0a76: Unknown result type (might be due to invalid IL or missing references) //IL_0a7e: Unknown result type (might be due to invalid IL or missing references) //IL_0a86: Unknown result type (might be due to invalid IL or missing references) //IL_09c3: Unknown result type (might be due to invalid IL or missing references) //IL_09cb: Unknown result type (might be due to invalid IL or missing references) //IL_09d3: Unknown result type (might be due to invalid IL or missing references) //IL_09db: Unknown result type (might be due to invalid IL or missing references) //IL_09e3: Unknown result type (might be due to invalid IL or missing references) //IL_09eb: Unknown result type (might be due to invalid IL or missing references) //IL_09f3: Unknown result type (might be due to invalid IL or missing references) //IL_09fb: Unknown result type (might be due to invalid IL or missing references) //IL_0a03: Unknown result type (might be due to invalid IL or missing references) //IL_0a0b: Unknown result type (might be due to invalid IL or missing references) //IL_0a8e: Unknown result type (might be due to invalid IL or missing references) //IL_0a96: Unknown result type (might be due to invalid IL or missing references) //IL_0aa1: Unknown result type (might be due to invalid IL or missing references) //IL_0aa9: Unknown result type (might be due to invalid IL or missing references) //IL_0ab4: Unknown result type (might be due to invalid IL or missing references) //IL_0abf: Unknown result type (might be due to invalid IL or missing references) //IL_0ac7: Unknown result type (might be due to invalid IL or missing references) //IL_0acf: Unknown result type (might be due to invalid IL or missing references) //IL_0ad7: Unknown result type (might be due to invalid IL or missing references) //IL_0adf: Unknown result type (might be due to invalid IL or missing references) //IL_0ae7: Unknown result type (might be due to invalid IL or missing references) //IL_0aef: Unknown result type (might be due to invalid IL or missing references) //IL_0af7: Unknown result type (might be due to invalid IL or missing references) //IL_0aff: Unknown result type (might be due to invalid IL or missing references) //IL_0b07: Unknown result type (might be due to invalid IL or missing references) //IL_0b0f: Unknown result type (might be due to invalid IL or missing references) //IL_0b17: Unknown result type (might be due to invalid IL or missing references) //IL_0b1f: Unknown result type (might be due to invalid IL or missing references) //IL_0b27: Unknown result type (might be due to invalid IL or missing references) //IL_0b2f: Unknown result type (might be due to invalid IL or missing references) //IL_0b37: Unknown result type (might be due to invalid IL or missing references) //IL_0b3f: Unknown result type (might be due to invalid IL or missing references) //IL_0b47: Unknown result type (might be due to invalid IL or missing references) //IL_0b4f: Unknown result type (might be due to invalid IL or missing references) //IL_0b57: Unknown result type (might be due to invalid IL or missing references) //IL_0b5f: Unknown result type (might be due to invalid IL or missing references) //IL_0b67: Unknown result type (might be due to invalid IL or missing references) //IL_0b6f: Unknown result type (might be due to invalid IL or missing references) //IL_0b77: Unknown result type (might be due to invalid IL or missing references) //IL_0b7f: Unknown result type (might be due to invalid IL or missing references) //IL_0b87: Unknown result type (might be due to invalid IL or missing references) //IL_0b8f: Unknown result type (might be due to invalid IL or missing references) //IL_0b97: Unknown result type (might be due to invalid IL or missing references) //IL_0b9f: Unknown result type (might be due to invalid IL or missing references) //IL_0ba7: Unknown result type (might be due to invalid IL or missing references) //IL_0baf: Unknown result type (might be due to invalid IL or missing references) //IL_0bb7: Unknown result type (might be due to invalid IL or missing references) //IL_0bbf: Unknown result type (might be due to invalid IL or missing references) //IL_0bc7: Unknown result type (might be due to invalid IL or missing references) //IL_0bcf: Unknown result type (might be due to invalid IL or missing references) //IL_0bd7: Unknown result type (might be due to invalid IL or missing references) //IL_0bdf: Unknown result type (might be due to invalid IL or missing references) //IL_0be7: Unknown result type (might be due to invalid IL or missing references) //IL_0844: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0883: Unknown result type (might be due to invalid IL or missing references) //IL_088b: Unknown result type (might be due to invalid IL or missing references) //IL_0893: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a3: Unknown result type (might be due to invalid IL or missing references) //IL_08ab: Unknown result type (might be due to invalid IL or missing references) //IL_08b3: Unknown result type (might be due to invalid IL or missing references) //IL_08bb: Unknown result type (might be due to invalid IL or missing references) //IL_08c3: Unknown result type (might be due to invalid IL or missing references) //IL_08cb: Unknown result type (might be due to invalid IL or missing references) //IL_08d3: Unknown result type (might be due to invalid IL or missing references) //IL_08db: Unknown result type (might be due to invalid IL or missing references) //IL_08e3: Unknown result type (might be due to invalid IL or missing references) //IL_08eb: Unknown result type (might be due to invalid IL or missing references) //IL_08f3: Unknown result type (might be due to invalid IL or missing references) //IL_08fb: Unknown result type (might be due to invalid IL or missing references) //IL_0903: Unknown result type (might be due to invalid IL or missing references) //IL_090b: Unknown result type (might be due to invalid IL or missing references) //IL_0913: Unknown result type (might be due to invalid IL or missing references) //IL_091b: Unknown result type (might be due to invalid IL or missing references) //IL_0923: Unknown result type (might be due to invalid IL or missing references) //IL_092b: Unknown result type (might be due to invalid IL or missing references) //IL_0933: Unknown result type (might be due to invalid IL or missing references) //IL_093b: Unknown result type (might be due to invalid IL or missing references) //IL_0943: Unknown result type (might be due to invalid IL or missing references) //IL_094b: Unknown result type (might be due to invalid IL or missing references) //IL_0953: Unknown result type (might be due to invalid IL or missing references) //IL_095b: Unknown result type (might be due to invalid IL or missing references) //IL_0963: Unknown result type (might be due to invalid IL or missing references) //IL_096b: Unknown result type (might be due to invalid IL or missing references) //IL_0973: Unknown result type (might be due to invalid IL or missing references) //IL_097b: Unknown result type (might be due to invalid IL or missing references) //IL_0983: Unknown result type (might be due to invalid IL or missing references) //IL_098b: Unknown result type (might be due to invalid IL or missing references) //IL_0993: Unknown result type (might be due to invalid IL or missing references) //IL_099b: Unknown result type (might be due to invalid IL or missing references) //IL_09a3: Unknown result type (might be due to invalid IL or missing references) //IL_09ab: Unknown result type (might be due to invalid IL or missing references) //IL_09b3: Unknown result type (might be due to invalid IL or missing references) //IL_09bb: Unknown result type (might be due to invalid IL or missing references) //IL_0bef: Unknown result type (might be due to invalid IL or missing references) //IL_0bf7: Unknown result type (might be due to invalid IL or missing references) //IL_0bfe: Unknown result type (might be due to invalid IL or missing references) //IL_0c06: Unknown result type (might be due to invalid IL or missing references) //IL_0c0d: Unknown result type (might be due to invalid IL or missing references) //IL_0c15: Unknown result type (might be due to invalid IL or missing references) //IL_0c1c: Unknown result type (might be due to invalid IL or missing references) //IL_0c24: Unknown result type (might be due to invalid IL or missing references) //IL_0c2b: Unknown result type (might be due to invalid IL or missing references) //IL_0c40: Unknown result type (might be due to invalid IL or missing references) //IL_0c32: Unknown result type (might be due to invalid IL or missing references) //IL_0c39: Unknown result type (might be due to invalid IL or missing references) //IL_0c48: Unknown result type (might be due to invalid IL or missing references) //IL_0c50: Unknown result type (might be due to invalid IL or missing references) //IL_0c57: Unknown result type (might be due to invalid IL or missing references) //IL_0c5e: Unknown result type (might be due to invalid IL or missing references) //IL_0c65: Unknown result type (might be due to invalid IL or missing references) //IL_0c6c: Unknown result type (might be due to invalid IL or missing references) //IL_0c73: Unknown result type (might be due to invalid IL or missing references) //IL_0c7a: Unknown result type (might be due to invalid IL or missing references) //IL_0c81: Unknown result type (might be due to invalid IL or missing references) //IL_0cc7: Unknown result type (might be due to invalid IL or missing references) //IL_0cce: Unknown result type (might be due to invalid IL or missing references) //IL_0cd5: Unknown result type (might be due to invalid IL or missing references) //IL_0cdc: Unknown result type (might be due to invalid IL or missing references) //IL_0ce3: Unknown result type (might be due to invalid IL or missing references) //IL_0cea: Unknown result type (might be due to invalid IL or missing references) //IL_0cf1: Unknown result type (might be due to invalid IL or missing references) //IL_0cf8: Unknown result type (might be due to invalid IL or missing references) //IL_0cff: Unknown result type (might be due to invalid IL or missing references) //IL_0d06: Unknown result type (might be due to invalid IL or missing references) //IL_0d0d: Unknown result type (might be due to invalid IL or missing references) //IL_0d14: Unknown result type (might be due to invalid IL or missing references) //IL_0d1b: Unknown result type (might be due to invalid IL or missing references) //IL_0d22: Unknown result type (might be due to invalid IL or missing references) //IL_0d29: Unknown result type (might be due to invalid IL or missing references) //IL_0d30: Unknown result type (might be due to invalid IL or missing references) //IL_0d37: Unknown result type (might be due to invalid IL or missing references) //IL_0d3e: Unknown result type (might be due to invalid IL or missing references) //IL_0d45: Unknown result type (might be due to invalid IL or missing references) //IL_0d4c: Unknown result type (might be due to invalid IL or missing references) //IL_0d53: Unknown result type (might be due to invalid IL or missing references) //IL_0d5a: Unknown result type (might be due to invalid IL or missing references) //IL_0d61: Unknown result type (might be due to invalid IL or missing references) //IL_0d68: Unknown result type (might be due to invalid IL or missing references) //IL_0d6f: Unknown result type (might be due to invalid IL or missing references) //IL_0d76: Unknown result type (might be due to invalid IL or missing references) //IL_0d7d: Unknown result type (might be due to invalid IL or missing references) //IL_0d84: Unknown result type (might be due to invalid IL or missing references) //IL_0d8b: Unknown result type (might be due to invalid IL or missing references) //IL_0d92: Unknown result type (might be due to invalid IL or missing references) //IL_0d99: Unknown result type (might be due to invalid IL or missing references) //IL_0da0: Unknown result type (might be due to invalid IL or missing references) //IL_0da7: Unknown result type (might be due to invalid IL or missing references) //IL_0dae: Unknown result type (might be due to invalid IL or missing references) //IL_0db5: Unknown result type (might be due to invalid IL or missing references) //IL_0dbc: Unknown result type (might be due to invalid IL or missing references) //IL_0dc3: Unknown result type (might be due to invalid IL or missing references) //IL_0dca: Unknown result type (might be due to invalid IL or missing references) //IL_0dd1: Unknown result type (might be due to invalid IL or missing references) //IL_0dd8: Unknown result type (might be due to invalid IL or missing references) //IL_0ddf: Unknown result type (might be due to invalid IL or missing references) //IL_0de6: Unknown result type (might be due to invalid IL or missing references) //IL_0ded: Unknown result type (might be due to invalid IL or missing references) //IL_0df4: Unknown result type (might be due to invalid IL or missing references) //IL_0dfb: Unknown result type (might be due to invalid IL or missing references) //IL_0e02: Unknown result type (might be due to invalid IL or missing references) //IL_0e09: Unknown result type (might be due to invalid IL or missing references) //IL_0e10: Unknown result type (might be due to invalid IL or missing references) //IL_0e17: Unknown result type (might be due to invalid IL or missing references) //IL_0e1e: Unknown result type (might be due to invalid IL or missing references) //IL_0e25: Unknown result type (might be due to invalid IL or missing references) //IL_0e2c: Unknown result type (might be due to invalid IL or missing references) //IL_0e33: Unknown result type (might be due to invalid IL or missing references) //IL_0e3a: Unknown result type (might be due to invalid IL or missing references) //IL_0e41: Unknown result type (might be due to invalid IL or missing references) //IL_0e48: Unknown result type (might be due to invalid IL or missing references) //IL_0e4f: Unknown result type (might be due to invalid IL or missing references) //IL_0e56: Unknown result type (might be due to invalid IL or missing references) //IL_0e5d: Unknown result type (might be due to invalid IL or missing references) //IL_0e64: Unknown result type (might be due to invalid IL or missing references) //IL_0e6b: Unknown result type (might be due to invalid IL or missing references) //IL_0e72: Unknown result type (might be due to invalid IL or missing references) //IL_0e79: Unknown result type (might be due to invalid IL or missing references) //IL_0e80: Unknown result type (might be due to invalid IL or missing references) //IL_0e87: Unknown result type (might be due to invalid IL or missing references) //IL_0e8e: Unknown result type (might be due to invalid IL or missing references) //IL_0e95: Unknown result type (might be due to invalid IL or missing references) //IL_0e9c: Unknown result type (might be due to invalid IL or missing references) //IL_0ea3: Unknown result type (might be due to invalid IL or missing references) //IL_0eaa: Unknown result type (might be due to invalid IL or missing references) //IL_0eb1: Unknown result type (might be due to invalid IL or missing references) //IL_0eb8: Unknown result type (might be due to invalid IL or missing references) //IL_0ebf: Unknown result type (might be due to invalid IL or missing references) //IL_0ec6: Unknown result type (might be due to invalid IL or missing references) //IL_0ecd: Unknown result type (might be due to invalid IL or missing references) //IL_0ed4: Unknown result type (might be due to invalid IL or missing references) //IL_0edb: Unknown result type (might be due to invalid IL or missing references) //IL_0ee2: Unknown result type (might be due to invalid IL or missing references) //IL_0ee9: Unknown result type (might be due to invalid IL or missing references) //IL_0ef0: Unknown result type (might be due to invalid IL or missing references) //IL_0ef7: Unknown result type (might be due to invalid IL or missing references) //IL_0efe: Unknown result type (might be due to invalid IL or missing references) //IL_0f05: Unknown result type (might be due to invalid IL or missing references) //IL_0f0c: Unknown result type (might be due to invalid IL or missing references) //IL_0f13: Unknown result type (might be due to invalid IL or missing references) //IL_0f1a: Unknown result type (might be due to invalid IL or missing references) //IL_0f21: Unknown result type (might be due to invalid IL or missing references) //IL_0f28: Unknown result type (might be due to invalid IL or missing references) //IL_0f2f: Unknown result type (might be due to invalid IL or missing references) //IL_0f36: Unknown result type (might be due to invalid IL or missing references) //IL_0f3d: Unknown result type (might be due to invalid IL or missing references) //IL_0f44: Unknown result type (might be due to invalid IL or missing references) //IL_0f4b: Unknown result type (might be due to invalid IL or missing references) //IL_0f52: Unknown result type (might be due to invalid IL or missing references) //IL_0f59: Unknown result type (might be due to invalid IL or missing references) //IL_0f60: Unknown result type (might be due to invalid IL or missing references) //IL_0f67: Unknown result type (might be due to invalid IL or missing references) //IL_0f6e: Unknown result type (might be due to invalid IL or missing references) //IL_0f75: Unknown result type (might be due to invalid IL or missing references) //IL_0f7c: Unknown result type (might be due to invalid IL or missing references) //IL_0f83: Unknown result type (might be due to invalid IL or missing references) //IL_0f8a: Unknown result type (might be due to invalid IL or missing references) //IL_0f91: Unknown result type (might be due to invalid IL or missing references) //IL_0f98: Unknown result type (might be due to invalid IL or missing references) //IL_0f9f: Unknown result type (might be due to invalid IL or missing references) //IL_0fa6: Unknown result type (might be due to invalid IL or missing references) //IL_0fad: Unknown result type (might be due to invalid IL or missing references) //IL_0fb4: Unknown result type (might be due to invalid IL or missing references) //IL_0fbb: Unknown result type (might be due to invalid IL or missing references) //IL_0fc2: Unknown result type (might be due to invalid IL or missing references) //IL_0fc9: Unknown result type (might be due to invalid IL or missing references) //IL_0fd0: Unknown result type (might be due to invalid IL or missing references) //IL_0fd7: Unknown result type (might be due to invalid IL or missing references) //IL_0fde: Unknown result type (might be due to invalid IL or missing references) //IL_0fe5: Unknown result type (might be due to invalid IL or missing references) //IL_0fec: Unknown result type (might be due to invalid IL or missing references) //IL_0ff3: Unknown result type (might be due to invalid IL or missing references) //IL_0ffa: Unknown result type (might be due to invalid IL or missing references) //IL_1001: Unknown result type (might be due to invalid IL or missing references) //IL_1008: Unknown result type (might be due to invalid IL or missing references) //IL_100f: Unknown result type (might be due to invalid IL or missing references) //IL_1016: Unknown result type (might be due to invalid IL or missing references) //IL_101d: Unknown result type (might be due to invalid IL or missing references) //IL_1024: Unknown result type (might be due to invalid IL or missing references) //IL_102b: Unknown result type (might be due to invalid IL or missing references) //IL_1032: Unknown result type (might be due to invalid IL or missing references) //IL_1039: Unknown result type (might be due to invalid IL or missing references) //IL_1040: Unknown result type (might be due to invalid IL or missing references) //IL_1047: Unknown result type (might be due to invalid IL or missing references) //IL_104e: Unknown result type (might be due to invalid IL or missing references) //IL_1055: Unknown result type (might be due to invalid IL or missing references) //IL_105c: Unknown result type (might be due to invalid IL or missing references) //IL_1063: Unknown result type (might be due to invalid IL or missing references) //IL_106a: Unknown result type (might be due to invalid IL or missing references) //IL_1071: Unknown result type (might be due to invalid IL or missing references) //IL_1078: Unknown result type (might be due to invalid IL or missing references) //IL_107f: Unknown result type (might be due to invalid IL or missing references) //IL_1086: Unknown result type (might be due to invalid IL or missing references) //IL_108d: Unknown result type (might be due to invalid IL or missing references) //IL_1094: Unknown result type (might be due to invalid IL or missing references) //IL_109b: Unknown result type (might be due to invalid IL or missing references) //IL_10a2: Unknown result type (might be due to invalid IL or missing references) //IL_10a9: Unknown result type (might be due to invalid IL or missing references) //IL_10b0: Unknown result type (might be due to invalid IL or missing references) //IL_10b7: Unknown result type (might be due to invalid IL or missing references) //IL_10be: Unknown result type (might be due to invalid IL or missing references) //IL_10c5: Unknown result type (might be due to invalid IL or missing references) //IL_10cc: Unknown result type (might be due to invalid IL or missing references) //IL_10d3: Unknown result type (might be due to invalid IL or missing references) //IL_10da: Unknown result type (might be due to invalid IL or missing references) //IL_10e1: Unknown result type (might be due to invalid IL or missing references) //IL_10e8: Unknown result type (might be due to invalid IL or missing references) //IL_10ef: Unknown result type (might be due to invalid IL or missing references) //IL_10f6: Unknown result type (might be due to invalid IL or missing references) //IL_10fd: Unknown result type (might be due to invalid IL or missing references) //IL_1104: Unknown result type (might be due to invalid IL or missing references) //IL_1108: Unknown result type (might be due to invalid IL or missing references) //IL_110c: Unknown result type (might be due to invalid IL or missing references) //IL_1110: Unknown result type (might be due to invalid IL or missing references) //IL_1114: Unknown result type (might be due to invalid IL or missing references) //IL_1118: Unknown result type (might be due to invalid IL or missing references) //IL_111c: Unknown result type (might be due to invalid IL or missing references) //IL_1120: Unknown result type (might be due to invalid IL or missing references) //IL_1124: Unknown result type (might be due to invalid IL or missing references) //IL_1128: Unknown result type (might be due to invalid IL or missing references) //IL_112c: Unknown result type (might be due to invalid IL or missing references) //IL_1130: Unknown result type (might be due to invalid IL or missing references) //IL_1134: Unknown result type (might be due to invalid IL or missing references) //IL_1138: Unknown result type (might be due to invalid IL or missing references) //IL_113c: Unknown result type (might be due to invalid IL or missing references) //IL_1140: Unknown result type (might be due to invalid IL or missing references) //IL_1144: Unknown result type (might be due to invalid IL or missing references) //IL_1148: Unknown result type (might be due to invalid IL or missing references) //IL_114c: Unknown result type (might be due to invalid IL or missing references) //IL_1150: Unknown result type (might be due to invalid IL or missing references) //IL_1154: Unknown result type (might be due to invalid IL or missing references) //IL_1158: Unknown result type (might be due to invalid IL or missing references) //IL_115c: Unknown result type (might be due to invalid IL or missing references) //IL_1160: Unknown result type (might be due to invalid IL or missing references) //IL_1164: Unknown result type (might be due to invalid IL or missing references) //IL_1168: Unknown result type (might be due to invalid IL or missing references) //IL_116c: Unknown result type (might be due to invalid IL or missing references) //IL_1170: Unknown result type (might be due to invalid IL or missing references) //IL_1174: Unknown result type (might be due to invalid IL or missing references) //IL_1178: Unknown result type (might be due to invalid IL or missing references) //IL_117c: Unknown result type (might be due to invalid IL or missing references) //IL_1180: Unknown result type (might be due to invalid IL or missing references) //IL_07fe: Unknown result type (might be due to invalid IL or missing references) //IL_0804: Unknown result type (might be due to invalid IL or missing references) //IL_082e: Expected I4, but got Unknown //IL_1185: Unknown result type (might be due to invalid IL or missing references) //IL_0c88: Unknown result type (might be due to invalid IL or missing references) //IL_0c8f: Unknown result type (might be due to invalid IL or missing references) //IL_0c96: Unknown result type (might be due to invalid IL or missing references) //IL_0c9d: Unknown result type (might be due to invalid IL or missing references) //IL_0ca4: Unknown result type (might be due to invalid IL or missing references) //IL_0cab: Unknown result type (might be due to invalid IL or missing references) //IL_0cb2: Unknown result type (might be due to invalid IL or missing references) //IL_0cb9: Unknown result type (might be due to invalid IL or missing references) //IL_0cc0: Unknown result type (might be due to invalid IL or missing references) switch ((int)keyCode) { default: switch (keyCode - 670) { case 0: return (Key)0; case 1: return (Key)0; case 2: return (Key)0; case 3: return (Key)0; case 4: return (Key)0; case 5: return (Key)0; case 6: return (Key)0; case 7: return (Key)0; case 8: return (Key)0; } break; case 0: return (Key)0; case 8: return (Key)65; case 127: return (Key)78; case 9: return (Key)66; case 12: return (Key)104; case 13: return (Key)72; case 19: return (Key)0; case 27: return (Key)13; case 32: return (Key)76; case 256: return (Key)87; case 257: return (Key)88; case 258: return (Key)89; case 259: return (Key)90; case 260: return (Key)91; case 261: return (Key)92; case 262: return (Key)93; case 263: return (Key)94; case 264: return (Key)95; case 265: return (Key)96; case 266: return (Key)103; case 267: return (Key)98; case 268: return (Key)99; case 269: return (Key)100; case 270: return (Key)101; case 271: return (Key)102; case 272: return (Key)105; case 273: return (Key)85; case 274: return (Key)86; case 275: return (Key)84; case 276: return (Key)83; case 277: return (Key)77; case 278: return (Key)79; case 279: return (Key)80; case 280: return (Key)81; case 281: return (Key)82; case 282: return (Key)14; case 283: return (Key)15; case 284: return (Key)16; case 285: return (Key)17; case 286: return (Key)18; case 287: return (Key)19; case 288: return (Key)20; case 289: return (Key)21; case 290: return (Key)22; case 291: return (Key)23; case 292: return (Key)24; case 293: return (Key)25; case 294: return (Key)106; case 295: return (Key)107; case 296: return (Key)108; case 48: return (Key)26; case 49: return (Key)27; case 50: return (Key)28; case 51: return (Key)29; case 52: return (Key)30; case 53: return (Key)31; case 54: return (Key)32; case 55: return (Key)33; case 56: return (Key)34; case 57: return (Key)35; case 33: return (Key)111; case 34: return (Key)128; case 35: return (Key)114; case 36: return (Key)115; case 37: return (Key)116; case 38: return (Key)118; case 39: return (Key)71; case 40: return (Key)120; case 41: return (Key)121; case 42: return (Key)119; case 43: return (Key)123; case 44: return (Key)73; case 45: return (Key)63; case 46: return (Key)74; case 47: return (Key)75; case 58: return (Key)127; case 59: return (Key)70; case 60: return (Key)129; case 61: return (Key)64; case 62: return (Key)130; case 63: return (Key)131; case 64: return (Key)113; case 91: return (Key)67; case 92: return (Key)69; case 93: return (Key)68; case 94: return (Key)117; case 95: return (Key)122; case 96: return (Key)62; case 97: return (Key)36; case 98: return (Key)37; case 99: return (Key)38; case 100: return (Key)39; case 101: return (Key)40; case 102: return (Key)41; case 103: return (Key)42; case 104: return (Key)43; case 105: return (Key)44; case 106: return (Key)45; case 107: return (Key)46; case 108: return (Key)47; case 109: return (Key)48; case 110: return (Key)49; case 111: return (Key)50; case 112: return (Key)51; case 113: return (Key)52; case 114: return (Key)53; case 115: return (Key)54; case 116: return (Key)55; case 117: return (Key)56; case 118: return (Key)57; case 119: return (Key)58; case 120: return (Key)59; case 121: return (Key)60; case 122: return (Key)61; case 123: return (Key)124; case 124: return (Key)126; case 125: return (Key)125; case 126: return (Key)112; case 300: return (Key)97; case 301: return (Key)110; case 302: return (Key)0; case 303: return (Key)9; case 304: return (Key)5; case 305: return (Key)12; case 306: return (Key)8; case 307: return (Key)10; case 308: return (Key)6; case 310: return (Key)0; case 311: return (Key)7; case 309: return (Key)0; case 312: return (Key)11; case 313: return (Key)109; case 315: return (Key)0; case 316: return (Key)0; case 317: return (Key)0; case 318: return (Key)0; case 319: return (Key)0; case 321: return (Key)0; case 322: return (Key)0; case 323: return (Key)0; case 324: return (Key)0; case 325: return (Key)0; case 326: return (Key)0; case 327: return (Key)0; case 328: return (Key)0; case 329: return (Key)0; case 330: return (Key)0; case 331: return (Key)0; case 332: return (Key)0; case 333: return (Key)0; case 334: return (Key)0; case 335: return (Key)0; case 336: return (Key)0; case 337: return (Key)0; case 338: return (Key)0; case 339: return (Key)0; case 340: return (Key)0; case 341: return (Key)0; case 342: return (Key)0; case 343: return (Key)0; case 344: return (Key)0; case 345: return (Key)0; case 346: return (Key)0; case 347: return (Key)0; case 348: return (Key)0; case 349: return (Key)0; case 350: return (Key)0; case 351: return (Key)0; case 352: return (Key)0; case 353: return (Key)0; case 354: return (Key)0; case 355: return (Key)0; case 356: return (Key)0; case 357: return (Key)0; case 358: return (Key)0; case 359: return (Key)0; case 360: return (Key)0; case 361: return (Key)0; case 362: return (Key)0; case 363: return (Key)0; case 364: return (Key)0; case 365: return (Key)0; case 366: return (Key)0; case 367: return (Key)0; case 368: return (Key)0; case 369: return (Key)0; case 370: return (Key)0; case 371: return (Key)0; case 372: return (Key)0; case 373: return (Key)0; case 374: return (Key)0; case 375: return (Key)0; case 376: return (Key)0; case 377: return (Key)0; case 378: return (Key)0; case 379: return (Key)0; case 380: return (Key)0; case 381: return (Key)0; case 382: return (Key)0; case 383: return (Key)0; case 384: return (Key)0; case 385: return (Key)0; case 386: return (Key)0; case 387: return (Key)0; case 388: return (Key)0; case 389: return (Key)0; case 390: return (Key)0; case 391: return (Key)0; case 392: return (Key)0; case 393: return (Key)0; case 394: return (Key)0; case 395: return (Key)0; case 396: return (Key)0; case 397: return (Key)0; case 398: return (Key)0; case 399: return (Key)0; case 400: return (Key)0; case 401: return (Key)0; case 402: return (Key)0; case 403: return (Key)0; case 404: return (Key)0; case 405: return (Key)0; case 406: return (Key)0; case 407: return (Key)0; case 408: return (Key)0; case 409: return (Key)0; case 410: return (Key)0; case 411: return (Key)0; case 412: return (Key)0; case 413: return (Key)0; case 414: return (Key)0; case 415: return (Key)0; case 416: return (Key)0; case 417: return (Key)0; case 418: return (Key)0; case 419: return (Key)0; case 420: return (Key)0; case 421: return (Key)0; case 422: return (Key)0; case 423: return (Key)0; case 424: return (Key)0; case 425: return (Key)0; case 426: return (Key)0; case 427: return (Key)0; case 428: return (Key)0; case 429: return (Key)0; case 430: return (Key)0; case 431: return (Key)0; case 432: return (Key)0; case 433: return (Key)0; case 434: return (Key)0; case 435: return (Key)0; case 436: return (Key)0; case 437: return (Key)0; case 438: return (Key)0; case 439: return (Key)0; case 440: return (Key)0; case 441: return (Key)0; case 442: return (Key)0; case 443: return (Key)0; case 444: return (Key)0; case 445: return (Key)0; case 446: return (Key)0; case 447: return (Key)0; case 448: return (Key)0; case 449: return (Key)0; case 450: return (Key)0; case 451: return (Key)0; case 452: return (Key)0; case 453: return (Key)0; case 454: return (Key)0; case 455: return (Key)0; case 456: return (Key)0; case 457: return (Key)0; case 458: return (Key)0; case 459: return (Key)0; case 460: return (Key)0; case 461: return (Key)0; case 462: return (Key)0; case 463: return (Key)0; case 464: return (Key)0; case 465: return (Key)0; case 466: return (Key)0; case 467: return (Key)0; case 468: return (Key)0; case 469: return (Key)0; case 470: return (Key)0; case 471: return (Key)0; case 472: return (Key)0; case 473: return (Key)0; case 474: return (Key)0; case 475: return (Key)0; case 476: return (Key)0; case 477: return (Key)0; case 478: return (Key)0; case 479: return (Key)0; case 480: return (Key)0; case 481: return (Key)0; case 482: return (Key)0; case 483: return (Key)0; case 484: return (Key)0; case 485: return (Key)0; case 486: return (Key)0; case 487: return (Key)0; case 488: return (Key)0; case 489: return (Key)0; case 490: return (Key)0; case 491: return (Key)0; case 492: return (Key)0; case 493: return (Key)0; case 494: return (Key)0; case 495: return (Key)0; case 496: return (Key)0; case 497: return (Key)0; case 498: return (Key)0; case 499: return (Key)0; case 500: return (Key)0; case 501: return (Key)0; case 502: return (Key)0; case 503: return (Key)0; case 504: return (Key)0; case 505: return (Key)0; case 506: return (Key)0; case 507: return (Key)0; case 508: return (Key)0; case 509: return (Key)0; case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 10: case 11: case 14: case 15: case 16: case 17: case 18: case 20: case 21: case 22: case 23: case 24: case 25: case 26: case 28: case 29: case 30: case 31: case 65: case 66: case 67: case 68: case 69: case 70: case 71: case 72: case 73: case 74: case 75: case 76: case 77: case 78: case 79: case 80: case 81: case 82: case 83: case 84: case 85: case 86: case 87: case 88: case 89: case 90: case 128: case 129: case 130: case 131: case 132: case 133: case 134: case 135: case 136: case 137: case 138: case 139: case 140: case 141: case 142: case 143: case 144: case 145: case 146: case 147: case 148: case 149: case 150: case 151: case 152: case 153: case 154: case 155: case 156: case 157: case 158: case 159: case 160: case 161: case 162: case 163: case 164: case 165: case 166: case 167: case 168: case 169: case 170: case 171: case 172: case 173: case 174: case 175: case 176: case 177: case 178: case 179: case 180: case 181: case 182: case 183: case 184: case 185: case 186: case 187: case 188: case 189: case 190: case 191: case 192: case 193: case 194: case 195: case 196: case 197: case 198: case 199: case 200: case 201: case 202: case 203: case 204: case 205: case 206: case 207: case 208: case 209: case 210: case 211: case 212: case 213: case 214: case 215: case 216: case 217: case 218: case 219: case 220: case 221: case 222: case 223: case 224: case 225: case 226: case 227: case 228: case 229: case 230: case 231: case 232: case 233: case 234: case 235: case 236: case 237: case 238: case 239: case 240: case 241: case 242: case 243: case 244: case 245: case 246: case 247: case 248: case 249: case 250: case 251: case 252: case 253: case 254: case 255: case 297: case 298: case 299: case 314: case 320: break; } return (Key)0; } } internal class LateUpdateHelper : MonoBehaviour { internal event Action? OnLateUpdate; private void LateUpdate() { this.OnLateUpdate?.Invoke(); } } internal class LinkedDictionary : IDictionary, ICollection>, IEnumerable>, IEnumerable { private class LinkedDictionaryKeys(LinkedDictionary parent) : ICollection, IEnumerable, IEnumerable { public int Count => P.Count; public bool IsReadOnly => false; public void Add(K item) { throw new InvalidOperationException(); } public void Clear() { P.Clear(); } public bool Contains(K item) { return P.ContainsKey(item); } public void CopyTo(K[] array, int arrayIndex) { foreach (K item in P.keyOrder) { array[arrayIndex++] = item; } } public IEnumerator GetEnumerator() { return P.keyOrder.GetEnumerator(); } public bool Remove(K item) { return P.Remove(item); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } private class LinkedDictionaryValues(LinkedDictionary parent) : ICollection, IEnumerable, IEnumerable { public int Count => P.Count; public bool IsReadOnly => false; public void Add(V item) { throw new InvalidOperationException("Add"); } public void Clear() { P.Clear(); } public bool Contains(V item) { return P.data.Any, V)>>((KeyValuePair, V)> e) => EqualityComparer.Default.Equals(e.Value.Item2, item)); } public void CopyTo(V[] array, int arrayIndex) { foreach (K item in P.keyOrder) { array[arrayIndex++] = P.data[item].Item2; } } public IEnumerator GetEnumerator() { return P.keyOrder.Select((K k) => P.data[k].Item2).GetEnumerator(); } public bool Remove(V item) { foreach (KeyValuePair, V)> datum in P.data) { if (EqualityComparer.Default.Equals(datum.Value.Item2, item)) { P.Remove(datum.Key); return true; } } return false; } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } private readonly Dictionary, V)> data = new Dictionary, V)>(); private readonly LinkedList keyOrder = new LinkedList(); public V this[K key] { get { return data[key].Item2; } set { Set(key, value); } } public ICollection Keys => new LinkedDictionaryKeys(this); public ICollection Values => new LinkedDictionaryValues(this); public int Count => keyOrder.Count; public bool IsReadOnly => false; public void Add(K key, V value) { if (data.ContainsKey(key)) { throw new ArgumentException($"An element with the same key already exists: {key}"); } data.Add(key, (keyOrder.AddLast(key), value)); } public void Add(KeyValuePair item) { Add(item.Key, item.Value); } public void Set(K key, V value) { Dictionary, V)> dictionary = data; LinkedListNode item; if (data.TryGetValue(key, out (LinkedListNode, V) value2)) { (item, _) = value2; } else { item = keyOrder.AddLast(key); } dictionary[key] = (item, value); } public void Clear() { data.Clear(); keyOrder.Clear(); } public bool Contains(KeyValuePair item) { if (data.TryGetValue(item.Key, out (LinkedListNode, V) value)) { return EqualityComparer.Default.Equals(item.Value, value.Item2); } return false; } public bool ContainsKey(K key) { return data.ContainsKey(key); } public void CopyTo(KeyValuePair[] array, int arrayIndex) { foreach (K item in keyOrder) { array[arrayIndex++] = new KeyValuePair(item, data[item].Item2); } } public IEnumerator> GetEnumerator() { return keyOrder.Select((K k) => new KeyValuePair(k, data[k].Item2)).GetEnumerator(); } public bool Remove(K key) { if (!data.TryGetValue(key, out (LinkedListNode, V) value)) { return false; } data.Remove(key); keyOrder.Remove(value.Item1); return true; } public bool Remove(KeyValuePair item) { if (!data.TryGetValue(item.Key, out (LinkedListNode, V) value) || !EqualityComparer.Default.Equals(item.Value, value.Item2)) { return false; } data.Remove(item.Key); keyOrder.Remove(value.Item1); return true; } public bool TryGetValue(K key, out V value) { if (!data.TryGetValue(key, out (LinkedListNode, V) value2)) { value = default(V); return false; } value = value2.Item2; return true; } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } internal class ListView(Func getter, int count) : IReadOnlyList, IEnumerable, IEnumerable, IReadOnlyCollection { public T this[int index] => P(index); public int Count => P; public IEnumerator GetEnumerator() { for (int i = 0; i < Count; i++) { yield return this[i]; } } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } [MonoDetourTargets(typeof(MappableKey), GenerateControlFlowVariants = true)] internal class MenuPrefabs { private static MenuPrefabs? instance; private readonly GameObject canvas; private readonly GameObject menuTemplate; private readonly GameObject keyBindTemplate; private readonly GameObject textButtonTemplate; private readonly GameObject textLabelTemplate; private readonly GameObject textChoiceTemplate; private readonly GameObject textInputTemplate; private readonly GameObject sliderTemplate; private readonly GameObject scrollPaneTemplate; private readonly GameObject colorSwatchTemplate; private static readonly EventSuppressor mappableKeyInit = new EventSuppressor(); internal static MenuPrefabs Get() { return instance ?? throw new Exception("UIManager not initialized yet"); } internal static void Load(UIManager uiManager) { if (instance == null) { instance = new MenuPrefabs(uiManager); } } private MenuPrefabs(UIManager uiManager) { //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_0423: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Unknown result type (might be due to invalid IL or missing references) //IL_0514: Unknown result type (might be due to invalid IL or missing references) //IL_051e: Expected O, but got Unknown //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_0568: Unknown result type (might be due to invalid IL or missing references) //IL_0574: Expected O, but got Unknown //IL_059a: Unknown result type (might be due to invalid IL or missing references) //IL_05a4: Unknown result type (might be due to invalid IL or missing references) //IL_05c3: Unknown result type (might be due to invalid IL or missing references) //IL_05ca: Unknown result type (might be due to invalid IL or missing references) //IL_05dd: Unknown result type (might be due to invalid IL or missing references) //IL_05f0: Unknown result type (might be due to invalid IL or missing references) //IL_0600: Unknown result type (might be due to invalid IL or missing references) //IL_062a: Unknown result type (might be due to invalid IL or missing references) //IL_062f: Unknown result type (might be due to invalid IL or missing references) //IL_0636: Unknown result type (might be due to invalid IL or missing references) //IL_0643: Unknown result type (might be due to invalid IL or missing references) //IL_0670: Expected O, but got Unknown //IL_067a: Unknown result type (might be due to invalid IL or missing references) //IL_067f: Unknown result type (might be due to invalid IL or missing references) //IL_0686: Unknown result type (might be due to invalid IL or missing references) //IL_0693: Unknown result type (might be due to invalid IL or missing references) //IL_06bb: Unknown result type (might be due to invalid IL or missing references) //IL_06c1: Unknown result type (might be due to invalid IL or missing references) //IL_06c6: Unknown result type (might be due to invalid IL or missing references) //IL_06d4: Unknown result type (might be due to invalid IL or missing references) //IL_06e0: Expected O, but got Unknown //IL_06ea: Unknown result type (might be due to invalid IL or missing references) //IL_06ef: Unknown result type (might be due to invalid IL or missing references) //IL_06f6: Unknown result type (might be due to invalid IL or missing references) //IL_0703: Unknown result type (might be due to invalid IL or missing references) //IL_076f: Expected O, but got Unknown //IL_0770: Unknown result type (might be due to invalid IL or missing references) //IL_0785: Unknown result type (might be due to invalid IL or missing references) //IL_0799: Unknown result type (might be due to invalid IL or missing references) canvas = UnityExtensions.FindChild(((Component)uiManager).gameObject, "UICanvas"); GameObject val = UnityExtensions.FindChild(canvas, "OptionsMenuScreen"); UnityExtensions.GetOrAddComponent(((Component)uiManager).gameObject).Action += delegate { if (instance == this) { instance = null; } }; menuTemplate = Object.Instantiate(val); menuTemplate.SetActive(false); ((Object)menuTemplate).name = "ModMenuScreen"; UnityExtensions.RemoveComponent(menuTemplate); UnityExtensions.RemoveComponent(UnityExtensions.FindChild(menuTemplate, "Title")); Object.Destroy((Object)(object)UnityExtensions.FindChild(menuTemplate, "Content")); Object.DontDestroyOnLoad((Object)(object)menuTemplate); using (mappableKeyInit.Suppress()) { keyBindTemplate = Object.Instantiate(UnityExtensions.FindChild(canvas, "KeyboardMenuScreen/Content/MappableKeys/UpButton")); } keyBindTemplate.SetActive(false); UnityExtensions.RemoveComponent(UnityExtensions.FindChild(keyBindTemplate, "Input Button Text")); Object.DontDestroyOnLoad((Object)(object)keyBindTemplate); textLabelTemplate = Object.Instantiate(UnityExtensions.FindChild(val, "Content/GameOptions/GameOptionsButton/Menu Button Text")); textLabelTemplate.SetActive(false); UnityExtensions.RemoveComponent(textLabelTemplate); ((Object)textLabelTemplate).name = "TextLabel"; ((Graphic)textLabelTemplate.GetComponent()).raycastTarget = false; Object.DontDestroyOnLoad((Object)(object)textLabelTemplate); GameObjectUtil.get_RectTransform(textLabelTemplate).sizeDelta = new Vector2(0f, 105f); textChoiceTemplate = Object.Instantiate(UnityExtensions.FindChild(canvas, "GameOptionsMenuScreen/Content/CamShakeSetting")); textChoiceTemplate.SetActive(false); ((Object)textChoiceTemplate).name = "ValueChoiceContainer"; Object.DontDestroyOnLoad((Object)(object)textChoiceTemplate); GameObject val2 = UnityExtensions.FindChild(textChoiceTemplate, "CamShakePopupOption"); ((Object)val2).name = "ValueChoice"; UnityExtensions.RemoveComponent(val2); MenuOptionHorizontal component = val2.GetComponent(); component.optionList = new string[1] { "###INTERNAL###" }; component.menuSetting = null; component.localizeText = false; component.applyButton = null; UnityExtensions.RemoveComponent(UnityExtensions.FindChild(val2, "Menu Option Label")); UnityExtensions.RemoveComponent(UnityExtensions.FindChild(val2, "Menu Option Text")); UnityExtensions.RemoveComponent(UnityExtensions.FindChild(val2, "Description")); textButtonTemplate = Object.Instantiate(UnityExtensions.FindChild(val, "Content/GameOptions")); textButtonTemplate.SetActive(false); ((Object)textButtonTemplate).name = "TextButtonContainer"; Object.DontDestroyOnLoad((Object)(object)textButtonTemplate); GameObjectUtil.get_RectTransform(textButtonTemplate).sizeDelta = Vector2.zero; GameObject val3 = UnityExtensions.FindChild(textButtonTemplate, "GameOptionsButton"); ((Object)val3).name = "TextButton"; UnityExtensions.RemoveComponent(val3); UnityExtensions.RemoveComponent(UnityExtensions.FindChild(val3, "Menu Button Text")); RectTransform obj = GameObjectUtil.get_RectTransform(val3); Vector2 sizeDelta = obj.sizeDelta; sizeDelta.x = 0f; obj.sizeDelta = sizeDelta; GameObject obj2 = Object.Instantiate(UnityExtensions.FindChild(val2, "Description")); RectTransform component2 = obj2.GetComponent(); ((Transform)component2).SetParent(val3.transform, false); component2.anchorMin = new Vector2(0.5f, 0.5f); component2.anchorMax = new Vector2(0.5f, 0.5f); component2.pivot = new Vector2(0.5f, 0.5f); ((Object)obj2).name = "Description"; Text component3 = obj2.GetComponent(); component3.alignment = (TextAnchor)4; ((MenuSelectable)val3.GetComponent()).descriptionText = ((Component)component3).GetComponent(); textInputTemplate = Object.Instantiate(textChoiceTemplate); textInputTemplate.SetActive(false); ((Object)textInputTemplate).name = "TextInputContainer"; Object.DontDestroyOnLoad((Object)(object)textInputTemplate); GameObject val4 = UnityExtensions.FindChild(textInputTemplate, "ValueChoice"); ((Object)val4).name = "TextInput"; UnityExtensions.RemoveComponent(val4); UnityExtensions.RemoveComponent(val4); Object.DestroyImmediate((Object)(object)val4.GetComponent()); UnityExtensions.RemoveComponent(val4); CustomInputField customInputField = val4.AddComponent(); ((InputField)customInputField).textComponent = UnityExtensions.FindChild(val4, "Menu Option Text").GetComponent(); ((InputField)customInputField).caretColor = Color.white; ((InputField)customInputField).contentType = (ContentType)0; ((InputField)customInputField).caretWidth = 8; ((InputField)customInputField).text = ""; val4.AddComponent().Animators = new List(3) { UnityExtensions.FindChild(val4, "Description").GetComponent(), UnityExtensions.FindChild(val4, "CursorLeft").GetComponent(), UnityExtensions.FindChild(val4, "CursorRight").GetComponent() }; sliderTemplate = Object.Instantiate(UnityExtensions.FindChild(canvas, "AudioMenuScreen/Content/MasterVolume")); sliderTemplate.SetActive(false); ((Object)sliderTemplate).name = "SliderContainer"; Object.DontDestroyOnLoad((Object)(object)sliderTemplate); GameObjectUtil.get_RectTransform(sliderTemplate).sizeDelta = Vector2.zero; GameObject obj3 = UnityExtensions.FindChild(sliderTemplate, "MasterSlider"); ((Object)obj3).name = "Slider"; obj3.GetComponent().onValueChanged = new SliderEvent(); UnityExtensions.RemoveComponent(obj3); UnityExtensions.GetOrAddComponent(obj3); UnityExtensions.RemoveComponent(UnityExtensions.FindChild(obj3, "Menu Option Label")); ((Object)UnityExtensions.FindChild(obj3, "MasterVolValue")).name = "Value"; scrollPaneTemplate = ConstructScrollPanePrefab(uiManager); colorSwatchTemplate = new GameObject("Color Swatch") { layer = 5 }; colorSwatchTemplate.SetActive(false); Object.DontDestroyOnLoad((Object)(object)colorSwatchTemplate); RectTransform val5 = colorSwatchTemplate.AddComponent(); val5.sizeDelta = Vector2.one * 70f; ((Vector2)(ref sizeDelta))..ctor(0f, 0.5f); val5.anchorMin = sizeDelta; val5.anchorMax = sizeDelta; val5.pivot = new Vector2(1f, 0.5f); val5.anchoredPosition = new Vector2(-0.5f * val5.sizeDelta.x, 0f); Transform val6 = ((Component)GameCameras.instance.hudCamera).transform.Find("In-game/Inventory/Journal/Enemy List Parent/Enemy List/Template Journal Entry"); GameObject val7 = new GameObject("Fill") { layer = 5 }; Extensions.SetParentReset(val7.transform, (Transform)(object)val5); Image obj4 = val7.AddComponent(); obj4.sprite = ((Component)val6.Find("Mask")).GetComponent().sprite; obj4.preserveAspect = true; GameObjectUtil.get_RectTransform(val7).FitToParent(); GameObject val8 = new GameObject("Outline") { layer = 5 }; Extensions.SetParentReset(val8.transform, (Transform)(object)val5); Image obj5 = val8.AddComponent(); obj5.sprite = ((Component)val6.Find("Standard Frame")).GetComponent().sprite; obj5.preserveAspect = true; Outline obj6 = val8.AddComponent(); Color white = Color.white; white.a = 0.5f; ((Shadow)obj6).effectColor = white; GameObjectUtil.get_RectTransform(val8).FitToParent(); GameObject val9 = new GameObject("Invalid Indicator") { layer = 5 }; Extensions.SetParentReset(val9.transform, (Transform)(object)val5); Text obj7 = val9.AddComponent(); ((Behaviour)obj7).enabled = false; obj7.text = "?"; obj7.font = textLabelTemplate.GetComponent().font; obj7.alignByGeometry = true; obj7.alignment = (TextAnchor)4; obj7.horizontalOverflow = (HorizontalWrapMode)1; obj7.verticalOverflow = (VerticalWrapMode)0; obj7.resizeTextForBestFit = true; obj7.resizeTextMaxSize = 100; obj7.resizeTextMinSize = 10; obj7.fontSize = 0; RectTransform obj8 = GameObjectUtil.get_RectTransform(val9); obj8.sizeDelta = Vector2.zero; obj8.anchorMax = new Vector2(0.52f, 0.8f); obj8.anchorMin = new Vector2(0.52f, 0.2f); } internal GameObject NewCustomMenu(LocalizedText title) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) GameObject obj = Object.Instantiate(menuTemplate); ((Object)obj).name = "ModMenuScreen-" + title.Canonical; obj.transform.SetParent(canvas.transform, false); obj.transform.localPosition = new Vector3(0f, 10f, 0f); return obj; } internal GameObject NewKeyBindContainer(out CustomMappableKey customMappableKey) { GameObject val = Object.Instantiate(keyBindTemplate); customMappableKey = CustomMappableKey.Replace(val.GetComponent()); return val; } internal GameObject NewTextButtonContainer(out MenuButton menuButton) { GameObject val = Object.Instantiate(textButtonTemplate); menuButton = UnityExtensions.FindChild(val, "TextButton").GetComponent(); return val; } internal GameObject NewTextLabel() { return Object.Instantiate(textLabelTemplate); } internal GameObject NewTextChoiceContainer(out MenuOptionHorizontal menuOptionHorizontal) { GameObject val = Object.Instantiate(textChoiceTemplate); menuOptionHorizontal = UnityExtensions.FindChild(val, "ValueChoice").GetComponent(); return val; } internal GameObject NewTextInputContainer(out CustomInputField customInputField) { GameObject val = Object.Instantiate(textInputTemplate); customInputField = UnityExtensions.FindChild(val, "TextInput").GetComponent(); return val; } internal GameObject NewColorSwatch() { return Object.Instantiate(colorSwatchTemplate); } internal GameObject NewSliderContainer(out Slider slider) { GameObject val = Object.Instantiate(sliderTemplate); slider = UnityExtensions.FindChild(val, "Slider").GetComponent(); return val; } internal GameObject NewScrollPane(out ScrollRect scrollRect, out ScrollFocusController focusController, out GameObject contentPane) { GameObject val = Object.Instantiate(scrollPaneTemplate); scrollRect = val.GetComponent(); focusController = val.GetComponent(); contentPane = UnityExtensions.FindChild(val, "Viewport/Content"); return val; } private static GameObject ConstructScrollPanePrefab(UIManager uiManager) { //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_0012: Expected O, but got Unknown //IL_003c: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown //IL_0084: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected O, but got Unknown //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_0214: 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) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("ScrollPane") { layer = 5 }; val.SetActive(false); Object.DontDestroyOnLoad((Object)(object)val); RectTransform val2 = val.AddComponent(); val2.sizeDelta = new Vector2(1510f, Mathf.Ceil(SpacingConstants.VSPACE_MEDIUM * 8.334f)); val2.pivot = new Vector2(0.5f, 1f); GameObject val3 = new GameObject("Viewport") { layer = 5 }; Extensions.SetParentReset(val3.transform, val.transform); ((Graphic)val3.AddComponent()).color = Color.clear; val3.AddComponent(); RectTransform val4 = GameObjectUtil.get_RectTransform(val3); val4.FitToParent(); GameObject val5 = new GameObject("Content") { layer = 5 }; Extensions.SetParentReset(val5.transform, val3.transform); ((Graphic)val5.AddComponent()).color = Color.clear; RectTransform val6 = GameObjectUtil.get_RectTransform(val5); Vector2 val7 = default(Vector2); ((Vector2)(ref val7))..ctor(0.5f, 1f); val6.pivot = val7; Vector2 val8 = (val6.anchorMax = (val6.anchorMin = val7)); GameObject obj = Object.Instantiate(UnityExtensions.FindChild(((Component)uiManager.achievementsMenuScreen).gameObject, "Content/Scrollbar"), (Transform)(object)val2, false); ((Object)obj).name = "Scrollbar V"; GameObjectUtil.get_RectTransform(UnityExtensions.FindChild(obj, "Background")).FitToParentVertical(); RectTransform val11 = GameObjectUtil.get_RectTransform(obj); RectTransform val12 = GameObjectUtil.get_RectTransform(UnityExtensions.FindChild(obj, "Sliding Area")); RectTransform val13 = GameObjectUtil.get_RectTransform(UnityExtensions.FindChild(obj, "Sliding Area/Handle/TopFleur")); val12.FitToParent(); val12.sizeDelta = new Vector2(0f, -150f); Object.DestroyImmediate((Object)(object)((Component)val13).GetComponent()); Extensions.SetParentReset((Transform)(object)val13, (Transform)(object)val12); val13.FitToParentHorizontal(); val13.sizeDelta = new Vector2(0f, 140f); val13.pivot = Vector2.one * 0.5f; Object.DestroyImmediate((Object)(object)((Component)((Transform)val12).Find("Handle")).gameObject); ((Object)((Component)val13).gameObject).name = "Handle"; val11.sizeDelta = new Vector2(50f, 0f); val11.FitToParentVertical(1f); Vector3 anchoredPosition3D = val11.anchoredPosition3D; anchoredPosition3D.z = -1f; val11.anchoredPosition3D = anchoredPosition3D; val11.pivot = new Vector2(0f, 0.5f); Object.DestroyImmediate((Object)(object)obj.GetComponent()); Slider val14 = obj.AddComponent(); val14.handleRect = val13; val14.direction = (Direction)2; val14.maxValue = 1f; val14.minValue = 0f; val14.value = 1f; GameObject obj2 = Object.Instantiate(obj, val.transform, false); ((Object)obj2).name = "Scrollbar H"; RectTransform obj3 = GameObjectUtil.get_RectTransform(obj2); ((Vector2)(ref val8))..ctor(0.5f, 0f); obj3.anchorMax = val8; obj3.anchorMin = val8; obj3.pivot = new Vector2(1f, 0.5f); obj2.AddComponent().fitToWidth = true; Slider component = obj2.GetComponent(); component.direction = (Direction)3; component.value = 0.5f; CustomScrollRect customScrollRect = val.AddComponent(); ((ScrollRect)customScrollRect).horizontal = false; ((ScrollRect)customScrollRect).vertical = true; ((ScrollRect)customScrollRect).verticalScrollbarVisibility = (ScrollbarVisibility)1; ((ScrollRect)customScrollRect).horizontalScrollbarVisibility = (ScrollbarVisibility)1; ((ScrollRect)customScrollRect).movementType = (MovementType)2; ((ScrollRect)customScrollRect).scrollSensitivity = 80f; ((ScrollRect)customScrollRect).viewport = val4; ((ScrollRect)customScrollRect).content = val6; ((ScrollRect)customScrollRect).normalizedPosition = new Vector2(0.5f, 1f); ScrollSliderController scrollSliderController = val.AddComponent(); scrollSliderController.VerticalSlider = val14; scrollSliderController.HorizontalSlider = component; val.AddComponent(); return val; } private static ReturnFlow MappableKeyInit(MappableKey self) { if (mappableKeyInit.Suppressed) { return (ReturnFlow)1; } return (ReturnFlow)0; } [MonoDetourHookInitialize] private static void Hook() { Md.MappableKey.OnEnable.ControlFlowPrefix(MappableKeyInit); Md.MappableKey.SetupRefs.ControlFlowPrefix(MappableKeyInit); Md.MappableKey.Start.ControlFlowPrefix(MappableKeyInit); } } [MonoDetourTargets(typeof(MenuSelectable))] internal class MenuSelectableAnimationProxy : MonoBehaviour, ISelectHandler, IEventSystemHandler, IDeselectHandler, ICancelHandler { [CompilerGenerated] private static class <>O { public static Manipulator <0>__HookOnSelect; public static Manipulator <1>__HookOnDeselect; public static Action <2>__AnimateUp; public static Action <3>__AnimateDown; } private Selectable _selectable; private bool _isMenuSelectable; public List Animators = new List(); private void Awake() { _selectable = ((Component)this).GetComponent(); _isMenuSelectable = _selectable is MenuSelectable; } public void OnDeselect(BaseEventData eventData) { if (!_isMenuSelectable) { ((MonoBehaviour)this).StartCoroutine(ValidateDeselect(eventData, force: false)); } } private IEnumerator ValidateDeselect(BaseEventData eventData, bool force) { if (Animators.Count == 0) { yield break; } GameObject prevSelectedObject = EventSystem.current.currentSelectedGameObject; yield return (object)new WaitForEndOfFrame(); if (!((Object)(object)EventSystem.current.currentSelectedGameObject != (Object)null || force)) { InputHandler ih = ManagerSingleton.Instance; if (Object.op_Implicit((Object)(object)ih) && !ih.acceptingInput) { while (!ih.acceptingInput) { yield return null; } } yield return null; } if ((Object)(object)EventSystem.current.currentSelectedGameObject != (Object)null || force) { foreach (Animator animator in Animators) { animator.ResetTrigger(MenuSelectable._showPropId); animator.SetTrigger(MenuSelectable._hidePropId); } yield break; } if ((Object)(object)prevSelectedObject != (Object)null && prevSelectedObject.activeInHierarchy) { EventSystem.current.SetSelectedGameObject(prevSelectedObject); } } public void OnSelect(BaseEventData eventData) { if (_isMenuSelectable || Animators.Count == 0 || !_selectable.interactable) { return; } foreach (Animator animator in Animators) { animator.ResetTrigger(MenuSelectable._hidePropId); animator.SetTrigger(MenuSelectable._showPropId); } } public void OnCancel(BaseEventData eventData) { ((MonoBehaviour)this).StartCoroutine(ValidateDeselect(eventData, force: true)); } [MonoDetourHookInitialize] private static void Hook() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //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 object obj = <>O.<0>__HookOnSelect; if (obj == null) { Manipulator val = HookOnSelect; <>O.<0>__HookOnSelect = val; obj = (object)val; } Md.UnityEngine.UI.MenuSelectable.OnSelect.ILHook((Manipulator)obj); object obj2 = <>O.<1>__HookOnDeselect; if (obj2 == null) { Manipulator val2 = HookOnDeselect; <>O.<1>__HookOnDeselect = val2; obj2 = (object)val2; } Md.UnityEngine.UI.MenuSelectable.ValidateDeselect.ILHookMoveNext((Manipulator)obj2); } private static void HookOnSelect(ILManipulationInfo info) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_000f: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(info.Context); while (val.TryGotoNext((MoveType)2, new Func[4] { (Instruction i) => ILPatternMatchingExt.MatchLdarg(i, 0), (Instruction i) => ILPatternMatchingExt.MatchLdfld(i, "descriptionText"), (Instruction i) => ILPatternMatchingExt.MatchLdsfld(i, "_showPropId"), (Instruction i) => ILPatternMatchingExt.MatchCallOrCallvirt(i, "SetTrigger") })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Action)AnimateUp); } } private static void HookOnDeselect(ILManipulationInfo info) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(info.Context); int locIndex = 1; while (val.TryGotoNext((MoveType)2, new Func[4] { (Instruction i) => ILPatternMatchingExt.MatchLdloc(i, ref locIndex), (Instruction i) => ILPatternMatchingExt.MatchLdfld(i, "descriptionText"), (Instruction i) => ILPatternMatchingExt.MatchLdsfld(i, "_hidePropId"), (Instruction i) => ILPatternMatchingExt.MatchCallOrCallvirt(i, "SetTrigger") })) { val.Emit(OpCodes.Ldloc, locIndex); val.EmitDelegate>((Action)AnimateDown); } } private static void AnimateUp(MenuSelectable selectable) { MenuSelectableAnimationProxy component = ((Component)selectable).gameObject.GetComponent(); if (!((Object)(object)component != (Object)null)) { return; } foreach (Animator animator in component.Animators) { animator.ResetTrigger(MenuSelectable._hidePropId); animator.SetTrigger(MenuSelectable._showPropId); } } private static void AnimateDown(MenuSelectable selectable) { MenuSelectableAnimationProxy component = ((Component)selectable).gameObject.GetComponent(); if (!((Object)(object)component != (Object)null)) { return; } foreach (Animator animator in component.Animators) { animator.ResetTrigger(MenuSelectable._showPropId); animator.SetTrigger(MenuSelectable._hidePropId); } } } [RequireComponent(typeof(RectTransform))] internal class OnChildTransformsChangeHelper : UIBehaviour { private readonly Dictionary childPositions = new Dictionary(); public event Action? OnChildrenChanged; protected void OnTransformChildrenChanged() { foreach (Transform item in childPositions.Keys.ToList()) { if ((Object)(object)item.parent != (Object)(object)((Component)this).transform) { childPositions.Remove(item); } } this.OnChildrenChanged?.Invoke(); } protected void Update() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown //IL_004c: 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_0036: Unknown result type (might be due to invalid IL or missing references) bool flag = false; foreach (Transform item in ((Component)this).transform) { Transform val = item; RectTransform val2 = (RectTransform)val; if (childPositions.TryGetValue(val, out var value) && !VectorUtil.Approximately(value, val2.anchoredPosition)) { flag = true; } childPositions[val] = val2.anchoredPosition; } if (flag) { this.OnChildrenChanged?.Invoke(); } } } internal class OnDestroyHelper : MonoBehaviour { internal event Action? Action; internal void OnDestroy() { this.Action?.Invoke(); } } internal class OnSelectHelper : MonoBehaviour, ISelectHandler, IEventSystemHandler { internal event Action? OnSelect; void ISelectHandler.OnSelect(BaseEventData eventData) { this.OnSelect?.Invoke(); } } internal static class RectTransformUtil { internal static void FitToParent(this RectTransform self) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //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_0029: 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_0036: Unknown result type (might be due to invalid IL or missing references) self.anchoredPosition = Vector2.zero; self.anchorMin = Vector2.zero; self.anchorMax = Vector2.one; Vector2 offsetMin = (self.offsetMax = Vector2.zero); self.offsetMin = offsetMin; self.sizeDelta = Vector2.zero; } internal static void FitToParentVertical(this RectTransform self, float anchorX = 0.5f) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_0034: 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) self.anchoredPosition = Vector2.zero; self.anchorMin = new Vector2(anchorX, 0f); self.anchorMax = new Vector2(anchorX, 1f); Vector2 sizeDelta = self.sizeDelta; sizeDelta.y = 0f; self.sizeDelta = sizeDelta; } internal static void FitToParentHorizontal(this RectTransform self, float anchorY = 0.5f) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_0034: 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) self.anchoredPosition = Vector2.zero; self.anchorMin = new Vector2(0f, anchorY); self.anchorMax = new Vector2(1f, anchorY); Vector2 sizeDelta = self.sizeDelta; sizeDelta.x = 0f; self.sizeDelta = sizeDelta; } internal static void SetAnchoredPosition(this RectTransform self, Vector2 pos) { //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_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) Rect rect = self.rect; Vector2 size = ((Rect)(ref rect)).size; self.anchoredPosition = pos; Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0.5f, 0.5f); self.anchorMax = val; self.anchorMin = val; self.offsetMin = pos - size / 2f; self.offsetMax = pos + size / 2f; self.sizeDelta = size; } } [RequireComponent(typeof(RectTransform))] internal class RotatedParentSizeFitter : UIBehaviour { private RectTransform RT; private RectTransform parentRT; public bool fitToWidth; public bool fitToHeight; protected override void Awake() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown ((UIBehaviour)this).Awake(); RT = (RectTransform)((Component)this).transform; parentRT = (RectTransform)((Component)this).transform.parent; } protected void LateUpdate() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_0072: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) ((Transform)RT).rotation = Quaternion.Euler(0f, 0f, 90f); RectTransform rT = RT; float num; Rect rect; if (!fitToHeight) { num = RT.sizeDelta.x; } else { rect = parentRT.rect; num = ((Rect)(ref rect)).height; } float num2; if (!fitToWidth) { num2 = RT.sizeDelta.y; } else { rect = parentRT.rect; num2 = ((Rect)(ref rect)).width; } rT.sizeDelta = new Vector2(num, num2); } } [RequireComponent(typeof(ScrollRect))] internal class ScrollFocusController : UIBehaviour { public float smoothScrollTime = 0.2f; private ScrollRect scrollRect; private Coroutine? smoothScrollRoutine; private bool menuAppearing = true; protected override void Awake() { ((UIBehaviour)this).Awake(); scrollRect = ((Component)this).GetComponent(); } protected override void OnEnable() { ((UIBehaviour)this).OnEnable(); menuAppearing = true; } internal void ScrollToIfOnMenuShow(Transform target) { if (menuAppearing) { ScrollTo(target); MenuScreen componentInParent = ((Component)this).GetComponentInParent(); if (Object.op_Implicit((Object)(object)componentInParent)) { ScrollFocusController[] componentsInChildren = ((Component)((Component)componentInParent).transform).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].SetMenuAppeared(); } } } menuAppearing = false; } internal void SetMenuAppeared() { menuAppearing = false; } public void ScrollTo(Transform target, bool smooth = false) { ScrollFocusController[] componentsInParent = ((Component)this).GetComponentsInParent(); for (int i = 0; i < componentsInParent.Length; i++) { componentsInParent[i].ScrollToInternal(target, smooth); } } private void ScrollToInternal(Transform target, bool smooth) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) menuAppearing = false; if (smoothScrollRoutine != null) { ((MonoBehaviour)this).StopCoroutine(smoothScrollRoutine); smoothScrollRoutine = null; } if (smooth) { smoothScrollRoutine = ((MonoBehaviour)this).StartCoroutine(Coro()); } else { scrollRect.normalizedPosition = GetScrollPoint(Vector2.op_Implicit(target.position)); } IEnumerator Coro() { Vector2 normalizedPosition = scrollRect.normalizedPosition; Vector2 scrollPoint = GetScrollPoint(Vector2.op_Implicit(target.position)); AnimationCurve curveX = AnimationCurve.EaseInOut(0f, normalizedPosition.x, smoothScrollTime, scrollPoint.x); AnimationCurve curveY = AnimationCurve.EaseInOut(0f, normalizedPosition.y, smoothScrollTime, scrollPoint.y); for (float time = 0f; time <= smoothScrollTime; time += Time.deltaTime) { scrollPoint = GetScrollPoint(Vector2.op_Implicit(target.position)); Keyframe[] obj = new Keyframe[2] { curveX.keys[0], default(Keyframe) }; Keyframe val = curveX.keys[^1]; ((Keyframe)(ref val)).value = scrollPoint.x; obj[1] = val; curveX.SetKeys((Keyframe[])(object)obj); Keyframe[] obj2 = new Keyframe[2] { curveY.keys[0], default(Keyframe) }; val = curveY.keys[^1]; ((Keyframe)(ref val)).value = scrollPoint.y; obj2[1] = val; curveY.SetKeys((Keyframe[])(object)obj2); scrollRect.normalizedPosition = new Vector2(curveX.Evaluate(time), curveY.Evaluate(time)); yield return null; } scrollRect.normalizedPosition = GetScrollPoint(Vector2.op_Implicit(target.position)); } } private Vector2 GetScrollPoint(Vector2 targetWorldPos) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_0037: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_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_0098: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) RectTransform viewport = scrollRect.viewport; RectTransform content = scrollRect.content; Rect rect = viewport.rect; Vector2 size = ((Rect)(ref rect)).size; rect = content.rect; Vector2 size2 = ((Rect)(ref rect)).size; Vector2 val = size2; Vector2 val2 = Vector2.op_Implicit(((Transform)content).InverseTransformPoint(Vector2.op_Implicit(targetWorldPos))); ((Vector2)(ref val)).Scale(content.pivot); ((Vector2)(ref size2)).Scale(Vector2.op_Implicit(((Transform)content).localScale)); val2 += val; ((Vector2)(ref val2)).Scale(Vector2.op_Implicit(((Transform)content).localScale)); Vector2 val3 = VectorUtil.Clamp01((val2 - size * 0.5f) / (size2 - size)); Vector2 result = val3; result.x = (scrollRect.horizontal ? val3.x : 0.5f); result.y = (scrollRect.vertical ? val3.y : 0.5f); return result; } } internal class ScrollNavigationHelper : EventTrigger { private ScrollRect scrollRect; private ScrollFocusController focusController; public Transform? container; private void Awake() { scrollRect = ((Component)this).GetComponentInParent(true); focusController = ((Component)this).GetComponentInParent(true); if (!Object.op_Implicit((Object)(object)scrollRect)) { throw new InvalidOperationException("Failed to find containing ScrollRect."); } if (!Object.op_Implicit((Object)(object)focusController)) { throw new InvalidOperationException("Failed to find containing ScrollFocusController."); } } private void OnTransformParentChanged() { Object.Destroy((Object)(object)this); } public override void OnSelect(BaseEventData eventData) { Transform target = (Transform)(Object.op_Implicit((Object)(object)container) ? ((object)container) : ((object)((Component)this).transform)); if (eventData is AxisEventData) { focusController.ScrollTo(target, smooth: true); } else if (((object)eventData).GetType() == typeof(BaseEventData)) { focusController.ScrollToIfOnMenuShow(target); } } public override void OnScroll(PointerEventData eventData) { scrollRect.OnScroll(eventData); } public override void OnDrag(PointerEventData eventData) { scrollRect.OnDrag(eventData); } public override void OnBeginDrag(PointerEventData eventData) { scrollRect.OnBeginDrag(eventData); } public override void OnEndDrag(PointerEventData eventData) { scrollRect.OnEndDrag(eventData); } public override void OnInitializePotentialDrag(PointerEventData eventData) { scrollRect.OnInitializePotentialDrag(eventData); } } [RequireComponent(typeof(ScrollRect))] internal class ScrollSliderController : UIBehaviour { [SerializeField] private Slider m_verticalSlider; [SerializeField] private Slider m_horizontalSlider; private ScrollRect scrollRect; public Slider VerticalSlider { get { return m_verticalSlider; } set { if (Object.op_Implicit((Object)(object)m_verticalSlider)) { ((UnityEvent)(object)m_verticalSlider.onValueChanged).RemoveListener((UnityAction)UpdateScrollRectVertical); } m_verticalSlider = value; if (Object.op_Implicit((Object)(object)m_verticalSlider)) { ((UnityEvent)(object)m_verticalSlider.onValueChanged).AddListener((UnityAction)UpdateScrollRectVertical); } } } public Slider HorizontalSlider { get { return m_horizontalSlider; } set { if (Object.op_Implicit((Object)(object)m_horizontalSlider)) { ((UnityEvent)(object)m_horizontalSlider.onValueChanged).RemoveListener((UnityAction)UpdateScrollRectHorizontal); } m_horizontalSlider = value; if (Object.op_Implicit((Object)(object)m_horizontalSlider)) { ((UnityEvent)(object)m_horizontalSlider.onValueChanged).AddListener((UnityAction)UpdateScrollRectHorizontal); } } } protected override void Awake() { scrollRect = ((Component)this).GetComponent(); } protected override void OnEnable() { if (Object.op_Implicit((Object)(object)VerticalSlider)) { ((UnityEvent)(object)VerticalSlider.onValueChanged).AddListener((UnityAction)UpdateScrollRectVertical); } if (Object.op_Implicit((Object)(object)HorizontalSlider)) { ((UnityEvent)(object)HorizontalSlider.onValueChanged).AddListener((UnityAction)UpdateScrollRectHorizontal); } ((UnityEvent)(object)scrollRect.onValueChanged).AddListener((UnityAction)UpdateVerticalSlider); ((UnityEvent)(object)scrollRect.onValueChanged).AddListener((UnityAction)UpdateHorizontalSlider); } protected override void OnDisable() { ((UnityEvent)(object)scrollRect.onValueChanged).RemoveListener((UnityAction)UpdateVerticalSlider); ((UnityEvent)(object)scrollRect.onValueChanged).RemoveListener((UnityAction)UpdateHorizontalSlider); if (Object.op_Implicit((Object)(object)VerticalSlider)) { ((UnityEvent)(object)VerticalSlider.onValueChanged).RemoveListener((UnityAction)UpdateScrollRectVertical); } if (Object.op_Implicit((Object)(object)HorizontalSlider)) { ((UnityEvent)(object)HorizontalSlider.onValueChanged).RemoveListener((UnityAction)UpdateScrollRectHorizontal); } } protected void LateUpdate() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)scrollRect) && Object.op_Implicit((Object)(object)scrollRect.content) && Object.op_Implicit((Object)(object)scrollRect.viewport)) { Rect rect = scrollRect.viewport.rect; Rect rect2 = scrollRect.content.rect; if (Object.op_Implicit((Object)(object)VerticalSlider)) { ((Component)VerticalSlider).gameObject.SetActive(scrollRect.vertical && ((int)scrollRect.verticalScrollbarVisibility == 0 || ((Rect)(ref rect2)).height > ((Rect)(ref rect)).height + 0.01f)); } if (Object.op_Implicit((Object)(object)HorizontalSlider)) { ((Component)HorizontalSlider).gameObject.SetActive(scrollRect.horizontal && ((int)scrollRect.horizontalScrollbarVisibility == 0 || ((Rect)(ref rect2)).width > ((Rect)(ref rect)).width + 0.01f)); } } } private void UpdateVerticalSlider(Vector2 v) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (VerticalUpdateNeeded()) { VerticalSlider.normalizedValue = scrollRect.normalizedPosition.y; } } private void UpdateHorizontalSlider(Vector2 v) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (HorizontalUpdateNeeded()) { HorizontalSlider.normalizedValue = scrollRect.normalizedPosition.x; } } private void UpdateScrollRectVertical(float v) { if (VerticalUpdateNeeded()) { scrollRect.verticalNormalizedPosition = VerticalSlider.normalizedValue; } } private void UpdateScrollRectHorizontal(float v) { if (HorizontalUpdateNeeded()) { scrollRect.horizontalNormalizedPosition = HorizontalSlider.normalizedValue; } } private bool VerticalUpdateNeeded() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (scrollRect.vertical && Object.op_Implicit((Object)(object)VerticalSlider)) { return !Mathf.Approximately(scrollRect.normalizedPosition.y, VerticalSlider.normalizedValue); } return false; } private bool HorizontalUpdateNeeded() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (scrollRect.horizontal && Object.op_Implicit((Object)(object)HorizontalSlider)) { return !Mathf.Approximately(scrollRect.normalizedPosition.x, HorizontalSlider.normalizedValue); } return false; } } internal class SelectableWrapper(Selectable selectable) : INavigable { private readonly Selectable selectable = selectable; private Navigation Nav { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return selectable.navigation; } set { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: 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) Selectable obj = selectable; Navigation navigation = value; ((Navigation)(ref navigation)).mode = (Mode)4; ((Navigation)(ref navigation)).wrapAround = false; obj.navigation = navigation; } } public void ClearNeighbor(NavigationDirection direction) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_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_003a: 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_003f: 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) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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_006c: Unknown result type (might be due to invalid IL or missing references) Navigation nav; Navigation nav2; switch (direction) { case NavigationDirection.Up: nav = Nav; ((Navigation)(ref nav)).selectOnUp = null; nav2 = nav; break; case NavigationDirection.Left: nav = Nav; ((Navigation)(ref nav)).selectOnLeft = null; nav2 = nav; break; case NavigationDirection.Right: nav = Nav; ((Navigation)(ref nav)).selectOnRight = null; nav2 = nav; break; case NavigationDirection.Down: nav = Nav; ((Navigation)(ref nav)).selectOnDown = null; nav2 = nav; break; default: throw direction.UnsupportedEnum(); } Nav = nav2; } public void ClearNeighbors() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) Nav = default(Navigation); } public bool GetSelectable(NavigationDirection direction, [MaybeNullWhen(false)] out Selectable selectable) { selectable = this.selectable; return true; } public void SetNeighbor(NavigationDirection direction, Selectable selectable) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_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_003a: 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_003f: 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) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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_006c: Unknown result type (might be due to invalid IL or missing references) Navigation nav; Navigation nav2; switch (direction) { case NavigationDirection.Up: nav = Nav; ((Navigation)(ref nav)).selectOnUp = selectable; nav2 = nav; break; case NavigationDirection.Left: nav = Nav; ((Navigation)(ref nav)).selectOnLeft = selectable; nav2 = nav; break; case NavigationDirection.Right: nav = Nav; ((Navigation)(ref nav)).selectOnRight = selectable; nav2 = nav; break; case NavigationDirection.Down: nav = Nav; ((Navigation)(ref nav)).selectOnDown = selectable; nav2 = nav; break; default: throw direction.UnsupportedEnum(); } Nav = nav2; } } internal static class StringUtil { internal static string Truncate(this string self, int maxChars) { if (maxChars <= 3 || self.Length <= maxChars) { return self; } return self.Substring(0, maxChars - 3) + "..."; } internal static string FirstLine(this string self, int maxChars) { string text = self.Split('\n')[0]; text = text.Split("
")[0]; if (text.Length > maxChars) { return text.Substring(0, maxChars - 3) + "..."; } return text; } internal static string UnCamelCase(this string self) { if (self.Contains(' ')) { return self; } StringBuilder stringBuilder = new StringBuilder(); bool flag = false; bool flag2 = true; foreach (char c in self) { if (flag2) { flag2 = false; stringBuilder.Append(char.ToUpper(c)); flag = char.IsUpper(c); continue; } if (char.IsUpper(c) && !flag) { stringBuilder.Append(' '); } stringBuilder.Append(c); flag = char.IsUpper(c); } return stringBuilder.ToString(); } internal static bool TryParseHex(this string self, out byte n) { return byte.TryParse(self, NumberStyles.HexNumber, null, out n); } } internal static class ThreadLocalContext where T : class { private class Scoped : IDisposable { private readonly T? prev; public Scoped(T value) { prev = ThreadLocalContext.currentValue; ThreadLocalContext.currentValue = value; } public void Dispose() { ThreadLocalContext.currentValue = prev; } } [ThreadStatic] private static T? currentValue; internal static bool Get([MaybeNullWhen(false)] out T value) { T val = currentValue; if (val != null) { value = val; return true; } value = null; return false; } internal static IDisposable Set(T value) { return new Scoped(value); } } internal class TreeNode where V : new() { private readonly Dictionary> subtrees = new Dictionary>(); public V Value = new V(); public IReadOnlyDictionary> Subtrees => subtrees; public TreeNode this[IEnumerable keys] { get { TreeNode treeNode = this; foreach (K key in keys) { if (treeNode.subtrees.TryGetValue(key, out TreeNode value)) { treeNode = value; continue; } value = new TreeNode(); treeNode.subtrees[key] = value; treeNode = value; } return treeNode; } } private void ForEachPostfixRecursive(List keys, Action, TreeNode> action) { foreach (KeyValuePair> subtree in subtrees) { keys.Add(subtree.Key); subtree.Value.ForEachPostfixRecursive(keys, action); keys.RemoveAt(keys.Count - 1); } action(keys, this); } public void ForEachPostfix(Action, TreeNode> action) { ForEachPostfixRecursive(new List(), action); } } internal static class UIManagerUtil { private static readonly List menuScreenFields = (from f in typeof(UIManager).GetFields(BindingFlags.Instance | BindingFlags.Public) where f.FieldType == typeof(MenuScreen) select f).ToList(); internal static MenuScreen? GetActiveMenuScreen(this UIManager self) { foreach (FieldInfo menuScreenField in menuScreenFields) { object? value = menuScreenField.GetValue(self); MenuScreen val = (MenuScreen)((value is MenuScreen) ? value : null); if (!((Object)(object)val == (Object)null) && ((Component)val).gameObject.activeInHierarchy) { return val; } } return null; } internal static void PlaySlider(this UIManager self) { UnityExtensions.FindChild(((Component)self).gameObject, "UIAudioPlayer").GetComponent().PlaySlider(); } } internal static class VectorUtil { [SpecialName] public sealed class $A8F42B4D85DA93665F1D4BD0C4F0ABAD { [SpecialName] public static class $A8F42B4D85DA93665F1D4BD0C4F0ABAD { } [ExtensionMarker("$A8F42B4D85DA93665F1D4BD0C4F0ABAD")] internal static bool Approximately(Vector2 v1, Vector2 v2) { throw new NotSupportedException(); } [ExtensionMarker("$A8F42B4D85DA93665F1D4BD0C4F0ABAD")] internal static Vector2 Clamp01(Vector2 v) { throw new NotSupportedException(); } } [SpecialName] public sealed class $8F1CC08547E77D955A6D73192FA545FB { [SpecialName] public static class $8F1CC08547E77D955A6D73192FA545FB { } [ExtensionMarker("$8F1CC08547E77D955A6D73192FA545FB")] internal static bool Approximately(Vector3 v1, Vector3 v2) { throw new NotSupportedException(); } [ExtensionMarker("$8F1CC08547E77D955A6D73192FA545FB")] internal static Vector3 Clamp01(Vector3 v) { throw new NotSupportedException(); } } internal static bool Approximately(Vector2 v1, Vector2 v2) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (Mathf.Approximately(v1.x, v2.x)) { return Mathf.Approximately(v1.y, v2.y); } return false; } internal static Vector2 Clamp01(Vector2 v) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_000b: Unknown result type (might be due to invalid IL or missing references) return Extensions.ClampVector2(v, Vector2.zero, Vector2.one); } internal static bool Approximately(Vector3 v1, Vector3 v2) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_0007: 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_0019: Unknown result type (might be due to invalid IL or missing references) if (Approximately(Vector2.op_Implicit(v1), Vector2.op_Implicit(v2))) { return Mathf.Approximately(v1.z, v2.z); } return false; } internal static Vector3 Clamp01(Vector3 v) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0013: 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) Vector3 result = Vector2.op_Implicit(Clamp01(Vector2.op_Implicit(v))); result.z = Mathf.Clamp01(v.z); return result; } } } namespace Silksong.ModMenu.Generator { [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] public class GenerateMenuAttribute : Attribute { } [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] public class ElementFactoryAttribute : Attribute where T : IElementFactory, new() { } [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] public class ModMenuIncludeAttribute : Attribute { } [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] public class ModMenuOptionsAttribute(params object[] options) : Attribute() { public readonly object[] Options = options; } [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] public class ModMenuRangeAttribute(object Min, object Max) : Attribute() { public readonly object Min = Min; public readonly object Max = Max; } [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] public class SubMenuAttribute : Attribute where T : ICustomMenu, new() { } public record CustomMenuValueChangedEvent(string MemberName, object? Value); public interface ICustomMenu : ICustomMenu { event Action? OnValueChanged; void ExportTo(T data); void ApplyFrom(T data); IEnumerable Elements(); } public interface ICustomMenu { } public interface IElementFactory : IElementFactory where E : SelectableValueElement { E CreateElement(LocalizedText name, LocalizedText description); } public interface IElementFactory { } public class SubMenuElement : TextButton where M : ICustomMenu { public readonly M SubMenu; public SubMenuElement(LocalizedText text, M subMenu, LocalizedText? description = null) : base(text, description ?? ((LocalizedText)"")) { SubMenu = subMenu; PaginatedMenuScreenBuilder paginatedMenuScreenBuilder = new PaginatedMenuScreenBuilder(text); paginatedMenuScreenBuilder.AddRange(SubMenu.Elements()); PaginatedMenuScreen screen = paginatedMenuScreenBuilder.Build(); OnSubmit = (Action)Delegate.Combine(OnSubmit, (Action)delegate { MenuScreenNavigation.Show(screen); }); } } } namespace Silksong.ModMenu.Elements { public abstract class AbstractGroup : MenuDisposable, INavigableMenuEntity, IMenuEntity, INavigable { private readonly VisibilityManager visibility = new VisibilityManager(DefaultVisibility: false); private GameObject? gameObjectParent; public VisibilityManager Visibility => visibility; protected AbstractGroup() { base.OnDispose += delegate { foreach (MenuDisposable item in AllEntities().OfType()) { item.Dispose(); } }; } public abstract IEnumerable AllEntities(); public IEnumerable AllElements() { return AllEntities().SelectMany((IMenuEntity e) => e.AllElements()); } public abstract bool Contains(IMenuEntity entity); protected void AddChild(IMenuEntity entity) { entity.SetParents(this, gameObjectParent); } public abstract void Clear(); protected abstract IEnumerable GetNavigables(NavigationDirection direction); public virtual void ClearNeighbor(NavigationDirection direction) { foreach (INavigable navigable in GetNavigables(direction)) { navigable.ClearNeighbor(direction); } } public virtual void ClearNeighbors() { ClearNeighbor(NavigationDirection.Up); ClearNeighbor(NavigationDirection.Left); ClearNeighbor(NavigationDirection.Right); ClearNeighbor(NavigationDirection.Down); } public virtual SelectableElement? GetDefaultSelectable() { return (from n in (from e in AllEntities() where IMenuEntityExtensions.get_VisibleSelf(e) select e).OfType() select n.GetDefaultSelectable()).WhereNonNull().FirstOrDefault(); } public abstract bool GetSelectable(NavigationDirection direction, [MaybeNullWhen(false)] out Selectable selectable); public virtual void SetGameObjectParent(GameObject parent) { ClearGameObjectParent(); gameObjectParent = parent; foreach (IMenuEntity item in AllEntities()) { item.SetGameObjectParent(gameObjectParent); } } public virtual void ClearGameObjectParent() { if ((Object)(object)gameObjectParent == (Object)null) { return; } foreach (IMenuEntity item in AllEntities()) { item.ClearGameObjectParent(); } } public virtual void SetNeighbor(NavigationDirection direction, Selectable selectable) { foreach (INavigable navigable in GetNavigables(direction)) { navigable.SetNeighbor(direction, selectable); } } public abstract void UpdateLayout(Vector2 localAnchorPos); } public abstract class BaseSelectableValueElement : SelectableElement { public abstract IBaseValueModel RawModel { get; } protected BaseSelectableValueElement(GameObject container, Selectable selectable) : base(container, selectable) { } } public class ChoiceElement : SelectableValueElement { public readonly IChoiceModel ChoiceModel; public readonly Text LabelText; public readonly Text DescriptionText; public readonly Text ChoiceText; public ChoiceElement(LocalizedText label, IChoiceModel model, LocalizedText description) : base(MenuPrefabs.Get().NewTextChoiceContainer(out MenuOptionHorizontal menuOptionHorizontal), (Selectable)(object)menuOptionHorizontal, (IValueModel)model) { ChoiceModel = model; GameObject gameObject = ((Component)menuOptionHorizontal).gameObject; CustomMenuOptionHorizontal custom = gameObject.AddComponent(); custom.Model = model; LabelText = UnityExtensions.FindChild(gameObject, "Menu Option Label").GetComponent(); DescriptionText = UnityExtensions.FindChild(gameObject, "Description").GetComponent(); ChoiceText = UnityExtensions.FindChild(gameObject, "Menu Option Text").GetComponent(); base.OnValueChanged += delegate { custom.UpdateText(); }; LocalizedTextExtensions.set_LocalizedText(LabelText, label); LocalizedTextExtensions.set_LocalizedText(DescriptionText, description); custom.UpdateText(); } public ChoiceElement(LocalizedText label, IChoiceModel model) : this(label, model, (LocalizedText)"") { } public ChoiceElement(LocalizedText label, List items, LocalizedText description) : this(label, (IChoiceModel)ChoiceModels.ForValues(items), description) { } public ChoiceElement(LocalizedText label, List items) : this(label, (IChoiceModel)ChoiceModels.ForValues(items), (LocalizedText)"") { } public override void SetMainColor(Color color) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) ((Graphic)LabelText).color = color; ((Graphic)DescriptionText).color = color; ((Graphic)ChoiceText).color = color; } public override void SetFontSizes(FontSizes fontSizes) { LabelText.fontSize = fontSizes.LabelSize(); DescriptionText.fontSize = fontSizes.DescriptionSize(); ChoiceText.fontSize = fontSizes.ChoiceSize(); } } public class ColorInput : TextInput { public enum InputFormat { RGB = 6, RGBA = 8 } [CompilerGenerated] private static class <>O { public static OnValidateInput <0>__HexValidation; } private readonly float swatchSizeMultiplier; [CompilerGenerated] private InputFormat k__BackingField; public readonly RectTransform Swatch; public readonly Image SwatchFill; public readonly Image SwatchOutline; public readonly Text InvalidValueIndicator; public InputFormat Format { get { return k__BackingField; } set { k__BackingField = value; InputField.characterLimit = (int)k__BackingField; string text = InputField.text; InputField.SetTextWithoutNotify(""); InputField.text = text; } } public ColorInput(LocalizedText label) : this(label, "") { } public ColorInput(LocalizedText label, LocalizedText description) : base(label, (ITextModel)TextModels.ForHexColors(), description) { //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_0056: Expected O, but got Unknown ((Object)Container).name = label.Canonical + " Color Input"; InputField.contentType = (ContentType)9; InputField inputField = InputField; object obj = <>O.<0>__HexValidation; if (obj == null) { OnValidateInput val = HexValidation; <>O.<0>__HexValidation = val; obj = (object)val; } inputField.onValidateInput = (OnValidateInput)obj; ApplyDefaultColors = true; Format = InputFormat.RGBA; Swatch = GameObjectUtil.get_RectTransform(MenuPrefabs.Get().NewColorSwatch()); ((Transform)Swatch).SetParent(((Component)InputField.textComponent).transform, false); ((Component)Swatch).gameObject.SetActive(true); SwatchFill = ((Component)((Transform)Swatch).Find("Fill")).GetComponent(); SwatchOutline = ((Component)((Transform)Swatch).Find("Outline")).GetComponent(); InvalidValueIndicator = ((Component)((Transform)Swatch).Find("Invalid Indicator")).GetComponent(); Rect rect = Swatch.rect; swatchSizeMultiplier = ((Rect)(ref rect)).height / InputField.textComponent.preferredHeight; base.OnTextValueChanged += delegate { //IL_0007: Unknown result type (might be due to invalid IL or missing references) ((Graphic)SwatchFill).color = base.Value; base.State = ((!TextModel.IsTextValid) ? ElementState.INVALID : ElementState.DEFAULT); ((Behaviour)InvalidValueIndicator).enabled = !TextModel.IsTextValid; }; base.Value = Color.clear; } public override void SetFontSizes(FontSizes fontSizes) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0055: Unknown result type (might be due to invalid IL or missing references) base.SetFontSizes(fontSizes); float num = InputField.textComponent.preferredHeight * swatchSizeMultiplier; Swatch.sizeDelta = Vector2.one * num; RectTransform swatch = Swatch; Vector2 anchoredPosition = Swatch.anchoredPosition; anchoredPosition.x = -0.5f * num; swatch.anchoredPosition = anchoredPosition; } private static char HexValidation(string input, int index, char addedChar) { if (!$"{addedChar}".TryParseHex(out var _)) { return '0'; } return char.ToUpper(addedChar); } } public static class Colors { public static readonly Color DEFAULT = Color.white; public static readonly Color DEFAULT_LOCKED = Color.grey; public static readonly Color TRUE = Color.Lerp(Color.white, Color.yellow, 0.5f); public static readonly Color TRUE_LOCKED = Color.Lerp(Color.grey, Color.yellow, 0.5f); public static readonly Color FALSE = Color.grey; public static readonly Color FALSE_LOCKED = Color.Lerp(Color.grey, Color.black, 0.5f); public static readonly Color INVALID = Color.Lerp(Color.white, Color.red, 0.5f); public static readonly Color INVALID_LOCKED = Color.Lerp(INVALID, Color.black, 0.5f); public static Color GetDefaultColor(ElementState state, bool interactable) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) return (Color)(state switch { ElementState.TRUE => interactable ? TRUE : TRUE_LOCKED, ElementState.FALSE => interactable ? FALSE : FALSE_LOCKED, ElementState.INVALID => interactable ? FALSE : INVALID_LOCKED, _ => interactable ? DEFAULT : DEFAULT_LOCKED, }); } public static Color GetDefaultColor(MenuElement menuElement) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) return GetDefaultColor(menuElement.State, interactable: false); } public static Color GetDefaultColor(SelectableElement selectableMenuElement) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return GetDefaultColor(selectableMenuElement.State, selectableMenuElement.Interactable); } } public class DynamicDescriptionChoiceElement : ChoiceElement { internal const string RIGHT_DESCRIPTION_NAME = "ModMenu-Right Description"; public readonly Text RightText; public DynamicDescriptionChoiceElement(LocalizedText label, IChoiceModel model, LocalizedText description, LocalizedText rightDescription) : base(label, model, description) { RightText = SetupRightDescription(DescriptionText, ChoiceText, SelectableComponent); LocalizedTextExtensions.set_LocalizedText(RightText, rightDescription); } public DynamicDescriptionChoiceElement(LocalizedText label, IChoiceModel model, LocalizedText description, Func getRightDescription) : this(label, model, description, getRightDescription(model.Value)) { DynamicDescriptionChoiceElement dynamicDescriptionChoiceElement = this; model.OnValueChanged += delegate(T value) { LocalizedTextExtensions.set_LocalizedText(dynamicDescriptionChoiceElement.RightText, getRightDescription(value)); }; } private static Text SetupRightDescription(Text descriptionText, Text choiceText, Selectable selectable) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) GameObject gameObject = ((Component)descriptionText).gameObject; GameObject val = Object.Instantiate(gameObject, gameObject.transform.parent, true); ((Object)val).name = "ModMenu-Right Description"; val.SetActive(true); Text component = val.GetComponent(); component.alignment = (TextAnchor)5; RectTransform component2 = gameObject.GetComponent(); RectTransform component3 = val.GetComponent(); RectTransform component4 = ((Component)choiceText).gameObject.GetComponent(); component3.anchorMin = new Vector2(1f, 0.5f); component3.anchorMax = new Vector2(1f, 0.5f); component3.pivot = new Vector2(1f, 0.5f); component3.anchoredPosition = new Vector2(component4.anchoredPosition.x + (1f - component4.pivot.x) * component4.sizeDelta.x, component2.anchoredPosition.y); ChangePositionByLanguage val2 = default(ChangePositionByLanguage); if (val.TryGetComponent(ref val2)) { val2.originalPosition = val.transform.localPosition; } UnityExtensions.GetOrAddComponent(((Component)selectable).gameObject).Animators.Add(val.GetComponent()); return component; } public override void SetFontSizes(FontSizes fontSizes) { base.SetFontSizes(fontSizes); RightText.fontSize = fontSizes.DescriptionSize(); } public override void SetMainColor(Color color) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) base.SetMainColor(color); ((Graphic)RightText).color = color; } } public enum ElementState { DEFAULT, TRUE, FALSE, INVALID } public static class FontSizeConstants { public const int CHOICE_SMALL = 24; public const int CHOICE_MEDIUM = 38; public const int CHOICE_LARGE = 56; public const int DESCRIPTION_SMALL = 27; public const int DESCRIPTION_MEDIUM = 41; public const int DESCRIPTION_LARGE = 55; public const int LABEL_SMALL = 30; public const int LABEL_MEDIUM = 45; public const int LABEL_LARGE = 60; public const int SLIDER_SMALL = 22; public const int SLIDER_MEDIUM = 32; public const int SLIDER_LARGE = 48; public static int ChoiceSize(this FontSizes self) { return self switch { FontSizes.Small => 24, FontSizes.Medium => 38, FontSizes.Large => 56, _ => 38, }; } public static int DescriptionSize(this FontSizes self) { return self switch { FontSizes.Small => 27, FontSizes.Medium => 41, FontSizes.Large => 55, _ => 41, }; } public static int LabelSize(this FontSizes self) { return self switch { FontSizes.Small => 30, FontSizes.Medium => 45, FontSizes.Large => 60, _ => 45, }; } public static int SliderSize(this FontSizes self) { return self switch { FontSizes.Small => 22, FontSizes.Medium => 32, FontSizes.Large => 48, _ => 32, }; } } public enum FontSizes { Small, Medium, Large } public class FreeGroup : AbstractGroup { private readonly LinkedDictionary entities = new LinkedDictionary(); public int Count => entities.Count; public override IEnumerable AllEntities() { return entities.Keys; } public override bool Contains(IMenuEntity entity) { return entities.ContainsKey(entity); } public bool TryGetOffset(IMenuEntity entity, out Vector2 offset) { return entities.TryGetValue(entity, out offset); } public void Add(IMenuEntity entity, Vector2 offset) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) entities[entity] = offset; AddChild(entity); } public void Update(IMenuEntity entity, Vector2 offset) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (!entities.ContainsKey(entity)) { throw new ArgumentException("Entity not present in FreeGroup"); } entities[entity] = offset; } public bool Remove(IMenuEntity entity) { if (entities.Remove(entity)) { entity.ClearParents(); return true; } return false; } public override void Clear() { foreach (IMenuEntity key in entities.Keys) { key.ClearParents(); } entities.Clear(); } private static float SortKey(NavigationDirection direction, Vector2 pos) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) return direction switch { NavigationDirection.Up => 0f - pos.y, NavigationDirection.Left => pos.x, NavigationDirection.Right => 0f - pos.x, NavigationDirection.Down => pos.y, _ => throw new ArgumentException($"{direction}"), }; } public override bool GetSelectable(NavigationDirection direction, [MaybeNullWhen(false)] out Selectable selectable) { selectable = (from n in GetNavigables(direction) select (!n.GetSelectable(direction, out Selectable selectable2)) ? null : selectable2).FirstOrDefault(); return (Object)(object)selectable != (Object)null; } protected override IEnumerable GetNavigables(NavigationDirection direction) { IEnumerable> source = entities.Where>((KeyValuePair e) => IMenuEntityExtensions.get_VisibleSelf(e.Key) && e.Key is INavigable); if (!source.Select((KeyValuePair e) => SortKey(direction, e.Value)).TryGetMin(out var key)) { return Array.Empty(); } return (from e in source where SortKey(direction, e.Value) == key select e.Key as INavigable).Take(1); } public override void UpdateLayout(Vector2 localAnchorPos) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) ClearNeighbors(); foreach (KeyValuePair entity in entities) { entity.Key.UpdateLayout(localAnchorPos + entity.Value); } } } public class GridGroup : AbstractGroup { private record GridCell(int Row, int Column) : IComparable { internal GridCell Next(GridGroup parent) { if (Column != parent.Columns - 1) { return new GridCell(Row, Column + 1); } return new GridCell(Row + 1, 0); } public int CompareTo(GridCell other) { if (Row != other.Row) { return Row.CompareTo(other.Row); } return Column.CompareTo(other.Column); } } private readonly List rows = new List(); private readonly Dictionary index = new Dictionary(); public readonly int Columns; public float HorizontalSpacing; public float VerticalSpacing; public bool WrapHorizontal; private GridCell nextEmptyCell; public int Rows => rows.Count; public GridGroup(int columns) { if (columns <= 0) { throw new ArgumentException($"Columns: {columns}"); } Columns = columns; HorizontalSpacing = SpacingConstants.HSPACE_MEDIUM; VerticalSpacing = SpacingConstants.VSPACE_MEDIUM; nextEmptyCell = new GridCell(0, 0); base..ctor(); } public override bool Contains(IMenuEntity entity) { return index.ContainsKey(entity); } public bool TryGetCell(IMenuEntity entity, out int row, out int column) { if (index.TryGetValue(entity, out GridCell value)) { row = value.Row; column = value.Column; return true; } row = -1; column = -1; return false; } public bool TryGetEntity(int row, int column, [MaybeNullWhen(false)] out IMenuEntity entity) { return TryGetValue(new GridCell(row, column), out entity); } public void Add(IMenuEntity entity) { while (IsFull(nextEmptyCell)) { nextEmptyCell = nextEmptyCell.Next(this); } AddAt(nextEmptyCell.Row, nextEmptyCell.Column, entity); nextEmptyCell = nextEmptyCell.Next(this); } public void AddAt(int row, int column, IMenuEntity entity) { if (row < 0) { throw new ArgumentException(string.Format("{0}: {1} (Must be >= 0)", "row", row)); } if (column < 0 || column >= Columns) { throw new ArgumentException(string.Format("{0}: {1} (Must be in [0, {2}))", "column", column, Columns)); } GridCell gridCell = new GridCell(row, column); if (index.TryGetValue(entity, out GridCell value)) { if (!(gridCell == value)) { throw new ArgumentException($"Entity already present at ({row}, {column})"); } return; } if (IsFull(gridCell)) { throw new ArgumentException($"({row}, {column}) is already filled."); } while (rows.Count <= row) { rows.Add(new IMenuEntity[Columns]); } rows[row][column] = entity; index[entity] = gridCell; AddChild(entity); } public bool Remove(IMenuEntity entity) { if (!index.TryGetValue(entity, out GridCell value)) { return false; } index.Remove(entity); rows[value.Row][value.Column] = null; nextEmptyCell = ((value.CompareTo(nextEmptyCell) <= 0) ? value : nextEmptyCell); entity.ClearParents(); if (value.Row == rows.Count - 1) { int num = value.Row; while (num >= 0 && rows[num].All((IMenuEntity e) => e == null)) { rows.RemoveAt(num); num--; } } return true; } public bool RemoveAt(int row, int column) { if (TryGetValue(new GridCell(row, column), out IMenuEntity entity)) { return Remove(entity); } return false; } public override void Clear() { foreach (IMenuEntity key in index.Keys) { key.ClearParents(); } rows.Clear(); index.Clear(); nextEmptyCell = new GridCell(0, 0); } public override bool GetSelectable(NavigationDirection direction, [MaybeNullWhen(false)] out Selectable selectable) { INavigable navigable = direction switch { NavigationDirection.Up => (from e in AllEntities() where IMenuEntityExtensions.get_VisibleSelf(e) select e).OfType().LastOrDefault(), NavigationDirection.Left => GetColumns().SelectMany((ListView col) => col.WhereNonNull((IMenuEntity e) => IMenuEntityExtensions.get_VisibleSelf(e)).OfType()).LastOrDefault(), NavigationDirection.Right => GetColumns().SelectMany((ListView col) => col.WhereNonNull((IMenuEntity e) => IMenuEntityExtensions.get_VisibleSelf(e)).OfType()).FirstOrDefault(), NavigationDirection.Down => (from e in AllEntities() where IMenuEntityExtensions.get_VisibleSelf(e) select e).OfType().FirstOrDefault(), _ => throw new ArgumentException($"{direction}"), }; selectable = null; return navigable?.GetSelectable(direction, out selectable) ?? false; } public override void UpdateLayout(Vector2 localAnchorPos) { //IL_002b: 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_0070: Unknown result type (might be due to invalid IL or missing references) ClearNeighbors(); foreach (KeyValuePair item in index) { IMenuEntity key = item.Key; GridCell value = item.Value; Vector2 localAnchorPos2 = localAnchorPos; localAnchorPos2.y -= VerticalSpacing * (float)value.Row; localAnchorPos2.x += HorizontalSpacing * ((float)value.Column - (float)(Columns - 1) / 2f); key.UpdateLayout(localAnchorPos2); } INavigable[] array = null; foreach (IMenuEntity[] row in rows) { INavigable[] array2 = row.Select((IMenuEntity e) => (e == null || !IMenuEntityExtensions.get_VisibleSelf(e)) ? null : (e as INavigable)).ToArray(); if (!array2.Any((INavigable n) => n != null)) { continue; } if (array != null) { for (int num = 0; num < Columns; num++) { if (array[num] != null && ClosestColumn(array2, NavigationDirection.Down, num, out var target)) { array[num].SetNeighborDown(target); } if (array2[num] != null && ClosestColumn(array, NavigationDirection.Up, num, out target)) { array2[num].SetNeighborUp(target); } } } array = array2; foreach (var (self, dest) in WrapHorizontal ? array2.WhereNonNull().CircularPairs() : array2.WhereNonNull().Pairs()) { self.ConnectSymmetric(dest, NavigationDirection.Right); } } static bool ClosestColumn(INavigable?[] row, NavigationDirection dir, int column, [MaybeNullWhen(false)] out Selectable reference) { int num2 = 0; while (num2 < row.Length) { int num3 = column + ((dir == NavigationDirection.Down) ? num2 : (-num2)); num2 = ((num2 == 0) ? 1 : ((num2 <= 0) ? (1 - num2) : (-num2))); if (num3 >= 0 && num3 < row.Length) { INavigable? obj = row[num3]; if (obj != null && obj.GetSelectable(dir, out reference)) { return true; } } } reference = null; return false; } } public override IEnumerable AllEntities() { return rows.SelectMany((IMenuEntity[] row) => row.WhereNonNull()); } private ListView> GetColumns() { return new ListView>((int column) => new ListView((int row) => rows[row][column], rows.Count), Columns); } protected override IEnumerable GetNavigables(NavigationDirection direction) { return direction switch { NavigationDirection.Up => rows.FirstOrDefault((IMenuEntity[] row) => row.Any((IMenuEntity e) => e is INavigable && IMenuEntityExtensions.get_VisibleSelf(e)))?.OfType() ?? Array.Empty(), NavigationDirection.Left => rows.SelectMany((IMenuEntity[] row) => row.Where((IMenuEntity e) => e is INavigable && IMenuEntityExtensions.get_VisibleSelf(e)).Take(1)).OfType(), NavigationDirection.Right => rows.SelectMany((IMenuEntity[] row) => row.Where((IMenuEntity e) => e is INavigable && IMenuEntityExtensions.get_VisibleSelf(e)).TakeLast(1)).OfType(), NavigationDirection.Down => rows.Where((IMenuEntity[] row) => row.Any((IMenuEntity e) => e is INavigable && IMenuEntityExtensions.get_VisibleSelf(e))).LastOrDefault()?.OfType() ?? Array.Empty(), _ => throw new ArgumentException($"{direction}"), }; } private bool TryGetValue(GridCell cell, [MaybeNullWhen(false)] out IMenuEntity entity) { entity = null; if (cell.Row < 0 || cell.Row >= rows.Count || cell.Column < 0 || cell.Column >= Columns) { return false; } entity = rows[cell.Row][cell.Column]; return entity != null; } private bool IsFull(GridCell cell) { IMenuEntity entity; return TryGetValue(cell, out entity); } } public interface IMenuEntity { VisibilityManager Visibility { get; } IEnumerable AllElements(); void UpdateLayout(Vector2 localAnchorPos); void SetGameObjectParent(GameObject container); void ClearGameObjectParent(); } public static class IMenuEntityExtensions { [SpecialName] public sealed class $DB042A3C43BFD14DC50AB9231B00FB60 { [SpecialName] public static class $6232F0A2B56B44C40FFF7BF23CA9914E { } [ExtensionMarker("$6232F0A2B56B44C40FFF7BF23CA9914E")] public bool Visible { [ExtensionMarker("$6232F0A2B56B44C40FFF7BF23CA9914E")] get { throw new NotSupportedException(); } } [ExtensionMarker("$6232F0A2B56B44C40FFF7BF23CA9914E")] public bool VisibleSelf { [ExtensionMarker("$6232F0A2B56B44C40FFF7BF23CA9914E")] get { throw new NotSupportedException(); } [ExtensionMarker("$6232F0A2B56B44C40FFF7BF23CA9914E")] set { throw new NotSupportedException(); } } [ExtensionMarker("$6232F0A2B56B44C40FFF7BF23CA9914E")] public bool VisibleInHierarchy { [ExtensionMarker("$6232F0A2B56B44C40FFF7BF23CA9914E")] get { throw new NotSupportedException(); } } [ExtensionMarker("$6232F0A2B56B44C40FFF7BF23CA9914E")] public void SetParents(IMenuEntity parent, GameObject? container = null) { throw new NotSupportedException(); } [ExtensionMarker("$6232F0A2B56B44C40FFF7BF23CA9914E")] public void ClearParents() { throw new NotSupportedException(); } } public static bool get_Visible(IMenuEntity self) { return self.Visibility.VisibleInHierarchy; } public static bool get_VisibleSelf(IMenuEntity self) { return self.Visibility.VisibleSelf; } public static void set_VisibleSelf(IMenuEntity self, bool value) { self.Visibility.VisibleSelf = value; } public static bool get_VisibleInHierarchy(IMenuEntity self) { return self.Visibility.VisibleInHierarchy; } public static void SetParents(this IMenuEntity self, IMenuEntity parent, GameObject? container = null) { self.Visibility.SetParent(parent.Visibility); if ((Object)(object)container != (Object)null) { self.SetGameObjectParent(container); } else { self.ClearGameObjectParent(); } } public static void ClearParents(this IMenuEntity self) { self.Visibility.ClearParent(); self.ClearGameObjectParent(); } } public interface INavigable { void ClearNeighbors(); void SetNeighbor(NavigationDirection direction, Selectable selectable); void ClearNeighbor(NavigationDirection direction); bool GetSelectable(NavigationDirection direction, [MaybeNullWhen(false)] out Selectable selectable); } public static class INavigableExtensions { [SpecialName] public sealed class $CB93A9300B4C197E540AA528C0982776 { [SpecialName] public static class $C1DBD4770CEC6FE4528F36E596E0ACC7 { } [ExtensionMarker("$C1DBD4770CEC6FE4528F36E596E0ACC7")] public void SetNeighborUp(Selectable selectable) { throw new NotSupportedException(); } [ExtensionMarker("$C1DBD4770CEC6FE4528F36E596E0ACC7")] public void SetNeighborUp(SelectableElement selectableElement) { throw new NotSupportedException(); } [ExtensionMarker("$C1DBD4770CEC6FE4528F36E596E0ACC7")] public void ClearNeighborUp() { throw new NotSupportedException(); } [ExtensionMarker("$C1DBD4770CEC6FE4528F36E596E0ACC7")] public bool GetNeighborUp([MaybeNullWhen(false)] out Selectable selectable) { throw new NotSupportedException(); } [ExtensionMarker("$C1DBD4770CEC6FE4528F36E596E0ACC7")] public void SetNeighborLeft(Selectable selectable) { throw new NotSupportedException(); } [ExtensionMarker("$C1DBD4770CEC6FE4528F36E596E0ACC7")] public void SetNeighborLeft(SelectableElement selectableElement) { throw new NotSupportedException(); } [ExtensionMarker("$C1DBD4770CEC6FE4528F36E596E0ACC7")] public void ClearNeighborLeft() { throw new NotSupportedException(); } [ExtensionMarker("$C1DBD4770CEC6FE4528F36E596E0ACC7")] public bool GetNeighborLeft([MaybeNullWhen(false)] out Selectable selectable) { throw new NotSupportedException(); } [ExtensionMarker("$C1DBD4770CEC6FE4528F36E596E0ACC7")] public void SetNeighborRight(Selectable selectable) { throw new NotSupportedException(); } [ExtensionMarker("$C1DBD4770CEC6FE4528F36E596E0ACC7")] public void SetNeighborRight(SelectableElement selectableElement) { throw new NotSupportedException(); } [ExtensionMarker("$C1DBD4770CEC6FE4528F36E596E0ACC7")] public bool GetNeighborRight([MaybeNullWhen(false)] out Selectable selectable) { throw new NotSupportedException(); } [ExtensionMarker("$C1DBD4770CEC6FE4528F36E596E0ACC7")] public void ClearNeighborRight() { throw new NotSupportedException(); } [ExtensionMarker("$C1DBD4770CEC6FE4528F36E596E0ACC7")] public void SetNeighborDown(Selectable selectable) { throw new NotSupportedException(); } [ExtensionMarker("$C1DBD4770CEC6FE4528F36E596E0ACC7")] public void SetNeighborDown(SelectableElement selectableElement) { throw new NotSupportedException(); } [ExtensionMarker("$C1DBD4770CEC6FE4528F36E596E0ACC7")] public void ClearNeighborDown() { throw new NotSupportedException(); } [ExtensionMarker("$C1DBD4770CEC6FE4528F36E596E0ACC7")] public bool GetNeighborDown([MaybeNullWhen(false)] out Selectable selectable) { throw new NotSupportedException(); } [ExtensionMarker("$C1DBD4770CEC6FE4528F36E596E0ACC7")] public void ConnectSymmetric(INavigable dest, NavigationDirection direction) { throw new NotSupportedException(); } } public static void SetNeighborUp(this INavigable self, Selectable selectable) { self.SetNeighbor(NavigationDirection.Up, selectable); } public static void SetNeighborUp(this INavigable self, SelectableElement selectableElement) { self.SetNeighborUp(selectableElement.SelectableComponent); } public static void ClearNeighborUp(this INavigable self) { self.ClearNeighbor(NavigationDirection.Up); } public static bool GetNeighborUp(this INavigable self, [MaybeNullWhen(false)] out Selectable selectable) { return self.GetSelectable(NavigationDirection.Up, out selectable); } public static void SetNeighborLeft(this INavigable self, Selectable selectable) { self.SetNeighbor(NavigationDirection.Left, selectable); } public static void SetNeighborLeft(this INavigable self, SelectableElement selectableElement) { self.SetNeighborLeft(selectableElement.SelectableComponent); } public static void ClearNeighborLeft(this INavigable self) { self.ClearNeighbor(NavigationDirection.Left); } public static bool GetNeighborLeft(this INavigable self, [MaybeNullWhen(false)] out Selectable selectable) { return self.GetSelectable(NavigationDirection.Left, out selectable); } public static void SetNeighborRight(this INavigable self, Selectable selectable) { self.SetNeighbor(NavigationDirection.Right, selectable); } public static void SetNeighborRight(this INavigable self, SelectableElement selectableElement) { self.SetNeighborRight(selectableElement.SelectableComponent); } public static bool GetNeighborRight(this INavigable self, [MaybeNullWhen(false)] out Selectable selectable) { return self.GetSelectable(NavigationDirection.Right, out selectable); } public static void ClearNeighborRight(this INavigable self) { self.ClearNeighbor(NavigationDirection.Right); } public static void SetNeighborDown(this INavigable self, Selectable selectable) { self.SetNeighbor(NavigationDirection.Down, selectable); } public static void SetNeighborDown(this INavigable self, SelectableElement selectableElement) { self.SetNeighborDown(selectableElement.SelectableComponent); } public static void ClearNeighborDown(this INavigable self) { self.ClearNeighbor(NavigationDirection.Down); } public static bool GetNeighborDown(this INavigable self, [MaybeNullWhen(false)] out Selectable selectable) { return self.GetSelectable(NavigationDirection.Down, out selectable); } public static void ConnectSymmetric(this INavigable self, INavigable dest, NavigationDirection direction) { if (dest.GetSelectable(direction, out Selectable selectable)) { self.SetNeighbor(direction, selectable); } if (self.GetSelectable(direction.Opposite(), out selectable)) { dest.SetNeighbor(direction.Opposite(), selectable); } } } public interface INavigableMenuEntity : IMenuEntity, INavigable { SelectableElement? GetDefaultSelectable(); } public class KeyBindElement : SelectableValueElement { public readonly Text LabelText; public readonly Text KeyBindText; public readonly Image KeyBindImage; public KeyBindElement(LocalizedText label, IValueModel model) : base(MenuPrefabs.Get().NewKeyBindContainer(out CustomMappableKey customMappableKey), (Selectable)(object)customMappableKey, model) { customMappableKey.KeyCodeModel = model; LabelText = UnityExtensions.FindChild(Container, "Input Button Text").GetComponent(); KeyBindText = customMappableKey.KeymapText; KeyBindImage = customMappableKey.KeymapImage; LocalizedTextExtensions.set_LocalizedText(LabelText, label); } public KeyBindElement(LocalizedText label) : this(label, new ValueModel((KeyCode)97)) { } public override void SetMainColor(Color color) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) ((Graphic)LabelText).color = color; ((Graphic)KeyBindText).color = color; ((Graphic)KeyBindImage).color = color; } public override void SetFontSizes(FontSizes fontSizes) { LabelText.fontSize = fontSizes.LabelSize(); } } public class LocalizedText { private readonly LocalisedString localisedString; private readonly string rawText; public string Text { get { //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) LocalisedString val = localisedString; if (!((LocalisedString)(ref val)).IsEmpty) { return Language.Get(localisedString.Key, localisedString.Sheet); } return rawText; } } public string Canonical { get { //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) LocalisedString val = localisedString; if (!((LocalisedString)(ref val)).IsEmpty) { return localisedString.Key; } return rawText; } } public bool IsLocalized { get { //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) LocalisedString val = localisedString; return !((LocalisedString)(ref val)).IsEmpty; } } public LocalisedString Localized => localisedString; private LocalizedText(LocalisedString localisedString, string rawText) { //IL_0007: 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) this.localisedString = localisedString; this.rawText = rawText; } public static LocalizedText Key(string languageKey) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return new LocalizedText(new LocalisedString("", languageKey), ""); } public static LocalizedText Key(LocalisedString localisedString) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return new LocalizedText(localisedString, ""); } public static LocalizedText Raw(string rawText) { //IL_0002: 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) return new LocalizedText(default(LocalisedString), rawText); } public override int GetHashCode() { //IL_0015: 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 (!IsLocalized) { return rawText.GetHashCode(); } return ((object)localisedString/*cast due to .constrained prefix*/).GetHashCode(); } public override bool Equals(object obj) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (obj is LocalizedText localizedText && IsLocalized == localizedText.IsLocalized) { if (!IsLocalized) { return rawText.Equals(localizedText.rawText); } LocalisedString val = localisedString; return ((LocalisedString)(ref val)).Equals(localizedText.localisedString); } return false; } public static implicit operator LocalizedText(string rawText) { return Raw(rawText); } public static implicit operator LocalizedText(LocalisedString localisedString) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return Key(localisedString); } } public static class LocalizedTextExtensions { [SpecialName] public sealed class $A57D1A366808A4F5C3E3D3D05C06A608 { [SpecialName] public static class $D20BD88F09228784DC6694E32CC129D0 { } [ExtensionMarker("$D20BD88F09228784DC6694E32CC129D0")] public LocalizedText LocalizedText { [ExtensionMarker("$D20BD88F09228784DC6694E32CC129D0")] get { throw new NotSupportedException(); } [ExtensionMarker("$D20BD88F09228784DC6694E32CC129D0")] set { throw new NotSupportedException(); } } } public static LocalizedText get_LocalizedText(Text self) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) AutoLocalizeTextUI val = default(AutoLocalizeTextUI); if (((Component)self).TryGetComponent(ref val) && !((LocalisedString)(ref val.text)).IsEmpty) { return val.text; } return self.text; } public static void set_LocalizedText(Text self, LocalizedText value) { //IL_003f: 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) if (value.IsLocalized) { AutoLocalizeTextUI val = default(AutoLocalizeTextUI); if (!((Component)self).TryGetComponent(ref val)) { using (((Component)self).gameObject.TempInactive()) { val = ((Component)self).gameObject.AddComponent(); val.textField = self; } } val.text = value.Localized; val.RefreshTextFromLocalization(); } else { AutoLocalizeTextUI val2 = default(AutoLocalizeTextUI); if (((Component)self).TryGetComponent(ref val2)) { Object.Destroy((Object)(object)val2); } self.text = value.Text; } } } public abstract class MenuDisposable : IDisposable { private bool disposed; public event Action? OnDispose { add { if (disposed) { value?.Invoke(); } else { OnDisposeInternal += value; } } remove { OnDisposeInternal -= value; } } private event Action? OnDisposeInternal; public void Dispose() { if (!disposed) { disposed = true; this.OnDisposeInternal?.Invoke(); } } } public abstract class MenuElement : MenuDisposable, IMenuEntity { private readonly VisibilityManager visibility = new VisibilityManager(DefaultVisibility: false); public readonly GameObject Container; public readonly RectTransform RectTransform; [CompilerGenerated] private ElementState k__BackingField; public bool ApplyDefaultColors = true; public VisibilityManager Visibility => visibility; public ElementState State { get { return k__BackingField; } set { if (k__BackingField != value) { k__BackingField = value; this.OnStateChanged?.Invoke(value); } } } public event Action? OnStateChanged; public event Action OnVisibilityChanged { add { visibility.OnVisibilityChanged += value; } remove { visibility.OnVisibilityChanged -= value; } } protected MenuElement(GameObject container) { MenuElement menuElement = this; Container = container; base.OnDispose += delegate { Object.Destroy((Object)(object)container); }; RectTransform = container.GetComponent(); visibility.OnVisibilityChanged += container.SetActive; container.SetActive(true); container.AddComponent().Action += Dispose; OnStateChanged += delegate { menuElement.MaybeApplyDefaultColors(); }; } public IEnumerable AllElements() { return new <>z__ReadOnlySingleElementList(this); } public virtual void SetMainColor(Color color) { } protected void MaybeApplyDefaultColors() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (ApplyDefaultColors) { SetMainColor(GetDefaultColorInternal()); } } public void UpdateLayout(Vector2 localAnchorPos) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) RectTransform.SetAnchoredPosition(localAnchorPos); } protected virtual Color GetDefaultColorInternal() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Colors.GetDefaultColor(this); } public virtual void SetFontSizes(FontSizes fontSizes) { } public void SetGameObjectParent(GameObject container) { Container.transform.SetParent(container.transform, false); } public void ClearGameObjectParent() { Container.transform.SetParent((Transform)null, false); } } public enum NavigationDirection { Up, Left, Right, Down } public static class NavigationDirectionExtensions { public static NavigationDirection Opposite(this NavigationDirection self) { return self switch { NavigationDirection.Up => NavigationDirection.Down, NavigationDirection.Left => NavigationDirection.Right, NavigationDirection.Right => NavigationDirection.Left, NavigationDirection.Down => NavigationDirection.Up, _ => throw new ArgumentException($"{self}"), }; } } public class ScrollingPane : MenuDisposable, INavigableMenuEntity, IMenuEntity, INavigable { [Flags] public enum ScrollAxes { Vertical = 1, Horizontal = 0x10, Both = 0x11 } [CompilerGenerated] private INavigableMenuEntity? k__BackingField; public readonly ScrollRect scrollRect; private readonly ScrollFocusController focusController; private bool resizeQueued = true; private Vector2 contentAnchor; private Vector2 anchorOffset; protected readonly GameObject scrollPane; protected readonly GameObject contentPane; public VisibilityManager Visibility { get; } = new VisibilityManager(DefaultVisibility: false); public INavigableMenuEntity? Content { get { return k__BackingField; } set { if (k__BackingField != value) { k__BackingField?.ClearParents(); k__BackingField = value; k__BackingField?.SetParents(this, contentPane); } } } public Vector2 ViewportSize { get { //IL_000b: Unknown result type (might be due to invalid IL or missing references) return GameObjectUtil.get_RectTransform(scrollPane).sizeDelta; } set { //IL_000b: Unknown result type (might be due to invalid IL or missing references) GameObjectUtil.get_RectTransform(scrollPane).sizeDelta = value; } } public ScrollAxes Axes { get { return (ScrollAxes)((scrollRect.vertical ? 1 : 0) | (scrollRect.horizontal ? 16 : 0)); } set { scrollRect.vertical = value.HasFlag(ScrollAxes.Vertical); scrollRect.horizontal = value.HasFlag(ScrollAxes.Horizontal); } } public float SmoothScrollTime { get { return focusController.smoothScrollTime; } set { focusController.smoothScrollTime = value; } } public ScrollingPane(INavigableMenuEntity content) { scrollPane = MenuPrefabs.Get().NewScrollPane(out scrollRect, out focusController, out contentPane); Content = content; contentPane.AddComponent().OnChildrenChanged += QueueContentResize; AddScrollNavHelpers(); base.OnDispose += delegate { Object.Destroy((Object)(object)scrollPane); }; Visibility.OnVisibilityChanged += delegate(bool visibleInHierarchy) { scrollPane.SetActive(visibleInHierarchy); }; scrollPane.SetActive(false); } public void ScrollTo(MenuElement element, bool smooth = false) { if (IMenuEntityExtensions.get_VisibleInHierarchy(element)) { focusController.ScrollTo(element.Container.transform, smooth); } } public void ScrollTo(int index, bool smooth = false) { MenuElement menuElement = Content?.AllElements().ElementAtOrDefault(index); if (menuElement != null && IMenuEntityExtensions.get_VisibleInHierarchy(menuElement)) { focusController.ScrollTo(menuElement.Container.transform, smooth); } } public void QueueContentResize() { resizeQueued = true; } public void UpdateLayout(Vector2 localAnchorPos) { //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_00ae: 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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_002a: 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_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) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) AddScrollNavHelpers(); if (resizeQueued) { resizeQueued = false; RectTransform val = (RectTransform)contentPane.transform; val.sizeDelta = Vector2.zero; Content?.UpdateLayout(Vector2.zero); var (val2, val3) = CalculateContentBounds(); val.sizeDelta = val3 - val2; contentAnchor = val.sizeDelta * 0.5f - val3; anchorOffset = new Vector2(0f, val3.y); } ((RectTransform)scrollPane.transform).anchoredPosition = localAnchorPos + anchorOffset; Content?.ClearNeighbors(); Content?.UpdateLayout(contentAnchor); } public void SetGameObjectParent(GameObject parent) { Extensions.SetParentReset(scrollPane.transform, parent.transform); } public void ClearGameObjectParent() { scrollPane.transform.SetParent((Transform)null); } private void AddScrollNavHelpers() { foreach (SelectableElement item in Content?.AllElements().OfType() ?? Array.Empty()) { Extensions.AddComponentIfNotPresent(((Component)item.SelectableComponent).gameObject).container = item.Container.transform; } } private (Vector2 min, Vector2 max) CalculateContentBounds() { //IL_0000: 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_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.one * float.MaxValue; Vector3 val2 = Vector3.one * float.MinValue; Matrix4x4 worldToLocalMatrix = contentPane.transform.worldToLocalMatrix; foreach (Transform item in EnumerateDescendantsConditional(contentPane.transform, ChildrenOfScrollPanesExceptScrollbars)) { RectTransform val3 = (RectTransform)(object)((item is RectTransform) ? item : null); if (val3 != null && ((Component)item).gameObject.activeInHierarchy) { Vector3[] corners = UIExtension.GetCorners(val3); foreach (Vector3 val4 in corners) { Vector3 val5 = ((Matrix4x4)(ref worldToLocalMatrix)).MultiplyPoint3x4(val4); val = Vector3.Min(val5, val); val2 = Vector3.Max(val5, val2); } } } return (min: Vector2.op_Implicit(val), max: Vector2.op_Implicit(val2)); static bool ChildrenOfScrollPanesExceptScrollbars(Transform x) { ScrollSliderController scrollSliderController = default(ScrollSliderController); if (((Component)x.parent).TryGetComponent(ref scrollSliderController) && (!Object.op_Implicit((Object)(object)scrollSliderController.VerticalSlider) || (Object)(object)x != (Object)(object)((Component)scrollSliderController.VerticalSlider).transform)) { if (Object.op_Implicit((Object)(object)scrollSliderController.HorizontalSlider)) { return (Object)(object)x != (Object)(object)((Component)scrollSliderController.HorizontalSlider).transform; } return true; } return false; } } private static IEnumerable EnumerateDescendantsConditional(Transform transform, Func shouldSkip) { foreach (Transform item2 in transform) { Transform item = item2; if (shouldSkip(item)) { continue; } yield return item; foreach (Transform item3 in EnumerateDescendantsConditional(item, shouldSkip)) { yield return item3; } } } public SelectableElement? GetDefaultSelectable() { return Content?.GetDefaultSelectable(); } public IEnumerable AllElements() { return Content?.AllElements() ?? Array.Empty(); } public void ClearNeighbors() { Content?.ClearNeighbors(); } public void SetNeighbor(NavigationDirection direction, Selectable selectable) { Content?.SetNeighbor(direction, selectable); } public void ClearNeighbor(NavigationDirection direction) { Content?.ClearNeighbor(direction); } public bool GetSelectable(NavigationDirection direction, [MaybeNullWhen(false)] out Selectable selectable) { selectable = null; return Content?.GetSelectable(direction, out selectable) ?? false; } } public abstract class SelectableElement : MenuElement, INavigableMenuEntity, IMenuEntity, INavigable { public readonly Selectable SelectableComponent; public bool IsSelected => SelectableComponent.IsSelected(); public bool Interactable { get { return SelectableComponent.interactable; } set { if (Interactable != value) { SelectableComponent.interactable = value; this.OnInteractableChanged?.Invoke(value); } } } public event Action? OnInteractableChanged; protected SelectableElement(GameObject container, Selectable selectable) : base(container) { SelectableComponent = selectable; OnInteractableChanged += delegate { MaybeApplyDefaultColors(); }; } public void ForceSelect() { if (!IsSelected) { SelectableComponent.ForceSelect(); } } public SelectableElement? GetDefaultSelectable() { return this; } public void ClearNeighbors() { new SelectableWrapper(SelectableComponent).ClearNeighbors(); } public void ClearNeighbor(NavigationDirection direction) { new SelectableWrapper(SelectableComponent).ClearNeighbor(direction); } public void SetNeighbor(NavigationDirection direction, Selectable selectable) { new SelectableWrapper(SelectableComponent).SetNeighbor(direction, selectable); } public bool GetSelectable(NavigationDirection direction, [MaybeNullWhen(false)] out Selectable selectable) { selectable = SelectableComponent; return true; } protected override Color GetDefaultColorInternal() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Colors.GetDefaultColor(this); } } public abstract class SelectableValueElement : BaseSelectableValueElement { public readonly IValueModel Model; public override IBaseValueModel RawModel => Model; public T Value { get { return Model.Value; } set { Model.Value = value; } } public event Action? OnValueChanged { add { Model.OnValueChanged += value; } remove { Model.OnValueChanged -= value; } } protected SelectableValueElement(GameObject container, Selectable selectable, IValueModel model) { Model = model; base..ctor(container, selectable); } } public class SliderElement : SelectableValueElement { private bool skipPlaySlider; public readonly Slider Slider; public readonly SliderModel SliderModel; public readonly Text LabelText; public readonly Text ValueText; public SliderElement(LocalizedText label, SliderModel model) : base(MenuPrefabs.Get().NewSliderContainer(out Slider slider), (Selectable)(object)slider, (IValueModel)model) { SliderElement sliderElement = this; ((Object)Container).name = label.Text; Slider = slider; GameObject gameObject = ((Component)Slider).gameObject; Slider.minValue = model.MinimumIndex; Slider.maxValue = model.MaximumIndex; Slider.wholeNumbers = true; Slider.value = model.MinimumIndex; SliderModel = model; LabelText = UnityExtensions.FindChild(gameObject, "Menu Option Label").GetComponent(); ValueText = UnityExtensions.FindChild(gameObject, "Value").GetComponent(); base.OnValueChanged += delegate { sliderElement.skipPlaySlider = true; sliderElement.Slider.value = model.Index; sliderElement.skipPlaySlider = false; sliderElement.UpdateValueText(); }; Slider.SetCallback(delegate(float v) { if (sliderElement.skipPlaySlider) { sliderElement.skipPlaySlider = false; } else { UIManager.instance.PlaySlider(); model.Index = Mathf.RoundToInt(v); } }); LocalizedTextExtensions.set_LocalizedText(LabelText, label); UpdateValueText(); } public override void SetMainColor(Color color) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) ((Graphic)LabelText).color = color; ((Graphic)ValueText).color = color; } public override void SetFontSizes(FontSizes fontSizes) { LabelText.fontSize = fontSizes.LabelSize(); ValueText.fontSize = fontSizes.SliderSize(); } private void UpdateValueText() { LocalizedTextExtensions.set_LocalizedText(ValueText, SliderModel.DisplayString()); } } public static class SpacingConstants { public static readonly Vector2 TOP_CENTER_ANCHOR = new Vector2(0f, 330f); public static float HSPACE_SMALL => 315f * Camera.main.aspect; public static float HSPACE_MEDIUM => 420f * Camera.main.aspect; public static float HSPACE_LARGE => 630f * Camera.main.aspect; public static float VSPACE_SMALL => 70f; public static float VSPACE_MEDIUM => 105f; public static float VSPACE_LARGE => 160f; } public class TextButton : SelectableElement { public Action? OnSubmit; public readonly MenuButton MenuButton; public readonly Text ButtonText; public readonly Text DescriptionText; public TextButton(LocalizedText text, LocalizedText description) : base(MenuPrefabs.Get().NewTextButtonContainer(out MenuButton menuButton), (Selectable)(object)menuButton) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) ((Object)Container).name = text.Text; MenuButton = menuButton; ((Component)MenuButton).GetComponent().SetCallback(delegate { if (base.Interactable) { OnSubmit?.Invoke(); } }); MenuButton.buttonType = (MenuButtonType)1; ButtonText = UnityExtensions.FindChild(((Component)menuButton).gameObject, "Menu Button Text").GetComponent(); LocalizedTextExtensions.set_LocalizedText(ButtonText, text); DescriptionText = UnityExtensions.FindChild(((Component)MenuButton).gameObject, "Description").GetComponent(); LocalizedTextExtensions.set_LocalizedText(DescriptionText, description); } public TextButton(LocalizedText text) : this(text, string.Empty) { } public TextButton(AbstractMenuScreen screen) : this(LocalizedTextExtensions.get_LocalizedText(screen.TitleText)) { OnSubmit = delegate { MenuScreenNavigation.Show(screen); }; } public override void SetMainColor(Color color) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) ((Graphic)ButtonText).color = color; ((Graphic)DescriptionText).color = color; } public override void SetFontSizes(FontSizes fontSizes) { ButtonText.fontSize = fontSizes.LabelSize(); DescriptionText.fontSize = fontSizes.DescriptionSize(); } } public class TextInput : SelectableValueElement { private static readonly HashSet intTypes = new HashSet { typeof(sbyte), typeof(byte), typeof(short), typeof(ushort), typeof(int), typeof(uint), typeof(long), typeof(ulong) }; private static readonly HashSet floatTypes = new HashSet { typeof(float), typeof(double) }; public readonly ITextModel TextModel; public readonly Text LabelText; public readonly Text DescriptionText; public readonly InputField InputField; public event Action OnTextValueChanged { add { TextModel.OnTextValueChanged += value; } remove { TextModel.OnTextValueChanged -= value; } } public TextInput(LocalizedText label, ITextModel model, LocalizedText description) : base(MenuPrefabs.Get().NewTextInputContainer(out CustomInputField customInputField), (Selectable)(object)customInputField, (IValueModel)model) { TextModel = model; GameObject gameObject = ((Component)customInputField).gameObject; LabelText = UnityExtensions.FindChild(gameObject, "Menu Option Label").GetComponent(); DescriptionText = UnityExtensions.FindChild(gameObject, "Description").GetComponent(); InputField = (InputField)(object)customInputField; OnTextValueChanged += delegate(string value) { InputField.text = value; }; ((UnityEvent)(object)InputField.onValueChanged).AddListener((UnityAction)delegate(string value) { TextModel.SetTextValue(value); }); LocalizedTextExtensions.set_LocalizedText(LabelText, label); LocalizedTextExtensions.set_LocalizedText(DescriptionText, description); if (intTypes.Contains(typeof(T))) { InputField.contentType = (ContentType)2; } else if (floatTypes.Contains(typeof(T))) { InputField.contentType = (ContentType)3; } } public TextInput(LocalizedText label, ITextModel model) : this(label, model, (LocalizedText)"") { } public override void SetMainColor(Color color) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) ((Graphic)LabelText).color = color; ((Graphic)DescriptionText).color = color; ((Graphic)InputField.textComponent).color = color; } public override void SetFontSizes(FontSizes fontSizes) { LabelText.fontSize = fontSizes.LabelSize(); DescriptionText.fontSize = fontSizes.DescriptionSize(); InputField.textComponent.fontSize = fontSizes.ChoiceSize(); } } public class TextLabel : MenuElement { public readonly Text Text; public TextLabel(LocalizedText text) : base(MenuPrefabs.Get().NewTextLabel()) { ((Object)Container).name = text.Text; Text = Container.GetComponent(); LocalizedTextExtensions.set_LocalizedText(Text, text); } public override void SetMainColor(Color color) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) ((Graphic)Text).color = color; } public override void SetFontSizes(FontSizes fontSizes) { Text.fontSize = fontSizes.LabelSize(); } } public class VerticalGroup : AbstractGroup { private readonly IndexedList entities = new IndexedList(); public float VerticalSpacing = SpacingConstants.VSPACE_MEDIUM; public bool HideInactiveElements = true; public override IEnumerable AllEntities() { return entities; } public override bool Contains(IMenuEntity entity) { return entities.Contains(entity); } public void Add(IMenuEntity entity) { entities.Add(entity); AddChild(entity); } public void AddRange(IEnumerable entities) { foreach (IMenuEntity entity in entities) { Add(entity); } } public void Insert(int index, IMenuEntity entity) { entities.Insert(index, entity); AddChild(entity); } public bool Remove(IMenuEntity entity) { if (!entities.Remove(entity)) { return false; } entity.ClearParents(); return true; } public void RemoveAt(int index) { if (entities.TryRemoveAt(index, out IMenuEntity item)) { item.ClearParents(); } } public override void Clear() { foreach (IMenuEntity entity in entities) { entity.ClearParents(); } entities.Clear(); } public override bool GetSelectable(NavigationDirection direction, [MaybeNullWhen(false)] out Selectable selectable) { switch (direction) { case NavigationDirection.Left: case NavigationDirection.Right: { selectable = (from n in NonHiddenEntities().MedianOutwards().OfType() select (!n.GetSelectable(direction, out Selectable selectable2)) ? null : selectable2).FirstOrDefault(); return (Object)(object)selectable != (Object)null; } case NavigationDirection.Up: { selectable = (from n in NonHiddenEntities().OfType() select (!n.GetSelectable(direction, out Selectable selectable2)) ? null : selectable2).LastOrDefault(); return (Object)(object)selectable != (Object)null; } case NavigationDirection.Down: { selectable = (from n in NonHiddenEntities().OfType() select (!n.GetSelectable(direction, out Selectable selectable2)) ? null : selectable2).FirstOrDefault(); return (Object)(object)selectable != (Object)null; } default: throw direction.UnsupportedEnum(); } } public override void UpdateLayout(Vector2 pos) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) ClearNeighbors(); foreach (IMenuEntity item in NonHiddenEntities()) { item.UpdateLayout(pos); pos.y -= VerticalSpacing; } foreach (var (self, dest) in NonHiddenEntities().OfType().Pairs()) { self.ConnectSymmetric(dest, NavigationDirection.Down); } } private IEnumerable NonHiddenEntities() { if (!HideInactiveElements) { return entities; } return entities.Where((IMenuEntity e) => IMenuEntityExtensions.get_VisibleSelf(e)); } protected override IEnumerable GetNavigables(NavigationDirection direction) { switch (direction) { case NavigationDirection.Left: case NavigationDirection.Right: return NonHiddenEntities().OfType(); case NavigationDirection.Up: return NonHiddenEntities().OfType().Take(1); case NavigationDirection.Down: return NonHiddenEntities().OfType().Reverse().Take(1); default: throw direction.UnsupportedEnum(); } } } public class VisibilityManager(bool DefaultVisibility) { private VisibilityManager? parent; [CompilerGenerated] private bool k__BackingField = true; [CompilerGenerated] private bool k__BackingField = true; public bool VisibleSelf { get { return k__BackingField; } set { if (k__BackingField != value) { k__BackingField = value; UpdateVisibleInHierarchy(); } } } public bool VisibleInHierarchy { get { return k__BackingField; } private set { if (k__BackingField != value) { k__BackingField = value; this.OnVisibilityChanged?.Invoke(value); } } } public event Action? OnVisibilityChanged; public void SetParent(VisibilityManager parent) { VisibilityManager? visibilityManager = this.parent; if (visibilityManager != null) { visibilityManager.OnVisibilityChanged -= UpdateVisibleInHierarchy; } this.parent = parent; this.parent.OnVisibilityChanged += UpdateVisibleInHierarchy; UpdateVisibleInHierarchy(); } public void ClearParent() { VisibilityManager? visibilityManager = parent; if (visibilityManager != null) { visibilityManager.OnVisibilityChanged -= UpdateVisibleInHierarchy; } parent = null; UpdateVisibleInHierarchy(); } private void UpdateVisibleInHierarchy(bool parentVisible) { UpdateVisibleInHierarchy(); } private void UpdateVisibleInHierarchy() { VisibleInHierarchy = VisibleSelf && (parent?.VisibleInHierarchy ?? DefaultVisibility); } } }