using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.ExceptionServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Threading.Tasks.Sources; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.NET.Common; using BepInExResoniteShim; using BepisLocaleLoader; using BepisModSettings.ConfigAttributes; using BepisModSettings.DataFeeds; using BepisResoniteWrapper; using Elements.Assets; using Elements.Core; using FrooxEngine; using FrooxEngine.UIX; using HarmonyLib; using ProtoFlux.Runtimes.Execution.Nodes.FrooxEngine.Variables; using Renderite.Shared; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(/*Could not decode attribute arguments.*/)] [assembly: TargetFramework(".NETCoreApp,Version=v10.0", FrameworkDisplayName = ".NET 10.0")] [assembly: AssemblyCompany("ResoniteModding")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("Copyright (c) ResoniteModding 2026")] [assembly: AssemblyDescription("A Resonite mod that lets you edit your mod settings in the settings tab of the dashboard.")] [assembly: AssemblyFileVersion("1.6.6.0")] [assembly: AssemblyInformationalVersion("1.6.6+fe7b9a3096257bfe4e7ee2a09d3bf8a07f043cdc")] [assembly: AssemblyProduct("Bepis Mod Settings")] [assembly: AssemblyTitle("BepisModSettings")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/ResoniteModding/BepisModSettings")] [assembly: AssemblyVersion("1.6.6.0")] [module: RefSafetyRules(11)] [CompilerGenerated] internal sealed class <>z__ReadOnlySingleElementList : global::System.Collections.IEnumerable, global::System.Collections.ICollection, global::System.Collections.IList, global::System.Collections.Generic.IEnumerable, global::System.Collections.Generic.IReadOnlyCollection, global::System.Collections.Generic.IReadOnlyList, global::System.Collections.Generic.ICollection, global::System.Collections.Generic.IList { private sealed class Enumerator : global::System.IDisposable, global::System.Collections.IEnumerator, global::System.Collections.Generic.IEnumerator { object global::System.Collections.IEnumerator.Current => _item; T global::System.Collections.Generic.IEnumerator.Current => _item; public Enumerator(T item) { _item = item; } bool global::System.Collections.IEnumerator.MoveNext() { if (!_moveNextCalled) { return _moveNextCalled = true; } return false; } void global::System.Collections.IEnumerator.Reset() { _moveNextCalled = false; } void global::System.IDisposable.Dispose() { } } int global::System.Collections.ICollection.Count => 1; bool global::System.Collections.ICollection.IsSynchronized => false; object global::System.Collections.ICollection.SyncRoot => this; object? global::System.Collections.IList.this[int index] { get { //IL_0003: Unknown result type (might be due to invalid IL or missing references) if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } set { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new NotSupportedException(); } } bool global::System.Collections.IList.IsFixedSize => true; bool global::System.Collections.IList.IsReadOnly => true; int global::System.Collections.Generic.IReadOnlyCollection.Count => 1; T global::System.Collections.Generic.IReadOnlyList.this[int index] { get { //IL_0003: Unknown result type (might be due to invalid IL or missing references) if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } } int global::System.Collections.Generic.ICollection.Count => 1; bool global::System.Collections.Generic.ICollection.IsReadOnly => true; T global::System.Collections.Generic.IList.this[int index] { get { //IL_0003: Unknown result type (might be due to invalid IL or missing references) if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } set { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new NotSupportedException(); } } public <>z__ReadOnlySingleElementList(T item) { _item = item; } global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { return new Enumerator(_item); } void global::System.Collections.ICollection.CopyTo(global::System.Array array, int index) { array.SetValue((object)_item, index); } int global::System.Collections.IList.Add(object? value) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new NotSupportedException(); } void global::System.Collections.IList.Clear() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new NotSupportedException(); } bool global::System.Collections.IList.Contains(object? value) { return EqualityComparer.Default.Equals(_item, (T)value); } int global::System.Collections.IList.IndexOf(object? value) { if (!EqualityComparer.Default.Equals(_item, (T)value)) { return -1; } return 0; } void global::System.Collections.IList.Insert(int index, object? value) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new NotSupportedException(); } void global::System.Collections.IList.Remove(object? value) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new NotSupportedException(); } void global::System.Collections.IList.RemoveAt(int index) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new NotSupportedException(); } global::System.Collections.Generic.IEnumerator global::System.Collections.Generic.IEnumerable.GetEnumerator() { return new Enumerator(_item); } void global::System.Collections.Generic.ICollection.Add(T item) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new NotSupportedException(); } void global::System.Collections.Generic.ICollection.Clear() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new NotSupportedException(); } bool global::System.Collections.Generic.ICollection.Contains(T item) { return EqualityComparer.Default.Equals(_item, item); } void global::System.Collections.Generic.ICollection.CopyTo(T[] array, int arrayIndex) { array[arrayIndex] = _item; } bool global::System.Collections.Generic.ICollection.Remove(T item) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new NotSupportedException(); } int global::System.Collections.Generic.IList.IndexOf(T item) { if (!EqualityComparer.Default.Equals(_item, item)) { return -1; } return 0; } void global::System.Collections.Generic.IList.Insert(int index, T item) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new NotSupportedException(); } void global::System.Collections.Generic.IList.RemoveAt(int index) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new NotSupportedException(); } } namespace BepisModSettings { [ResonitePlugin("ResoniteModding.BepisModSettings", "Bepis Mod Settings", "1.6.6", "ResoniteModding", "https://github.com/ResoniteModding/BepisModSettings")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BasePlugin { [HarmonyPatch(typeof(Engine), "RequestShutdown")] public static class RequestShutdownPatch { public static void Prefix() { Log.LogInfo((object)"Running shutdown, saving configs..."); Log.LogDebug((object)"Saving Config for BepInEx.Core"); ConfigFile coreConfig = ConfigFile.CoreConfig; if (coreConfig != null) { coreConfig.Save(); } if (((BaseChainloader)(object)NetChainloader.Instance).Plugins.Count <= 0) { return; } CollectionExtensions.Do((global::System.Collections.Generic.IEnumerable)((BaseChainloader)(object)NetChainloader.Instance).Plugins.Values, (Action)delegate(PluginInfo x) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown object instance = x.Instance; BasePlugin val = (BasePlugin)((instance is BasePlugin) ? instance : null); if (val != null) { ManualLogSource log = Log; bool flag = default(bool); BepInExDebugLogInterpolatedStringHandler val2 = new BepInExDebugLogInterpolatedStringHandler(18, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Saving Config for "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(x.Metadata.GUID); } log.LogDebug(val2); ConfigFile config = val.Config; if (config != null) { config.Save(); } } }); Log.LogInfo((object)"Configs Saved!"); } } [HarmonyPatch(typeof(SettingsDataFeed), "Enumerate", new global::System.Type[] { typeof(global::System.Collections.Generic.IReadOnlyList), typeof(global::System.Collections.Generic.IReadOnlyList), typeof(string), typeof(object) })] private static class EnumeratorPostfix { private static global::System.Collections.Generic.IAsyncEnumerable Postfix(global::System.Collections.Generic.IAsyncEnumerable __result, SettingsDataFeed __instance, global::System.Collections.Generic.IReadOnlyList path) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown try { if (!Enumerable.Contains((global::System.Collections.Generic.IEnumerable)path, "BepInEx")) { return __result; } if (!WorldExtensions.IsUserspace(((Worker)__instance).World)) { return DataFeedInjector.NotUserspaceEnumerable(path); } DataFeedHelpers.SettingsDataFeed = __instance; return DataFeedInjector.ReplaceEnumerable(__result, path); } catch (global::System.Exception ex) { ManualLogSource log = Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(61, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Failed to generate replacement for "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("SettingsDataFeed"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("."); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("Enumerate"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" - using original result."); } log.LogError(val); Log.LogError((object)ex.Message); return __result; } } } [HarmonyPatch(typeof(SettingsDataFeed), "PathSegmentName")] private static class PathSegmentNamePatch { private static bool Prefix(string pathSegment, int depth, ref LocaleString __result) { //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_0012: 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_0034: 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) LocaleString val = ((depth != 1) ? LocaleHelper.AsLocaleKey("Settings." + pathSegment + ".Breadcrumb", (string)null, true, (Dictionary)null) : LocaleHelper.AsLocaleKey("Settings.Category." + pathSegment, (string)null, true, (Dictionary)null)); __result = val; return false; } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Action <>9__0_0; public static Action> <>9__1_0; public static Action> <>9__1_1; public static Action> <>9__1_2; public static Action> <>9__1_3; public static EventHandler <>9__9_0; public static Func <>9__9_1; internal void b__0_0() { Log.LogError((object)"OneOfThem"); } internal void b__1_0(IField field) { ((IValue)(object)field).Value = "Test1"; } internal void b__1_1(IField field) { ((IValue)(object)field).Value = "Test2"; } internal void b__1_2(IField field) { ((IValue)(object)field).Value = "Test3"; } internal void b__1_3(IField field) { ((IValue)(object)field).Value = "Test4"; } internal void b__9_0(object? sender, SettingChangedEventArgs args) { if ((object)args.ChangedSetting == AllowCollapsingConfigs || (object)args.ChangedSetting == DefaultCollapsed) { DataFeedHelpers.RefreshSettingsScreen(); } } internal Slot b__9_1() { SettingsDataFeed settingsDataFeed = DataFeedHelpers.SettingsDataFeed; if (settingsDataFeed == null) { return null; } Slot slot = ((Component)settingsDataFeed).Slot; if (slot == null) { return null; } return InspectorHelper.OpenInspectorForTarget((IWorldElement)(object)slot, (Slot)null, false); } } [CompilerGenerated] private sealed class d__1 : global::System.Collections.Generic.IAsyncEnumerable, global::System.Collections.Generic.IAsyncEnumerator, global::System.IAsyncDisposable, IValueTaskSource, IValueTaskSource, IAsyncStateMachine { public int <>1__state; public AsyncIteratorMethodBuilder <>t__builder; public ManualResetValueTaskSourceCore <>v__promiseOfValueOrEnd; private DataFeedItem <>2__current; private bool <>w__disposeMode; private int <>l__initialThreadId; private global::System.Collections.Generic.IReadOnlyList path; public global::System.Collections.Generic.IReadOnlyList <>3__path; private global::System.Collections.Generic.IReadOnlyList groupingKeys; public global::System.Collections.Generic.IReadOnlyList <>3__groupingKeys; private string[] 5__2; private TaskAwaiter <>u__1; DataFeedItem global::System.Collections.Generic.IAsyncEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { //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) <>t__builder = AsyncIteratorMethodBuilder.Create(); this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } private void MoveNext() { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; try { TaskAwaiter val2; DataFeedGroup val3; switch (num) { default: if (<>w__disposeMode) { break; } num = (<>1__state = -1); <>2__current = null; val2 = global::System.Threading.Tasks.Task.CompletedTask.GetAwaiter(); if (!((TaskAwaiter)(ref val2)).IsCompleted) { num = (<>1__state = 0); <>u__1 = val2; d__1 d__ = this; ((AsyncIteratorMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompletedd__1>(ref val2, ref d__); return; } goto IL_00ab; case 0: val2 = <>u__1; <>u__1 = default(TaskAwaiter); num = (<>1__state = -1); goto IL_00ab; case -4: { num = (<>1__state = -1); if (<>w__disposeMode) { break; } 5__2 = Enumerable.ToArray(Enumerable.Concat((global::System.Collections.Generic.IEnumerable)groupingKeys, (global::System.Collections.Generic.IEnumerable)new <>z__ReadOnlySingleElementList("TestCustomDataFeed"))); DataFeedIndicator val6 = new DataFeedIndicator(); ((DataFeedItem)val6).InitBase("Test1", path, (global::System.Collections.Generic.IReadOnlyList)5__2, LocaleString.op_Implicit("Test1"), (Uri)null, (Action>)null, (Action>)null, (global::System.Collections.Generic.IReadOnlyList)null, (object)null); val6.InitSetupValue((Action>)delegate(IField field) { ((IValue)(object)field).Value = "Test1"; }, (string)null); <>2__current = (DataFeedItem)(object)val6; num = (<>1__state = -5); goto IL_037e; } case -5: { num = (<>1__state = -1); if (<>w__disposeMode) { break; } DataFeedIndicator val4 = new DataFeedIndicator(); ((DataFeedItem)val4).InitBase("Test2", path, (global::System.Collections.Generic.IReadOnlyList)5__2, LocaleString.op_Implicit("Test2"), (Uri)null, (Action>)null, (Action>)null, (global::System.Collections.Generic.IReadOnlyList)null, (object)null); val4.InitSetupValue((Action>)delegate(IField field) { ((IValue)(object)field).Value = "Test2"; }, (string)null); <>2__current = (DataFeedItem)(object)val4; num = (<>1__state = -6); goto IL_037e; } case -6: { num = (<>1__state = -1); if (<>w__disposeMode) { break; } DataFeedIndicator val5 = new DataFeedIndicator(); ((DataFeedItem)val5).InitBase("Test3", path, (global::System.Collections.Generic.IReadOnlyList)5__2, LocaleString.op_Implicit("Test3"), (Uri)null, (Action>)null, (Action>)null, (global::System.Collections.Generic.IReadOnlyList)null, (object)null); val5.InitSetupValue((Action>)delegate(IField field) { ((IValue)(object)field).Value = "Test3"; }, (string)null); <>2__current = (DataFeedItem)(object)val5; num = (<>1__state = -7); goto IL_037e; } case -7: { num = (<>1__state = -1); if (<>w__disposeMode) { break; } DataFeedIndicator val = new DataFeedIndicator(); ((DataFeedItem)val).InitBase("Test4", path, (global::System.Collections.Generic.IReadOnlyList)5__2, LocaleString.op_Implicit("Test4"), (Uri)null, (Action>)null, (Action>)null, (global::System.Collections.Generic.IReadOnlyList)null, (object)null); val.InitSetupValue((Action>)delegate(IField field) { ((IValue)(object)field).Value = "Test4"; }, (string)null); <>2__current = (DataFeedItem)(object)val; num = (<>1__state = -8); goto IL_037e; } case -8: { num = (<>1__state = -1); _ = <>w__disposeMode; break; } IL_00ab: ((TaskAwaiter)(ref val2)).GetResult(); val3 = DataFeedHelpers.DataFeedCollapseGroup("TestCustomDataFeed", path, groupingKeys, LocaleString.op_Implicit("TestCustomDataFeed")); <>2__current = (DataFeedItem)(object)val3; num = (<>1__state = -4); goto IL_037e; } } catch (global::System.Exception exception) { <>1__state = -2; 5__2 = null; <>2__current = null; ((AsyncIteratorMethodBuilder)(ref <>t__builder)).Complete(); <>v__promiseOfValueOrEnd.SetException(exception); return; } <>1__state = -2; 5__2 = null; <>2__current = null; ((AsyncIteratorMethodBuilder)(ref <>t__builder)).Complete(); <>v__promiseOfValueOrEnd.SetResult(false); return; IL_037e: <>v__promiseOfValueOrEnd.SetResult(true); } [DebuggerHidden] private void SetStateMachine(IAsyncStateMachine stateMachine) { } [DebuggerHidden] global::System.Collections.Generic.IAsyncEnumerator global::System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken = default(CancellationToken)) { //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) d__1 d__; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = -3; <>t__builder = AsyncIteratorMethodBuilder.Create(); <>w__disposeMode = false; d__ = this; } else { d__ = new d__1(-3); } d__.path = <>3__path; d__.groupingKeys = <>3__groupingKeys; return d__; } [DebuggerHidden] global::System.Threading.Tasks.ValueTask global::System.Collections.Generic.IAsyncEnumerator.MoveNextAsync() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Invalid comparison between Unknown and I4 if (<>1__state == -2) { return default(global::System.Threading.Tasks.ValueTask); } <>v__promiseOfValueOrEnd.Reset(); d__1 d__ = this; ((AsyncIteratorMethodBuilder)(ref <>t__builder)).MoveNext<d__1>(ref d__); short version = <>v__promiseOfValueOrEnd.Version; if ((int)<>v__promiseOfValueOrEnd.GetStatus(version) == 1) { return new global::System.Threading.Tasks.ValueTask(<>v__promiseOfValueOrEnd.GetResult(version)); } return new global::System.Threading.Tasks.ValueTask((IValueTaskSource)this, version); } [DebuggerHidden] bool IValueTaskSource.GetResult(short token) { return <>v__promiseOfValueOrEnd.GetResult(token); } [DebuggerHidden] ValueTaskSourceStatus IValueTaskSource.GetStatus(short token) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) return <>v__promiseOfValueOrEnd.GetStatus(token); } [DebuggerHidden] void IValueTaskSource.OnCompleted(Action continuation, object? state, short token, ValueTaskSourceOnCompletedFlags flags) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) <>v__promiseOfValueOrEnd.OnCompleted(continuation, state, token, flags); } [DebuggerHidden] void IValueTaskSource.GetResult(short token) { <>v__promiseOfValueOrEnd.GetResult(token); } [DebuggerHidden] ValueTaskSourceStatus IValueTaskSource.GetStatus(short token) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) return <>v__promiseOfValueOrEnd.GetStatus(token); } [DebuggerHidden] void IValueTaskSource.OnCompleted(Action continuation, object? state, short token, ValueTaskSourceOnCompletedFlags flags) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) <>v__promiseOfValueOrEnd.OnCompleted(continuation, state, token, flags); } [DebuggerHidden] global::System.Threading.Tasks.ValueTask global::System.IAsyncDisposable.DisposeAsync() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (<>1__state >= -1) { throw new NotSupportedException(); } if (<>1__state == -2) { return default(global::System.Threading.Tasks.ValueTask); } <>w__disposeMode = true; <>v__promiseOfValueOrEnd.Reset(); d__1 d__ = this; ((AsyncIteratorMethodBuilder)(ref <>t__builder)).MoveNext<d__1>(ref d__); return new global::System.Threading.Tasks.ValueTask((IValueTaskSource)(object)this, <>v__promiseOfValueOrEnd.Version); } } internal static ManualLogSource Log; public static ConfigEntry ShowHidden; public static ConfigEntry ShowProtected; public static ConfigEntry ShowEmptyPages; public static ConfigEntry SortEmptyPages; public static ConfigEntry AllowCollapsingConfigs; public static ConfigEntry DefaultCollapsed; public void ExampleConfigs() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Expected O, but got Unknown //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Expected O, but got Unknown //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Expected O, but got Unknown ConfigFile config = ((BasePlugin)this).Config; object[] array = new object[1]; object obj = <>c.<>9__0_0; if (obj == null) { Action val = delegate { Log.LogError((object)"OneOfThem"); }; <>c.<>9__0_0 = val; obj = (object)val; } array[0] = new ActionConfig((global::System.Delegate)obj); config.Bind("Tests", "TestAction", default(dummy), new ConfigDescription("TestAction", (AcceptableValueBase)null, array)); ((BasePlugin)this).Config.Bind("Tests", "TestProtected", "AWAWAWAWA THIS IS A TEST MESSAGE", new ConfigDescription("TestProtected", (AcceptableValueBase)null, new object[1] { new ProtectedConfig() })); ((BasePlugin)this).Config.Bind("Tests", "TestHidden", "AWAWAWAWA THIS IS A TEST MESSAGE", new ConfigDescription("TestHidden", (AcceptableValueBase)null, new object[1] { new HiddenConfig() })); ((BasePlugin)this).Config.Bind("Tests", "TestCustomDataFeed", default(dummy), new ConfigDescription("TestCustomDataFeed", (AcceptableValueBase)null, new object[1] { new CustomDataFeed(CustomDataFeedEnumerate) })); ((BasePlugin)this).Config.Bind("Tests", "TestRangeFloat", 0.5f, new ConfigDescription("TestRangeFloat", (AcceptableValueBase)null, new object[1] { (object)new RangeAttribute(0f, 1f, "0.00") })); } [AsyncIteratorStateMachine(typeof(d__1))] private static global::System.Collections.Generic.IAsyncEnumerable CustomDataFeedEnumerate(global::System.Collections.Generic.IReadOnlyList path, global::System.Collections.Generic.IReadOnlyList groupingKeys) { return new d__1(-2) { <>3__path = path, <>3__groupingKeys = groupingKeys }; } public override void Load() { //IL_0034: 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_0049: Expected O, but got Unknown //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Expected O, but got Unknown //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Expected O, but got Unknown //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Expected O, but got Unknown Log = ((BasePlugin)this).Log; ShowHidden = ((BasePlugin)this).Config.Bind("General", "ShowHidden", false, new ConfigDescription("Whether to show hidden Configs", (AcceptableValueBase)null, new object[1] { (object)new ConfigLocale("Settings.ResoniteModding.BepisModSettings.Configs.ShowHidden", "Settings.ResoniteModding.BepisModSettings.Configs.ShowHidden.Description") })); ShowProtected = ((BasePlugin)this).Config.Bind("General", "ShowProtected", false, "Whether to show protected Configs"); ShowEmptyPages = ((BasePlugin)this).Config.Bind("General", "ShowEmptyPages", true, "Whether to show category buttons for pages which would have no content"); SortEmptyPages = ((BasePlugin)this).Config.Bind("General", "SortEmptyPages", true, "Whether to sort empty pages to the bottom of the list"); AllowCollapsingConfigs = ((BasePlugin)this).Config.Bind("General", "Allow Collapsing", false, "Whether to allow collapsing Config Sections or not"); DefaultCollapsed = ((BasePlugin)this).Config.Bind("General", "Default Collapsed", false, "Whether to have Config Sections collapsed by default or not"); ((BasePlugin)this).Config.SettingChanged += delegate(object? sender, SettingChangedEventArgs args) { if ((object)args.ChangedSetting == AllowCollapsingConfigs || (object)args.ChangedSetting == DefaultCollapsed) { DataFeedHelpers.RefreshSettingsScreen(); } }; ExampleConfigs(); ((BasePlugin)this).Config.Bind("Debug", "OpenSettingsInspector", default(dummy), new ConfigDescription("OpenSettingsInspector", (AcceptableValueBase)null, new object[2] { new HiddenConfig(), new ActionConfig((global::System.Delegate)(object)(Func)delegate { SettingsDataFeed settingsDataFeed = DataFeedHelpers.SettingsDataFeed; if (settingsDataFeed == null) { return (Slot)null; } Slot slot = ((Component)settingsDataFeed).Slot; return (slot == null) ? null : InspectorHelper.OpenInspectorForTarget((IWorldElement)(object)slot, (Slot)null, false); }) })); ((BasePlugin)this).HarmonyInstance.PatchAll(); if (Engine.Current != null && Engine.Current.IsReady) { OnReady(); } else { ResoniteHooks.OnEngineReady += new Action(OnReady); } ManualLogSource log = Log; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(18, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Plugin "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("ResoniteModding.BepisModSettings"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" is loaded!"); } log.LogInfo(val); [CompilerGenerated] static void OnReady() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown FieldInfo obj = AccessTools.Field(typeof(Settings), "_categoryInfos"); if (((obj != null) ? obj.GetValue((object)null) : null) is Dictionary val2) { SettingCategoryInfo val3 = new SettingCategoryInfo(new Uri("https://avatars.githubusercontent.com/u/39589027?s=200&v=4.png"), 99L); val3.InitKey("BepInEx"); val2.Add(val3.Key, val3); } else { Log.LogError((object)"Failed to find _categoryInfos field in Settings."); } } } public override bool Unload() { ((BasePlugin)this).HarmonyInstance.UnpatchSelf(); FieldInfo obj = AccessTools.Field(typeof(Settings), "_categoryInfos"); if (((obj != null) ? obj.GetValue((object)null) : null) is Dictionary val) { val.Remove("BepInEx"); } else { Log.LogError((object)"Failed to find _categoryInfos field in Settings."); } return true; } } public static class PluginMetadata { public const string GUID = "ResoniteModding.BepisModSettings"; public const string NAME = "Bepis Mod Settings"; public const string VERSION = "1.6.6"; public const string AUTHORS = "ResoniteModding"; public const string REPOSITORY_URL = "https://github.com/ResoniteModding/BepisModSettings"; } } namespace BepisModSettings.DataFeeds { public static class BepisConfigsPage { [CompilerGenerated] private sealed class <>c__DisplayClass10_0 { public IButton btn; public ValueMultiDriver vmd; public Action <>9__1; internal void b__1() { LocaleHelper.SetLocalized(btn.LabelTextField, "Settings.BepInEx.Plugins.ResetConfig", (string)null, (Dictionary)null); } } [CompilerGenerated] private sealed class <>c__DisplayClass10_1 { [StructLayout((LayoutKind)3)] private struct <b__0>d : IAsyncStateMachine { public int <>1__state; public AsyncTaskMethodBuilder <>t__builder; public <>c__DisplayClass10_1 <>4__this; private TaskAwaiter <>u__1; private void MoveNext() { //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_0060: 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_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) //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_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_00b5: Expected O, but got Unknown //IL_00ba: Expected O, but got Unknown int num = <>1__state; <>c__DisplayClass10_1 <>c__DisplayClass10_ = <>4__this; try { TaskAwaiter val; if (num != 0) { val = global::System.Threading.Tasks.Task.Delay(2000, <>c__DisplayClass10_.token).GetAwaiter(); if (!((TaskAwaiter)(ref val)).IsCompleted) { num = (<>1__state = 0); <>u__1 = val; ((AsyncTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompletedb__0>d>(ref val, ref this); return; } } else { val = <>u__1; <>u__1 = default(TaskAwaiter); num = (<>1__state = -1); } ((TaskAwaiter)(ref val)).GetResult(); if (_resetPressed) { IButton obj = <>c__DisplayClass10_.CS$<>8__locals1.btn; Action obj2 = <>c__DisplayClass10_.CS$<>8__locals1.<>9__1; if (obj2 == null) { <>c__DisplayClass10_0 <>c__DisplayClass10_2 = <>c__DisplayClass10_.CS$<>8__locals1; Action val2 = delegate { LocaleHelper.SetLocalized(<>c__DisplayClass10_.CS$<>8__locals1.btn.LabelTextField, "Settings.BepInEx.Plugins.ResetConfig", (string)null, (Dictionary)null); }; Action val3 = val2; <>c__DisplayClass10_2.<>9__1 = val2; obj2 = val3; } ((IComponentBase)obj).RunSynchronously(obj2, false); _resetPressed = false; ValueMultiDriver obj3 = <>c__DisplayClass10_.CS$<>8__locals1.vmd; if (obj3 != null) { ((SyncField)(object)obj3.Value).Value = _resetPressed; } } } catch (global::System.Exception exception) { <>1__state = -2; ((AsyncTaskMethodBuilder)(ref <>t__builder)).SetException(exception); return; } <>1__state = -2; ((AsyncTaskMethodBuilder)(ref <>t__builder)).SetResult(); } [DebuggerHidden] private void SetStateMachine(IAsyncStateMachine stateMachine) { ((AsyncTaskMethodBuilder)(ref <>t__builder)).SetStateMachine(stateMachine); } } public CancellationToken token; public <>c__DisplayClass10_0 CS$<>8__locals1; [AsyncStateMachine(typeof(<b__0>d))] internal global::System.Threading.Tasks.Task? b__0() { //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) <b__0>d <b__0>d = default(<b__0>d); <b__0>d.<>t__builder = AsyncTaskMethodBuilder.Create(); <b__0>d.<>4__this = this; <b__0>d.<>1__state = -1; ((AsyncTaskMethodBuilder)(ref <b__0>d.<>t__builder)).Start<<b__0>d>(ref <b__0>d); return ((AsyncTaskMethodBuilder)(ref <b__0>d.<>t__builder)).Task; } } [CompilerGenerated] private sealed class <>c__DisplayClass4_0 { public ModMeta metadata; public Uri uri; internal void b__0(IField field) { ((IValue)(object)field).Value = metadata.ID; } internal void b__2(IField field) { ((IValue)(object)field).Value = metadata.Author; } internal void b__1(IField field) { ((IValue)(object)field).Value = metadata.Version; } internal void b__3(SyncDelegate syncDelegate) { Slot val = ((syncDelegate != null) ? ((SyncElement)syncDelegate).Slot : null); if (val != null) { ((SyncField)(object)((ContainerWorker)(object)val).AttachComponent(true, (Action)null).URL).Value = uri; } } } [CompilerGenerated] private sealed class <>c__DisplayClass5_0 { public ModMeta metaData; public Func <>9__8; public ButtonEventHandler <>9__22; public ButtonEventHandler <>9__23; internal bool b__8(PluginInfo x) { return x.Metadata.GUID == metaData.ID; } internal void b__2(SyncDelegate syncDelegate) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0031: Expected O, but got Unknown Button component = ((ContainerWorker)(object)((SyncElement)syncDelegate).Slot).GetComponent