using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using BepInEx.NET.Common; using BepInExResoniteShim; using Elements.Core; using FrooxEngine; using HarmonyLib; [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("art0007i")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("2.0.1.0")] [assembly: AssemblyInformationalVersion("2.0.1+c70ec525305c9efd7a83c01db71a6921670bcd7c")] [assembly: AssemblyProduct("ParentalIssues")] [assembly: AssemblyTitle("ParentalIssues")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/art0007i/ParentalIssues")] [assembly: AssemblyVersion("2.0.1.0")] [module: RefSafetyRules(11)] namespace ParentalIssues; [ResonitePlugin("art0007i.ParentalIssues", "ParentalIssues", "2.0.1", "art0007i", "https://github.com/art0007i/ParentalIssues")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BasePlugin { [HarmonyPatch] private class ParentalIssuesPatch { [CompilerGenerated] private sealed class d__0 : global::System.Collections.Generic.IEnumerable, global::System.Collections.IEnumerable, global::System.Collections.Generic.IEnumerator, global::System.Collections.IEnumerator, global::System.IDisposable { private int <>1__state; private MethodBase <>2__current; private int <>l__initialThreadId; MethodBase global::System.Collections.Generic.IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object global::System.Collections.IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__0(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void global::System.IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: { <>1__state = -1; MethodInfo val = AccessTools.Method(typeof(SceneInspector), "OnInsertParentPressed", (global::System.Type[])null, (global::System.Type[])null); <>2__current = (MethodBase)(object)val; <>1__state = 1; return true; } case 1: { <>1__state = -1; MethodInfo val = AccessTools.Method(typeof(SceneInspector), "OnAddChildPressed", (global::System.Type[])null, (global::System.Type[])null); <>2__current = (MethodBase)(object)val; <>1__state = 2; return true; } case 2: { <>1__state = -1; MethodInfo val = AccessTools.Method(typeof(SlotPositioning), "CreatePivotAtCenter", new global::System.Type[3] { typeof(Slot), typeof(BoundingBox).MakeByRefType(), typeof(bool) }, (global::System.Type[])null); <>2__current = (MethodBase)(object)val; <>1__state = 3; return true; } case 3: <>1__state = -1; return false; } } bool global::System.Collections.IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void global::System.Collections.IEnumerator.Reset() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new NotSupportedException(); } [DebuggerHidden] global::System.Collections.Generic.IEnumerator global::System.Collections.Generic.IEnumerable.GetEnumerator() { if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; return this; } return new d__0(0); } [DebuggerHidden] global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { return (global::System.Collections.IEnumerator)((global::System.Collections.Generic.IEnumerable)this).GetEnumerator(); } } [CompilerGenerated] private sealed class d__1 : global::System.Collections.Generic.IEnumerable, global::System.Collections.IEnumerable, global::System.Collections.Generic.IEnumerator, global::System.Collections.IEnumerator, global::System.IDisposable { private int <>1__state; private CodeInstruction <>2__current; private int <>l__initialThreadId; private global::System.Collections.Generic.IEnumerable codes; public global::System.Collections.Generic.IEnumerable <>3__codes; private global::System.Collections.Generic.IEnumerator <>7__wrap1; private CodeInstruction 5__3; private string 5__4; CodeInstruction global::System.Collections.Generic.IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object global::System.Collections.IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void global::System.IDisposable.Dispose() { int num = <>1__state; if (num == -3 || (uint)(num - 1) <= 1u) { try { } finally { <>m__Finally1(); } } <>7__wrap1 = null; 5__3 = null; 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_0089: 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_00ac: Expected O, but got Unknown try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>7__wrap1 = codes.GetEnumerator(); <>1__state = -3; goto IL_0104; case 1: <>1__state = -3; 5__3.operand = 5__4.Remove(0, 2); goto IL_00d7; case 2: { <>1__state = -3; 5__4 = null; 5__3 = null; goto IL_0104; } IL_0104: if (((global::System.Collections.IEnumerator)<>7__wrap1).MoveNext()) { 5__3 = <>7__wrap1.Current; object operand = 5__3.operand; 5__4 = operand as string; if (5__4 != null && 5__4.StartsWith(" - ")) { <>2__current = new CodeInstruction(OpCodes.Call, (object)typeof(Plugin).GetMethod("ProcessString")); <>1__state = 1; return true; } goto IL_00d7; } <>m__Finally1(); <>7__wrap1 = null; return false; IL_00d7: <>2__current = 5__3; <>1__state = 2; return true; } } catch { //try-fault ((global::System.IDisposable)this).Dispose(); throw; } } bool global::System.Collections.IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; if (<>7__wrap1 != null) { ((global::System.IDisposable)<>7__wrap1).Dispose(); } } [DebuggerHidden] void global::System.Collections.IEnumerator.Reset() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new NotSupportedException(); } [DebuggerHidden] global::System.Collections.Generic.IEnumerator global::System.Collections.Generic.IEnumerable.GetEnumerator() { d__1 d__; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; d__ = this; } else { d__ = new d__1(0); } d__.codes = <>3__codes; return d__; } [DebuggerHidden] global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { return (global::System.Collections.IEnumerator)((global::System.Collections.Generic.IEnumerable)this).GetEnumerator(); } } [IteratorStateMachine(typeof(d__0))] private static global::System.Collections.Generic.IEnumerable TargetMethods() { yield return (MethodBase)(object)AccessTools.Method(typeof(SceneInspector), "OnInsertParentPressed", (global::System.Type[])null, (global::System.Type[])null); yield return (MethodBase)(object)AccessTools.Method(typeof(SceneInspector), "OnAddChildPressed", (global::System.Type[])null, (global::System.Type[])null); yield return (MethodBase)(object)AccessTools.Method(typeof(SlotPositioning), "CreatePivotAtCenter", new global::System.Type[3] { typeof(Slot), typeof(BoundingBox).MakeByRefType(), typeof(bool) }, (global::System.Type[])null); } [IteratorStateMachine(typeof(d__1))] public static global::System.Collections.Generic.IEnumerable Transpiler(global::System.Collections.Generic.IEnumerable codes) { global::System.Collections.Generic.IEnumerator enumerator = codes.GetEnumerator(); try { while (((global::System.Collections.IEnumerator)enumerator).MoveNext()) { CodeInstruction code = enumerator.Current; object operand = code.operand; if (operand is string s && s.StartsWith(" - ")) { yield return new CodeInstruction(OpCodes.Call, (object)typeof(Plugin).GetMethod("ProcessString")); code.operand = s.Remove(0, 2); } yield return code; } } finally { ((global::System.IDisposable)enumerator)?.Dispose(); } } } internal static ManualLogSource Log; public override void Load() { Log = ((BasePlugin)this).Log; ((BasePlugin)this).HarmonyInstance.PatchAll(); } public static string ProcessString(string str) { if (str.ToLower().EndsWith("s")) { return str + "'"; } return str + "'s"; } } public static class PluginMetadata { public const string GUID = "art0007i.ParentalIssues"; public const string NAME = "ParentalIssues"; public const string VERSION = "2.0.1"; public const string AUTHORS = "art0007i"; public const string REPOSITORY_URL = "https://github.com/art0007i/ParentalIssues"; }