Decompiled source of Freeroam v1.0.0

BepInEx/plugins/Freeroam/Freeroam.dll

Decompiled 3 months 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 Atomicrops.Game.DebugTools;
using Atomicrops.Game.GameState;
using BepInEx;
using BepInEx.Logging;
using Freeroam;
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.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: BuildDateTime("2024-02-19T00:21:55")]
[assembly: AssemblyCompany("Freeroam")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+48da0ee339a3afe45050864988f618b2e1a7a7c9")]
[assembly: AssemblyProduct("Freeroam")]
[assembly: AssemblyTitle("Freeroam")]
[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 Template
{
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "Freeroam";

		public const string PLUGIN_NAME = "Freeroam";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace Freeroam
{
	[AttributeUsage(AttributeTargets.Assembly)]
	public class BuildDateTimeAttribute : Attribute
	{
		public DateTime Built { get; }

		public BuildDateTimeAttribute(string date)
		{
			Built = DateTime.Parse(date);
		}
	}
	public static class DayNightSystem_Holder
	{
		public static bool dayPaused;
	}
	[HarmonyPatch(typeof(DayNightSystem), "AwakeSub")]
	internal class DayNightSystem_AwakeSub_Patch
	{
		private static void Postfix(DayNightSystem __instance)
		{
			__instance.onDayBegin += delegate
			{
				DayNightSystem_Holder.dayPaused = true;
				DebugCommands.NoDayProgressOn();
			};
		}
	}
	[HarmonyPatch(typeof(DayNightSystem), "Update")]
	internal class DayNightSystem_Update_Patch
	{
		private static void Postfix(DayNightSystem __instance)
		{
			if (Input.GetKeyUp((KeyCode)110) && DayNightSystem_Holder.dayPaused)
			{
				DebugCommands.NoDayProgressOff();
				DebugCommands.GoToDuskPhase();
				DayNightSystem_Holder.dayPaused = false;
			}
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "fhghaha.plugin.Freeroam";

		public const string PLUGIN_NAME = "Freeroam";

		public const string PLUGIN_VERSION = "1.0.0";
	}
	[BepInPlugin("fhghaha.plugin.Freeroam", "Freeroam", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		public static ManualLogSource Log;

		private void Awake()
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			((BaseUnityPlugin)this).Logger.LogMessage((object)"---------------Plugin fhghaha.plugin.Freeroam is loaded!---------------");
			((BaseUnityPlugin)this).Logger.LogMessage((object)$"---------------{GetBuildDateTime()}---------------");
			Harmony val = new Harmony("fhghaha.plugin.Freeroam");
			val.PatchAll();
		}

		private static DateTime? GetBuildDateTime()
		{
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			return (Attribute.GetCustomAttribute(executingAssembly, typeof(BuildDateTimeAttribute)) is BuildDateTimeAttribute buildDateTimeAttribute) ? new DateTime?(buildDateTimeAttribute.Built) : null;
		}
	}
}