Decompiled source of TestToolsAsc3nt v1.0.0

TestToolsPatch.dll

Decompiled 2 years ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using TestToolsPatch.MoreMoney;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("TestToolsPatch")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TestToolsPatch")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("61323617-5e55-436d-bfaf-e8373819090e")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace TestToolsPatch
{
	[BepInPlugin("xAsc3nt.TestToolsPatch", "LC TestTools", "1.0.0")]
	public class TestToolsPatch : BaseUnityPlugin
	{
		private const string modGUID = "xAsc3nt.TestToolsPatch";

		private const string modName = "LC TestTools";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("xAsc3nt.TestToolsPatch");

		public static TestToolsPatch Instance;

		public ConfigEntry<int> startingAmount;

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("xAsc3nt.TestToolsPatch");
			mls.LogInfo((object)"The Test Mod has awaken :)");
			startingAmount = ((BaseUnityPlugin)this).Config.Bind<int>("Starting Amount Config", "Starting Amount", 5000, "The starting amount can be configured here");
			harmony.PatchAll(typeof(TestToolsPatch));
			harmony.PatchAll(typeof(QuotaSettingsPatch));
		}
	}
}
namespace TestToolsPatch.MoreMoney
{
	[HarmonyPatch(typeof(TimeOfDay))]
	internal class QuotaSettingsPatch
	{
		[HarmonyPostfix]
		[HarmonyPatch("Awake")]
		private static void MoreStartCredit(TimeOfDay __instance)
		{
			if (__instance.quotaVariables != null)
			{
				__instance.quotaVariables.startingCredits = TestToolsPatch.Instance.startingAmount.Value;
			}
		}
	}
}