Decompiled source of UnlimatedFPS v1.0.0

SolarFPSUnlimated/SolarFPSUnlimated.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
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("SolarBooster")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SolarBooster")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("1794c9e2-6213-4024-b55e-67f56da5b373")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace SolarMoneyBooster;

[BepInPlugin("Solar.Money", "SolarMoneyBooster", "1.0.0")]
public class MoreMoneyStart : BaseUnityPlugin
{
	[HarmonyPatch(typeof(TimeOfDay))]
	[HarmonyPatch("Awake")]
	public static class TimeOfDayAwakePatch
	{
		private static void Postfix(TimeOfDay __instance)
		{
			if (__instance.quotaVariables != null)
			{
				__instance.quotaVariables.startingCredits = Instance.startingAmount.Value;
			}
		}
	}

	private const string modGUID = "Solar.Money";

	private const string modName = "SolarMoneyBooster";

	private const string modVersion = "1.0.0";

	private readonly Harmony harmony;

	public ConfigEntry<int> startingAmount;

	public static MoreMoneyStart Instance;

	public bool init;

	private static bool OnGUIEnabled;

	private Rect windowRect;

	private float deltaTime;

	public MoreMoneyStart()
	{
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Expected O, but got Unknown
		windowRect = new Rect(20f, 20f, 280f, 350f);
		harmony = new Harmony("Solar.Money");
	}

	private void OnGUI()
	{
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		new Rect((float)Screen.width - 220f, 20f, 195f, 500f);
		int num = Mathf.RoundToInt(1f / deltaTime);
		GUILayout.Label($"FPS: {num}", Array.Empty<GUILayoutOption>());
	}

	private void WindowFunction(int windowID)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		GUI.DragWindow(new Rect(0f, 0f, 10000f, 20f));
	}

	static MoreMoneyStart()
	{
		OnGUIEnabled = true;
	}

	public static void DrawText(Rect rect, string text, Color color, int fontSize = 12, FontStyle fontStyle = 0)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Expected O, but got Unknown
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Expected O, but got Unknown
		GUIStyle val = new GUIStyle(GUI.skin.label);
		val.fontSize = fontSize;
		val.normal.textColor = color;
		val.fontStyle = fontStyle;
		GUI.Label(rect, new GUIContent(text), val);
	}

	private void Update()
	{
		deltaTime += (Time.unscaledDeltaTime - deltaTime) * 0.1f;
		if (Application.targetFrameRate != 450)
		{
			Application.targetFrameRate = 450;
		}
		if (QualitySettings.vSyncCount != 0)
		{
			QualitySettings.vSyncCount = 0;
		}
	}

	private void Start()
	{
		Application.targetFrameRate = 400;
		QualitySettings.vSyncCount = 0;
	}
}