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", "2.0.0")]
public class GPSPlugin : BaseUnityPlugin
{
private const string MyGUID = "com.equinox.GPS";
private const string PluginName = "GPS";
private const string VersionString = "2.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: 2.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: 2.0.0 is loaded.");
Log = ((BaseUnityPlugin)this).Logger;
}
private void OnGUI()
{
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: 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_00e9: Expected O, but got Unknown
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Unknown result type (might be due to invalid IL or missing references)
//IL_0110: Unknown result type (might be due to invalid IL or missing references)
//IL_011f: Expected O, but got Unknown
//IL_0123: Unknown result type (might be due to invalid IL or missing references)
//IL_0128: Unknown result type (might be due to invalid IL or missing references)
//IL_0130: Unknown result type (might be due to invalid IL or missing references)
//IL_014d: Unknown result type (might be due to invalid IL or missing references)
//IL_0154: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: Unknown result type (might be due to invalid IL or missing references)
if (LoadingStates.hasGameLoaded && !UIManager.instance.anyMenuOpen && !((Object)(object)Player.instance == (Object)null) && !((Object)(object)Player.instance.fpcontroller == (Object)null))
{
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);
}
}
}