using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using HarmonyLib;
using NoHUD.Patches;
using Reptile;
using SlopCrew.API;
using TMPro;
using UnityEngine;
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(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyCompany("NoHUD")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Hide the HUD")]
[assembly: AssemblyFileVersion("1.1.1.0")]
[assembly: AssemblyInformationalVersion("1.1.1")]
[assembly: AssemblyProduct("NoHUD")]
[assembly: AssemblyTitle("NoHUD")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.1.0")]
[module: UnverifiableCode]
namespace NoHUD
{
[BepInPlugin("NoHUD", "NoHUD", "1.1.1")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Core : BaseUnityPlugin
{
public static ConfigEntry<KeyCode> configToggleKey;
public static ConfigEntry<bool> configSlopNames;
internal static bool active = true;
internal static bool isDragsunSpeedometerLoaded = false;
internal static GameObject DragsunSpeedLabel;
internal static bool isSoftGoatSpeedometerLoaded = false;
internal static GameObject SoftGoatSpeedBar;
internal static bool isSlopCrewLoaded = false;
private void Awake()
{
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Expected O, but got Unknown
((BaseUnityPlugin)this).Logger.LogInfo((object)"NoHUD is loaded.");
configToggleKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "ToggleKey", (KeyCode)96, "The key used to toggle the HUD.");
configSlopNames = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "SlopNames", true, "Sets whether the names of other players in SlopCrew will be affected or not. Has no effect if SlopCrew is not loaded.");
Harmony val = new Harmony("NoHUD");
val.PatchAll(typeof(BaseModule_HandleStageFullyLoaded_Patch));
val.PatchAll(typeof(GameplayUI_Init_Patch));
val.PatchAll(typeof(GraffitiGame_Init_Patch));
foreach (KeyValuePair<string, PluginInfo> pluginInfo in Chainloader.PluginInfos)
{
if (pluginInfo.Value.Metadata.GUID == "Speedometer")
{
isSoftGoatSpeedometerLoaded = true;
}
else if (pluginInfo.Value.Metadata.GUID == "com.Dragsun.Speedometer")
{
isDragsunSpeedometerLoaded = true;
}
else if (pluginInfo.Value.Metadata.GUID == "SlopCrew.Plugin")
{
isSlopCrewLoaded = true;
}
}
if (isSoftGoatSpeedometerLoaded)
{
((BaseUnityPlugin)this).Logger.LogInfo((object)"Speedometer (SoftGoat) is loaded.");
}
if (isDragsunSpeedometerLoaded)
{
((BaseUnityPlugin)this).Logger.LogInfo((object)"Speedometer (Dragsun) is loaded.");
}
if (isSlopCrewLoaded)
{
((BaseUnityPlugin)this).Logger.LogInfo((object)"SlopCrew is loaded.");
ISlopCrewAPI aPI = APIManager.API;
aPI.OnPlayerCountChanged += delegate
{
FindSlopCrewNames();
};
}
}
private void Update()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_012b: 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_0146: Unknown result type (might be due to invalid IL or missing references)
//IL_018d: Unknown result type (might be due to invalid IL or missing references)
//IL_0192: Unknown result type (might be due to invalid IL or missing references)
//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
//IL_01d8: 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_01f3: Unknown result type (might be due to invalid IL or missing references)
if (!Input.GetKeyDown(configToggleKey.Value) || !Core.Instance.BaseModule.IsPlayingInStage || Core.Instance.BaseModule.IsLoading)
{
return;
}
GameplayUI value = Traverse.Create((object)Core.Instance.UIManager).Field<GameplayUI>("gameplay").Value;
active = !active;
((Behaviour)value.chargeBar).enabled = active;
if ((Object)(object)SoftGoatSpeedBar != (Object)null)
{
SoftGoatSpeedBar.SetActive(active);
}
if ((Object)(object)DragsunSpeedLabel != (Object)null)
{
DragsunSpeedLabel.SetActive(active);
}
Image[] componentsInChildren = ((Component)value).gameObject.GetComponentsInChildren<Image>(true);
foreach (Image val in componentsInChildren)
{
Color color = ((Graphic)val).color;
color.a = Convert.ToInt32(active);
((Graphic)val).color = color;
}
TextMeshProUGUI[] componentsInChildren2 = ((Component)value).gameObject.GetComponentsInChildren<TextMeshProUGUI>(true);
foreach (TextMeshProUGUI val2 in componentsInChildren2)
{
Color color2 = ((Graphic)val2).color;
color2.a = Convert.ToInt32(active);
((Graphic)val2).color = color2;
}
GraffitiGame val3 = Object.FindObjectOfType<GraffitiGame>();
if (!((Object)(object)val3 != (Object)null))
{
return;
}
SpriteRenderer[] componentsInChildren3 = ((Component)val3).GetComponentsInChildren<SpriteRenderer>(true);
foreach (SpriteRenderer val4 in componentsInChildren3)
{
Color color3 = val4.color;
color3.a = Convert.ToInt32(active);
val4.color = color3;
}
TextMeshProUGUI[] componentsInChildren4 = ((Component)val3).GetComponentsInChildren<TextMeshProUGUI>(true);
foreach (TextMeshProUGUI val5 in componentsInChildren4)
{
Color color4 = ((Graphic)val5).color;
color4.a = Convert.ToInt32(active);
((Graphic)val5).color = color4;
}
LineRenderer[] componentsInChildren5 = ((Component)val3).GetComponentsInChildren<LineRenderer>(true);
foreach (LineRenderer val6 in componentsInChildren5)
{
if (active)
{
val6.startWidth = 0.2491f;
val6.endWidth = 0.2491f;
}
else
{
val6.startWidth = 0f;
val6.endWidth = 0f;
}
}
}
public static void FindSlopCrewNames()
{
if (!Core.Instance.BaseModule.IsPlayingInStage || Core.Instance.BaseModule.IsLoading || !isSlopCrewLoaded || !configSlopNames.Value)
{
return;
}
Player[] array = Object.FindObjectsOfType<Player>();
foreach (Player val in array)
{
try
{
((Component)((Component)val).transform.Find("RootObject").Find("interactionCapsule").Find("SlopCrew_NameplateContainer")).gameObject.SetActive(active);
}
catch
{
}
}
}
}
public static class PluginInfo
{
public const string PLUGIN_GUID = "NoHUD";
public const string PLUGIN_NAME = "NoHUD";
public const string PLUGIN_VERSION = "1.1.1";
}
}
namespace NoHUD.Patches
{
[HarmonyPatch(typeof(BaseModule), "HandleStageFullyLoaded")]
public class BaseModule_HandleStageFullyLoaded_Patch
{
public static void Postfix()
{
if (Core.isDragsunSpeedometerLoaded)
{
GameplayUI value = Traverse.Create((object)Core.Instance.UIManager).Field<GameplayUI>("gameplay").Value;
Core.DragsunSpeedLabel = ((Component)((Component)value.gameplayScreen).transform.Find("Speedometer")).gameObject;
Core.DragsunSpeedLabel.SetActive(Core.active);
}
if (Core.isSoftGoatSpeedometerLoaded)
{
GameplayUI value2 = Traverse.Create((object)Core.Instance.UIManager).Field<GameplayUI>("gameplay").Value;
Core.SoftGoatSpeedBar = ((Component)((Component)value2.gameplayScreen).transform.Find("chargeGroup").Find("chargeBackground(Clone)")).gameObject;
Core.SoftGoatSpeedBar.SetActive(Core.active);
}
}
}
[HarmonyPatch(typeof(GameplayUI), "Init")]
internal class GameplayUI_Init_Patch
{
public static void Postfix(GameplayUI __instance)
{
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_008a: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
if (!Core.active)
{
((Behaviour)__instance.chargeBar).enabled = Core.active;
Image[] componentsInChildren = ((Component)__instance).gameObject.GetComponentsInChildren<Image>(true);
foreach (Image val in componentsInChildren)
{
Color color = ((Graphic)val).color;
color.a = Convert.ToInt32(Core.active);
((Graphic)val).color = color;
}
TextMeshProUGUI[] componentsInChildren2 = ((Component)__instance).gameObject.GetComponentsInChildren<TextMeshProUGUI>(true);
foreach (TextMeshProUGUI val2 in componentsInChildren2)
{
Color color2 = ((Graphic)val2).color;
color2.a = Convert.ToInt32(Core.active);
((Graphic)val2).color = color2;
}
}
}
}
[HarmonyPatch(typeof(GraffitiGame), "Init")]
internal class GraffitiGame_Init_Patch
{
public static void Postfix(GraffitiGame __instance)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: 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_0085: Unknown result type (might be due to invalid IL or missing references)
if (Core.active)
{
return;
}
SpriteRenderer[] componentsInChildren = ((Component)__instance).GetComponentsInChildren<SpriteRenderer>(true);
foreach (SpriteRenderer val in componentsInChildren)
{
Color color = val.color;
color.a = Convert.ToInt32(Core.active);
val.color = color;
}
TextMeshProUGUI[] componentsInChildren2 = ((Component)__instance).GetComponentsInChildren<TextMeshProUGUI>(true);
foreach (TextMeshProUGUI val2 in componentsInChildren2)
{
Color color2 = ((Graphic)val2).color;
color2.a = Convert.ToInt32(Core.active);
((Graphic)val2).color = color2;
}
LineRenderer[] componentsInChildren3 = ((Component)__instance).GetComponentsInChildren<LineRenderer>(true);
foreach (LineRenderer val3 in componentsInChildren3)
{
if (Core.active)
{
val3.startWidth = 0.2491f;
val3.endWidth = 0.2491f;
}
else
{
val3.startWidth = 0f;
val3.endWidth = 0f;
}
}
}
}
}