Decompiled source of Fast Load Mono version v1.0.0

FastLoadMono.dll

Decompiled 3 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using HarmonyLib;
using LoadToSave;
using MelonLoader;
using Microsoft.CodeAnalysis;
using ScheduleOne.Persistence;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: MelonInfo(typeof(EntryPoint), "LoadToSave", "1.0.0", "_peron", null)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("FastLoadMono")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("FastLoadMono")]
[assembly: AssemblyTitle("FastLoadMono")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace LoadToSave
{
	public class EntryPoint : MelonMod
	{
		[HarmonyPatch(typeof(LoadManager))]
		public class PlayerConfig
		{
			[HarmonyPatch("RefreshSaveInfo")]
			[HarmonyPostfix]
			public static void Selected(LoadManager __instance)
			{
				if (!ModExecuted)
				{
					__instance.StartGame(LoadManager.SaveGames[(int)_entry.BoxedValue - 1], false);
					ModExecuted = true;
				}
			}
		}

		private static MelonPreferences_Category? _cat;

		private static MelonPreferences_Entry? _entry;

		public static bool ModExecuted;

		public override void OnInitializeMelon()
		{
			_cat = MelonPreferences.CreateCategory("LoadToSave_LoadToSaveCategory", "LoadToSave - Config");
			_entry = _cat.CreateEntry<int>("LoadToSave_SaveToLoad", 1, "SaveToLoad", false);
			_cat.SetFilePath("UserData/LoadToSave.cfg");
			_cat.SaveToFile(true);
		}

		public static void LoadAllCategories()
		{
			foreach (MelonPreferences_Category category in MelonPreferences.Categories)
			{
				category.LoadFromFile(true);
			}
		}
	}
}