using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using NoRNGFloppyDisks; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("NoRNGFloppyDisks")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("My first plugin")] [assembly: AssemblyTitle("NoRNGFloppyDisks")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public class customFileAdderPatch { [HarmonyPatch(typeof(CL_GameManager), "Start")] public class CustomFileCommand { private static void Postfix() { Action action = setNextDiskFile; CommandConsole.BuildCommand("setnextdiskfile", action); } public static void setNextDiskFile(string[] args) { if (args.Length == 0) { CommandConsole.Log("no arguement provided"); return; } if (args[0].ToLower() == "error") { fileAdder.nextDiskFileChanger("error"); } if (args[0].ToLower() == "toddstuff") { fileAdder.nextDiskFileChanger("toddstuff"); } if (args[0].ToLower() == "sysbckp") { fileAdder.nextDiskFileChanger("sysbckp"); } if (args[0].ToLower() == "recovery") { fileAdder.nextDiskFileChanger("recovery"); } } } [HarmonyPatch(typeof(DiskController), "CreateDiskContents")] public static class fileAdder { private static string diskFilesChosen; public static void Postfix(ref List ___diskFolders) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown List list = new List(); List list2 = new List(); List list3 = new List(); List list4 = new List(); List list5 = new List(); List list6 = new List { "ERROR", "toddstuff", "SYSBCKP", "RECOVERY" }; OS_Filesystem val = new OS_Filesystem(); Plugin.Logger.LogInfo((object)"we got here ig"); WKAssetDatabase fullCombinedAssetDatabase = CL_AssetManager.GetFullCombinedAssetDatabase(); foreach (OS_DiskData diskDatum in fullCombinedAssetDatabase.diskData) { foreach (DiskDataSelector diskDataSelector in diskDatum.diskDataSelectors) { foreach (FileInfo file in diskDataSelector.files) { Plugin.Logger.LogInfo((object)"we got into the disk name check"); if (diskDatum.diskName == "DSF-LG") { list.Add(file); } if (diskDatum.diskName == "ERROR") { list2.Add(file); } if (diskDatum.diskName == "toddstuff") { list3.Add(file); } if (diskDatum.diskName == "SYSBCKP") { list4.Add(file); } if (diskDatum.diskName == "RECOVERY") { list5.Add(file); } } } } Plugin.Logger.LogInfo((object)"we got out of the disk name check"); if (diskFilesChosen == "error") { List obj = ___diskFolders; obj[obj.Count - 1].fileInfo.children = list2; List obj2 = ___diskFolders; ((Object)obj2[obj2.Count - 1]).name = "ERROR"; List obj3 = ___diskFolders; obj3[obj3.Count - 1].itemName = "ERROR"; List obj4 = ___diskFolders; obj4[obj4.Count - 1].fileInfo.name = "ERROR"; List obj5 = ___diskFolders; obj5[obj5.Count - 1].nameText.text = "ERROR"; } if (diskFilesChosen == "toddstuff") { List obj6 = ___diskFolders; obj6[obj6.Count - 1].fileInfo.children = list3; List obj7 = ___diskFolders; ((Object)obj7[obj7.Count - 1]).name = "toddstuff"; List obj8 = ___diskFolders; obj8[obj8.Count - 1].itemName = "toddstuff"; List obj9 = ___diskFolders; obj9[obj9.Count - 1].fileInfo.name = "toddstuff"; List obj10 = ___diskFolders; obj10[obj10.Count - 1].nameText.text = "toddstuff"; } if (diskFilesChosen == "sysbckp") { List obj11 = ___diskFolders; obj11[obj11.Count - 1].fileInfo.children = list4; List obj12 = ___diskFolders; ((Object)obj12[obj12.Count - 1]).name = "SYSBCKP"; List obj13 = ___diskFolders; obj13[obj13.Count - 1].itemName = "SYSBCKP"; List obj14 = ___diskFolders; obj14[obj14.Count - 1].fileInfo.name = "SYSBCKP"; List obj15 = ___diskFolders; obj15[obj15.Count - 1].nameText.text = "SYSBCKP"; } if (diskFilesChosen == "recovery") { List obj16 = ___diskFolders; obj16[obj16.Count - 1].fileInfo.children = list5; List obj17 = ___diskFolders; ((Object)obj17[obj17.Count - 1]).name = "RECOVERY"; List obj18 = ___diskFolders; obj18[obj18.Count - 1].itemName = "RECOVERY"; List obj19 = ___diskFolders; obj19[obj19.Count - 1].fileInfo.name = "RECOVERY"; List obj20 = ___diskFolders; obj20[obj20.Count - 1].nameText.text = "RECOVERY"; } } public static void nextDiskFileChanger(string chosenDiskFile) { diskFilesChosen = chosenDiskFile; } } } namespace NoRNGFloppyDisks { [BepInPlugin("NoRNGFloppyDisksGUID", "No rng floppy disks", "1.0.0.0")] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Logger; private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown Harmony val = new Harmony("NoRNGFloppyDisks"); Logger = ((BaseUnityPlugin)this).Logger; Logger.LogInfo((object)"Plugin NoRNGFloppyDisks is loaded!"); val.PatchAll(); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "NoRNGFloppyDisks"; public const string PLUGIN_NAME = "My first plugin"; public const string PLUGIN_VERSION = "1.0.0"; } }