plugins/GPS/GPS.dll

Decompiled 2 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EquinoxsModUtils;
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("GPS")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("GPS")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("521af113-8c7d-4f21-8a59-32f4842a5d61")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace GPS;

[BepInPlugin("com.equinox.GPS", "GPS", "1.0.0")]
public class GPSPlugin : BaseUnityPlugin
{
	private const string MyGUID = "com.equinox.GPS";

	private const string PluginName = "GPS";

	private const string VersionString = "1.0.0";

	private static readonly Harmony Harmony = new Harmony("com.equinox.GPS");

	public static ManualLogSource Log = new ManualLogSource("GPS");

	public static ConfigEntry<float> yOffset;

	public static ConfigEntry<float> xOffset;

	private void Awake()
	{
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Expected O, but got Unknown
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Expected O, but got Unknown
		((BaseUnityPlugin)this).Logger.LogInfo((object)"PluginName: GPS, VersionString: 1.0.0 is loading...");
		Harmony.PatchAll();
		xOffset = ((BaseUnityPlugin)this).Config.Bind<float>("General", "X Offset", 70f, new ConfigDescription("Controls the horizontal position of the GUI. Increase until it's centered with your compass.", (AcceptableValueBase)null, Array.Empty<object>()));
		yOffset = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Y Offset", 250f, new ConfigDescription("Controls the vertical position of the GUI. Increase until it sits below your compass.", (AcceptableValueBase)null, Array.Empty<object>()));
		((BaseUnityPlugin)this).Logger.LogInfo((object)"PluginName: GPS, VersionString: 1.0.0 is loaded.");
		Log = ((BaseUnityPlugin)this).Logger;
	}

	private void OnGUI()
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Expected O, but got Unknown
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: Expected O, but got Unknown
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_010e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0115: Unknown result type (might be due to invalid IL or missing references)
		if (ModUtils.hasGameLoaded)
		{
			Vector3 position = ((Component)Player.instance.fpcontroller).transform.position;
			string text = position.x.ToString("#").PadLeft(5);
			string text2 = position.y.ToString("#").PadLeft(5);
			string text3 = position.z.ToString("#").PadLeft(5);
			string text4 = text + ", " + text2 + ", " + text3;
			GUIContent val = new GUIContent(text4);
			GUIStyle val2 = new GUIStyle
			{
				fontSize = 14,
				alignment = (TextAnchor)4
			};
			val2.normal.textColor = Color.white;
			val2.normal.background = null;
			GUIStyle val3 = val2;
			Vector2 val4 = val3.CalcSize(val);
			GUI.Label(new Rect((float)Screen.width - val4.x - xOffset.Value, yOffset.Value, val4.x, val4.y), val, val3);
		}
	}
}