using System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 RunHUD { [BepInPlugin("benjamin.runhud", "RunHUD", "1.0.0")] [BepInProcess("REPO.exe")] public class Plugin : BaseUnityPlugin { public const string Guid = "benjamin.runhud"; public const string Name = "RunHUD"; public const string Version = "1.0.0"; internal static ManualLogSource Log; internal static ConfigEntry Enabled; internal static ConfigEntry ShowLevel; internal static ConfigEntry ShowHaul; internal static ConfigEntry ShowEnemyCount; internal static ConfigEntry Corner; internal static ConfigEntry Scale; private void Awake() { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; Enabled = ((BaseUnityPlugin)this).Config.Bind("General", "Enabled", true, "Master switch."); ShowLevel = ((BaseUnityPlugin)this).Config.Bind("Display", "ShowLevel", true, "Show the current level number and name."); ShowHaul = ((BaseUnityPlugin)this).Config.Bind("Display", "ShowHaul", true, "Show hauled value against the extraction goal, with a percentage."); ShowEnemyCount = ((BaseUnityPlugin)this).Config.Bind("Display", "ShowEnemyCount", false, "Show how many enemies are currently spawned. Host only - clients have no reliable count. Off by default because knowing is arguably cheating."); Corner = ((BaseUnityPlugin)this).Config.Bind("Display", "Corner", 1, new ConfigDescription("0 top-left, 1 top-right, 2 bottom-left, 3 bottom-right.", (AcceptableValueBase)(object)new AcceptableValueRange(0, 3), Array.Empty())); Scale = ((BaseUnityPlugin)this).Config.Bind("Display", "Scale", 1f, new ConfigDescription("Text size multiplier.", (AcceptableValueBase)(object)new AcceptableValueRange(0.6f, 2.5f), Array.Empty())); ((Component)this).gameObject.AddComponent(); Log.LogInfo((object)"RunHUD v1.0.0 loaded."); } } internal class Hud : MonoBehaviour { private void OnGUI() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_011e: 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_0134: 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_00de: Unknown result type (might be due to invalid IL or missing references) if (Plugin.Enabled.Value && SemiFunc.RunIsLevel()) { string text = Build(); if (!string.IsNullOrEmpty(text)) { GUIStyle val = new GUIStyle(GUI.skin.label) { richText = true, alignment = (TextAnchor)0, fontSize = Mathf.RoundToInt(14f * Plugin.Scale.Value) }; Vector2 val2 = val.CalcSize(new GUIContent(text)); val2.x += 18f; val2.y += 14f; float num = ((Plugin.Corner.Value == 0 || Plugin.Corner.Value == 2) ? 16f : ((float)Screen.width - val2.x - 16f)); float num2 = ((Plugin.Corner.Value == 0 || Plugin.Corner.Value == 1) ? 16f : ((float)Screen.height - val2.y - 16f)); Rect val3 = default(Rect); ((Rect)(ref val3))..ctor(num, num2, val2.x, val2.y); GUI.color = new Color(0f, 0f, 0f, 0.55f); GUI.Box(val3, GUIContent.none); GUI.color = Color.white; GUI.Label(new Rect(((Rect)(ref val3)).x + 9f, ((Rect)(ref val3)).y + 7f, ((Rect)(ref val3)).width, ((Rect)(ref val3)).height), text, val); } } } private string Build() { StringBuilder stringBuilder = new StringBuilder(); RunManager instance = RunManager.instance; if (Plugin.ShowLevel.Value && (Object)(object)instance != (Object)null) { string text = (((Object)(object)instance.levelCurrent != (Object)null) ? ((Object)instance.levelCurrent).name : ""); int num = text.LastIndexOf('-'); if (num >= 0 && num < text.Length - 1) { text = text.Substring(num + 1).Trim(); } stringBuilder.Append($"Level {instance.levelsCompleted + 1}"); if (!string.IsNullOrEmpty(text)) { stringBuilder.Append(" " + text + ""); } } RoundDirector instance2 = RoundDirector.instance; if (Plugin.ShowHaul.Value && (Object)(object)instance2 != (Object)null && instance2.haulGoal > 0) { if (stringBuilder.Length > 0) { stringBuilder.Append('\n'); } float num2 = (float)instance2.currentHaul / (float)instance2.haulGoal * 100f; string text2 = ((num2 >= 100f) ? "#7fd4a0" : ((num2 >= 60f) ? "#e8c46a" : "#ff8a5c")); stringBuilder.Append($"Haul {instance2.currentHaul:n0} / {instance2.haulGoal:n0} ({num2:0}%)"); } EnemyDirector instance3 = EnemyDirector.instance; if (Plugin.ShowEnemyCount.Value && (Object)(object)instance3 != (Object)null && SemiFunc.IsMasterClientOrSingleplayer() && instance3.enemiesSpawned != null) { if (stringBuilder.Length > 0) { stringBuilder.Append('\n'); } stringBuilder.Append($"Enemies spawned {instance3.enemiesSpawned.Count}"); } return stringBuilder.ToString(); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "RunHUD"; public const string PLUGIN_NAME = "RunHUD"; public const string PLUGIN_VERSION = "1.0.0"; } }