using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Xml;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LethalConfig;
using LethalConfig.ConfigItems;
using LethalConfig.ConfigItems.Options;
using Microsoft.CodeAnalysis;
using ProHUD.Asset;
using ProHUD.Config;
using ProHUD.Patch;
using ProHUD.Util;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.UI;
[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: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: AssemblyCompany("ProHUD")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ProHUD")]
[assembly: AssemblyTitle("ProHUD")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.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]
[Microsoft.CodeAnalysis.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;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace ProHUD
{
public static class PluginInfo
{
public const string GUID = "hexkivo.ProHUD";
public const string NAME = "ProHUD";
public const string VERSION = "0.1.5";
}
[BepInPlugin("hexkivo.ProHUD", "ProHUD", "0.1.5")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BaseUnityPlugin
{
private readonly Harmony harmony = new Harmony("hexkivo.ProHUD");
public bool isInputUtils = false;
internal static ManualLogSource Log = Logger.CreateLogSource("hexkivo.ProHUD");
public static bool isLethalConfig = false;
public static Plugin? Instance { get; set; }
private void Awake()
{
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
}
if (Chainloader.PluginInfos.Values.Any((PluginInfo p) => p.Metadata.GUID == "ainavt.lc.lethalconfig"))
{
LogInfo("Lethalconfig Founded");
isLethalConfig = true;
}
try
{
Loader.LoadAll();
Setting.BindAll();
((BaseUnityPlugin)this).Config.SettingChanged += delegate(object sender, SettingChangedEventArgs e)
{
LogInfo($"Config [{e.ChangedSetting.Definition.Key}] set to [{e.ChangedSetting.BoxedValue}]");
};
harmony.PatchAll();
Log.LogInfo((object)"Plugin Load Complete");
}
catch (Exception ex)
{
LogError(ex.Message);
}
}
internal static void LogInfo(object data)
{
Log.LogInfo(data);
}
internal static void LogError(object data)
{
Log.LogError(data);
}
internal static void LogWarning(object data)
{
Log.LogWarning(data);
}
internal static void LogFatal(object data)
{
Log.LogFatal(data);
}
internal static void LogDebug(object data)
{
Log.LogDebug(data);
}
}
}
namespace ProHUD.Util
{
public static class Loader
{
public static void LoadAll()
{
Translation.Load();
ProHUD.Asset.JetpackMeter.Load();
}
public static string GetAssemblyName()
{
string? fullName = Assembly.GetExecutingAssembly().FullName;
return ((fullName != null) ? fullName.Split(',')[0] : null) ?? "";
}
public static AssetBundle LoadAssetBundle(string name)
{
string name2 = GetAssemblyName() + ".Asset." + name;
using Stream stream = Assembly.GetExecutingAssembly()?.GetManifestResourceStream(name2);
return AssetBundle.LoadFromStream(stream);
}
public static XmlDocument LoadXML(string name)
{
string name2 = GetAssemblyName() + ".Asset." + name + ".xml";
using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(name2);
string xml = ((stream != null) ? (new StreamReader(stream).ReadToEnd() ?? string.Empty) : string.Empty);
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(xml);
return xmlDocument;
}
}
public static class Game
{
public static bool isControlling(PlayerControllerB player)
{
if ((Object)(object)player == (Object)null)
{
return false;
}
return (((NetworkBehaviour)player).IsOwner && player.isPlayerControlled && (!((NetworkBehaviour)player).IsServer || player.isHostPlayerObject)) || player.isTestingPlayer;
}
public static bool isPlayer(PlayerControllerB player)
{
if ((Object)(object)player == (Object)null)
{
return false;
}
return (Object)(object)GameNetworkManager.Instance?.localPlayerController == (Object)(object)player;
}
}
public static class Tool
{
public static object GetField<InstanceType>(InstanceType obj, string field)
{
return AccessTools.Field(typeof(InstanceType), field).GetValue(obj);
}
public static FieldType GetField<InstanceType, FieldType>(InstanceType obj, string field)
{
return (FieldType)AccessTools.Field(typeof(InstanceType), field).GetValue(obj);
}
public static void SetField<InstanceType, FieldType>(InstanceType obj, string field, FieldType temp)
{
AccessTools.Field(typeof(InstanceType), field).SetValue(obj, temp);
}
public static object InvokeMethod<InstanceType>(InstanceType obj, string method, object[]? parameter = null)
{
return AccessTools.Method(typeof(InstanceType), method, (Type[])null, (Type[])null).Invoke(obj, parameter);
}
public static GameObject AddHUD(string name, Transform? parent = null, bool WorldPositionStays = false)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
GameObject val = new GameObject(name);
if ((Object)(object)parent == (Object)null)
{
parent = HUDManager.Instance.HUDContainer.transform;
}
val.transform.SetParent(parent, WorldPositionStays);
return val;
}
public static GameObject AddHUD(string name, Sprite sprite, Transform? parent = null, bool WorldPositionStays = false)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
GameObject val = new GameObject(name);
if ((Object)(object)parent == (Object)null)
{
HUDManager instance = HUDManager.Instance;
object obj;
if (instance == null)
{
obj = null;
}
else
{
GameObject hUDContainer = instance.HUDContainer;
obj = ((hUDContainer != null) ? hUDContainer.transform : null);
}
parent = (Transform?)obj;
}
val.AddComponent<Image>().sprite = sprite;
val.transform.SetParent(parent, WorldPositionStays);
return val;
}
}
public static class Translation
{
public static Dictionary<string, XmlDocument> LanguageData = new Dictionary<string, XmlDocument>();
public static string CurrentLangage()
{
return Setting.Language?.Value.ToString() ?? string.Empty;
}
public static void Load()
{
try
{
string[] names = Enum.GetNames(typeof(Setting.LanguageOption));
foreach (string text in names)
{
LanguageData.Add(text, Loader.LoadXML(text));
Plugin.LogInfo("Language pack loaded: " + text + ".xml");
}
Plugin.LogInfo("Language data load complete");
}
catch
{
throw;
}
}
public static string Translate(string name, bool isDesc = false)
{
string key = Setting.Language?.Value.ToString() ?? "Korean";
if (isDesc)
{
name += "_DESC";
}
return LanguageData[key].GetElementById(name)?.InnerText ?? string.Empty;
}
}
}
namespace ProHUD.Asset
{
internal static class JetpackMeter
{
public static AudioClip? JetpackCriticalBeep;
public static Sprite? MeterSprite;
public static Sprite? FrameSprite;
public static Sprite? WarningSprite;
public static void Load()
{
AssetBundle val = Loader.LoadAssetBundle("JetpackAssets");
if (!((Object)(object)val == (Object)null))
{
MeterSprite = val.LoadAsset<Sprite>("jetpackMeter");
FrameSprite = val.LoadAsset<Sprite>("jetpackMeterFrame");
WarningSprite = val.LoadAsset<Sprite>("jetpackMeterWarning");
JetpackCriticalBeep = val.LoadAsset<AudioClip>("jetpackCriticalBeep");
Plugin.LogInfo("[Jetpack HUD] sprites and audio loaded");
}
}
}
}
namespace ProHUD.Patch
{
[HarmonyPatch]
internal static class Clock
{
private static int ClockTime;
private static Vector3 NumberPosition;
private static Vector3 IconPosition;
private static Vector2 ClockSize;
private static Vector2 IconSize;
private static Vector2 TextSize;
private static RectTransform? ClockEdge;
[HarmonyPatch(typeof(HUDManager), "Awake")]
[HarmonyPostfix]
private static void Awake(ref HUDManager __instance)
{
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: 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_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: 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)
ClockEdge = ((Component)((TMP_Text)__instance.clockNumber).transform.parent).gameObject.GetComponent<RectTransform>();
NumberPosition = ((TMP_Text)__instance.clockNumber).transform.localPosition;
IconPosition = ((Component)__instance.clockIcon).transform.localPosition;
ClockSize = ClockEdge.sizeDelta;
IconSize = ((Component)__instance.clockIcon).GetComponent<RectTransform>().sizeDelta;
TextSize = ((TMP_Text)__instance.clockNumber).rectTransform.sizeDelta;
ResizeClock();
}
[HarmonyPatch(typeof(HUDManager), "SetClock")]
[HarmonyPrefix]
private static void SetClock(ref HUDManager __instance, float timeNormalized, float numberOfHours, ref bool __runOriginal)
{
__runOriginal = false;
int num = (int)(timeNormalized * (60f * numberOfHours)) + 360;
int num2 = num / 60 % 24;
int num3 = num % 60;
string text = ((ProHUD.Config.Clock.CLOCK_STD.Value || ProHUD.Config.Clock.CLOCK_COMPACT.Value) ? "" : "\n");
string text2 = (ProHUD.Config.Clock.CLOCK_STD.Value ? "" : " AM");
if (!ProHUD.Config.Clock.CLOCK_STD.Value)
{
if (num2 < 12)
{
text2 = " AM";
}
else
{
text2 = " PM";
num2 %= 12;
if (num2 == 0)
{
num2 = 12;
}
}
}
((TMP_Text)__instance.clockNumber).text = $"{num2:0}:{num3:00}";
if (ProHUD.Config.Clock.CLOCK_FULL_DIGIT.Value && num2 < 10)
{
((TMP_Text)__instance.clockNumber).text = "<color=#633100>0</color>" + ((TMP_Text)__instance.clockNumber).text;
}
TextMeshProUGUI clockNumber = __instance.clockNumber;
((TMP_Text)clockNumber).text = ((TMP_Text)clockNumber).text + text + text2;
}
[HarmonyPatch(typeof(TimeOfDay), "SetInsideLightingDimness")]
[HarmonyPostfix]
private static void SetInsideLightingDimness()
{
PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
if (localPlayerController.inTerminalMenu)
{
HUDManager.Instance.SetClockVisible(false);
}
else if ((ProHUD.Config.Clock.CLOCK_IN_SHIP.Value && localPlayerController.isInHangarShipRoom) || (ProHUD.Config.Clock.CLOCK_IN_FACTORY.Value && localPlayerController.isInsideFactory))
{
HUDManager.Instance.SetClockVisible(true);
}
}
[HarmonyPatch(typeof(TimeOfDay), "MoveTimeOfDay")]
[HarmonyPostfix]
private static void MoveTimeOfDay(TimeOfDay __instance, ref float ___changeHUDTimeInterval)
{
if (ProHUD.Config.Clock.CLOCK_FAST_UPDATE.Value)
{
int num = (int)(__instance.normalizedTimeOfDay * (60f * (float)__instance.numberOfHours));
if (num != ClockTime)
{
ClockTime = num;
HUDManager.Instance.SetClock(__instance.normalizedTimeOfDay, (float)__instance.numberOfHours, true);
___changeHUDTimeInterval = 0f;
}
}
}
public static void ResizeClock(object? sender = null, EventArgs? e = null)
{
//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
//IL_0211: Unknown result type (might be due to invalid IL or missing references)
//IL_022b: Unknown result type (might be due to invalid IL or missing references)
//IL_0245: 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_0041: 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_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_0148: Unknown result type (might be due to invalid IL or missing references)
//IL_017c: Unknown result type (might be due to invalid IL or missing references)
//IL_0196: Unknown result type (might be due to invalid IL or missing references)
//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Unknown result type (might be due to invalid IL or missing references)
//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
//IL_01e2: 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_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_0117: Unknown result type (might be due to invalid IL or missing references)
//IL_011c: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)ClockEdge == (Object)null)
{
return;
}
if (ProHUD.Config.Clock.CLOCK_COMPACT.Value)
{
ClockEdge.sizeDelta = new Vector2(ClockSize.x - 40f, 50f);
((Component)HUDManager.Instance.clockIcon).GetComponent<RectTransform>().sizeDelta = IconSize / 2f;
if (ProHUD.Config.Clock.CLOCK_STD.Value)
{
ClockEdge.sizeDelta = new Vector2(ClockSize.x - 40f, 50f);
((TMP_Text)HUDManager.Instance.clockNumber).rectTransform.sizeDelta = TextSize;
((TMP_Text)HUDManager.Instance.clockNumber).transform.localPosition = NumberPosition + new Vector3(-15f, -1f, 0f);
((Component)HUDManager.Instance.clockIcon).transform.localPosition = IconPosition + new Vector3(-5f, -2f, 0f);
}
else
{
ClockEdge.sizeDelta = new Vector2(ClockSize.x + 10f, 50f);
((TMP_Text)HUDManager.Instance.clockNumber).rectTransform.sizeDelta = new Vector2(TextSize.x + 50f, TextSize.y);
((TMP_Text)HUDManager.Instance.clockNumber).transform.localPosition = NumberPosition + new Vector3(-20f, -1f, 0f);
((Component)HUDManager.Instance.clockIcon).transform.localPosition = IconPosition + new Vector3(-30f, -2f, 0f);
}
}
else
{
ClockEdge.sizeDelta = ClockSize;
((TMP_Text)HUDManager.Instance.clockNumber).rectTransform.sizeDelta = TextSize;
((Component)HUDManager.Instance.clockIcon).GetComponent<RectTransform>().sizeDelta = IconSize;
((TMP_Text)HUDManager.Instance.clockNumber).transform.localPosition = NumberPosition;
((Component)HUDManager.Instance.clockIcon).transform.localPosition = IconPosition;
}
}
}
[HarmonyPatch]
internal static class Compass
{
private static GameObject? CompassUI;
private static GameObject? CompassIndex;
private static TextMeshProUGUI? CompassText;
private static TextMeshProUGUI? CenterIndex;
private static Gradient CompassGradient = new Gradient();
[HarmonyPatch(typeof(HUDManager), "Awake")]
[HarmonyPostfix]
private static void Awake(HUDManager __instance)
{
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_0141: Unknown result type (might be due to invalid IL or missing references)
//IL_0197: Unknown result type (might be due to invalid IL or missing references)
//IL_019c: Unknown result type (might be due to invalid IL or missing references)
//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
//IL_0200: Unknown result type (might be due to invalid IL or missing references)
//IL_0205: Unknown result type (might be due to invalid IL or missing references)
//IL_0216: Unknown result type (might be due to invalid IL or missing references)
//IL_021b: Unknown result type (might be due to invalid IL or missing references)
//IL_022c: Unknown result type (might be due to invalid IL or missing references)
//IL_0231: Unknown result type (might be due to invalid IL or missing references)
CompassUI = Tool.AddHUD("CompassUI", __instance.HUDContainer.transform);
CenterIndex = CompassUI.AddComponent<TextMeshProUGUI>();
((TMP_Text)CenterIndex).text = "▼";
((TMP_Text)CenterIndex).alignment = (TextAlignmentOptions)514;
((TMP_Text)CenterIndex).fontSize = 14f;
((Graphic)CenterIndex).color = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)80, (byte)0, byte.MaxValue));
((Transform)((TMP_Text)CenterIndex).rectTransform).localPosition = new Vector3(0f, 250f, 0f);
CompassIndex = Tool.AddHUD("Compass", CompassUI.transform);
CompassText = CompassIndex.AddComponent<TextMeshProUGUI>();
((TMP_Text)CompassText).text = "B N 015 030 045 060 075 E 105 120 135 150 165 S 195 210 225 240 255 W 285 300 315 330 345 N 015 030 045 060 075 E 105 120 135 150 165 S 195 210 225 240 255 W 285 300 315 330 345 N E";
((TMP_Text)CompassText).font = ((TMP_Text)__instance.weightCounter).font;
((TMP_Text)CompassText).enableWordWrapping = false;
((TMP_Text)CompassText).fontSize = 14f;
((TMP_Text)CompassText).fontStyle = (FontStyles)1;
((TMP_Text)CompassText).alignment = (TextAlignmentOptions)514;
((Transform)((TMP_Text)CompassText).rectTransform).localPosition = new Vector3(0f, 0f, 0f);
((Behaviour)CompassText).enabled = true;
((TMP_Text)CompassText).characterSpacing = -5f;
CompassUI.SetActive(ProHUD.Config.Compass.COMPASS.Value);
CompassGradient.SetKeys((GradientColorKey[])(object)new GradientColorKey[2]
{
new GradientColorKey(Color32.op_Implicit(new Color32(byte.MaxValue, (byte)80, (byte)0, byte.MaxValue)), 0f),
new GradientColorKey(Color32.op_Implicit(new Color32(byte.MaxValue, (byte)80, (byte)0, byte.MaxValue)), 1f)
}, (GradientAlphaKey[])(object)new GradientAlphaKey[4]
{
new GradientAlphaKey(0f, 0f),
new GradientAlphaKey(1f, 0.3f),
new GradientAlphaKey(1f, 0.7f),
new GradientAlphaKey(0f, 1f)
});
}
[HarmonyPatch(typeof(HUDManager), "Update")]
[HarmonyPostfix]
[HarmonyPriority(401)]
private static void Update()
{
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: 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_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: 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_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: 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_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_012f: Unknown result type (might be due to invalid IL or missing references)
//IL_0131: Unknown result type (might be due to invalid IL or missing references)
//IL_013a: Unknown result type (might be due to invalid IL or missing references)
//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
if (!ProHUD.Config.Compass.COMPASS.Value)
{
return;
}
PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
Quaternion val;
float num;
if (ProHUD.Config.Compass.COMPASS_NORTH_SHIP.Value && !localPlayerController.isInsideFactory)
{
val = ((Component)localPlayerController.gameplayCamera).transform.rotation;
float y = ((Quaternion)(ref val)).eulerAngles.y;
Vector3 val2 = StartOfRound.Instance.elevatorTransform.position - ((Component)localPlayerController).transform.position;
val = Quaternion.LookRotation(((Vector3)(ref val2)).normalized);
num = Calibrate(y, ((Quaternion)(ref val)).eulerAngles.y);
}
else
{
val = ((Component)localPlayerController.gameplayCamera).transform.rotation;
num = Calibrate(((Quaternion)(ref val)).eulerAngles.y);
}
float num2 = (0f - num) / 15f * ((TMP_Text)CompassText).preferredWidth / (float)(((TMP_Text)CompassText).text.Length / 5);
((Transform)((TMP_Text)CompassText).rectTransform).localPosition = new Vector3(num2, -12f, 0f);
TMP_TextInfo textInfo = ((TMP_Text)CompassText).textInfo;
for (int i = 0; i < textInfo.characterCount; i++)
{
TMP_CharacterInfo val3 = textInfo.characterInfo[i];
int vertexIndex = val3.vertexIndex;
int materialReferenceIndex = val3.materialReferenceIndex;
Color32[] colors = textInfo.meshInfo[materialReferenceIndex].colors32;
Vector3[] vertices = textInfo.meshInfo[materialReferenceIndex].vertices;
for (int j = 0; j < 4; j++)
{
colors[vertexIndex + j] = Color32.op_Implicit(CompassGradient.Evaluate(Mathf.InverseLerp(-200f - num2, 200f - num2, vertices[vertexIndex + j].x)));
}
}
((TMP_Text)CompassText).UpdateVertexData();
}
[HarmonyPatch(typeof(Terminal), "BeginUsingTerminal")]
[HarmonyPrefix]
private static void BeginUsingTerminal()
{
GameObject? compassUI = CompassUI;
if (compassUI != null)
{
compassUI.SetActive(false);
}
}
[HarmonyPatch(typeof(Terminal), "QuitTerminal")]
[HarmonyPrefix]
private static void QuitTerminal()
{
GameObject? compassUI = CompassUI;
if (compassUI != null)
{
compassUI.SetActive(ProHUD.Config.Compass.COMPASS.Value);
}
}
private static float Calibrate(float direction)
{
return (direction - (float)ProHUD.Config.Compass.COMPASS_NORTH.Value * 45f + 540f) % 360f - 180f;
}
private static float Calibrate(float direction, float correction)
{
return (direction - correction + 540f) % 360f - 180f;
}
public static void ConfigChanged(object? sender, EventArgs? e)
{
GameObject? compassUI = CompassUI;
if (compassUI != null)
{
compassUI.SetActive(ProHUD.Config.Compass.COMPASS.Value);
}
}
}
[HarmonyPatch]
internal static class Crosshair
{
private static GameObject? CrosshairUI;
private static TextMeshProUGUI? CrosshairText;
private static float TargetAlpha;
[HarmonyPatch(typeof(HUDManager), "Awake")]
[HarmonyPostfix]
private static void Awake(HUDManager __instance)
{
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
CrosshairUI = Tool.AddHUD("CrosshairUI", ((Component)__instance.PlayerInfo.canvasGroup).transform);
CrosshairText = CrosshairUI.AddComponent<TextMeshProUGUI>();
((TMP_Text)CrosshairText).alignment = (TextAlignmentOptions)514;
((TMP_Text)CrosshairText).font = ((TMP_Text)__instance.weightCounter).font;
((TMP_Text)CrosshairText).enableWordWrapping = false;
((TMP_Text)CrosshairText).text = ProHUD.Config.Crosshair.CROSSHAIR_TYPE.Value;
((TMP_Text)CrosshairText).fontSize = ProHUD.Config.Crosshair.CROSSHAIR_SIZE.Value;
((Graphic)CrosshairText).color = Color32.op_Implicit(new Color32((byte)ProHUD.Config.Crosshair.CROSSHAIR_RED.Value, (byte)ProHUD.Config.Crosshair.CROSSHAIR_GREEN.Value, (byte)ProHUD.Config.Crosshair.CROSSHAIR_BLUE.Value, (byte)ProHUD.Config.Crosshair.CROSSHAIR_ALPHA.Value));
CrosshairUI.SetActive(ProHUD.Config.Crosshair.CROSSHAIR.Value);
TargetAlpha = (float)ProHUD.Config.Crosshair.CROSSHAIR_ALPHA.Value / 255f;
((Transform)((TMP_Text)CrosshairText).rectTransform).localPosition = Vector3.zero;
}
[HarmonyPatch(typeof(HUDManager), "Update")]
[HarmonyPostfix]
private static void Update()
{
if (!((Object)(object)CrosshairText == (Object)null))
{
((TMP_Text)CrosshairText).alpha = Mathf.Lerp(((TMP_Text)CrosshairText).alpha, TargetAlpha, 10f * Time.deltaTime);
}
}
[HarmonyPatch(typeof(Terminal), "BeginUsingTerminal")]
[HarmonyPrefix]
private static void BeginUsingTerminal()
{
TargetAlpha = 0f;
}
[HarmonyPatch(typeof(Terminal), "QuitTerminal")]
[HarmonyPrefix]
private static void QuitTerminal()
{
TargetAlpha = (float)ProHUD.Config.Crosshair.CROSSHAIR_ALPHA.Value / 255f;
}
public static void SettingChanged(object sender, EventArgs e)
{
GameObject? crosshairUI = CrosshairUI;
if (crosshairUI != null)
{
crosshairUI.SetActive(ProHUD.Config.Crosshair.CROSSHAIR.Value);
}
}
public static void TypeChanged(object sender, EventArgs e)
{
if (!((Object)(object)CrosshairText == (Object)null))
{
((TMP_Text)CrosshairText).text = ProHUD.Config.Crosshair.CROSSHAIR_TYPE.Value;
}
}
public static void SizeChanged(object sender, EventArgs e)
{
if (!((Object)(object)CrosshairText == (Object)null))
{
((TMP_Text)CrosshairText).fontSize = ProHUD.Config.Crosshair.CROSSHAIR_SIZE.Value;
}
}
public static void ColorChanged(object sender, EventArgs e)
{
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)CrosshairText == (Object)null))
{
((Graphic)CrosshairText).color = Color32.op_Implicit(new Color32((byte)ProHUD.Config.Crosshair.CROSSHAIR_RED.Value, (byte)ProHUD.Config.Crosshair.CROSSHAIR_GREEN.Value, (byte)ProHUD.Config.Crosshair.CROSSHAIR_BLUE.Value, (byte)ProHUD.Config.Crosshair.CROSSHAIR_ALPHA.Value));
}
}
public static void AlphaChanged(object sender, EventArgs e)
{
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)CrosshairText == (Object)null))
{
((Graphic)CrosshairText).color = Color32.op_Implicit(new Color32((byte)ProHUD.Config.Crosshair.CROSSHAIR_RED.Value, (byte)ProHUD.Config.Crosshair.CROSSHAIR_GREEN.Value, (byte)ProHUD.Config.Crosshair.CROSSHAIR_BLUE.Value, (byte)ProHUD.Config.Crosshair.CROSSHAIR_ALPHA.Value));
TargetAlpha = (float)ProHUD.Config.Crosshair.CROSSHAIR_ALPHA.Value / 255f;
}
}
}
[HarmonyPatch]
internal static class DiscountAlert
{
private static bool PlayerAlerted;
private static int counter;
[HarmonyPatch(typeof(StartMatchLever), "PlayLeverPullEffectsClientRpc")]
[HarmonyPostfix]
private static void PlayLeverPullEffectsClientRpc()
{
PlayerAlerted = false;
counter++;
if (StartOfRound.Instance.inShipPhase && !PlayerAlerted && counter == 1)
{
PlayerAlerted = true;
((MonoBehaviour)HUDManager.Instance).StartCoroutine(DisplayAlert());
}
else if (counter > 1)
{
counter = 0;
}
}
private static IEnumerator DisplayAlert()
{
yield return (object)new WaitForSeconds(5f);
StringBuilder discount_list = new StringBuilder();
Terminal terminal = HUDManager.Instance?.terminalScript;
if ((Object)(object)terminal == (Object)null)
{
yield break;
}
for (int i = 0; i < terminal.buyableItemsList.Length; i++)
{
if (terminal.itemSalesPercentages[i] != 100)
{
discount_list.Append("\n<color=#000000>* " + terminal.buyableItemsList[i].itemName + " " + $"${(float)(terminal.buyableItemsList[i].creditsWorth * terminal.itemSalesPercentages[i]) / 100f} " + $"({100 - terminal.itemSalesPercentages[i]}% OFF!)</color>");
}
}
if (ProHUD.Config.DiscountAlert.ALERT_NO_DISCOUNT.Value && discount_list.ToString() == "")
{
HUDManager instance = HUDManager.Instance;
if (instance != null)
{
instance.DisplayTip("<color=#000000>No Discount!</color>", "<color=#000000>None :(\nCheck back Later!</color>", false, false, "LC_Tip1");
}
}
else if (ProHUD.Config.DiscountAlert.ALERT_DISCOUNT.Value && discount_list.ToString() != "")
{
HUDManager instance2 = HUDManager.Instance;
if (instance2 != null)
{
instance2.DisplayTip("<color=#000000>Today's Discounts!</color>", discount_list.ToString(), false, false, "LC_Tip1");
}
}
}
}
[HarmonyPatch]
internal static class InsanityMeter
{
private static GameObject? InsanityFrame;
private static Image? Meter;
[HarmonyPatch(typeof(HUDManager), "Awake")]
[HarmonyPostfix]
private static void Awake(HUDManager __instance)
{
//IL_001a: 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_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: 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_0115: Unknown result type (might be due to invalid IL or missing references)
//IL_0142: Unknown result type (might be due to invalid IL or missing references)
Sprite sprite = Sprite.Create(Texture2D.whiteTexture, new Rect(0f, 0f, 4f, 4f), new Vector2(0.5f, 0.5f));
Vector2 sizeDelta = default(Vector2);
((Vector2)(ref sizeDelta))..ctor(10f, 50f);
InsanityFrame = Tool.AddHUD("InsanityFrame", sprite, ((Component)__instance.PlayerInfo.canvasGroup).transform);
Image component = InsanityFrame.GetComponent<Image>();
((Graphic)component).color = Color32.op_Implicit(new Color32((byte)0, (byte)0, (byte)0, byte.MaxValue));
((Graphic)component).rectTransform.sizeDelta = sizeDelta;
((Transform)((Graphic)component).rectTransform).localPosition = new Vector3(-290f, 150f, 0f);
((Component)component).transform.localRotation = Quaternion.Euler(new Vector3(0f, -30f, 0f));
GameObject val = Tool.AddHUD("InsanityMeter", sprite, InsanityFrame.transform);
Meter = val.GetComponent<Image>();
((Graphic)Meter).color = Color32.op_Implicit(new Color32((byte)127, (byte)0, byte.MaxValue, byte.MaxValue));
Meter.fillMethod = (FillMethod)1;
Meter.type = (Type)3;
((Graphic)Meter).rectTransform.sizeDelta = sizeDelta;
}
[HarmonyPatch(typeof(PlayerControllerB), "Update")]
[HarmonyPostfix]
public static void Update(PlayerControllerB __instance)
{
if (!((Object)(object)Meter == (Object)null))
{
Meter.fillAmount = __instance.insanityLevel / __instance.maxInsanityLevel;
}
}
public static void ConfigChanged(object? sender, EventArgs? e)
{
if (!((Object)(object)InsanityFrame == (Object)null))
{
InsanityFrame.SetActive(ProHUD.Config.InsanityMeter.INSANITY_METER.Value);
}
}
}
[HarmonyPatch]
internal static class JetpackMeter
{
private static GameObject? JetpackUI;
private static Image? JetpackFrame;
private static Image? JetpackBar;
private static Image? JetpackWarning;
private static bool isJetpackCritical = false;
private static bool PlayingJetpackCritical = false;
private static float CriticalLevel = 0.75f;
[HarmonyPatch(typeof(HUDManager), "Awake")]
[HarmonyPostfix]
private static void Awake()
{
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: 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_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_0143: Unknown result type (might be due to invalid IL or missing references)
//IL_0148: Unknown result type (might be due to invalid IL or missing references)
//IL_015d: Unknown result type (might be due to invalid IL or missing references)
//IL_0162: Unknown result type (might be due to invalid IL or missing references)
//IL_0181: Unknown result type (might be due to invalid IL or missing references)
//IL_0186: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Unknown result type (might be due to invalid IL or missing references)
//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)ProHUD.Asset.JetpackMeter.FrameSprite == (Object)null) && !((Object)(object)ProHUD.Asset.JetpackMeter.MeterSprite == (Object)null) && !((Object)(object)ProHUD.Asset.JetpackMeter.WarningSprite == (Object)null))
{
JetpackUI = Tool.AddHUD("JetpackUI", GameObject.Find("IngamePlayerHUD").transform);
RectTransform val = JetpackUI.AddComponent<RectTransform>();
JetpackUI.transform.localScale = new Vector3(2f, 2f, 2f);
JetpackUI.transform.localPosition = Vector2.op_Implicit(new Vector2(200f, 0f));
JetpackUI.transform.localRotation = Quaternion.Euler(new Vector3(0f, 30f, 0f));
JetpackFrame = Tool.AddHUD("JetpackFrame", ProHUD.Asset.JetpackMeter.FrameSprite, JetpackUI.transform).GetComponent<Image>();
JetpackBar = Tool.AddHUD("JetpackMeter", ProHUD.Asset.JetpackMeter.MeterSprite, JetpackUI.transform).GetComponent<Image>();
JetpackWarning = Tool.AddHUD("JetpackWarning", ProHUD.Asset.JetpackMeter.WarningSprite, JetpackUI.transform).GetComponent<Image>();
((Transform)((Graphic)JetpackBar).rectTransform).localPosition = Vector2.op_Implicit(Vector2.zero);
((Transform)((Graphic)JetpackFrame).rectTransform).localPosition = Vector2.op_Implicit(Vector2.zero);
((Transform)((Graphic)JetpackWarning).rectTransform).localPosition = Vector2.op_Implicit(new Vector2(30f, 0f));
((Component)((Graphic)JetpackWarning).rectTransform).transform.localRotation = Quaternion.Euler(new Vector3(0f, 15f, 0f));
((Component)((Graphic)JetpackWarning).rectTransform).transform.localScale = new Vector3(1.2f, 1.2f, 1.2f);
JetpackBar.type = (Type)3;
JetpackBar.fillMethod = (FillMethod)1;
}
}
[HarmonyPatch(typeof(PlayerControllerB), "Update")]
[HarmonyPostfix]
private static void Update(ref PlayerControllerB __instance, ref bool ___isHoldingObject, ref GrabbableObject ___currentlyHeldObjectServer)
{
//IL_0084: 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_00cf: 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_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_0106: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: Unknown result type (might be due to invalid IL or missing references)
if (Game.isControlling(__instance) && !((Object)(object)JetpackUI == (Object)null) && !((Object)(object)JetpackFrame == (Object)null) && !((Object)(object)JetpackBar == (Object)null) && !((Object)(object)JetpackWarning == (Object)null))
{
if ((ProHUD.Config.JetpackMeter.JETPACK_METER.Value & ___isHoldingObject) && ___currentlyHeldObjectServer is JetpackItem)
{
JetpackUI.SetActive(true);
float num = ((Vector3)(ref ((JetpackItem)___currentlyHeldObjectServer).forces)).magnitude / 50f;
JetpackBar.fillAmount = num;
((Behaviour)JetpackWarning).enabled = num > CriticalLevel;
Color color = Color.Lerp(Color32.op_Implicit(new Color32(byte.MaxValue, (byte)200, (byte)100, (byte)200)), Color32.op_Implicit(new Color32((byte)200, (byte)60, (byte)60, (byte)200)), num);
((Graphic)JetpackBar).color = color;
((Graphic)JetpackFrame).color = color;
((Graphic)JetpackWarning).color = color;
}
else
{
JetpackUI.SetActive(false);
}
}
}
[HarmonyPatch(typeof(JetpackItem), "SetJetpackAudios")]
[HarmonyPostfix]
private static void SetJetpackAudios(JetpackItem __instance, ref bool __runOriginal, ref Vector3 ___forces, bool ___jetpackActivated, ref float ___noiseInterval)
{
//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)ProHUD.Asset.JetpackMeter.JetpackCriticalBeep == (Object)null)
{
return;
}
if (((Vector3)(ref ___forces)).magnitude > 50f * CriticalLevel)
{
if (!PlayingJetpackCritical)
{
PlayingJetpackCritical = true;
__instance.jetpackBeepsAudio.clip = ProHUD.Asset.JetpackMeter.JetpackCriticalBeep;
__instance.jetpackBeepsAudio.Play();
}
}
else
{
PlayingJetpackCritical = false;
}
if (!(__runOriginal = !PlayingJetpackCritical) && ___jetpackActivated)
{
if (___noiseInterval >= 0.5f)
{
___noiseInterval = 0f;
RoundManager.Instance.PlayAudibleNoise(((Component)__instance).transform.position, 25f, 0.85f, 0, ((GrabbableObject)__instance).playerHeldBy.isInHangarShipRoom && StartOfRound.Instance.hangarDoorsClosed, 41);
}
else
{
___noiseInterval += Time.deltaTime;
}
}
}
[HarmonyPatch(typeof(JetpackItem), "JetpackEffect")]
[HarmonyPostfix]
private static void JetpackEffect(JetpackItem __instance, bool enable)
{
if (!((Object)(object)ProHUD.Asset.JetpackMeter.JetpackCriticalBeep == (Object)null) && enable && isJetpackCritical)
{
PlayingJetpackCritical = true;
__instance.jetpackBeepsAudio.clip = ProHUD.Asset.JetpackMeter.JetpackCriticalBeep;
__instance.jetpackBeepsAudio.Play();
}
}
}
[HarmonyPatch]
internal static class ResidualQuantity
{
[HarmonyPatch(typeof(PlayerControllerB), "LateUpdate")]
[HarmonyPostfix]
private static void LateUpdate(bool ___isHoldingObject, GrabbableObject ___currentlyHeldObjectServer)
{
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: 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_00e6: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_015d: Unknown result type (might be due to invalid IL or missing references)
//IL_0162: Unknown result type (might be due to invalid IL or missing references)
//IL_019a: Unknown result type (might be due to invalid IL or missing references)
//IL_019f: Unknown result type (might be due to invalid IL or missing references)
//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
if (ProHUD.Config.ResidualQuantity.RESIDUAL_QUNTITY.Value && ___isHoldingObject && (Object)(object)___currentlyHeldObjectServer != (Object)null)
{
if (___currentlyHeldObjectServer is SprayPaintItem)
{
HUDManager.Instance.batteryMeter.fillAmount = ((SprayPaintItem)___currentlyHeldObjectServer).sprayCanTank / 1.3f;
((Graphic)HUDManager.Instance.batteryMeter).color = Color32.op_Implicit(new Color32((byte)0, byte.MaxValue, byte.MaxValue, byte.MaxValue));
((Component)HUDManager.Instance.batteryMeter).gameObject.SetActive(true);
((Graphic)((Component)GameObject.Find("BatteryMeterFrame").transform).GetComponent<Image>()).color = Color32.op_Implicit(new Color32((byte)0, byte.MaxValue, byte.MaxValue, (byte)111));
}
else if (___currentlyHeldObjectServer is TetraChemicalItem)
{
HUDManager.Instance.batteryMeter.fillAmount = ((TetraChemicalItem)___currentlyHeldObjectServer).fuel / 1.3f;
((Graphic)HUDManager.Instance.batteryMeter).color = Color32.op_Implicit(new Color32((byte)0, byte.MaxValue, byte.MaxValue, byte.MaxValue));
((Component)HUDManager.Instance.batteryMeter).gameObject.SetActive(true);
((Graphic)((Component)GameObject.Find("BatteryMeterFrame").transform).GetComponent<Image>()).color = Color32.op_Implicit(new Color32((byte)0, byte.MaxValue, byte.MaxValue, (byte)111));
}
else if (___currentlyHeldObjectServer.itemProperties.requiresBattery)
{
((Graphic)HUDManager.Instance.batteryMeter).color = Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, (byte)0, byte.MaxValue));
((Graphic)((Component)GameObject.Find("BatteryMeterFrame").transform).GetComponent<Image>()).color = Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, (byte)0, (byte)111));
}
}
}
}
[HarmonyPatch]
internal static class Scan
{
private static CallbackContext PingContext;
private static bool ToggleScan;
private static Image? ScanImage;
private static TextMeshProUGUI? TotalText;
private static TextMeshProUGUI? TotalNum;
private static int ShipTotalDisplayNum;
private static int ShipTotal;
private static float AddingInterval;
private static bool Adding;
private static bool AddingOne;
private static float totalScrapScannedDisplayNum;
private static bool isUpdating;
[HarmonyPatch(typeof(HUDManager), "Awake")]
[HarmonyPrefix]
private static void Awake()
{
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
GameObject obj = GameObject.Find("/Systems/UI/Canvas/ObjectScanner/GlobalScanInfo/AnimContainer/Image");
ScanImage = ((obj != null) ? obj.GetComponent<Image>() : null);
GameObject obj2 = GameObject.Find("/Systems/UI/Canvas/ObjectScanner/GlobalScanInfo/AnimContainer/Image/TotalText");
TotalText = ((obj2 != null) ? obj2.GetComponent<TextMeshProUGUI>() : null);
GameObject obj3 = GameObject.Find("/Systems/UI/Canvas/ObjectScanner/GlobalScanInfo/AnimContainer/Image/TotalNum");
TotalNum = ((obj3 != null) ? obj3.GetComponent<TextMeshProUGUI>() : null);
if (!((Object)(object)ScanImage == (Object)null) && !((Object)(object)TotalText == (Object)null) && !((Object)(object)TotalNum == (Object)null))
{
((Transform)((TMP_Text)TotalText).rectTransform).localPosition = new Vector3(-24f, -11f, 0f);
((Transform)((TMP_Text)TotalNum).rectTransform).localPosition = new Vector3(-1f, -11f, 0f);
((TMP_Text)TotalNum).lineSpacing = 40f;
((TMP_Text)TotalText).text = "TOTAL:\n\nLOOTED:";
((TMP_Text)TotalText).alignment = (TextAlignmentOptions)1025;
((MaskableGraphic)TotalText).maskable = false;
((TMP_Text)TotalText).enableWordWrapping = false;
}
}
[HarmonyPatch(typeof(HUDManager), "OnEnable")]
[HarmonyPostfix]
private static void OnEnable()
{
ToggleScan = false;
IngamePlayerSettings.Instance.playerInput.actions.FindAction("PingScan", false).performed += PingScan_Toggle;
}
[HarmonyPatch(typeof(HUDManager), "OnDisable")]
[HarmonyPostfix]
private static void OnDisable()
{
IngamePlayerSettings.Instance.playerInput.actions.FindAction("PingScan", false).performed -= PingScan_Toggle;
ToggleScan = false;
}
[HarmonyPatch(typeof(HUDManager), "UpdateScanNodes")]
[HarmonyPostfix]
private static void UpdateScanNodes(HUDManager __instance, Animator ___scanInfoAnimator, int ___scannedScrapNum, Dictionary<RectTransform, ScanNodeProperties> ___scanNodes, ref int ___totalScrapScanned, ref int ___totalScrapScannedDisplayNum, ref float ___addToDisplayTotalInterval)
{
bool flag = false;
for (int i = 0; i < __instance.scanElements.Length; i++)
{
if (___scanNodes.Count > 0 && ___scanNodes.TryGetValue(__instance.scanElements[i], out ScanNodeProperties value) && (Object)(object)value != (Object)null && value.nodeType == 2)
{
flag = true;
}
}
if (!flag)
{
ShipTotalDisplayNum = 0;
AddingInterval = 0f;
}
if (ProHUD.Config.Scan.SCAN_SUM_OF_ONE.Value)
{
___scanInfoAnimator.SetBool("display", ___scannedScrapNum >= 1 && flag);
}
}
[HarmonyPatch(typeof(HUDManager), "Update")]
[HarmonyPostfix]
private static void Update(HUDManager __instance, ref float ___playerPingingScan, TextMeshProUGUI ___totalValueText, Animator ___scanInfoAnimator, ref float ___addToDisplayTotalInterval, ref int ___totalScrapScannedDisplayNum, int ___scannedScrapNum, int ___totalScrapScanned, ref bool ___addingToDisplayTotal)
{
//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
if (ProHUD.Config.Scan.SCAN_SUM_OF_ONE.Value)
{
if (___scannedScrapNum == 1 && ___totalScrapScannedDisplayNum < ___totalScrapScanned)
{
AddingOne = true;
if (___addToDisplayTotalInterval <= 0.03f)
{
___addToDisplayTotalInterval += Time.deltaTime;
}
else
{
___addToDisplayTotalInterval = 0f;
___totalScrapScannedDisplayNum = (int)Mathf.Clamp(Mathf.MoveTowards((float)___totalScrapScannedDisplayNum, (float)___totalScrapScanned, 1500f * Time.deltaTime), 20f, 10000f);
((TMP_Text)___totalValueText).text = $"${___totalScrapScannedDisplayNum}";
__instance.UIAudio.PlayOneShot(__instance.addToScrapTotalSFX);
}
}
else if (AddingOne)
{
AddingOne = false;
__instance.UIAudio.PlayOneShot(__instance.finishAddingToTotalSFX);
}
}
if (___addToDisplayTotalInterval == 0f)
{
isUpdating = totalScrapScannedDisplayNum < (float)___totalScrapScannedDisplayNum;
totalScrapScannedDisplayNum = ___totalScrapScannedDisplayNum;
}
if ((bool)Tool.InvokeMethod<HUDManager>(__instance, "CanPlayerScan"))
{
PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
if (ProHUD.Config.Scan.SCAN_SHIP_TOTAL.Value && localPlayerController.isInHangarShipRoom && ___scanInfoAnimator.GetBool("display") && (ShipTotalDisplayNum < ShipTotal || isUpdating))
{
Adding = true;
if ((___addToDisplayTotalInterval == 0f && isUpdating) || AddingInterval > 0.03f)
{
ShipTotalDisplayNum = (int)Mathf.MoveTowards((float)ShipTotalDisplayNum, (float)ShipTotal, 1500f * Time.deltaTime);
((TMP_Text)___totalValueText).text = $"${___totalScrapScannedDisplayNum}\n${ShipTotalDisplayNum}";
if (AddingInterval > 0.03f)
{
AddingInterval = 0f;
}
}
else if (!isUpdating)
{
AddingInterval += Time.deltaTime;
}
}
else if (Adding)
{
Adding = false;
__instance.UIAudio.PlayOneShot(__instance.finishAddingToTotalSFX);
}
}
if (___playerPingingScan < -1f && ___playerPingingScan >= -5f)
{
___playerPingingScan -= Time.deltaTime;
}
if (!(___playerPingingScan > 0f - ProHUD.Config.Scan.SCAN_INTERVAL.Value + 0.3f) && ((ProHUD.Config.Scan.SCAN_HOLD.Value && IngamePlayerSettings.Instance.playerInput.actions.FindAction("PingScan", false).IsPressed()) || (ProHUD.Config.Scan.SCAN_TOGGLE.Value && ToggleScan)))
{
Tool.InvokeMethod<HUDManager>(__instance, "PingScan_performed", new object[1] { PingContext });
}
}
[HarmonyPatch(typeof(HUDManager), "PingScan_performed")]
[HarmonyPrefix]
private static void PingScan_performed(HUDManager __instance, ref CallbackContext context, ref bool __runOriginal, ref float ___playerPingingScan, List<ScanNodeProperties> ___nodesOnScreen, int ___scannedScrapNum)
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: 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_0431: Unknown result type (might be due to invalid IL or missing references)
//IL_0455: Unknown result type (might be due to invalid IL or missing references)
//IL_0479: Unknown result type (might be due to invalid IL or missing references)
//IL_049d: Unknown result type (might be due to invalid IL or missing references)
//IL_04c1: Unknown result type (might be due to invalid IL or missing references)
//IL_035b: Unknown result type (might be due to invalid IL or missing references)
//IL_037f: Unknown result type (might be due to invalid IL or missing references)
//IL_03a3: Unknown result type (might be due to invalid IL or missing references)
//IL_03c7: Unknown result type (might be due to invalid IL or missing references)
//IL_03eb: Unknown result type (might be due to invalid IL or missing references)
if (((CallbackContext)(ref context)).performed)
{
PingContext = context;
}
if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null || !(bool)Tool.InvokeMethod<HUDManager>(__instance, "CanPlayerScan") || ___playerPingingScan > -1f || ((!ProHUD.Config.Scan.SCAN_TOGGLE.Value || !ToggleScan) && !((CallbackContext)(ref context)).performed))
{
return;
}
__runOriginal = false;
___playerPingingScan = 0.3f;
if (!ProHUD.Config.Scan.SCAN_TOGGLE_ANIMATION.Value)
{
((Component)__instance.scanEffectAnimator).transform.position = ((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform.position;
__instance.scanEffectAnimator.SetTrigger("scan");
}
if (!ProHUD.Config.Scan.SCAN_TOGGLE_SFX.Value)
{
__instance.UIAudio.PlayOneShot(__instance.scanSFX);
}
if ((Object)(object)ScanImage == (Object)null || (Object)(object)TotalText == (Object)null || (Object)(object)TotalNum == (Object)null)
{
return;
}
GameObject obj2 = GameObject.Find("/Environment/HangarShip");
ShipTotal = ((obj2 == null) ? null : obj2.GetComponentsInChildren<GrabbableObject>()?.Where(delegate(GrabbableObject obj)
{
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
if (((object)obj).GetType() == typeof(GiftBoxItem))
{
return !((GiftBoxItem)obj).hasUsedGift;
}
return (obj != null && ((Component)obj).GetComponentInChildren<ScanNodeProperties>()?.nodeType == 2) ? true : false;
}))?.Sum((GrabbableObject scrap) => scrap.scrapValue) ?? 0;
((TMP_Text)TotalText).text = "";
Dictionary<string, (int, int)> dictionary = new Dictionary<string, (int, int)>();
foreach (ScanNodeProperties item3 in ___nodesOnScreen.Where((ScanNodeProperties node) => node.nodeType == 2))
{
if (item3.nodeType == 2)
{
if (dictionary.TryGetValue(item3.headerText, out var _))
{
int item = dictionary[item3.headerText].Item1 + 1;
int item2 = dictionary[item3.headerText].Item2 + item3.scrapValue;
dictionary[item3.headerText] = (item, item2);
}
else
{
dictionary.Add(item3.headerText, (1, item3.scrapValue));
}
}
}
foreach (KeyValuePair<string, (int, int)> item4 in dictionary)
{
TextMeshProUGUI? totalText = TotalText;
((TMP_Text)totalText).text = ((TMP_Text)totalText).text + $"<color=#ff3333>{item4.Value.Item1} {item4.Key}: {item4.Value.Item2}\n</color>";
}
PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
if (ProHUD.Config.Scan.SCAN_SHIP_TOTAL.Value && localPlayerController.isInHangarShipRoom)
{
((Transform)((Graphic)ScanImage).rectTransform).localScale = new Vector3(1f, 1.6f, 1f);
((Transform)((TMP_Text)TotalText).rectTransform).localScale = new Vector3(1f, 0.625f, 1f);
((Transform)((TMP_Text)TotalNum).rectTransform).localScale = new Vector3(1f, 0.625f, 1f);
((Transform)((TMP_Text)TotalText).rectTransform).localPosition = new Vector3(-24f, 2f, 0f);
((Transform)((TMP_Text)TotalNum).rectTransform).localPosition = new Vector3(-1f, 0f, 0f);
TextMeshProUGUI? totalText2 = TotalText;
((TMP_Text)totalText2).text = ((TMP_Text)totalText2).text + "\nTOTAL:\n\nLOOTED:";
}
else
{
((Transform)((Graphic)ScanImage).rectTransform).localScale = new Vector3(1f, 1f, 1f);
((Transform)((TMP_Text)TotalText).rectTransform).localScale = new Vector3(1f, 1f, 1f);
((Transform)((TMP_Text)TotalNum).rectTransform).localScale = new Vector3(1f, 1f, 1f);
((Transform)((TMP_Text)TotalText).rectTransform).localPosition = new Vector3(-24f, -11f, 0f);
((Transform)((TMP_Text)TotalNum).rectTransform).localPosition = new Vector3(-1f, -15f, 0f);
TextMeshProUGUI? totalText3 = TotalText;
((TMP_Text)totalText3).text = ((TMP_Text)totalText3).text + "\nTOTAL:\n\n\n";
}
}
private static void PingScan_Toggle(CallbackContext context)
{
if (ToggleScan)
{
ToggleScan = false;
}
else if (ProHUD.Config.Scan.SCAN_TOGGLE.Value && !((Object)(object)GameNetworkManager.Instance?.localPlayerController == (Object)null) && ((CallbackContext)(ref context)).performed)
{
ToggleScan = true;
}
}
}
[HarmonyPatch]
internal static class StaminaMeter
{
private const float METER_EMPTY = 0.298f;
private const float METER_FULL = 0.91f;
private static float minStamina = 0.1f;
private static readonly Color32 NormalColor = new Color32(byte.MaxValue, (byte)127, (byte)0, byte.MaxValue);
private static readonly Color32 ExhaustedColor = new Color32((byte)127, (byte)63, (byte)0, byte.MaxValue);
private static Gradient StaminaGradient = new Gradient();
private static GameObject ExhaustedIndicator;
private static TextMeshProUGUI arrow;
[HarmonyPatch(typeof(HUDManager), "Awake")]
[HarmonyPostfix]
public static void Awake(HUDManager __instance)
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: 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_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: 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)
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_0161: Unknown result type (might be due to invalid IL or missing references)
//IL_0166: Unknown result type (might be due to invalid IL or missing references)
//IL_018a: Unknown result type (might be due to invalid IL or missing references)
//IL_018f: Unknown result type (might be due to invalid IL or missing references)
//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
StaminaGradient.SetKeys((GradientColorKey[])(object)new GradientColorKey[4]
{
new GradientColorKey(Color32.op_Implicit(NormalColor), 0f),
new GradientColorKey(Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, (byte)0, byte.MaxValue)), 0.33f),
new GradientColorKey(Color32.op_Implicit(new Color32((byte)127, byte.MaxValue, (byte)0, byte.MaxValue)), 0.66f),
new GradientColorKey(Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue)), 1f)
}, (GradientAlphaKey[])(object)new GradientAlphaKey[2]
{
new GradientAlphaKey(1f, 0f),
new GradientAlphaKey(1f, 1f)
});
ExhaustedIndicator = Tool.AddHUD("ExhaustedIndicator", ((Component)__instance.PlayerInfo.canvasGroup).transform);
arrow = ExhaustedIndicator.AddComponent<TextMeshProUGUI>();
((TMP_Text)arrow).text = "▼\n▲";
((TMP_Text)arrow).lineSpacing = 30f;
((TMP_Text)arrow).enableWordWrapping = false;
((TMP_Text)arrow).fontSize = 10f;
((TMP_Text)arrow).alignment = (TextAlignmentOptions)514;
((Graphic)arrow).color = Color32.op_Implicit(NormalColor);
((Transform)((TMP_Text)arrow).rectTransform).rotation = Quaternion.Euler(new Vector3(0f, 0f, -20f));
((Transform)((TMP_Text)arrow).rectTransform).localPosition = new Vector3(-364f, 83f, 0f);
minStamina = (ProHUD.Config.StaminaMeter.STAMINA_ACCURATE.Value ? 0.1f : 0.3f);
ExhaustedIndicator.SetActive(ProHUD.Config.StaminaMeter.STAMINA_ACCURATE.Value && ProHUD.Config.StaminaMeter.STAMINA_EXHAUSTED.Value);
}
[HarmonyPatch(typeof(PlayerControllerB), "LateUpdate")]
[HarmonyPostfix]
public static void LateUpdate(PlayerControllerB __instance, Image ___sprintMeterUI, float ___sprintMeter, float ___drunkness)
{
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
if (!Game.isPlayer(__instance))
{
return;
}
___sprintMeterUI.fillAmount = Mathf.Lerp(0.298f, 0.91f, (___sprintMeter - minStamina) / (1f - minStamina));
if (___sprintMeter > 0.3f || __instance.isSprinting)
{
if (ProHUD.Config.StaminaMeter.STAMINA_TZP_GRADIENT.Value && ___drunkness > 0f)
{
((Graphic)___sprintMeterUI).color = StaminaGradient.Evaluate(___drunkness);
}
else
{
((Graphic)___sprintMeterUI).color = Color32.op_Implicit(NormalColor);
}
}
else
{
((Graphic)___sprintMeterUI).color = Color32.op_Implicit(ExhaustedColor);
}
}
public static void ConfigChanged(object? sender, EventArgs? e)
{
minStamina = (ProHUD.Config.StaminaMeter.STAMINA_ACCURATE.Value ? 0.1f : 0.3f);
GameObject exhaustedIndicator = ExhaustedIndicator;
if (exhaustedIndicator != null)
{
exhaustedIndicator.SetActive(ProHUD.Config.StaminaMeter.STAMINA_ACCURATE.Value && ProHUD.Config.StaminaMeter.STAMINA_EXHAUSTED.Value);
}
}
}
[HarmonyPatch]
internal static class StatusText
{
private static GameObject? HPMetricUI;
private static TextMeshProUGUI? HPMetricText;
[HarmonyPatch(typeof(HUDManager), "Awake")]
[HarmonyPrefix]
private static void Awake(HUDManager __instance)
{
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
HPMetricUI = Tool.AddHUD("HPMetric", ((TMP_Text)__instance.weightCounter).transform);
HPMetricText = HPMetricUI.AddComponent<TextMeshProUGUI>();
((TMP_Text)HPMetricText).rectTransform.anchoredPosition = new Vector2(30f, 15f);
((TMP_Text)HPMetricText).font = ((TMP_Text)__instance.weightCounter).font;
((TMP_Text)HPMetricText).fontSize = 16f;
((TMP_Text)HPMetricText).text = "HP:100";
((TMP_Text)HPMetricText).alignment = ((TMP_Text)__instance.weightCounter).alignment;
((Graphic)HPMetricText).color = Color32.op_Implicit(new Color32((byte)0, (byte)195, (byte)0, byte.MaxValue));
((TMP_Text)HPMetricText).overflowMode = (TextOverflowModes)0;
HPMetricUI.SetActive(ProHUD.Config.StatusText.HEALTH_METRIC.Value);
}
[HarmonyPatch(typeof(HUDManager), "UpdateHealthUI")]
[HarmonyPostfix]
private static void UpdateHealthUI(int health)
{
if ((Object)(object)HPMetricText != (Object)null && (Object)(object)GameNetworkManager.Instance?.localPlayerController != (Object)null && !GameNetworkManager.Instance.localPlayerController.isPlayerDead)
{
((TMP_Text)HPMetricText).text = $"HP:{health}";
}
}
[HarmonyPatch(typeof(HUDManager), "Update")]
[HarmonyPostfix]
private static void Update(ref TextMeshProUGUI ___weightCounter, ref Animator ___weightCounterAnimator)
{
if (ProHUD.Config.StatusText.LB2KG.Value && Object.op_Implicit((Object)(object)___weightCounter) && Object.op_Implicit((Object)(object)___weightCounterAnimator))
{
float num = Mathf.RoundToInt(Mathf.Clamp(GameNetworkManager.Instance.localPlayerController.carryWeight - 1f, 0f, 100f) * 105f);
float num2 = num * 0.4536f;
((TMP_Text)___weightCounter).text = $"{num2:0.#} Kg";
}
}
public static void ConfigChanged(object? sender, EventArgs? e)
{
GameObject? hPMetricUI = HPMetricUI;
if (hPMetricUI != null)
{
hPMetricUI.SetActive(ProHUD.Config.StatusText.HEALTH_METRIC.Value);
}
}
}
}
namespace ProHUD.Config
{
internal static class Clock
{
public static ConfigEntry<bool>? CLOCK_STD;
public static ConfigEntry<bool>? CLOCK_FULL_DIGIT;
public static ConfigEntry<bool>? CLOCK_FAST_UPDATE;
public static ConfigEntry<bool>? CLOCK_COMPACT;
public static ConfigEntry<bool>? CLOCK_IN_SHIP;
public static ConfigEntry<bool>? CLOCK_IN_FACTORY;
public static void bind()
{
CLOCK_STD = Setting.Bind("SECTION_CLOCK", "CLOCK_STD", defaultValue: false);
CLOCK_FULL_DIGIT = Setting.Bind("SECTION_CLOCK", "CLOCK_FULL_DIGIT", defaultValue: false);
CLOCK_FAST_UPDATE = Setting.Bind("SECTION_CLOCK", "CLOCK_FAST_UPDATE", defaultValue: false);
CLOCK_COMPACT = Setting.Bind("SECTION_CLOCK", "CLOCK_COMPACT", defaultValue: false);
CLOCK_IN_SHIP = Setting.Bind("SECTION_CLOCK", "CLOCK_IN_SHIP", defaultValue: false);
CLOCK_IN_FACTORY = Setting.Bind("SECTION_CLOCK", "CLOCK_IN_FACTORY", defaultValue: false);
CLOCK_STD.SettingChanged += ProHUD.Patch.Clock.ResizeClock;
CLOCK_COMPACT.SettingChanged += ProHUD.Patch.Clock.ResizeClock;
}
}
internal static class Compass
{
public enum CompassNorth
{
TopRight,
Right,
BottomRight,
Bottom,
BottomLeft,
Left,
TopLeft,
Top
}
public static ConfigEntry<bool>? COMPASS;
public static ConfigEntry<CompassNorth>? COMPASS_NORTH;
public static ConfigEntry<bool>? COMPASS_NORTH_SHIP;
public static void bind()
{
COMPASS = Setting.Bind("SECTION_COMPASS", "COMPASS", defaultValue: false);
COMPASS_NORTH = Setting.Bind("SECTION_COMPASS", "COMPASS_NORTH", CompassNorth.TopLeft);
COMPASS_NORTH_SHIP = Setting.Bind("SECTION_COMPASS", "COMPASS_NORTH_SHIP", defaultValue: false);
COMPASS.SettingChanged += ProHUD.Patch.Compass.ConfigChanged;
}
}
internal static class Crosshair
{
public static ConfigEntry<bool>? CROSSHAIR;
public static ConfigEntry<string>? CROSSHAIR_TYPE;
public static ConfigEntry<int>? CROSSHAIR_SIZE;
public static ConfigEntry<int>? CROSSHAIR_RED;
public static ConfigEntry<int>? CROSSHAIR_GREEN;
public static ConfigEntry<int>? CROSSHAIR_BLUE;
public static ConfigEntry<int>? CROSSHAIR_ALPHA;
public static void bind()
{
CROSSHAIR = Setting.Bind("SECTION_CROSSHAIR", "CROSSHAIR", defaultValue: false);
CROSSHAIR_TYPE = Setting.Bind("SECTION_CROSSHAIR", "CROSSHAIR_TYPE", "- + -");
CROSSHAIR_SIZE = Setting.Bind("SECTION_CROSSHAIR", "CROSSHAIR_SIZE", 20, 1, 100);
CROSSHAIR_RED = Setting.Bind("SECTION_CROSSHAIR", "CROSSHAIR_RED", 255, 0, 255);
CROSSHAIR_GREEN = Setting.Bind("SECTION_CROSSHAIR", "CROSSHAIR_GREEN", 255, 0, 255);
CROSSHAIR_BLUE = Setting.Bind("SECTION_CROSSHAIR", "CROSSHAIR_BLUE", 255, 0, 255);
CROSSHAIR_ALPHA = Setting.Bind("SECTION_CROSSHAIR", "CROSSHAIR_ALPHA", 127, 0, 255);
CROSSHAIR.SettingChanged += ProHUD.Patch.Crosshair.SettingChanged;
CROSSHAIR_TYPE.SettingChanged += ProHUD.Patch.Crosshair.TypeChanged;
CROSSHAIR_SIZE.SettingChanged += ProHUD.Patch.Crosshair.SizeChanged;
CROSSHAIR_RED.SettingChanged += ProHUD.Patch.Crosshair.ColorChanged;
CROSSHAIR_GREEN.SettingChanged += ProHUD.Patch.Crosshair.ColorChanged;
CROSSHAIR_BLUE.SettingChanged += ProHUD.Patch.Crosshair.ColorChanged;
CROSSHAIR_ALPHA.SettingChanged += ProHUD.Patch.Crosshair.AlphaChanged;
}
}
internal static class DiscountAlert
{
public static ConfigEntry<bool>? ALERT_DISCOUNT;
public static ConfigEntry<bool>? ALERT_NO_DISCOUNT;
public static void bind()
{
ALERT_DISCOUNT = Setting.Bind("SECTION_ALERT", "ALERT_DISCOUNT", defaultValue: false);
ALERT_NO_DISCOUNT = Setting.Bind("SECTION_ALERT", "ALERT_NO_DISCOUNT", defaultValue: false);
}
}
internal static class InsanityMeter
{
public static ConfigEntry<bool>? INSANITY_METER;
public static void bind()
{
INSANITY_METER = Setting.Bind("SECTION_STATUS", "INSANITY_METER", defaultValue: false);
INSANITY_METER.SettingChanged += ProHUD.Patch.InsanityMeter.ConfigChanged;
}
}
internal static class JetpackMeter
{
public static ConfigEntry<bool>? JETPACK_METER;
public static void bind()
{
JETPACK_METER = Setting.Bind("SECTION_ITEM", "JETPACK_METER", defaultValue: false);
}
}
internal static class ResidualQuantity
{
public static ConfigEntry<bool>? RESIDUAL_QUNTITY;
public static void bind()
{
RESIDUAL_QUNTITY = Setting.Bind("SECTION_ITEM", "RESIDUAL_QUNTITY", defaultValue: false);
}
}
internal static class Scan
{
public static ConfigEntry<bool>? SCAN_HOLD;
public static ConfigEntry<bool>? SCAN_TOGGLE;
public static ConfigEntry<float>? SCAN_INTERVAL;
public static ConfigEntry<bool>? SCAN_TOGGLE_ANIMATION;
public static ConfigEntry<bool>? SCAN_TOGGLE_SFX;
public static ConfigEntry<bool>? SCAN_SHIP_TOTAL;
public static ConfigEntry<bool>? SCAN_SHOW_ALL_ITEM;
public static ConfigEntry<bool>? SCAN_SUM_OF_ONE;
public static void bind()
{
SCAN_HOLD = Setting.Bind("SECTION_SCAN", "SCAN_HOLD", defaultValue: false);
SCAN_TOGGLE = Setting.Bind("SECTION_SCAN", "SCAN_TOGGLE", defaultValue: false);
SCAN_INTERVAL = Setting.Bind("SECTION_SCAN", "SCAN_INTERVAL", 1.3f, 1.3f, 5f, RequireRestart: false, 0.1f);
SCAN_TOGGLE_ANIMATION = Setting.Bind("SECTION_SCAN", "SCAN_TOGGLE_ANIMATION", defaultValue: false);
SCAN_TOGGLE_SFX = Setting.Bind("SECTION_SCAN", "SCAN_TOGGLE_SFX", defaultValue: false);
SCAN_SHIP_TOTAL = Setting.Bind("SECTION_SCAN", "SCAN_SHIP_TOTAL", defaultValue: false);
SCAN_SHOW_ALL_ITEM = Setting.Bind("SECTION_SCAN", "SCAN_SHOW_ALL_ITEM", defaultValue: false);
SCAN_SUM_OF_ONE = Setting.Bind("SECTION_SCAN", "SCAN_SUM_OF_ONE", defaultValue: false);
}
}
internal static class StaminaMeter
{
public static ConfigEntry<bool>? STAMINA_ACCURATE;
public static ConfigEntry<bool>? STAMINA_EXHAUSTED;
public static ConfigEntry<bool>? STAMINA_TZP_GRADIENT;
public static void bind()
{
STAMINA_ACCURATE = Setting.Bind("SECTION_STATUS", "STAMINA_ACCURATE", defaultValue: false);
STAMINA_EXHAUSTED = Setting.Bind("SECTION_STATUS", "STAMINA_EXHAUSTED", defaultValue: false);
STAMINA_TZP_GRADIENT = Setting.Bind("SECTION_STATUS", "STAMINA_TZP_GRADIENT", defaultValue: false);
STAMINA_ACCURATE.SettingChanged += ProHUD.Patch.StaminaMeter.ConfigChanged;
STAMINA_EXHAUSTED.SettingChanged += ProHUD.Patch.StaminaMeter.ConfigChanged;
}
}
internal static class StatusText
{
public static ConfigEntry<bool>? HEALTH_METRIC;
public static ConfigEntry<bool>? LB2KG;
public static void bind()
{
HEALTH_METRIC = Setting.Bind("SECTION_STATUS", "HEALTH_METRIC", defaultValue: false);
LB2KG = Setting.Bind("SECTION_STATUS", "LB2KG", defaultValue: false);
HEALTH_METRIC.SettingChanged += ProHUD.Patch.StatusText.ConfigChanged;
}
}
public static class Setting
{
public enum LanguageOption
{
English,
Korean
}
public static ConfigEntry<LanguageOption>? Language;
public static void BindAll()
{
Language = Bind("SECTION_GENERAL", "LANGUAGE", LanguageOption.Korean, null, null, RequireRestart: true);
Clock.bind();
Compass.bind();
Crosshair.bind();
DiscountAlert.bind();
InsanityMeter.bind();
JetpackMeter.bind();
ResidualQuantity.bind();
StaminaMeter.bind();
StatusText.bind();
Scan.bind();
}
public static ConfigEntry<T> Bind<T>(string Section, string Key, T defaultValue, object? min = null, object? max = null, bool RequireRestart = false, float step = 0f)
{
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: Expected O, but got Unknown
//IL_00af: Expected O, but got Unknown
//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_0120: Expected O, but got Unknown
//IL_0120: Expected O, but got Unknown
//IL_015a: Unknown result type (might be due to invalid IL or missing references)
//IL_017e: Unknown result type (might be due to invalid IL or missing references)
//IL_0188: Expected O, but got Unknown
//IL_0188: Expected O, but got Unknown
//IL_0204: Unknown result type (might be due to invalid IL or missing references)
//IL_020e: Expected O, but got Unknown
//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
//IL_01d7: Expected O, but got Unknown
//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
//IL_01e5: Expected O, but got Unknown
//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
//IL_01f4: Expected O, but got Unknown
//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
//IL_01f9: Expected O, but got Unknown
//IL_0314: Unknown result type (might be due to invalid IL or missing references)
//IL_031e: Expected O, but got Unknown
//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
//IL_02e6: Expected O, but got Unknown
//IL_034b: Unknown result type (might be due to invalid IL or missing references)
//IL_0355: Expected O, but got Unknown
//IL_029d: Unknown result type (might be due to invalid IL or missing references)
//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
//IL_02ae: Expected O, but got Unknown
//IL_02af: Unknown result type (might be due to invalid IL or missing references)
//IL_02bc: Expected O, but got Unknown
//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
//IL_02cb: Expected O, but got Unknown
//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
//IL_02d0: Expected O, but got Unknown
//IL_0258: Unknown result type (might be due to invalid IL or missing references)
//IL_025d: Unknown result type (might be due to invalid IL or missing references)
//IL_0269: Expected O, but got Unknown
//IL_026a: Unknown result type (might be due to invalid IL or missing references)
//IL_0277: Expected O, but got Unknown
//IL_0278: Unknown result type (might be due to invalid IL or missing references)
//IL_0281: Unknown result type (might be due to invalid IL or missing references)
//IL_028f: Expected O, but got Unknown
//IL_028a: Unknown result type (might be due to invalid IL or missing references)
//IL_0294: Expected O, but got Unknown
//IL_03b1: Unknown result type (might be due to invalid IL or missing references)
//IL_03bb: Expected O, but got Unknown
try
{
if ((Object)(object)Plugin.Instance == (Object)null)
{
throw new Exception("Plugin is not Constructed");
}
if ((min != null && typeof(T) != min.GetType()) || (max != null && typeof(T) != max.GetType()))
{
throw new ArgumentException("INVALID MIN OR MAX VALUE TYPE");
}
bool flag = false;
if (min != null && max != null)
{
flag = true;
}
ConfigEntry<T> val = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<T>(new ConfigDefinition(Translation.Translate(Section), Translation.Translate(Key)), defaultValue, new ConfigDescription(Translation.Translate(Key, isDesc: true), (AcceptableValueBase)null, Array.Empty<object>()));
if (flag)
{
if (typeof(T).IsEquivalentTo(typeof(int)))
{
val = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<T>(new ConfigDefinition(Translation.Translate(Section), Translation.Translate(Key)), defaultValue, new ConfigDescription(Translation.Translate(Key, isDesc: true), (AcceptableValueBase)(object)new AcceptableValueRange<int>((int)min, (int)max), Array.Empty<object>()));
}
else if (typeof(T).IsEquivalentTo(typeof(float)))
{
val = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<T>(new ConfigDefinition(Translation.Translate(Section), Translation.Translate(Key)), defaultValue, new ConfigDescription(Translation.Translate(Key, isDesc: true), (AcceptableValueBase)(object)new AcceptableValueRange<float>((float)min, (float)max), Array.Empty<object>()));
}
}
if (Plugin.isLethalConfig)
{
if (typeof(T).IsEquivalentTo(typeof(int)))
{
if (flag)
{
ConfigEntry<int> obj = val as ConfigEntry<int>;
IntSliderOptions val2 = new IntSliderOptions();
((BaseRangeOptions<int>)val2).Min = (int)min;
((BaseRangeOptions<int>)val2).Max = (int)max;
((BaseOptions)val2).RequiresRestart = RequireRestart;
LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(obj, val2));
}
else
{
LethalConfigManager.AddConfigItem((BaseConfigItem)new IntInputFieldConfigItem(val as ConfigEntry<int>, RequireRestart));
}
}
else if (typeof(T).IsEquivalentTo(typeof(float)))
{
if (flag)
{
if (step > 0f)
{
ConfigEntry<float> obj2 = val as ConfigEntry<float>;
FloatStepSliderOptions val3 = new FloatStepSliderOptions();
((BaseRangeOptions<float>)val3).Min = (float)min;
((BaseRangeOptions<float>)val3).Max = (float)max;
val3.Step = step;
((BaseOptions)val3).RequiresRestart = RequireRestart;
LethalConfigManager.AddConfigItem((BaseConfigItem)new FloatStepSliderConfigItem(obj2, val3));
}
else
{
ConfigEntry<float> obj3 = val as ConfigEntry<float>;
FloatSliderOptions val4 = new FloatSliderOptions();
((BaseRangeOptions<float>)val4).Min = (float)min;
((BaseRangeOptions<float>)val4).Max = (float)max;
((BaseOptions)val4).RequiresRestart = RequireRestart;
LethalConfigManager.AddConfigItem((BaseConfigItem)new FloatSliderConfigItem(obj3, val4));
}
}
else
{
LethalConfigManager.AddConfigItem((BaseConfigItem)new FloatInputFieldConfigItem(val as ConfigEntry<float>, RequireRestart));
}
}
else if (typeof(T).IsEquivalentTo(typeof(bool)))
{
LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(val as ConfigEntry<bool>, RequireRestart));
}
else if (typeof(T).IsEquivalentTo(typeof(string)))
{
LethalConfigManager.AddConfigItem((BaseConfigItem)new TextInputFieldConfigItem(val as ConfigEntry<string>, RequireRestart));
}
else if (typeof(T).IsEnum)
{
Type settingType = ((ConfigEntryBase)val).SettingType;
Type type = typeof(EnumDropDownConfigItem<>).MakeGenericType(settingType);
object obj4 = Activator.CreateInstance(type, val, RequireRestart);
LethalConfigManager.AddConfigItem((BaseConfigItem)obj4);
}
}
return val;
}
catch (Exception ex)
{
Plugin.LogError(ex.StackTrace);
throw ex;
}
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}