Decompiled source of LethalDays v0.0.5

BepInEx/plugins/LethalDays.dll

Decompiled a year 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.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LethalDays")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Slows the clock down to better allow Exploration")]
[assembly: AssemblyFileVersion("0.0.5.0")]
[assembly: AssemblyInformationalVersion("0.0.5")]
[assembly: AssemblyProduct("LethalDays")]
[assembly: AssemblyTitle("LethalDays")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.5.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 LethalDays
{
	[BepInPlugin("IsCoffeeTho.LethalDays", "LethalDays", "0.0.5")]
	[BepInProcess("Lethal Company.exe")]
	public class Plugin : BaseUnityPlugin
	{
		private const string MOD_GUID = "IsCoffeeTho.LethalDays";

		private readonly Harmony harmony = new Harmony("IsCoffeeTho.LethalDays");

		public static Plugin Instance;

		internal ManualLogSource mls;

		public ConfigEntry<float> CFG_timescale;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			Instance.CFG_timescale = ((BaseUnityPlugin)this).Config.Bind<float>("LethalDays", "TimeScale", 1f, "How many 'In Game Seconds' should happen a second");
			mls = Logger.CreateLogSource("IsCoffeeTho.LethalDays");
			mls.LogInfo((object)"Plugin LethalDays is loaded! MOD_GUID: 'IsCoffeeTho.LethalDays'");
			harmony.PatchAll(typeof(Plugin));
		}

		[HarmonyPatch(typeof(TimeOfDay), "Update")]
		[HarmonyPostfix]
		public static void AdjustTime(TimeOfDay __instance)
		{
			__instance.globalTimeSpeedMultiplier = 0.0167f * Instance.CFG_timescale.Value;
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "LethalDays";

		public const string PLUGIN_NAME = "LethalDays";

		public const string PLUGIN_VERSION = "0.0.5";
	}
}