Decompiled source of MailOrderMayhem v0.1.0

plugins/shroudednight-MailOrderMayhem/MailOrderMayhem.dll

Decompiled a day ago
using System;
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 BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Il2CppSystem.Collections.Generic;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("MailOrderMayhem")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("More apartment items")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0")]
[assembly: AssemblyProduct("MailOrderMayhem")]
[assembly: AssemblyTitle("MailOrderMayhem")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.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;
		}
	}
}
namespace com.shroudednight.MailOrderMayhem
{
	internal static class Extensions
	{
		public static void INFO(this ManualLogSource logSource, string data)
		{
			logSource.Log((LogLevel)16, (object)data);
		}

		public static void WARN(this ManualLogSource logSource, string data)
		{
			logSource.Log((LogLevel)4, (object)data);
		}

		public static void ERROR(this ManualLogSource logSource, string data)
		{
			logSource.Log((LogLevel)2, (object)data);
		}

		public static void FATAL(this ManualLogSource logSource, string data)
		{
			logSource.Log((LogLevel)1, (object)data);
		}
	}
	[BepInPlugin("MailOrderMayhem", "MailOrderMayhem", "0.1.0")]
	public class Plugin : BasePlugin
	{
		[HarmonyPatch(typeof(FurnishingsController), "UpdateListDisplay")]
		public class FurnishingsController_UpdateListDisplay
		{
			public static bool Prefix(FurnishingsController __instance)
			{
				Enumerator<FurniturePreset> enumerator = Toolbox.Instance.allFurniture.GetEnumerator();
				while (enumerator.MoveNext())
				{
					enumerator.Current.purchasable = true;
				}
				return true;
			}
		}

		[HarmonyPatch(typeof(ApartmentItemsController), "UpdateListDisplay")]
		public class ApartmentItemsController_UpdateListDisplay
		{
			public static bool Prefix(ApartmentItemsController __instance)
			{
				Enumerator<string, InteractablePreset> enumerator = Toolbox.Instance.objectPresetDictionary.GetEnumerator();
				while (enumerator.MoveNext())
				{
					KeyValuePair<string, InteractablePreset> current = enumerator.Current;
					current.Value.spawnable = true;
					current.Value.allowInApartmentShop = true;
				}
				return true;
			}
		}

		public override void Load()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				new Harmony("MailOrderMayhem").PatchAll();
			}
			catch (Exception value)
			{
				((BasePlugin)this).Log.FATAL($"Unable to load ${"MailOrderMayhem"}: {value}");
				throw;
			}
			((BasePlugin)this).Log.INFO("Plugin MailOrderMayhem is loaded");
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "MailOrderMayhem";

		public const string PLUGIN_NAME = "MailOrderMayhem";

		public const string PLUGIN_VERSION = "0.1.0";
	}
}