Decompiled source of Spoods Mono Larger Trash Can Radius v1.1.0

Spood.Mono.LargerTrashRadius.dll

Decompiled 3 weeks ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using HarmonyLib;
using MelonLoader;
using MelonLoader.Preferences;
using Microsoft.CodeAnalysis;
using ScheduleOne.ObjectScripts;
using Spood.Mono.LargerTrashRadius;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Mod), "Spood.Mono.LargerTrashRadius", "1.1.0", "Spood", null)]
[assembly: MelonGame("TVGS", "Schedule I")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Spood.Mono.LargerTrashRadius")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+e01cfdbd1073309a390015276101ef3f38f556de")]
[assembly: AssemblyProduct("Spood.Mono.LargerTrashRadius")]
[assembly: AssemblyTitle("Spood.Mono.LargerTrashRadius")]
[assembly: NeutralResourcesLanguage("en-US")]
[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;
		}
	}
}
namespace Spood.Mono.LargerTrashRadius
{
	public class Mod : MelonMod
	{
		public const string PreferencesCategory = "Spood_LargerTrashRadius";

		public const string PreferencesRadiusEntryName = "radius";

		public override void OnInitializeMelon()
		{
			((MelonBase)this).LoggerInstance.Msg("Spood.Mono.LargerTrashRadius Initialized");
			SetupPreferences();
			((MelonBase)this).HarmonyInstance.PatchAll();
		}

		private void SetupPreferences()
		{
			MelonPreferences_Category val = MelonPreferences.CreateCategory("Spood_LargerTrashRadius");
			if (val.GetEntry("radius") == null)
			{
				val.CreateEntry<float>("radius", 5.5f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
				val.SaveToFile(true);
			}
		}
	}
	[HarmonyPatch(typeof(TrashContainerItem), "Awake")]
	internal class PickupRadiusPatch
	{
		private static void Prefix(TrashContainerItem __instance)
		{
			MelonPreferences_Category category = MelonPreferences.GetCategory("Spood_LargerTrashRadius");
			float value = category.GetEntry<float>("radius").Value;
			__instance.PickupSquareWidth = value;
		}
	}
}