Decompiled source of MoneyMenu v1.4.4

BepInEx/plugins/SolarMoneyMenuV1.4.4.dll

Decompiled 10 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 int currentPage;

	private string textField;

	private bool toggleState;

	private Texture2D button;

	private Texture2D buttonhovered;

	private Texture2D buttonactive;

	private Texture2D windowbackground;

	private Texture2D windowbackgroundhover;

	private Color guiColor;

	private int clickCount;

	private Vector2 scrollPosition = Vector2.zero;

	private static Texture2D CheatBox;

	private static Texture2D CheatBoxSeperator;

	private static Texture2D SliderBar;

	private static Texture2D SliderGrab;

	private void Awake()
	{
		if (!Object.op_Implicit((Object)(object)Instance))
		{
			Instance = this;
		}
		startingAmount = ((BaseUnityPlugin)this).Config.Bind<int>("Credit Amoount", "Credits", 120, "Edit Credits Here");
		harmony.PatchAll(typeof(TimeOfDayAwakePatch));
	}

	public MoreMoneyStart()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Expected O, but got Unknown
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Expected O, but got Unknown
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Expected O, but got Unknown
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Expected O, but got Unknown
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Expected O, but got Unknown
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Expected O, but got Unknown
		guiColor = Color.white;
		button = new Texture2D(1, 1);
		buttonhovered = new Texture2D(1, 1);
		buttonactive = new Texture2D(1, 1);
		windowbackground = new Texture2D(1, 1);
		windowbackgroundhover = new Texture2D(1, 1);
		windowRect = new Rect(20f, 20f, 280f, 350f);
		currentPage = 1;
		harmony = new Harmony("Solar.Money");
	}

	private void OnGUI()
	{
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Expected O, but got Unknown
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0241: Unknown result type (might be due to invalid IL or missing references)
		//IL_0246: Unknown result type (might be due to invalid IL or missing references)
		//IL_025a: Unknown result type (might be due to invalid IL or missing references)
		//IL_025f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0267: Unknown result type (might be due to invalid IL or missing references)
		//IL_026c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0280: Unknown result type (might be due to invalid IL or missing references)
		//IL_0285: Unknown result type (might be due to invalid IL or missing references)
		//IL_028d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0292: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
		Rect rect = new Rect((float)Screen.width - 220f, 20f, 195f, 500f);
		string text = "<color=white>Money Menu Version:1.4.3\nDev : Solar  \nLATENCY : \n</color>" + Time.deltaTime;
		Color white = Color.white;
		int fontSize = 16;
		FontStyle fontStyle = (FontStyle)1;
		DrawText(rect, text, white, fontSize, fontStyle);
		GUI.color = guiColor;
		windowRect = GUI.Window(0, windowRect, new WindowFunction(WindowFunction), "<b><color=red>[SOLAR]</color> Money Menu</b>");
		float num = ((Rect)(ref windowRect)).y + 20f;
		float num2 = ((Rect)(ref windowRect)).height - 10f;
		GUILayout.BeginArea(new Rect(((Rect)(ref windowRect)).x + 20f, num, ((Rect)(ref windowRect)).width - 40f, num2));
		GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
		if (currentPage == 1)
		{
			GUILayout.Label("<b><color=white>I Update The Menu Very Frequently !</color></b>", Array.Empty<GUILayoutOption>());
			GUILayout.Label("<color=white>Credit Amount: </color>" + startingAmount.Value, Array.Empty<GUILayoutOption>());
			startingAmount.Value = Mathf.RoundToInt(GUILayout.HorizontalSlider((float)startingAmount.Value, 0f, 10000f, Array.Empty<GUILayoutOption>()));
			if (GUILayout.Button("Set Credit Amount: 60", Array.Empty<GUILayoutOption>()))
			{
				startingAmount.Value = 60;
			}
			if (GUILayout.Button("Set Credit Amount: 300", Array.Empty<GUILayoutOption>()))
			{
				startingAmount.Value = 300;
			}
			if (GUILayout.Button("Set Credit Amount: 400", Array.Empty<GUILayoutOption>()))
			{
				startingAmount.Value = 400;
			}
			if (GUILayout.Button("Set Credit Amount: 500", Array.Empty<GUILayoutOption>()))
			{
				startingAmount.Value = 500;
			}
			if (GUILayout.Button("Set Credit Amount: 1000", Array.Empty<GUILayoutOption>()))
			{
				startingAmount.Value = 1000;
			}
			if (GUILayout.Button("Set Credit Amount: 10000", Array.Empty<GUILayoutOption>()))
			{
				startingAmount.Value = 10000;
			}
			if (GUILayout.Button("Change Menu Theme", Array.Empty<GUILayoutOption>()))
			{
				switch (clickCount % 3)
				{
				case 0:
					guiColor = Color.Lerp(Color.red, Color.blue, Mathf.PingPong(Time.time, 1f));
					break;
				case 1:
					guiColor = Color.Lerp(Color.green, Color.yellow, Mathf.PingPong(Time.time, 1f));
					break;
				case 2:
					guiColor = Color.Lerp(Color.white, Color.grey, Mathf.PingPong(Time.time, 1f));
					break;
				}
				clickCount++;
			}
			GUILayout.Label("This Will Open MoneyMenu On ThunderStore To Check If You Have The Latest Version.", Array.Empty<GUILayoutOption>());
			if (GUILayout.Button("Redirect To Download", Array.Empty<GUILayoutOption>()))
			{
				Application.OpenURL("https://thunderstore.io/c/lethal-company/p/Solar32/MoneyMenu/");
			}
		}
		GUILayout.EndVertical();
		GUILayout.EndArea();
	}

	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;
	}

	private static void LerpedColour()
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Expected O, but got Unknown
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		float num = Mathf.PingPong(Time.time, 1f);
		Color val = Color32.op_Implicit(new Color32((byte)176, (byte)196, (byte)222, (byte)222));
		Color red = Color.red;
		Color val2 = Color.Lerp(val, red, num);
		Texture2D val3 = new Texture2D(1, 1);
		val3.SetPixel(0, 0, val2);
		val3.Apply();
		new GUIStyle(GUI.skin.button).normal.background = val3;
	}

	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);
	}
}