Decompiled source of RapidInflation v1.0.1

RapidInflation.dll

Decompiled a year 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 RapidInflation.Patches;
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("RapidInflation")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RapidInflation")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("49f15457-b8dd-4946-826e-e2257edcae4d")]
[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 RapidInflation
{
	[BepInPlugin("Murkorus.RapidInflation", "RapidInflation", "1.0.0.0")]
	public class InflationModBase : BaseUnityPlugin
	{
		private const string modGUID = "Murkorus.RapidInflation";

		private const string modName = "RapidInflation";

		private const string modVersion = "1.0.0.0";

		private readonly Harmony harmony = new Harmony("Murkorus.RapidInflation");

		public static InflationModBase Instance;

		internal ManualLogSource mls;

		public ConfigEntry<int> startingQuota;

		public ConfigEntry<int> startingCredits;

		public ConfigEntry<int> baseIncrease;

		public ConfigEntry<int> deadlineDaysAmount;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			LoadConfig();
			mls = Logger.CreateLogSource("Murkorus.RapidInflation");
			mls.LogInfo((object)"Murkorus.RapidInflation has loaded. Version: 1.0.0.0");
			harmony.PatchAll(typeof(InflationModBase));
			harmony.PatchAll(typeof(QuotaSettingsPatch));
		}

		private void LoadConfig()
		{
			startingQuota = ((BaseUnityPlugin)this).Config.Bind<int>("\u200bQuota", "startingQuota", 250, (ConfigDescription)null);
			startingCredits = ((BaseUnityPlugin)this).Config.Bind<int>("\u200bQuota", "startingCredits", 100, (ConfigDescription)null);
			baseIncrease = ((BaseUnityPlugin)this).Config.Bind<int>("\u200bQuota", "baseIncrease", 200, (ConfigDescription)null);
			deadlineDaysAmount = ((BaseUnityPlugin)this).Config.Bind<int>("\u200bQuota", "deadlineDaysAmount", 5, (ConfigDescription)null);
		}
	}
}
namespace RapidInflation.Patches
{
	[HarmonyPatch]
	internal class QuotaSettingsPatch
	{
		[HarmonyPatch(typeof(TimeOfDay), "Awake")]
		[HarmonyPostfix]
		private static void HigherQuotaPatch(ref QuotaSettings ___quotaVariables)
		{
			___quotaVariables.startingQuota = InflationModBase.Instance.startingQuota.Value;
			___quotaVariables.startingCredits = InflationModBase.Instance.startingCredits.Value;
			___quotaVariables.baseIncrease = InflationModBase.Instance.baseIncrease.Value;
			___quotaVariables.deadlineDaysAmount = InflationModBase.Instance.deadlineDaysAmount.Value;
		}
	}
}