Decompiled source of No rng floppy disks v1.4.0

NoRNGFloppyDisks.dll

Decompiled a day ago
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()
		{
			CommandConsole.AddCommand("setnextdiskfile", (Action<string[]>)setNextDiskFile, true);
		}

		public static void setNextDiskFile(string[] args)
		{
			if (args.Length == 0)
			{
				CommandConsole.Log("no arguement provided", false);
			}
			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<OS_File> ___diskFolders)
		{
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			List<FileInfo> list = new List<FileInfo>();
			List<FileInfo> list2 = new List<FileInfo>();
			List<FileInfo> list3 = new List<FileInfo>();
			List<FileInfo> list4 = new List<FileInfo>();
			List<FileInfo> list5 = new List<FileInfo>();
			List<string> list6 = new List<string> { "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<OS_File> obj = ___diskFolders;
				obj[obj.Count - 1].fileInfo.children = list2;
				List<OS_File> obj2 = ___diskFolders;
				((Object)obj2[obj2.Count - 1]).name = "ERROR";
				List<OS_File> obj3 = ___diskFolders;
				obj3[obj3.Count - 1].itemName = "ERROR";
				List<OS_File> obj4 = ___diskFolders;
				obj4[obj4.Count - 1].fileInfo.name = "ERROR";
				List<OS_File> obj5 = ___diskFolders;
				obj5[obj5.Count - 1].nameText.text = "ERROR";
			}
			if (diskFilesChosen == "toddstuff")
			{
				List<OS_File> obj6 = ___diskFolders;
				obj6[obj6.Count - 1].fileInfo.children = list3;
				List<OS_File> obj7 = ___diskFolders;
				((Object)obj7[obj7.Count - 1]).name = "toddstuff";
				List<OS_File> obj8 = ___diskFolders;
				obj8[obj8.Count - 1].itemName = "toddstuff";
				List<OS_File> obj9 = ___diskFolders;
				obj9[obj9.Count - 1].fileInfo.name = "toddstuff";
				List<OS_File> obj10 = ___diskFolders;
				obj10[obj10.Count - 1].nameText.text = "toddstuff";
			}
			if (diskFilesChosen == "sysbckp")
			{
				List<OS_File> obj11 = ___diskFolders;
				obj11[obj11.Count - 1].fileInfo.children = list4;
				List<OS_File> obj12 = ___diskFolders;
				((Object)obj12[obj12.Count - 1]).name = "SYSBCKP";
				List<OS_File> obj13 = ___diskFolders;
				obj13[obj13.Count - 1].itemName = "SYSBCKP";
				List<OS_File> obj14 = ___diskFolders;
				obj14[obj14.Count - 1].fileInfo.name = "SYSBCKP";
				List<OS_File> obj15 = ___diskFolders;
				obj15[obj15.Count - 1].nameText.text = "SYSBCKP";
			}
			if (diskFilesChosen == "recovery")
			{
				List<OS_File> obj16 = ___diskFolders;
				obj16[obj16.Count - 1].fileInfo.children = list5;
				List<OS_File> obj17 = ___diskFolders;
				((Object)obj17[obj17.Count - 1]).name = "RECOVERY";
				List<OS_File> obj18 = ___diskFolders;
				obj18[obj18.Count - 1].itemName = "RECOVERY";
				List<OS_File> obj19 = ___diskFolders;
				obj19[obj19.Count - 1].fileInfo.name = "RECOVERY";
				List<OS_File> 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";
	}
}