using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Threading.Tasks; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using BepInEx.NET.Common; using BepInExResoniteShim; using BepisResoniteWrapper; using Elements.Core; using FrooxEngine; using FrooxEngine.Store; using FrooxEngine.UIX; using HarmonyLib; using Newtonsoft.Json; using SkyFrost.Base; [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.4.0")] [assembly: AssemblyInformationalVersion("2.0.4+bde9558f7ceb091f9676db93ff4a28b8b4b1f171")] [assembly: AssemblyProduct("LocalStorage")] [assembly: AssemblyTitle("LocalStorage")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/art0007i/LocalStorage")] [assembly: AssemblyVersion("2.0.4.0")] [module: RefSafetyRules(11)] namespace LocalStorage; [ResonitePlugin("art0007i.LocalStorage", "LocalStorage", "2.0.4", "art0007i", "https://github.com/art0007i/LocalStorage")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BasePlugin { [HarmonyPatch(typeof(InventoryBrowser))] private class InventoryPatch { [HarmonyPatch("ShowInventoryOwners")] [HarmonyPrefix] public static bool ShowInventoriesPrefix(InventoryBrowser __instance) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown if (!HIDE_LOCAL) { object obj; if (__instance == null) { obj = null; } else { Engine engine = ((Worker)__instance).Engine; if (engine == null) { obj = null; } else { EngineSkyFrostInterface cloud = engine.Cloud; obj = ((cloud != null) ? ((SkyFrostInterface)cloud).CurrentUser : null); } } if (obj == null) { object obj2; if (__instance == null) { obj2 = null; } else { RecordDirectory currentDirectory = __instance.CurrentDirectory; obj2 = ((currentDirectory != null) ? currentDirectory.OwnerId : null); } if ((string)obj2 != "L-LocalStorage" && WorldExtensions.IsUserspace(((Worker)__instance).World)) { RecordDirectory val = new RecordDirectory("L-LocalStorage", "Inventory", ((Worker)__instance).Engine, (string)null); __instance.Open(val, (Slide)1); return false; } } } object obj3; if (__instance == null) { obj3 = null; } else { RecordDirectory currentDirectory2 = __instance.CurrentDirectory; obj3 = ((currentDirectory2 != null) ? currentDirectory2.OwnerId : null); } if ((string)obj3 == "L-LocalStorage") { object obj4; if (__instance == null) { obj4 = null; } else { Engine engine2 = ((Worker)__instance).Engine; if (engine2 == null) { obj4 = null; } else { EngineSkyFrostInterface cloud2 = engine2.Cloud; obj4 = ((cloud2 != null) ? ((SkyFrostInterface)cloud2).CurrentUser : null); } } if (obj4 == null && WorldExtensions.IsUserspace(((Worker)__instance).World)) { Traverse.Create((object)__instance).Method("TryInitialize", global::System.Array.Empty()).GetValue((object[])null); return false; } } return true; } [HarmonyPatch("BeginGeneratingNewDirectory")] [HarmonyPostfix] public static void GenerationPostfix(InventoryBrowser __instance, UIBuilder __result, ref GridLayout folders) { //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_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_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_0081: 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_008a: Unknown result type (might be due to invalid IL or missing references) if (!HIDE_LOCAL && __instance.CurrentDirectory == null && WorldExtensions.IsUserspace(((Worker)__instance).World)) { __result.NestInto(((Component)folders).Slot); colorX lime = colorX.Lime; colorX black = colorX.Black; colorX val = MathX.Lerp(ref lime, ref black, 0.5f, (ColorProfileAwareOperation)0); ButtonEventHandler val2 = (ButtonEventHandler)(object)AccessTools.Method(typeof(InventoryBrowser), "OpenInventory", (global::System.Type[])null, (global::System.Type[])null).CreateDelegate(typeof(ButtonEventHandler), (object)__instance); LocaleString val3 = LocaleString.op_Implicit("Local Storage"); colorX? val4 = val; __result.Button(ref val3, ref val4, val2, "L-LocalStorage", __instance.ActualDoublePressInterval); __result.NestOut(); } } [HarmonyPatch("OnChanges")] [HarmonyPostfix] public static void OnChangesPostFix(InventoryBrowser __instance, ref SyncRef