Decompiled source of Admin Panel v1.0.0

RepoMod1.dll

Decompiled 11 hours ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
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("RepoMod1")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("RepoMod1")]
[assembly: AssemblyTitle("RepoMod1")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace Mod
{
	[BepInPlugin("quinn.carter.repoadmin", "Quinn's REPO Admin Panel", "1.0.0")]
	[BepInProcess("REPO.exe")]
	public class AdminPanelMain : BaseUnityPlugin
	{
		private bool showMenu = false;

		private Rect windowRect = new Rect(50f, 50f, 300f, 400f);

		public static bool isNoclipActive;

		public static bool isGodModeActive;

		public static bool isSuperSpeedActive;

		public static PlayerController? localPlayer;

		private void Update()
		{
			if (Input.GetKeyDown((KeyCode)61))
			{
				showMenu = !showMenu;
				if (showMenu)
				{
					Cursor.lockState = (CursorLockMode)0;
					Cursor.visible = true;
				}
			}
			if (isNoclipActive && (Object)(object)localPlayer != (Object)null)
			{
				HandleNoclipMovement();
			}
		}

		private void OnGUI()
		{
			//IL_0013: 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_0033: Expected O, but got Unknown
			//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)
			if (showMenu)
			{
				windowRect = GUILayout.Window(1, windowRect, new WindowFunction(DrawAdminWindow), "⚠\ufe0f REPO ADMIN PANEL ⚠\ufe0f", Array.Empty<GUILayoutOption>());
			}
		}

		private void DrawAdminWindow(int windowID)
		{
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.Space(10f);
			GUILayout.Label("Movement Features:", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
			string text = (isNoclipActive ? "DISABLE NOCLIP" : "ENABLE NOCLIP");
			if (GUILayout.Button(text, Array.Empty<GUILayoutOption>()))
			{
				isNoclipActive = !isNoclipActive;
				TogglePlayerColliders(!isNoclipActive);
			}
			string text2 = (isSuperSpeedActive ? "DISABLE SUPER SPEED" : "ENABLE SUPER SPEED");
			if (GUILayout.Button(text2, Array.Empty<GUILayoutOption>()))
			{
				isSuperSpeedActive = !isSuperSpeedActive;
				if (!((Object)(object)localPlayer != (Object)null))
				{
				}
			}
			GUILayout.Space(15f);
			GUILayout.Label("Survival Features:", Array.Empty<GUILayoutOption>());
			string text3 = (isGodModeActive ? "GODMODE: ACTIVE" : "GODMODE: INACTIVE");
			if (GUILayout.Button(text3, Array.Empty<GUILayoutOption>()))
			{
				isGodModeActive = !isGodModeActive;
			}
			GUILayout.Space(15f);
			GUILayout.Label("Economy Features:", Array.Empty<GUILayoutOption>());
			if (GUILayout.Button("+ Add $10,000 Scrap Value", Array.Empty<GUILayoutOption>()) && (Object)(object)localPlayer != (Object)null)
			{
				Debug.Log((object)"[Admin Panel] Adding funds to inventory storage...");
			}
			GUILayout.Space(20f);
			if (GUILayout.Button("✕ Close Menu", Array.Empty<GUILayoutOption>()))
			{
				showMenu = false;
			}
			GUI.DragWindow(new Rect(0f, 0f, 10000f, 10000f));
		}

		private void TogglePlayerColliders(bool enableColliders)
		{
			if (!((Object)(object)localPlayer == (Object)null))
			{
				Collider[] componentsInChildren = ((Component)localPlayer).GetComponentsInChildren<Collider>();
				Collider[] array = componentsInChildren;
				foreach (Collider val in array)
				{
					val.enabled = enableColliders;
				}
				Rigidbody component = ((Component)localPlayer).GetComponent<Rigidbody>();
				if ((Object)(object)component != (Object)null)
				{
					component.useGravity = enableColliders;
					component.isKinematic = !enableColliders;
				}
			}
		}

		private void HandleNoclipMovement()
		{
			//IL_0040: 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_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)localPlayer == (Object)null))
			{
				float num = 15f;
				Vector2 val = default(Vector2);
				((Vector2)(ref val))..ctor(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"));
				Vector3 val2 = ((Component)localPlayer).transform.forward * val.y + ((Component)localPlayer).transform.right * val.x;
				if (Input.GetKey((KeyCode)32))
				{
					val2 += Vector3.up;
				}
				if (Input.GetKey((KeyCode)306))
				{
					val2 += Vector3.down;
				}
				Transform transform = ((Component)localPlayer).transform;
				transform.position += val2 * num * Time.deltaTime;
			}
		}
	}
	[HarmonyPatch(typeof(PlayerController), "Start")]
	public static class PlayerTrackerPatch
	{
		[HarmonyPostfix]
		public static void Postfix(PlayerController __instance)
		{
			AdminPanelMain.localPlayer = __instance;
			Debug.Log((object)"[Admin Panel] Local player tracked successfully!");
		}
	}
}