using System; 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 ASKAPanelKit; using ASKAUI; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using HarmonyLib; using Il2CppInterop.Runtime.Attributes; using Il2CppInterop.Runtime.Injection; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Microsoft.CodeAnalysis; using SSSGame; using SSSGame.UI; using SandSailorStudio.Attributes; using SandSailorStudio.UI; using TMPro; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.InputSystem.Utilities; using UnityEngine.Profiling; using UnityEngine.SceneManagement; 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(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("DEATH STUDIOS")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("ASKA UI Framework — Config Management And Panel Registry For BepInEx IL2CPP Mods.")] [assembly: AssemblyFileVersion("0.0.6.0")] [assembly: AssemblyInformationalVersion("0.0.6+2eb37794b32916412ebcb0dfd350cd795fb081cc")] [assembly: AssemblyProduct("AskaUI")] [assembly: AssemblyTitle("AskaUI")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.6.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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] [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 ASKAPanelKit { public static class PK { public static readonly Color ColOverlay = new Color(0.01f, 0.02f, 0.02f, 0.78f); public static readonly Color ColPanel = new Color(0.04f, 0.05f, 0.05f, 0.985f); public static readonly Color ColHeader = new Color(0.09f, 0.1f, 0.1f, 0.99f); public static readonly Color ColAccent = new Color(0.92f, 0.38f, 0.08f, 1f); public static readonly Color ColAccentDim = new Color(0.23f, 0.24f, 0.24f, 1f); public static readonly Color ColText = new Color(1f, 0.6f, 0.26f, 1f); public static readonly Color ColMuted = new Color(0.94f, 0.72f, 0.52f, 1f); public static readonly Color ColGreen = new Color(0.33f, 0.82f, 0.46f, 1f); public static readonly Color ColRed = new Color(0.84f, 0.32f, 0.26f, 1f); public static readonly Color ColInput = new Color(0.09f, 0.09f, 0.09f, 1f); private static void EnsureBuilt() { ASKAUIKit.EnsureBuilt(); } public static void Header(string title, string desc = null) { EnsureBuilt(); ASKAUIKit.DrawSectionHeader(title, desc); } public static void BeginSection(string title) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) EnsureBuilt(); GUILayout.Space(6f); Color color = GUI.color; GUI.color = ColAccent; GUILayout.Label(title, ASKAUIKit.StSection, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.ExpandWidth(true), GUILayout.Height(44f) }); GUI.color = color; GUILayout.Space(2f); } public static void EndSection() { GUILayout.Space(4f); } public static void BeginCard() { EnsureBuilt(); ASKAUIKit.BeginCard(); } public static void EndCard() { ASKAUIKit.EndCard(); } public static bool BoolRow(string label, bool current, string hint = null) { EnsureBuilt(); return ASKAUIKit.DrawBoolRow(label, current, hint); } public static float FloatRow(string label, float current, float min, float max, string suffix = "", float step = 1f) { EnsureBuilt(); return ASKAUIKit.DrawFloatRow(label, current, min, max, suffix, step); } public static int IntRow(string label, int current, int min, int max, string suffix = "") { EnsureBuilt(); return ASKAUIKit.DrawIntRow(label, current, min, max, suffix); } public static void StatRow(string label, string value) { EnsureBuilt(); ASKAUIKit.DrawStatRow(label, value); } public static void ColoredStatRow(string label, string value, Color color) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_0064: Unknown result type (might be due to invalid IL or missing references) EnsureBuilt(); GUILayout.BeginHorizontal(ASKAUIKit.StCard, (Il2CppReferenceArray)null); GUILayout.Label(label, ASKAUIKit.StLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(540f) }); GUILayout.FlexibleSpace(); Color color2 = GUI.color; GUI.color = color; GUILayout.Label(value, ASKAUIKit.StValue, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(300f) }); GUI.color = color2; GUILayout.EndHorizontal(); } public static void ProgressRow(string label, float current, float max) { EnsureBuilt(); ASKAUIKit.DrawProgressBar(label, current, max); } public static bool Btn(string label, float width = 180f) { EnsureBuilt(); return ASKAUIKit.DrawButton(label, width); } public static bool ActionButton(string label, string color = "accent") { EnsureBuilt(); return (color == "green") ? ASKAUIKit.DrawButtonGreen(label) : ((color == "red") ? ASKAUIKit.DrawButtonRed(label) : ASKAUIKit.DrawButton(label)); } public static bool ResetToDefaultsBtn() { return ActionButton("↺ Reset to Defaults", "red"); } public static void BeginButtonRow() { GUILayout.BeginHorizontal((Il2CppReferenceArray)null); } public static void EndButtonRow() { GUILayout.EndHorizontal(); } public static void HelpBox(string text, string type = "info") { EnsureBuilt(); if (!(type == "error")) { if (type == "warning") { ASKAUIKit.DrawWarningBox(text); } else { ASKAUIKit.DrawInfoBox(text); } } else { ASKAUIKit.DrawErrorBox(text); } } public static void Separator() { EnsureBuilt(); ASKAUIKit.DrawSeparator(); } public static void Footer(string text) { EnsureBuilt(); ASKAUIKit.DrawFooter(text); } public static void Badge(string text, Color color) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) EnsureBuilt(); Color color2 = GUI.color; GUI.color = color; GUILayout.Label(text, ASKAUIKit.StLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) }); GUI.color = color2; } public static int DropdownRow(string label, int selected, string[] options, string hint = null) { EnsureBuilt(); GUILayout.BeginVertical(ASKAUIKit.StCard, (Il2CppReferenceArray)null); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label(label, ASKAUIKit.StLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(540f) }); GUILayout.FlexibleSpace(); if (GUILayout.Button("◀", ASKAUIKit.StSmallBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(36f) })) { selected = (selected - 1 + options.Length) % options.Length; } GUILayout.Label(options[selected], ASKAUIKit.StValue, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) }); if (GUILayout.Button("▶", ASKAUIKit.StSmallBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(36f) })) { selected = (selected + 1) % options.Length; } GUILayout.EndHorizontal(); if (!string.IsNullOrWhiteSpace(hint)) { GUILayout.Label(hint, ASKAUIKit.StMuted, (Il2CppReferenceArray)null); } GUILayout.EndVertical(); return selected; } public static void Reset() { ASKAUIKit.Reset(); } public static string TextField(string label, string current, float width = 300f) { EnsureBuilt(); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label(label, ASKAUIKit.StLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(width) }); string result = GUILayout.TextField(current, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(200f) }); GUILayout.EndHorizontal(); return result; } public static bool ToggleRow(string label, bool current) { return BoolRow(label, current); } public static bool BeginCollapsible(string title, bool defaultOpen) { BeginSection(title); BeginCard(); return defaultOpen; } public static void EndCollapsible() { EndCard(); EndSection(); } } } namespace ASKAUI { public struct HUDSnapshot { public float Health; public float HealthMax; public float Warmth; public float WarmthMax; public float Food; public float FoodMax; public float Water; public float WaterMax; public float Stamina; public float StaminaMax; public bool Valid; } public class ASKAHUDOverlay : MonoBehaviour { public static ConfigEntry CfgEnabled; public static ConfigEntry CfgHideVanilla; public static ConfigEntry CfgX; public static ConfigEntry CfgY; public static ConfigEntry CfgBarW; public static ConfigEntry CfgBarH; public static ConfigEntry CfgGap; public static HUDSnapshot LiveSnap; internal static FieldInfo FCurrentValue; internal static FieldInfo FMax; internal static FieldInfo FHealthAttr; internal static FieldInfo FWarmthAttr; internal static FieldInfo FFoodAttr; internal static FieldInfo FWaterAttr; internal static FieldInfo FStaminaAttr; internal static bool FieldsReady; private PlayerHUDMenu _hudMenu; private bool _vanillaHidden; private float _hudSearchTimer; private string _lastScene = ""; private const float HudSearchInterval = 3f; private GUIStyle _stLabel; private GUIStyle _stValue; private bool _stylesReady; private static readonly Color C_Health = new Color(0.85f, 0.22f, 0.22f, 1f); private static readonly Color C_Warmth = new Color(0.2f, 0.55f, 0.9f, 1f); private static readonly Color C_Food = new Color(0.78f, 0.55f, 0.18f, 1f); private static readonly Color C_Water = new Color(0.22f, 0.72f, 0.88f, 1f); private static readonly Color C_Stamina = new Color(0.33f, 0.82f, 0.46f, 1f); private static readonly Color C_BgBar = new Color(0.08f, 0.08f, 0.08f, 0.8f); private static readonly Color C_Border = new Color(0.92f, 0.38f, 0.08f, 0.6f); private static readonly Color C_Text = new Color(1f, 0.6f, 0.26f, 1f); private static readonly Color C_Muted = new Color(0.7f, 0.65f, 0.58f, 1f); public static ASKAHUDOverlay Instance { get; private set; } public HUDSnapshot Snap => LiveSnap; public ASKAHUDOverlay(IntPtr ptr) : base(ptr) { } public void Reset() { _stylesReady = false; } internal static void BuildFieldCache() { //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Expected O, but got Unknown if (FieldsReady) { return; } try { FCurrentValue = typeof(Property).GetField("_currentValue", BindingFlags.Instance | BindingFlags.NonPublic); FMax = typeof(VariableAttribute).GetField("max", BindingFlags.Instance | BindingFlags.Public); FHealthAttr = typeof(PlayerWidget).GetField("_healthAttr", BindingFlags.Instance | BindingFlags.NonPublic); FWarmthAttr = typeof(PlayerWidget).GetField("_warmthAttr", BindingFlags.Instance | BindingFlags.NonPublic); FFoodAttr = typeof(PlayerWidget).GetField("_foodAttr", BindingFlags.Instance | BindingFlags.NonPublic); FWaterAttr = typeof(PlayerWidget).GetField("_waterAttr", BindingFlags.Instance | BindingFlags.NonPublic); FStaminaAttr = typeof(PlayerWidget).GetField("_staminaAttr", BindingFlags.Instance | BindingFlags.NonPublic); FieldsReady = FCurrentValue != null && FMax != null && FHealthAttr != null && FWarmthAttr != null && FFoodAttr != null && FWaterAttr != null && FStaminaAttr != null; ManualLogSource loggerInstance = ASKAUIPlugin.LoggerInstance; if (loggerInstance != null) { loggerInstance.LogInfo((object)($"[ASKAUI-HUD] Field cache ready={FieldsReady}" + ((!FieldsReady) ? $" curVal={FCurrentValue != null} max={FMax != null} h={FHealthAttr != null} w={FWarmthAttr != null} f={FFoodAttr != null} wa={FWaterAttr != null} s={FStaminaAttr != null}" : ""))); } } catch (Exception ex) { ManualLogSource loggerInstance2 = ASKAUIPlugin.LoggerInstance; if (loggerInstance2 != null) { bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(33, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[ASKAUI-HUD] Field cache failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } loggerInstance2.LogWarning(val); } } } internal static (float cur, float max) ReadAttr(FieldInfo attrField, PlayerWidget pw) { try { if (attrField == null || (Object)(object)pw == (Object)null) { return (cur: 0f, max: 100f); } object? value = attrField.GetValue(pw); VariableAttribute val = (VariableAttribute)((value is VariableAttribute) ? value : null); if (val == null) { return (cur: 0f, max: 100f); } float item = ((FCurrentValue != null) ? ((float)FCurrentValue.GetValue(val)) : 0f); float num = ((FMax != null) ? ((float)FMax.GetValue(val)) : 100f); return (cur: item, max: (num > 0f) ? num : 100f); } catch { return (cur: 0f, max: 100f); } } private void Awake() { Instance = this; } private void OnDestroy() { RestoreVanillaHUD(); } private void Update() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) Scene activeScene = SceneManager.GetActiveScene(); string name = ((Scene)(ref activeScene)).name; if (name != _lastScene) { _lastScene = name; _hudMenu = null; _vanillaHidden = false; _hudSearchTimer = 0f; LiveSnap = default(HUDSnapshot); } if (!IsEnabled()) { RestoreVanillaHUD(); return; } _hudSearchTimer -= Time.deltaTime; if (_hudSearchTimer <= 0f) { _hudSearchTimer = 3f; if ((Object)(object)_hudMenu == (Object)null) { try { _hudMenu = Object.FindObjectOfType(); } catch { } } } ManageVanillaVisibility(); } private void OnGUI() { //IL_00c2: 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_012a: Unknown result type (might be due to invalid IL or missing references) //IL_015e: 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) if (IsEnabled() && LiveSnap.Valid) { EnsureStyles(); float x = CfgX?.Value ?? 20f; float num = CfgY?.Value ?? 20f; float w = CfgBarW?.Value ?? 220f; float num2 = CfgBarH?.Value ?? 26f; float num3 = CfgGap?.Value ?? 10f; DrawBar(x, num + (num2 + num3) * 0f, w, num2, "HEALTH", LiveSnap.Health, LiveSnap.HealthMax, C_Health); DrawBar(x, num + (num2 + num3) * 1f, w, num2, "WARMTH", LiveSnap.Warmth, LiveSnap.WarmthMax, C_Warmth); DrawBar(x, num + (num2 + num3) * 2f, w, num2, "FOOD", LiveSnap.Food, LiveSnap.FoodMax, C_Food); DrawBar(x, num + (num2 + num3) * 3f, w, num2, "WATER", LiveSnap.Water, LiveSnap.WaterMax, C_Water); DrawBar(x, num + (num2 + num3) * 4f, w, num2, "STAMINA", LiveSnap.Stamina, LiveSnap.StaminaMax, C_Stamina); } } private void ManageVanillaVisibility() { bool flag = CfgHideVanilla?.Value ?? true; if (flag && !_vanillaHidden) { HideVanillaHUD(); } if (!flag && _vanillaHidden) { RestoreVanillaHUD(); } } private void HideVanillaHUD() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown if ((Object)(object)_hudMenu == (Object)null) { return; } try { _hudMenu.SetHudActive(false); _vanillaHidden = true; ManualLogSource loggerInstance = ASKAUIPlugin.LoggerInstance; if (loggerInstance != null) { loggerInstance.LogInfo((object)"[ASKAUI-HUD] Vanilla HUD hidden."); } } catch (Exception ex) { ManualLogSource loggerInstance2 = ASKAUIPlugin.LoggerInstance; if (loggerInstance2 != null) { bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(36, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[ASKAUI-HUD] HideVanillaHUD failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } loggerInstance2.LogWarning(val); } } } public void RestoreVanillaHUD() { if (!_vanillaHidden) { return; } try { if ((Object)(object)_hudMenu == (Object)null) { _hudMenu = Object.FindObjectOfType(); } if ((Object)(object)_hudMenu != (Object)null) { _hudMenu.SetHudActive(true); _vanillaHidden = false; ManualLogSource loggerInstance = ASKAUIPlugin.LoggerInstance; if (loggerInstance != null) { loggerInstance.LogInfo((object)"[ASKAUI-HUD] Vanilla HUD restored."); } } } catch { } } public static bool IsEnabled() { return CfgEnabled?.Value ?? false; } private void EnsureStyles() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) if (!_stylesReady) { _stylesReady = true; _stLabel = new GUIStyle(GUI.skin.label) { fontSize = 14, fontStyle = (FontStyle)1, wordWrap = false, alignment = (TextAnchor)3 }; _stLabel.normal.textColor = C_Text; _stValue = new GUIStyle(GUI.skin.label) { fontSize = 13, wordWrap = false, alignment = (TextAnchor)5 }; _stValue.normal.textColor = C_Muted; } } private void DrawBar(float x, float y, float w, float h, string label, float val, float max, Color fillCol) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) float num = w + 80f; float num2 = ((max > 0f) ? Mathf.Clamp01(val / max) : 0f); FillRect(new Rect(x, y, num, h), C_BgBar); DrawOutline(new Rect(x, y, num, h), C_Border); GUI.Label(new Rect(x + 4f, y, 74f, h), label, _stLabel); float num3 = x + 80f; float num4 = w - 4f; FillRect(new Rect(num3, y + 2f, num4, h - 4f), new Color(0f, 0f, 0f, 0.45f)); if (num2 > 0f) { Color color = GUI.color; GUI.color = ((num2 < 0.2f) ? Color.Lerp(fillCol, Color.white, Mathf.PingPong(Time.time * 2f, 1f) * 0.35f) : fillCol); GUI.DrawTexture(new Rect(num3 + 1f, y + 3f, (num4 - 2f) * num2, h - 6f), (Texture)(object)Texture2D.whiteTexture); GUI.color = color; } string text = ((max > 0f) ? $"{val:F0} / {max:F0}" : "-- / --"); GUI.Label(new Rect(num3, y, num4, h), text, _stValue); } private static void FillRect(Rect r, Color c) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) Color color = GUI.color; GUI.color = c; GUI.DrawTexture(r, (Texture)(object)Texture2D.whiteTexture); GUI.color = color; } private static void DrawOutline(Rect r, Color c) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_00b2: 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) Color color = GUI.color; GUI.color = c; GUI.DrawTexture(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, ((Rect)(ref r)).width, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).yMax - 1f, ((Rect)(ref r)).width, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, 1f, ((Rect)(ref r)).height), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref r)).xMax - 1f, ((Rect)(ref r)).y, 1f, ((Rect)(ref r)).height), (Texture)(object)Texture2D.whiteTexture); GUI.color = color; } } [HarmonyPatch(typeof(PlayerWidget))] internal static class PlayerWidgetPatches { [HarmonyPatch("_OnSetHealth")] [HarmonyPostfix] private static void PostHealth(PlayerWidget __instance) { if (ASKAHUDOverlay.FieldsReady) { (float cur, float max) tuple = ASKAHUDOverlay.ReadAttr(ASKAHUDOverlay.FHealthAttr, __instance); float item = tuple.cur; float item2 = tuple.max; HUDSnapshot liveSnap = ASKAHUDOverlay.LiveSnap; liveSnap.Health = item; liveSnap.HealthMax = item2; liveSnap.Valid = true; ASKAHUDOverlay.LiveSnap = liveSnap; } } [HarmonyPatch("_OnSetWarmth")] [HarmonyPostfix] private static void PostWarmth(PlayerWidget __instance) { if (ASKAHUDOverlay.FieldsReady) { (float cur, float max) tuple = ASKAHUDOverlay.ReadAttr(ASKAHUDOverlay.FWarmthAttr, __instance); float item = tuple.cur; float item2 = tuple.max; HUDSnapshot liveSnap = ASKAHUDOverlay.LiveSnap; liveSnap.Warmth = item; liveSnap.WarmthMax = item2; liveSnap.Valid = true; ASKAHUDOverlay.LiveSnap = liveSnap; } } [HarmonyPatch("_OnSetFood")] [HarmonyPostfix] private static void PostFood(PlayerWidget __instance) { if (ASKAHUDOverlay.FieldsReady) { (float cur, float max) tuple = ASKAHUDOverlay.ReadAttr(ASKAHUDOverlay.FFoodAttr, __instance); float item = tuple.cur; float item2 = tuple.max; HUDSnapshot liveSnap = ASKAHUDOverlay.LiveSnap; liveSnap.Food = item; liveSnap.FoodMax = item2; liveSnap.Valid = true; ASKAHUDOverlay.LiveSnap = liveSnap; } } [HarmonyPatch("_OnSetWater")] [HarmonyPostfix] private static void PostWater(PlayerWidget __instance) { if (ASKAHUDOverlay.FieldsReady) { (float cur, float max) tuple = ASKAHUDOverlay.ReadAttr(ASKAHUDOverlay.FWaterAttr, __instance); float item = tuple.cur; float item2 = tuple.max; HUDSnapshot liveSnap = ASKAHUDOverlay.LiveSnap; liveSnap.Water = item; liveSnap.WaterMax = item2; liveSnap.Valid = true; ASKAHUDOverlay.LiveSnap = liveSnap; } } [HarmonyPatch("_OnSetStamina")] [HarmonyPostfix] private static void PostStamina(PlayerWidget __instance) { if (ASKAHUDOverlay.FieldsReady) { (float cur, float max) tuple = ASKAHUDOverlay.ReadAttr(ASKAHUDOverlay.FStaminaAttr, __instance); float item = tuple.cur; float item2 = tuple.max; HUDSnapshot liveSnap = ASKAHUDOverlay.LiveSnap; liveSnap.Stamina = item; liveSnap.StaminaMax = item2; liveSnap.Valid = true; ASKAHUDOverlay.LiveSnap = liveSnap; } } } [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] public class ASKAUIEntryPointAttribute : Attribute { } public static class AskaUIInGameTab { private static bool _injected; public static void RegisterIl2CppType() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown try { if (!ClassInjector.IsTypeRegisteredInIl2Cpp()) { ClassInjector.RegisterTypeInIl2Cpp(); } } catch (Exception ex) { ManualLogSource loggerInstance = ASKAUIPlugin.LoggerInstance; if (loggerInstance != null) { bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(37, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[ASKAUI] IL2CPP registration failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } loggerInstance.LogError(val); } } } [HarmonyPatch(typeof(SettingsMenu), "Start")] [HarmonyPostfix] public static void Start_Postfix(SettingsMenu __instance) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown if (_injected) { return; } try { _InjectTab(__instance); _injected = true; } catch (Exception ex) { ManualLogSource loggerInstance = ASKAUIPlugin.LoggerInstance; if (loggerInstance != null) { bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(28, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[ASKAUI] Tab inject failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } loggerInstance.LogError(val); } } } private static void _InjectTab(SettingsMenu menu) { //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Expected O, but got Unknown //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0213: 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_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: 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_01da: Unknown result type (might be due to invalid IL or missing references) TabGroupControls mainTabGroup = menu.MainTabGroup; if ((Object)(object)mainTabGroup == (Object)null) { ManualLogSource loggerInstance = ASKAUIPlugin.LoggerInstance; if (loggerInstance != null) { loggerInstance.LogWarning((object)"[ASKAUI] MainTabGroup is null — skipping tab inject."); } return; } if (((TabGroup)mainTabGroup).buttons == null || ((TabGroup)mainTabGroup).buttons.Count == 0) { ManualLogSource loggerInstance2 = ASKAUIPlugin.LoggerInstance; if (loggerInstance2 != null) { loggerInstance2.LogWarning((object)"[ASKAUI] No existing tab buttons to clone — skipping."); } return; } TabButton val = ((TabGroup)mainTabGroup).buttons[0]; GameObject val2 = Object.Instantiate(((Component)val).gameObject, ((Component)val).transform.parent); ((Object)val2).name = "TabBtn_ASKAUI_Mods"; TabButton component = val2.GetComponent(); if ((Object)(object)component == (Object)null) { Object.Destroy((Object)(object)val2); ManualLogSource loggerInstance3 = ASKAUIPlugin.LoggerInstance; if (loggerInstance3 != null) { loggerInstance3.LogError((object)"[ASKAUI] Cloned object has no TabButton component."); } return; } component.order = ((TabGroup)mainTabGroup).buttons.Count + 10; TextMeshProUGUI componentInChildren = val2.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { ((TMP_Text)componentInChildren).text = "MODS"; } Transform val3 = ((Component)menu).transform; if ((Object)(object)val.page != (Object)null) { val3 = ((Component)val.page).transform.parent; } GameObject val4 = new GameObject("TabPage_ASKAUI_Mods"); val4.transform.SetParent(val3, false); RectTransform val5 = val4.AddComponent(); if ((Object)(object)val.page != (Object)null) { RectTransform component2 = ((Component)val.page).GetComponent(); if ((Object)(object)component2 != (Object)null) { val5.anchorMin = component2.anchorMin; val5.anchorMax = component2.anchorMax; val5.offsetMin = component2.offsetMin; val5.offsetMax = component2.offsetMax; val5.anchoredPosition = component2.anchoredPosition; val5.sizeDelta = component2.sizeDelta; } } else { val5.anchorMin = Vector2.zero; val5.anchorMax = Vector2.one; val5.offsetMin = Vector2.zero; val5.offsetMax = Vector2.zero; } AskaUITabPage page = val4.AddComponent(); val4.SetActive(false); component.page = (TabPage)(object)page; component.group = (TabGroup)(object)mainTabGroup; ((TabGroup)mainTabGroup).AddButton(component); mainTabGroup.SortButtons(); ManualLogSource loggerInstance4 = ASKAUIPlugin.LoggerInstance; if (loggerInstance4 != null) { loggerInstance4.LogInfo((object)"[ASKAUI] 'MODS' tab injected successfully."); } } } public static class ASKAUIKit { public const string KitVersion = "1.2.0"; public static readonly Color ColPanel = new Color(0.04f, 0.05f, 0.05f, 0.985f); public static readonly Color ColPanelSoft = new Color(0.1f, 0.11f, 0.1f, 0.96f); public static readonly Color ColHeader = new Color(0.09f, 0.1f, 0.1f, 0.99f); public static readonly Color ColAccent = new Color(0.92f, 0.38f, 0.08f, 1f); public static readonly Color ColAccentDim = new Color(0.23f, 0.24f, 0.24f, 1f); public static readonly Color ColText = new Color(1f, 0.6f, 0.26f, 1f); public static readonly Color ColMuted = new Color(0.7f, 0.68f, 0.64f, 1f); public static readonly Color ColGreen = new Color(0.33f, 0.82f, 0.46f, 1f); public static readonly Color ColRed = new Color(0.84f, 0.32f, 0.26f, 1f); public static readonly Color ColWarning = new Color(0.92f, 0.72f, 0.22f, 1f); public static readonly Color ColInfo = new Color(0.22f, 0.62f, 0.92f, 1f); private static GUIStyle _stRowStyle; private static GUIStyle _stAccentLine; private static GUIStyle _stBadgeAccent; private static GUIStyle _stInfoWarning; private static GUIStyle _stInfoError; private static GUIStyle _stInfoBlue; private static GUIStyle _stSectionTitle; private static GUIStyle _stAccentBar; private static GUIStyle _stCardShadow; private static Texture2D _texPanel; private static Texture2D _texPanelSoft; private static Texture2D _texHeader; private static Texture2D _texAccent; private static Texture2D _texAccentDim; private static Texture2D _texAccentHover; private static Texture2D _texAccentPressed; private static Texture2D _texGreen; private static Texture2D _texRed; private static Texture2D _texWarning; private static Texture2D _texInfo; private static Texture2D _texProgressBg; private static Texture2D _texProgressFill; private static Texture2D _texShadow; public static GUIStyle StLabel { get; private set; } public static GUIStyle StMuted { get; private set; } public static GUIStyle StSection { get; private set; } public static GUIStyle StCard { get; private set; } public static GUIStyle StButton { get; private set; } public static GUIStyle StButtonOn { get; private set; } public static GUIStyle StButtonOff { get; private set; } public static GUIStyle StValue { get; private set; } public static GUIStyle StTab { get; private set; } public static GUIStyle StTabActive { get; private set; } public static GUIStyle StBadge { get; private set; } public static GUIStyle StSmallBtn { get; private set; } public static GUIStyle StProgressBg { get; private set; } public static GUIStyle StProgressFill { get; private set; } public static GUIStyle StSeparator { get; private set; } public static GUIStyle StFooter { get; private set; } public static void EnsureBuilt() { if (StLabel == null) { Build(); } } public static void Reset() { StLabel = null; } private static void Build() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: 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) //IL_0122: 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_0140: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0183: 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_01bf: 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_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Expected O, but got Unknown //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0225: 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_023b: Expected O, but got Unknown //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Expected O, but got Unknown //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Expected O, but got Unknown //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Expected O, but got Unknown //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Expected O, but got Unknown //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Expected O, but got Unknown //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Expected O, but got Unknown //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Expected O, but got Unknown //IL_0329: Expected O, but got Unknown //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Expected O, but got Unknown //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Expected O, but got Unknown //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Expected O, but got Unknown //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_0408: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_044c: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_0462: Expected O, but got Unknown //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a6: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04c2: Unknown result type (might be due to invalid IL or missing references) //IL_04c8: Unknown result type (might be due to invalid IL or missing references) //IL_04d8: Expected O, but got Unknown //IL_04e3: Unknown result type (might be due to invalid IL or missing references) //IL_04e8: Unknown result type (might be due to invalid IL or missing references) //IL_04f1: Unknown result type (might be due to invalid IL or missing references) //IL_04f9: Unknown result type (might be due to invalid IL or missing references) //IL_04ff: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Unknown result type (might be due to invalid IL or missing references) //IL_0523: Unknown result type (might be due to invalid IL or missing references) //IL_0528: Unknown result type (might be due to invalid IL or missing references) //IL_0532: Expected O, but got Unknown //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0544: Expected O, but got Unknown //IL_054f: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_055d: Unknown result type (might be due to invalid IL or missing references) //IL_0565: Unknown result type (might be due to invalid IL or missing references) //IL_0571: Unknown result type (might be due to invalid IL or missing references) //IL_0576: Unknown result type (might be due to invalid IL or missing references) //IL_0580: Expected O, but got Unknown //IL_0581: Unknown result type (might be due to invalid IL or missing references) //IL_0586: Unknown result type (might be due to invalid IL or missing references) //IL_0590: Expected O, but got Unknown //IL_0591: Unknown result type (might be due to invalid IL or missing references) //IL_05a2: Unknown result type (might be due to invalid IL or missing references) //IL_05a8: Unknown result type (might be due to invalid IL or missing references) //IL_05b3: Unknown result type (might be due to invalid IL or missing references) //IL_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_05ca: Unknown result type (might be due to invalid IL or missing references) //IL_05d5: Unknown result type (might be due to invalid IL or missing references) //IL_05e6: Unknown result type (might be due to invalid IL or missing references) //IL_05ec: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Expected O, but got Unknown //IL_0607: Unknown result type (might be due to invalid IL or missing references) //IL_060c: Unknown result type (might be due to invalid IL or missing references) //IL_061d: Unknown result type (might be due to invalid IL or missing references) //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_062c: Expected O, but got Unknown //IL_062d: Unknown result type (might be due to invalid IL or missing references) //IL_0632: Unknown result type (might be due to invalid IL or missing references) //IL_063c: Expected O, but got Unknown //IL_063d: Unknown result type (might be due to invalid IL or missing references) //IL_0642: Unknown result type (might be due to invalid IL or missing references) //IL_064c: Expected O, but got Unknown //IL_064d: Unknown result type (might be due to invalid IL or missing references) //IL_065e: Expected O, but got Unknown //IL_0669: Unknown result type (might be due to invalid IL or missing references) //IL_066e: Unknown result type (might be due to invalid IL or missing references) //IL_067f: Unknown result type (might be due to invalid IL or missing references) //IL_0684: Unknown result type (might be due to invalid IL or missing references) //IL_068e: Expected O, but got Unknown //IL_068f: Unknown result type (might be due to invalid IL or missing references) //IL_0694: Unknown result type (might be due to invalid IL or missing references) //IL_069e: Expected O, but got Unknown //IL_069f: Unknown result type (might be due to invalid IL or missing references) //IL_06a4: Unknown result type (might be due to invalid IL or missing references) //IL_06ae: Expected O, but got Unknown //IL_06af: Unknown result type (might be due to invalid IL or missing references) //IL_06c0: Expected O, but got Unknown //IL_06cb: Unknown result type (might be due to invalid IL or missing references) //IL_06d0: Unknown result type (might be due to invalid IL or missing references) //IL_06e1: Unknown result type (might be due to invalid IL or missing references) //IL_06e6: Unknown result type (might be due to invalid IL or missing references) //IL_06f0: Expected O, but got Unknown //IL_06f1: Unknown result type (might be due to invalid IL or missing references) //IL_06f6: Unknown result type (might be due to invalid IL or missing references) //IL_0700: Expected O, but got Unknown //IL_0701: Unknown result type (might be due to invalid IL or missing references) //IL_0706: Unknown result type (might be due to invalid IL or missing references) //IL_0710: Expected O, but got Unknown //IL_0711: Unknown result type (might be due to invalid IL or missing references) //IL_0722: Expected O, but got Unknown //IL_072d: Unknown result type (might be due to invalid IL or missing references) //IL_0732: Unknown result type (might be due to invalid IL or missing references) //IL_073b: Unknown result type (might be due to invalid IL or missing references) //IL_0743: Unknown result type (might be due to invalid IL or missing references) //IL_075d: Unknown result type (might be due to invalid IL or missing references) //IL_0768: Unknown result type (might be due to invalid IL or missing references) //IL_0770: Unknown result type (might be due to invalid IL or missing references) //IL_0775: Unknown result type (might be due to invalid IL or missing references) //IL_077f: Expected O, but got Unknown //IL_0785: Expected O, but got Unknown //IL_0790: Unknown result type (might be due to invalid IL or missing references) //IL_0795: Unknown result type (might be due to invalid IL or missing references) //IL_07a6: Unknown result type (might be due to invalid IL or missing references) //IL_07ab: Unknown result type (might be due to invalid IL or missing references) //IL_07b5: Expected O, but got Unknown //IL_07b6: Unknown result type (might be due to invalid IL or missing references) //IL_07bb: Unknown result type (might be due to invalid IL or missing references) //IL_07c5: Expected O, but got Unknown //IL_07c6: Unknown result type (might be due to invalid IL or missing references) //IL_07cb: Unknown result type (might be due to invalid IL or missing references) //IL_07d5: Expected O, but got Unknown //IL_07d6: Unknown result type (might be due to invalid IL or missing references) //IL_07e7: Expected O, but got Unknown //IL_07f1: Unknown result type (might be due to invalid IL or missing references) //IL_07f6: Unknown result type (might be due to invalid IL or missing references) //IL_07ff: Unknown result type (might be due to invalid IL or missing references) //IL_0807: Unknown result type (might be due to invalid IL or missing references) //IL_080f: Unknown result type (might be due to invalid IL or missing references) //IL_0815: Unknown result type (might be due to invalid IL or missing references) //IL_0825: Expected O, but got Unknown //IL_082f: Unknown result type (might be due to invalid IL or missing references) //IL_0834: Unknown result type (might be due to invalid IL or missing references) //IL_0845: Unknown result type (might be due to invalid IL or missing references) //IL_084a: Unknown result type (might be due to invalid IL or missing references) //IL_0854: Expected O, but got Unknown //IL_0855: Unknown result type (might be due to invalid IL or missing references) //IL_085a: Unknown result type (might be due to invalid IL or missing references) //IL_0864: Expected O, but got Unknown //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_086a: Unknown result type (might be due to invalid IL or missing references) //IL_0874: Expected O, but got Unknown //IL_0875: Unknown result type (might be due to invalid IL or missing references) //IL_0886: Expected O, but got Unknown //IL_0890: Unknown result type (might be due to invalid IL or missing references) //IL_0895: Unknown result type (might be due to invalid IL or missing references) //IL_08a6: Unknown result type (might be due to invalid IL or missing references) //IL_08ab: Unknown result type (might be due to invalid IL or missing references) //IL_08b5: Expected O, but got Unknown //IL_08b6: Unknown result type (might be due to invalid IL or missing references) //IL_08bb: Unknown result type (might be due to invalid IL or missing references) //IL_08c5: Expected O, but got Unknown //IL_08c6: Unknown result type (might be due to invalid IL or missing references) //IL_08cb: Unknown result type (might be due to invalid IL or missing references) //IL_08d5: Expected O, but got Unknown //IL_08d6: Unknown result type (might be due to invalid IL or missing references) //IL_08e7: Expected O, but got Unknown //IL_08f1: Unknown result type (might be due to invalid IL or missing references) //IL_08f6: Unknown result type (might be due to invalid IL or missing references) //IL_0907: Unknown result type (might be due to invalid IL or missing references) //IL_090d: Unknown result type (might be due to invalid IL or missing references) //IL_0918: Unknown result type (might be due to invalid IL or missing references) //IL_0929: Unknown result type (might be due to invalid IL or missing references) //IL_092f: Unknown result type (might be due to invalid IL or missing references) //IL_093a: Unknown result type (might be due to invalid IL or missing references) //IL_093f: Unknown result type (might be due to invalid IL or missing references) //IL_0949: Expected O, but got Unknown //IL_094a: Unknown result type (might be due to invalid IL or missing references) //IL_094f: Unknown result type (might be due to invalid IL or missing references) //IL_0959: Expected O, but got Unknown //IL_095a: Unknown result type (might be due to invalid IL or missing references) //IL_0961: Unknown result type (might be due to invalid IL or missing references) //IL_096b: Expected O, but got Unknown //IL_0971: Expected O, but got Unknown //IL_0976: Unknown result type (might be due to invalid IL or missing references) //IL_097b: Unknown result type (might be due to invalid IL or missing references) //IL_098c: Unknown result type (might be due to invalid IL or missing references) //IL_0992: Unknown result type (might be due to invalid IL or missing references) //IL_09a2: Expected O, but got Unknown //IL_09b6: Unknown result type (might be due to invalid IL or missing references) //IL_09d9: Unknown result type (might be due to invalid IL or missing references) //IL_09fc: Unknown result type (might be due to invalid IL or missing references) _texPanel = MakeGradientV(32, new Color(0.06f, 0.07f, 0.07f, 0.985f), new Color(0.04f, 0.05f, 0.05f, 0.985f)); _texPanelSoft = MakeGradientV(32, new Color(0.13f, 0.14f, 0.13f, 0.96f), new Color(0.1f, 0.11f, 0.1f, 0.96f)); _texHeader = MakeGradientH(128, new Color(0.15f, 0.08f, 0.04f, 0.99f), new Color(0.09f, 0.1f, 0.1f, 0.99f)); _texAccent = MakeTex(ColAccent); _texAccentDim = MakeTex(ColAccentDim); _texAccentHover = MakeTex(new Color(0.96f, 0.48f, 0.12f, 1f)); _texAccentPressed = MakeTex(new Color(0.7f, 0.25f, 0.05f, 1f)); _texGreen = MakeTex(ColGreen); _texRed = MakeTex(ColRed); _texWarning = MakeTex(ColWarning); _texInfo = MakeTex(ColInfo); _texProgressBg = MakeTex(new Color(0.12f, 0.13f, 0.13f, 0.96f)); _texProgressFill = MakeGradientH(64, ColAccent, new Color(0.98f, 0.55f, 0.18f, 1f)); _texShadow = MakeTex(new Color(0f, 0f, 0f, 0.15f)); GUIStyle val = new GUIStyle(GUI.skin.label) { fontSize = 18, fontStyle = (FontStyle)1 }; val.normal.textColor = ColText; StLabel = val; GUIStyle val2 = new GUIStyle(GUI.skin.label) { fontSize = 15, wordWrap = true }; val2.normal.textColor = ColMuted; StMuted = val2; GUIStyle val3 = new GUIStyle(GUI.skin.box); val3.normal.background = _texHeader; val3.normal.textColor = ColText; val3.border = new RectOffset(0, 0, 0, 0); val3.padding = new RectOffset(14, 14, 8, 8); val3.margin = new RectOffset(0, 0, 0, 8); val3.fontSize = 18; val3.fontStyle = (FontStyle)1; val3.alignment = (TextAnchor)3; StSection = val3; GUIStyle val4 = new GUIStyle(GUI.skin.box); val4.normal.background = _texPanel; val4.normal.textColor = ColText; val4.border = new RectOffset(0, 0, 0, 0); val4.padding = new RectOffset(14, 14, 12, 12); val4.margin = new RectOffset(0, 0, 0, 10); StCard = val4; StButton = MakeBtn(_texAccentDim, ColText); StButtonOn = MakeBtn(_texAccent, ColPanel); StButtonOff = MakeBtn(_texAccentDim, ColRed); GUIStyle val5 = new GUIStyle(GUI.skin.label) { fontSize = 16, fontStyle = (FontStyle)1, alignment = (TextAnchor)5 }; val5.normal.textColor = ColAccent; StValue = val5; GUIStyle val6 = new GUIStyle(GUI.skin.button) { fontSize = 17, fontStyle = (FontStyle)1, fixedHeight = 46f, margin = new RectOffset(0, 10, 0, 0), padding = new RectOffset(12, 12, 8, 8) }; val6.normal.background = _texPanelSoft; val6.normal.textColor = ColMuted; val6.hover.background = _texAccentDim; val6.hover.textColor = ColText; val6.active.background = _texAccent; val6.active.textColor = ColPanel; StTab = val6; GUIStyle val7 = new GUIStyle(StTab); val7.normal.background = _texAccent; val7.normal.textColor = ColPanel; val7.hover.background = _texAccent; val7.hover.textColor = ColPanel; val7.active.background = _texAccent; val7.active.textColor = ColPanel; StTabActive = val7; GUIStyle val8 = new GUIStyle(GUI.skin.label) { fontSize = 12, fontStyle = (FontStyle)1 }; val8.normal.textColor = ColPanel; val8.normal.background = _texAccent; val8.alignment = (TextAnchor)4; val8.padding = new RectOffset(6, 6, 1, 1); val8.fixedHeight = 20f; StBadge = val8; GUIStyle val9 = new GUIStyle(GUI.skin.button) { fontSize = 13, fontStyle = (FontStyle)1, fixedHeight = 28f, margin = new RectOffset(0, 6, 0, 0), padding = new RectOffset(8, 8, 4, 4) }; val9.normal.background = _texAccentDim; val9.normal.textColor = ColText; val9.hover.background = _texAccent; val9.hover.textColor = ColPanel; val9.active.background = _texAccent; val9.active.textColor = ColPanel; StSmallBtn = val9; GUIStyle val10 = new GUIStyle(GUI.skin.box); val10.normal.background = _texProgressBg; val10.border = new RectOffset(0, 0, 0, 0); val10.margin = new RectOffset(0, 0, 0, 0); val10.padding = new RectOffset(0, 0, 0, 0); val10.fixedHeight = 22f; StProgressBg = val10; GUIStyle val11 = new GUIStyle(GUI.skin.box); val11.normal.background = _texProgressFill; val11.border = new RectOffset(0, 0, 0, 0); val11.margin = new RectOffset(0, 0, 0, 0); val11.padding = new RectOffset(0, 0, 0, 0); val11.fixedHeight = 22f; StProgressFill = val11; GUIStyle val12 = new GUIStyle(GUI.skin.box); val12.normal.background = _texAccentDim; val12.border = new RectOffset(0, 0, 0, 0); val12.margin = new RectOffset(0, 0, 6, 6); val12.padding = new RectOffset(0, 0, 0, 0); val12.fixedHeight = 1f; StSeparator = val12; GUIStyle val13 = new GUIStyle(GUI.skin.label) { fontSize = 13, fontStyle = (FontStyle)2 }; val13.normal.textColor = new Color(0.94f, 0.72f, 0.52f, 0.45f); val13.alignment = (TextAnchor)4; val13.padding = new RectOffset(0, 0, 8, 4); StFooter = val13; GUIStyle val14 = new GUIStyle(GUI.skin.box); val14.normal.background = _texAccent; val14.border = new RectOffset(0, 0, 0, 0); val14.margin = new RectOffset(0, 0, 0, 0); val14.padding = new RectOffset(0, 0, 0, 0); val14.fixedHeight = 2f; _stAccentLine = val14; GUIStyle val15 = new GUIStyle(GUI.skin.label) { fontSize = 18, fontStyle = (FontStyle)1, alignment = (TextAnchor)3 }; val15.normal.textColor = ColText; _stSectionTitle = val15; GUIStyle val16 = new GUIStyle(GUI.skin.box); val16.normal.background = _texAccent; val16.border = new RectOffset(0, 0, 0, 0); val16.margin = new RectOffset(0, 0, 0, 0); val16.padding = new RectOffset(0, 0, 0, 0); val16.fixedWidth = 3f; _stAccentBar = val16; GUIStyle val17 = new GUIStyle(GUI.skin.box); val17.normal.background = _texShadow; val17.border = new RectOffset(0, 0, 0, 0); val17.margin = new RectOffset(0, 0, 0, 0); val17.padding = new RectOffset(0, 0, 0, 0); val17.fixedHeight = 1f; _stCardShadow = val17; GUIStyle val18 = new GUIStyle(GUI.skin.box); val18.normal.background = _texPanelSoft; val18.normal.textColor = ColText; val18.hover.background = _texAccentDim; val18.hover.textColor = ColText; val18.border = new RectOffset(0, 0, 0, 0); val18.margin = new RectOffset(0, 0, 0, 6); val18.padding = new RectOffset(12, 12, 8, 8); _stRowStyle = val18; GUIStyle val19 = new GUIStyle(StBadge); val19.normal.background = _texAccent; val19.normal.textColor = Color.white; _stBadgeAccent = val19; _stInfoWarning = MakeInfoBox(new Color(0.92f, 0.72f, 0.22f, 0.15f)); _stInfoError = MakeInfoBox(new Color(0.84f, 0.32f, 0.26f, 0.15f)); _stInfoBlue = MakeInfoBox(new Color(0.22f, 0.62f, 0.92f, 0.12f)); } public static void DrawSectionHeader(string title, string desc = null) { GUILayout.BeginHorizontal(StSection, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(44f) }); GUILayout.Box("", _stAccentBar, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(3f), GUILayout.ExpandHeight(true) }); GUILayout.Label(title, _stSectionTitle, (Il2CppReferenceArray)null); GUILayout.EndHorizontal(); GUILayout.Box("", _stAccentLine, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); if (!string.IsNullOrWhiteSpace(desc)) { GUILayout.Label(desc, StMuted, (Il2CppReferenceArray)null); GUILayout.Space(4f); } } public static void BeginCard() { GUILayout.BeginVertical(StCard, (Il2CppReferenceArray)null); } public static void EndCard() { GUILayout.EndVertical(); GUILayout.Box("", _stCardShadow, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); GUILayout.Box("", _stAccentLine, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); } public static bool DrawBoolRow(string label, bool current, string hint = null) { GUILayout.BeginVertical(_stRowStyle, (Il2CppReferenceArray)null); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label(label, StLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(540f) }); GUILayout.FlexibleSpace(); GUILayout.Label(current ? "ON" : "OFF", StValue, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(52f) }); bool flag = GUILayout.Button("OFF", current ? StButton : StButtonOff, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(88f) }); bool flag2 = GUILayout.Button("ON", current ? StButtonOn : StButton, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(88f) }); GUILayout.EndHorizontal(); if (!string.IsNullOrWhiteSpace(hint)) { GUILayout.Label(hint, StMuted, (Il2CppReferenceArray)null); } GUILayout.EndVertical(); if (flag) { return false; } if (flag2) { return true; } return current; } public static float DrawFloatRow(string label, float current, float min, float max, string suffix = "", float step = 1f) { GUILayout.BeginVertical(_stRowStyle, (Il2CppReferenceArray)null); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label(label, StLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(540f) }); GUILayout.FlexibleSpace(); if (GUILayout.Button($"-{step}", StButton, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(72f) })) { current = Mathf.Clamp(current - step, min, max); } GUILayout.Label(current.ToString("F1") + suffix, StValue, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) }); if (GUILayout.Button($"+{step}", StButtonOn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(72f) })) { current = Mathf.Clamp(current + step, min, max); } GUILayout.EndHorizontal(); GUILayout.Label($"Range: {min:F0}–{max:F0}{suffix}", StMuted, (Il2CppReferenceArray)null); GUILayout.EndVertical(); return current; } public static int DrawIntRow(string label, int current, int min, int max, string suffix = "") { GUILayout.BeginVertical(_stRowStyle, (Il2CppReferenceArray)null); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label(label, StLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(540f) }); GUILayout.FlexibleSpace(); if (GUILayout.Button("-1", StButton, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(72f) })) { current = Mathf.Clamp(current - 1, min, max); } GUILayout.Label(current + suffix, StValue, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) }); if (GUILayout.Button("+1", StButtonOn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(72f) })) { current = Mathf.Clamp(current + 1, min, max); } GUILayout.EndHorizontal(); GUILayout.Label($"Range: {min}–{max}{suffix}", StMuted, (Il2CppReferenceArray)null); GUILayout.EndVertical(); return current; } public static bool DrawButton(string label, float width = 180f) { return GUILayout.Button(label, StButton, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(width) }); } public static bool DrawButtonGreen(string label, float width = 180f) { return GUILayout.Button(label, StButtonOn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(width) }); } public static bool DrawButtonRed(string label, float width = 180f) { return GUILayout.Button(label, StButtonOff, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(width) }); } public static bool DrawSmallButton(string label, float width = 100f) { return GUILayout.Button(label, StSmallBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(width) }); } public static void DrawStatRow(string label, string value) { GUILayout.BeginHorizontal(_stRowStyle, (Il2CppReferenceArray)null); GUILayout.Label(label, StLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(540f) }); GUILayout.FlexibleSpace(); GUILayout.Label(value, StValue, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(300f) }); GUILayout.EndHorizontal(); } public static void DrawHeaderWithBadge(string title, string badge, Color badgeColor) { GUILayout.BeginHorizontal(StSection, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(44f) }); GUILayout.Box("", _stAccentBar, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(3f), GUILayout.ExpandHeight(true) }); GUILayout.Label(title, _stSectionTitle, (Il2CppReferenceArray)null); GUILayout.FlexibleSpace(); GUILayout.Label(badge, _stBadgeAccent, (Il2CppReferenceArray)null); GUILayout.EndHorizontal(); GUILayout.Space(4f); } public static void DrawBadge(string text, Color color) { GUILayout.Label(text, _stBadgeAccent, (Il2CppReferenceArray)null); } public static void DrawSeparator() { GUILayout.Box("", StSeparator, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); } public static void DrawFooter(string text) { GUILayout.FlexibleSpace(); GUILayout.Label(text, StFooter, (Il2CppReferenceArray)null); } public static void DrawProgressBar(string label, float current, float max) { //IL_00f1: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) GUILayout.BeginVertical(_stRowStyle, (Il2CppReferenceArray)null); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label(label, StLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(400f) }); GUILayout.FlexibleSpace(); float num = ((max > 0f) ? Mathf.Clamp01(current / max) : 0f); GUILayout.Label($"{current:F0} / {max:F0} ({num * 100f:F0}%)", StValue, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(300f) }); GUILayout.EndHorizontal(); GUILayout.Space(4f); Rect rect = GUILayoutUtility.GetRect(200f, 22f); GUI.Box(rect, "", StProgressBg); if (num > 0f) { Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref rect)).x + 2f, ((Rect)(ref rect)).y + 2f, (((Rect)(ref rect)).width - 4f) * num, ((Rect)(ref rect)).height - 4f); GUI.Box(val, "", StProgressFill); } GUILayout.EndVertical(); } public static bool DrawToggleRow(string label, bool current) { GUILayout.BeginVertical(_stRowStyle, (Il2CppReferenceArray)null); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label(label, StLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(540f) }); GUILayout.FlexibleSpace(); current = GUILayout.Toggle(current, current ? "ON" : "OFF", current ? StButtonOn : StButtonOff, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) }); GUILayout.EndHorizontal(); GUILayout.EndVertical(); return current; } public static string DrawTextInputRow(string label, string current) { GUILayout.BeginVertical(_stRowStyle, (Il2CppReferenceArray)null); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label(label, StLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(300f) }); GUI.SetNextControlName("ASKAUI_TxtInput"); string result = GUILayout.TextField(current ?? "", 200, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(400f), GUILayout.Height(32f) }); GUILayout.EndHorizontal(); GUILayout.EndVertical(); return result; } public static void DrawInfoBox(string message, Color bgColor) { GUILayout.Box(message, _stInfoBlue, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); } public static void DrawWarningBox(string message) { GUILayout.Box(message, _stInfoWarning, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); } public static void DrawErrorBox(string message) { GUILayout.Box(message, _stInfoError, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); } public static void DrawInfoBox(string message) { GUILayout.Box(message, _stInfoBlue, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); } private static GUIStyle MakeInfoBox(Color bgColor) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown GUIStyle val = new GUIStyle(GUI.skin.box); val.normal.background = MakeTex(bgColor); val.normal.textColor = ColText; val.border = new RectOffset(0, 0, 0, 0); val.padding = new RectOffset(14, 14, 10, 10); val.margin = new RectOffset(0, 0, 0, 10); val.fontSize = 15; val.wordWrap = true; return val; } private static GUIStyle MakeBtn(Texture2D bg, Color text) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_003c: 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_004d: Expected O, but got Unknown //IL_004e: 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_0061: 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_0079: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown GUIStyle val = new GUIStyle(GUI.skin.button) { fontSize = 14, fontStyle = (FontStyle)1, fixedHeight = 36f, margin = new RectOffset(0, 8, 0, 0), padding = new RectOffset(10, 10, 6, 6) }; val.normal.background = bg; val.normal.textColor = text; val.hover.background = _texAccentHover; val.hover.textColor = text; val.active.background = _texAccentPressed; val.active.textColor = text; return val; } private static Texture2D MakeTex(Color color) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Expected O, but got Unknown //IL_000c: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(1, 1); val.SetPixel(0, 0, color); val.Apply(); return val; } private static Texture2D MakeGradientH(int width, Color left, Color right) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Expected O, but got Unknown //IL_0021: 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_0024: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(width, 1); ((Texture)val).wrapMode = (TextureWrapMode)1; for (int i = 0; i < width; i++) { float num = (float)i / (float)(width - 1); val.SetPixel(i, 0, Color.Lerp(left, right, num)); } val.Apply(); return val; } private static Texture2D MakeGradientV(int height, Color top, Color bottom) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Expected O, but got Unknown //IL_0021: 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_0024: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(1, height); ((Texture)val).wrapMode = (TextureWrapMode)1; for (int i = 0; i < height; i++) { float num = (float)i / (float)(height - 1); val.SetPixel(0, i, Color.Lerp(top, bottom, num)); } val.Apply(); return val; } } public class ASKAUIModInfo { public string Name { get; } public string Category { get; } public Action Draw { get; } public ASKAUIModInfo(string name, Action draw, string category = "General") { Name = name; Draw = draw; Category = category; } } public static class ASKAUIModRegistry { internal static readonly ManualLogSource Logger = Logger.CreateLogSource("AskaUI"); private static readonly List _mods = new List(); private static readonly Dictionary> _configs = new Dictionary>(); public static IReadOnlyList<(string Name, Action Draw)> Panels { get { List<(string, Action)> list = new List<(string, Action)>(); foreach (ASKAUIModInfo mod in _mods) { list.Add((mod.Name, mod.Draw)); } return list; } } public static IReadOnlyList Mods => _mods; public static IReadOnlyDictionary> RegisteredConfigs => _configs; public static void RegisterPanel(string name, Action drawCallback) { RegisterPanel(name, drawCallback, "General"); } public static void RegisterPanel(string name, Action drawCallback, string category) { //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown if (string.IsNullOrWhiteSpace(name) || drawCallback == null) { return; } bool flag = default(bool); BepInExDebugLogInterpolatedStringHandler val; for (int i = 0; i < _mods.Count; i++) { if (string.Equals(_mods[i].Name, name, StringComparison.OrdinalIgnoreCase)) { _mods[i] = new ASKAUIModInfo(name, drawCallback, category); val = new BepInExDebugLogInterpolatedStringHandler(45, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[ASKAUI] Panel '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("' re-registered (category: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(category); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")."); } Logger.LogDebug(val); return; } } _mods.Add(new ASKAUIModInfo(name, drawCallback, category)); val = new BepInExDebugLogInterpolatedStringHandler(42, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[ASKAUI] Panel '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(name); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("' registered (category: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(category); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")."); } Logger.LogDebug(val); } public static void UnregisterPanel(string name) { _mods.RemoveAll((ASKAUIModInfo m) => string.Equals(m.Name, name, StringComparison.OrdinalIgnoreCase)); } public static void RegisterConfig(string modName, ConfigEntryBase entry) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown if (!_configs.ContainsKey(modName)) { _configs[modName] = new List(); } _configs[modName].Add(entry); bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(33, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[ASKAUI] Config registered for "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(modName); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(entry.Definition.Key); } Logger.LogInfo(val); } } public class ASKAUIOverlay : MonoBehaviour { private const float SidebarW = 300f; private const float HeaderH = 80f; private const float FooterH = 36f; private const float TabH = 52f; private const float CatLabelH = 30f; private const float SearchH = 40f; private static readonly Color C_Bg = new Color(0.06f, 0.07f, 0.07f, 0.97f); private static readonly Color C_Sidebar = new Color(0.04f, 0.045f, 0.045f, 1f); private static readonly Color C_Header = new Color(0.05f, 0.06f, 0.06f, 1f); private static readonly Color C_Content = new Color(0.07f, 0.08f, 0.08f, 1f); private static readonly Color C_Divider = new Color(0.18f, 0.19f, 0.19f, 1f); private static readonly Color C_Accent = new Color(0.92f, 0.38f, 0.08f, 1f); private static readonly Color C_AccentDim = new Color(0.22f, 0.23f, 0.23f, 1f); private static readonly Color C_TabHover = new Color(0.14f, 0.15f, 0.15f, 1f); private static readonly Color C_TabActive = new Color(0.92f, 0.38f, 0.08f, 1f); private static readonly Color C_CatLabel = new Color(0.3f, 0.31f, 0.31f, 1f); private static readonly Color C_Text = new Color(1f, 0.6f, 0.26f, 1f); private static readonly Color C_TextMuted = new Color(0.7f, 0.65f, 0.58f, 1f); private static readonly Color C_TextDim = new Color(0.5f, 0.48f, 0.44f, 1f); private static readonly Color C_Green = new Color(0.33f, 0.82f, 0.46f, 1f); private static readonly Color C_SearchBg = new Color(0.11f, 0.12f, 0.12f, 1f); private static readonly Color C_ScrollThumb = new Color(0.25f, 0.26f, 0.26f, 1f); private bool _visible; private int _activeTab; private Vector2 _contentScroll; private Vector2 _sidebarScroll; private string _searchText = ""; private bool _searchFocused; private List _filteredIndices = new List(); private List _allIndices = new List(); private int _lastModCount; private int _probeIndex; private bool _savedCursor; private CursorLockMode _savedLock; private GameObject _blockerRoot; private readonly List _suppressed = new List(); private Texture2D _tBg; private Texture2D _tSidebar; private Texture2D _tHeader; private Texture2D _tContent; private Texture2D _tAccent; private Texture2D _tAccentDim; private Texture2D _tTabHover; private Texture2D _tTabActive; private Texture2D _tCatLabel; private Texture2D _tDivider; private Texture2D _tSearchBg; private Texture2D _tScrollThumb; private GUIStyle _stTitle; private GUIStyle _stSubtitle; private GUIStyle _stWatermark; private GUIStyle _stTabNormal; private GUIStyle _stTabActive; private GUIStyle _stCatLabel; private GUIStyle _stLabel; private GUIStyle _stMuted; private GUIStyle _stDim; private GUIStyle _stContentTitle; private GUIStyle _stSearch; private GUIStyle _stSearchPlaceholder; private GUIStyle _stNoMods; private GUIStyle _stModCount; private GUIStyle _stCloseBtn; private GUIStyle _stFooter; private bool _stylesBuilt; private bool _pendingFirstRunJump; private float _firstRunPromptTimer; private const float FirstRunPromptDelaySeconds = 5f; private const int HubWindowId = 1095977813; private const float TitleBarH = 56f; private static ManualLogSource Log => ASKAUIModRegistry.Logger; public ASKAUIOverlay(IntPtr ptr) : base(ptr) { } private void Awake() { CreateBlocker(); LoadPrefs(); BuildFilteredList(); Log.LogInfo((object)"[ASKAUI] Overlay ready. Press HOME to open."); } private void Start() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown ASKAUIPlugin.RunAutoDiscovery(); BuildFilteredList(); ManualLogSource log = Log; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(50, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[ASKAUI] Auto-discovery complete. "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ASKAUIModRegistry.Mods.Count); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" panel(s) found."); } log.LogInfo(val); MaybeShowFirstRunKeybindPrompt(); } private void MaybeShowFirstRunKeybindPrompt() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown try { if (ToggleKeybind.CfgHasSeenPrompt != null && !ToggleKeybind.CfgHasSeenPrompt.Value) { ToggleKeybind.CfgHasSeenPrompt.Value = true; _pendingFirstRunJump = true; } } catch (Exception ex) { ManualLogSource log = Log; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(47, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[ASKAUI] First-run keybind prompt flag failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogWarning(val); } } private void OnDestroy() { if ((Object)(object)_blockerRoot != (Object)null) { Object.Destroy((Object)(object)_blockerRoot); } SavePrefs(); } private void Update() { //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) PerformanceMonitor.Update(); if (ToggleKeybind.IsCapturing) { ToggleKeybind.PumpCapture(); return; } if (ToggleKeybind.WasTriggeredThisFrame()) { SetVisible(!_visible); } if (_pendingFirstRunJump && !_visible) { _firstRunPromptTimer += Time.unscaledDeltaTime; if (_firstRunPromptTimer >= 5f) { SetVisible(show: true); } } if (!_visible) { return; } if (Input.GetKeyDown((KeyCode)27)) { SetVisible(show: false); return; } IReadOnlyList mods = ASKAUIModRegistry.Mods; if (mods.Count <= 0 || Keyboard.current == null) { return; } if (mods.Count != _lastModCount) { _lastModCount = mods.Count; _allIndices.Clear(); for (int i = 0; i < mods.Count; i++) { _allIndices.Add(i); } } List list = ((_filteredIndices.Count > 0) ? _filteredIndices : _allIndices); if (list.Count > 0) { int num = list.IndexOf(_activeTab); if (((ButtonControl)Keyboard.current.leftArrowKey).wasPressedThisFrame) { num = (num - 1 + list.Count) % list.Count; _activeTab = list[num]; _contentScroll = Vector2.zero; } if (((ButtonControl)Keyboard.current.rightArrowKey).wasPressedThisFrame) { num = (num + 1) % list.Count; _activeTab = list[num]; _contentScroll = Vector2.zero; } } } private void LateUpdate() { if (_visible) { Cursor.visible = true; Cursor.lockState = (CursorLockMode)0; SuppressInput(); } } private void OnGUI() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) if (_visible) { EnsureStyles(); GUI.depth = -1000; GUI.ModalWindow(1095977813, new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), WindowFunction.op_Implicit((Action)DrawHub), GUIContent.none, GUIStyle.none); } } private void DrawHub(int id) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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_0077: 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_0087: Unknown result type (might be due to invalid IL or missing references) float num = Screen.width; float num2 = Screen.height; DrawRect(new Rect(0f, 0f, num, num2), new Color(0f, 0f, 0f, 0.55f)); float num3 = 24f; Rect val = default(Rect); ((Rect)(ref val))..ctor(num3, num3, num - num3 * 2f, num2 - num3 * 2f); DrawRect(val, C_Bg); DrawHeader(val); DrawSidebar(val); DrawContentPane(val); DrawFooter(val); ProbeMods(); } private void ProbeMods() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Invalid comparison between Unknown and I4 //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Invalid comparison between Unknown and I4 //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Invalid comparison between Unknown and I4 EventType type = Event.current.type; if ((int)type != 8 && (int)type != 7) { return; } IReadOnlyList mods = ASKAUIModRegistry.Mods; if (mods == null || mods.Count == 0) { return; } if (_probeIndex >= mods.Count) { _probeIndex = 0; } if (_probeIndex == _activeTab) { if ((int)type == 7) { _probeIndex = (_probeIndex + 1) % mods.Count; } return; } ASKAUIModInfo aSKAUIModInfo = mods[_probeIndex]; GUILayout.BeginArea(new Rect(-100000f, -100000f, 99990f, 99990f)); Stopwatch stopwatch = Stopwatch.StartNew(); try { aSKAUIModInfo.Draw?.Invoke(); } catch { } finally { stopwatch.Stop(); PerformanceMonitor.RecordModDraw(aSKAUIModInfo.Name, stopwatch.Elapsed.TotalMilliseconds); } GUILayout.EndArea(); if ((int)type == 7) { _probeIndex = (_probeIndex + 1) % mods.Count; } } private void DrawHeader(Rect hub) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_005b: 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0112: 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_0182: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Expected O, but got Unknown //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) Rect r = default(Rect); ((Rect)(ref r))..ctor(((Rect)(ref hub)).x, ((Rect)(ref hub)).y, ((Rect)(ref hub)).width, 80f); DrawRect(r, C_Header); DrawRect(new Rect(((Rect)(ref hub)).x, ((Rect)(ref hub)).y + 80f - 2f, ((Rect)(ref hub)).width, 2f), C_Accent); float x = ((Rect)(ref hub)).x; float xMax = ((Rect)(ref hub)).xMax; GUI.Label(new Rect(x + 20f, ((Rect)(ref hub)).y + 8f, 500f, 38f), "ASKA MOD HUB", _stTitle); Rect val = default(Rect); ((Rect)(ref val))..ctor(xMax - 16f - 28f, ((Rect)(ref hub)).y + 8f, 28f, 28f); GUI.color = (Color)(((Rect)(ref val)).Contains(Event.current.mousePosition) ? new Color(0.9f, 0.3f, 0.2f, 1f) : C_TextMuted); if (GUI.Button(val, "✕", _stCloseBtn)) { SetVisible(show: false); } GUI.color = Color.white; float num = xMax - 20f - 28f - 12f - 220f; if (num > x + 540f) { GUI.Label(new Rect(num, ((Rect)(ref hub)).y + 12f, 220f, 22f), "DEATH // DEATHPHANTOMG49", _stWatermark); } int count = ASKAUIModRegistry.Mods.Count; string text = $" {count} mod{((count != 1) ? "s" : "")} loaded "; Vector2 val2 = _stModCount.CalcSize(new GUIContent(text)); float num2 = ((Rect)(ref hub)).y + 54f; DrawRect(new Rect(x + 22f, num2, val2.x, 18f), C_Accent); GUI.Label(new Rect(x + 22f, num2, val2.x, 18f), text, _stModCount); GUI.Label(new Rect(x + 26f + val2.x, num2, xMax - (x + 26f + val2.x) - 16f, 18f), ToggleKeybind.CurrentComboDisplay + " / ESC to close · ← → navigate tabs", _stSubtitle); } private void DrawSidebar(Rect hub) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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_0091: 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_00d1: 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_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Invalid comparison between Unknown and I4 //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Invalid comparison between Unknown and I4 //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Invalid comparison between Unknown and I4 //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Invalid comparison between Unknown and I4 //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Invalid comparison between Unknown and I4 //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: 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_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Unknown result type (might be due to invalid IL or missing references) //IL_0709: Unknown result type (might be due to invalid IL or missing references) //IL_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05a0: Unknown result type (might be due to invalid IL or missing references) //IL_05a5: Unknown result type (might be due to invalid IL or missing references) //IL_05c2: Unknown result type (might be due to invalid IL or missing references) //IL_05c7: Unknown result type (might be due to invalid IL or missing references) //IL_0623: Unknown result type (might be due to invalid IL or missing references) //IL_05ee: Unknown result type (might be due to invalid IL or missing references) //IL_05f0: Unknown result type (might be due to invalid IL or missing references) //IL_0647: Unknown result type (might be due to invalid IL or missing references) //IL_0661: Unknown result type (might be due to invalid IL or missing references) //IL_067e: Unknown result type (might be due to invalid IL or missing references) //IL_0683: Unknown result type (might be due to invalid IL or missing references) float num = ((Rect)(ref hub)).y + 80f; float num2 = ((Rect)(ref hub)).height - 80f - 36f; Rect r = default(Rect); ((Rect)(ref r))..ctor(((Rect)(ref hub)).x, num, 300f, num2); DrawRect(r, C_Sidebar); DrawRect(new Rect(((Rect)(ref r)).xMax - 1f, num, 1f, num2), C_Divider); Rect r2 = default(Rect); ((Rect)(ref r2))..ctor(((Rect)(ref r)).x + 10f, num + 10f, 280f, 40f); DrawRect(r2, C_SearchBg); DrawRect(new Rect(((Rect)(ref r2)).x, ((Rect)(ref r2)).yMax - 1f, ((Rect)(ref r2)).width, 1f), _searchFocused ? C_Accent : C_Divider); string searchText = _searchText; bool flag = string.IsNullOrEmpty(_searchText); string text = ((!flag) ? (_searchText + ((_searchFocused && Mathf.FloorToInt(Time.time * 2f) % 2 == 0) ? "|" : "")) : (_searchFocused ? "|" : " \ud83d\udd0d Search mods…")); GUI.Label(new Rect(((Rect)(ref r2)).x + 8f, ((Rect)(ref r2)).y + 5f, ((Rect)(ref r2)).width - 16f, 22f), text, (flag && !_searchFocused) ? _stSearchPlaceholder : _stSearch); if ((int)Event.current.type == 0) { _searchFocused = ((Rect)(ref r2)).Contains(Event.current.mousePosition); if (_searchFocused) { Event.current.Use(); } } if (_searchFocused && (int)Event.current.type == 4) { char character = Event.current.character; bool flag2 = false; if ((character == '\b' || (int)Event.current.keyCode == 8) && _searchText.Length > 0) { string searchText2 = _searchText; _searchText = searchText2.Substring(0, searchText2.Length - 1); flag2 = true; } else if ((int)Event.current.keyCode == 127) { _searchText = ""; flag2 = true; } else if (character >= ' ') { _searchText += character; flag2 = true; } else if ((int)Event.current.keyCode == 27) { _searchText = ""; _searchFocused = false; flag2 = true; } if (flag2) { Event.current.Use(); } } if (_searchText != searchText) { BuildFilteredList(); } IReadOnlyList mods = ASKAUIModRegistry.Mods; List list = ((_filteredIndices.Count > 0) ? _filteredIndices : Enumerable.Range(0, mods.Count).ToList()); float num3 = ((Rect)(ref r2)).yMax + 8f; float num4 = num2 - 40f - 28f; Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref r)).x, num3, 299f, num4); Dictionary> dictionary = new Dictionary>(StringComparer.OrdinalIgnoreCase); List list2 = new List(); foreach (int item in list) { string text2 = mods[item].Category ?? "General"; if (!dictionary.ContainsKey(text2)) { dictionary[text2] = new List(); list2.Add(text2); } dictionary[text2].Add(item); } float num5 = 0f; foreach (string item2 in list2) { num5 += 30f + (float)dictionary[item2].Count * 52f + 4f; } if (!list.Contains(_activeTab) && list.Count > 0) { _activeTab = list[0]; } _sidebarScroll = GUI.BeginScrollView(val, _sidebarScroll, new Rect(0f, 0f, 280f, Mathf.Max(num5, num4)), false, false); float num6 = 0f; Rect r3 = default(Rect); foreach (string item3 in list2) { DrawRect(new Rect(0f, num6, 280f, 30f), C_CatLabel); GUI.Label(new Rect(12f, num6 + 3f, 270f, 26f), item3.ToUpperInvariant(), _stCatLabel); num6 += 30f; foreach (int item4 in dictionary[item3]) { bool flag3 = item4 == _activeTab; ((Rect)(ref r3))..ctor(0f, num6, 280f, 52f); if (flag3) { DrawRect(new Rect(0f, num6, 4f, 52f), C_Accent); DrawRect(new Rect(4f, num6, 276f, 52f), C_AccentDim); } else if (((Rect)(ref r3)).Contains(Event.current.mousePosition)) { DrawRect(r3, C_TabHover); } string name = mods[item4].Name; GUI.Label(new Rect(14f, num6 + 4f, 270f, 44f), name, flag3 ? _stTabActive : _stTabNormal); if ((int)Event.current.type == 0 && Event.current.button == 0 && ((Rect)(ref r3)).Contains(Event.current.mousePosition)) { _activeTab = item4; _contentScroll = Vector2.zero; Event.current.Use(); } num6 += 52f; } num6 += 4f; } if (list.Count == 0) { GUI.Label(new Rect(10f, 10f, 270f, 40f), "No results for\n\"" + _searchText + "\"", _stMuted); } GUI.EndScrollView(); } private void DrawContentPane(Rect hub) { //IL_0047: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0188: 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_01be: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) float num = ((Rect)(ref hub)).y + 80f; float num2 = ((Rect)(ref hub)).height - 80f - 36f; Rect r = default(Rect); ((Rect)(ref r))..ctor(((Rect)(ref hub)).x + 300f, num, ((Rect)(ref hub)).width - 300f, num2); DrawRect(r, C_Content); IReadOnlyList mods = ASKAUIModRegistry.Mods; if (mods.Count == 0) { GUI.Label(new Rect(((Rect)(ref r)).x + 40f, ((Rect)(ref r)).y + ((Rect)(ref r)).height / 2f - 30f, ((Rect)(ref r)).width - 80f, 60f), "No mod panels registered yet.\n\nMods call ASKAUIModRegistry.RegisterPanel() at startup to appear here.", _stNoMods); return; } List list = ((_filteredIndices.Count > 0) ? _filteredIndices : Enumerable.Range(0, mods.Count).ToList()); if (!list.Contains(_activeTab) && list.Count > 0) { _activeTab = list[0]; } if (!list.Contains(_activeTab)) { return; } Rect r2 = default(Rect); ((Rect)(ref r2))..ctor(((Rect)(ref r)).x, ((Rect)(ref r)).y, ((Rect)(ref r)).width, 56f); DrawRect(r2, C_Header); DrawRect(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y + 56f - 2f, ((Rect)(ref r)).width, 2f), C_Accent); GUI.Label(new Rect(((Rect)(ref r)).x + 16f, ((Rect)(ref r)).y, ((Rect)(ref r)).width - 32f, 56f), mods[_activeTab].Name, _stContentTitle); float num3 = ((Rect)(ref r)).y + 56f + 2f; float num4 = num2 - 56f - 2f; Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref r)).x + 4f, num3, ((Rect)(ref r)).width - 8f, num4); _contentScroll = GUI.BeginScrollView(val, _contentScroll, new Rect(0f, 0f, ((Rect)(ref val)).width - 20f, 9999f), false, false); GUILayout.BeginArea(new Rect(0f, 0f, ((Rect)(ref val)).width - 24f, 9999f)); GUILayout.Space(10f); ASKAUIKit.EnsureBuilt(); Stopwatch stopwatch = Stopwatch.StartNew(); try { mods[_activeTab].Draw?.Invoke(); } catch (Exception ex) { GUILayout.Label("[Draw error] " + ex.Message, _stMuted, (Il2CppReferenceArray)null); } finally { stopwatch.Stop(); PerformanceMonitor.RecordModDraw(mods[_activeTab].Name, stopwatch.Elapsed.TotalMilliseconds); } GUILayout.Space(20f); GUILayout.EndArea(); GUI.EndScrollView(); } private void DrawFooter(Rect hub) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) Rect r = default(Rect); ((Rect)(ref r))..ctor(((Rect)(ref hub)).x, ((Rect)(ref hub)).yMax - 36f, ((Rect)(ref hub)).width, 36f); DrawRect(r, C_Header); DrawRect(new Rect(((Rect)(ref hub)).x, ((Rect)(ref r)).y, ((Rect)(ref hub)).width, 1f), C_Divider); GUI.Label(new Rect(((Rect)(ref r)).x + 16f, ((Rect)(ref r)).y + 6f, ((Rect)(ref r)).width - 32f, 20f), $"ASKA UI Framework v1.0 · DEATH STUDIOS · {ASKAUIModRegistry.Mods.Count} panel(s) registered", _stFooter); } private void EnsureStyles() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_0058: 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_0078: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) if (!_stylesBuilt) { _stylesBuilt = true; _tBg = MkTex(C_Bg); _tSidebar = MkTex(C_Sidebar); _tHeader = MkTex(C_Header); _tContent = MkTex(C_Content); _tAccent = MkTex(C_Accent); _tAccentDim = MkTex(C_AccentDim); _tTabHover = MkTex(C_TabHover); _tTabActive = MkTex(C_TabActive); _tCatLabel = MkTex(C_CatLabel); _tDivider = MkTex(C_Divider); _tSearchBg = MkTex(C_SearchBg); _tScrollThumb = MkTex(C_ScrollThumb); _stTitle = St(GUI.skin.label, delegate(GUIStyle s) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) s.fontSize = 32; s.fontStyle = (FontStyle)1; s.normal.textColor = C_Text; s.alignment = (TextAnchor)3; }); _stSubtitle = St(GUI.skin.label, delegate(GUIStyle s) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) s.fontSize = 14; s.normal.textColor = C_TextDim; s.alignment = (TextAnchor)3; }); _stWatermark = St(GUI.skin.label, delegate(GUIStyle s) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) s.fontSize = 14; s.fontStyle = (FontStyle)2; s.normal.textColor = new Color(0.94f, 0.72f, 0.52f, 0.45f); s.alignment = (TextAnchor)5; }); _stModCount = St(GUI.skin.label, delegate(GUIStyle s) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown s.fontSize = 13; s.fontStyle = (FontStyle)1; s.normal.textColor = new Color(0.04f, 0.05f, 0.05f, 1f); s.alignment = (TextAnchor)4; s.padding = new RectOffset(4, 4, 0, 0); }); _stCatLabel = St(GUI.skin.label, delegate(GUIStyle s) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown s.fontSize = 12; s.fontStyle = (FontStyle)1; s.normal.textColor = new Color(0.65f, 0.66f, 0.65f, 1f); s.alignment = (TextAnchor)3; s.padding = new RectOffset(0, 0, 0, 0); }); _stTabNormal = St(GUI.skin.label, delegate(GUIStyle s) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown s.fontSize = 16; s.fontStyle = (FontStyle)0; s.normal.textColor = C_TextMuted; s.alignment = (TextAnchor)3; s.padding = new RectOffset(4, 4, 2, 2); s.wordWrap = false; }); _stTabActive = St(GUI.skin.label, delegate(GUIStyle s) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown s.fontSize = 16; s.fontStyle = (FontStyle)1; s.normal.textColor = C_Text; s.alignment = (TextAnchor)3; s.padding = new RectOffset(4, 4, 2, 2); s.wordWrap = false; }); _stLabel = St(GUI.skin.label, delegate(GUIStyle s) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) s.fontSize = 18; s.fontStyle = (FontStyle)1; s.normal.textColor = C_Text; s.alignment = (TextAnchor)3; }); _stContentTitle = St(GUI.skin.label, delegate(GUIStyle s) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown s.fontSize = 22; s.fontStyle = (FontStyle)1; s.normal.textColor = C_Text; s.alignment = (TextAnchor)3; s.padding = new RectOffset(0, 0, 0, 0); }); _stMuted = St(GUI.skin.label, delegate(GUIStyle s) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) s.fontSize = 16; s.wordWrap = true; s.normal.textColor = C_TextMuted; s.alignment = (TextAnchor)3; }); _stDim = St(GUI.skin.label, delegate(GUIStyle s) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) s.fontSize = 14; s.normal.textColor = C_TextDim; }); _stSearch = St(GUI.skin.label, delegate(GUIStyle s) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) s.fontSize = 16; s.normal.textColor = C_Text; s.alignment = (TextAnchor)3; }); _stSearchPlaceholder = St(GUI.skin.label, delegate(GUIStyle s) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) s.fontSize = 16; s.normal.textColor = C_TextDim; s.alignment = (TextAnchor)3; }); _stNoMods = St(GUI.skin.label, delegate(GUIStyle s) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) s.fontSize = 18; s.wordWrap = true; s.normal.textColor = C_TextDim; s.alignment = (TextAnchor)4; }); _stCloseBtn = St(GUI.skin.button, delegate(GUIStyle s) { //IL_002c: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown s.fontSize = 20; s.fontStyle = (FontStyle)1; s.normal.background = MkTex(new Color(0f, 0f, 0f, 0f)); s.normal.textColor = C_TextMuted; s.alignment = (TextAnchor)4; s.border = new RectOffset(0, 0, 0, 0); s.padding = new RectOffset(0, 0, 0, 0); }); _stFooter = St(GUI.skin.label, delegate(GUIStyle s) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) s.fontSize = 13; s.fontStyle = (FontStyle)2; s.normal.textColor = C_TextDim; s.alignment = (TextAnchor)3; }); } } private void BuildFilteredList() { _filteredIndices.Clear(); IReadOnlyList mods = ASKAUIModRegistry.Mods; string value = _searchText?.Trim() ?? ""; for (int i = 0; i < mods.Count; i++) { if (string.IsNullOrEmpty(value) || mods[i].Name.IndexOf(value, StringComparison.OrdinalIgnoreCase) >= 0 || (mods[i].Category ?? "").IndexOf(value, StringComparison.OrdinalIgnoreCase) >= 0) { _filteredIndices.Add(i); } } } private void SetVisible(bool show) { //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_013b: Unknown result type (might be due to invalid IL or missing references) if (show == _visible) { return; } _visible = show; if (show) { _savedCursor = Cursor.visible; _savedLock = Cursor.lockState; Cursor.visible = true; Cursor.lockState = (CursorLockMode)0; GameObject blockerRoot = _blockerRoot; if (blockerRoot != null) { blockerRoot.SetActive(true); } SuppressInput(); LoadPrefs(); _searchText = ""; _searchFocused = false; _stylesBuilt = false; ASKAUIKit.Reset(); HUDSettingsPanel.Reset(); ASKAHUDOverlay.Instance?.Reset(); ASKAUIPlugin.RunAutoDiscovery(); BuildFilteredList(); if (!_pendingFirstRunJump) { return; } _pendingFirstRunJump = false; IReadOnlyList mods = ASKAUIModRegistry.Mods; for (int i = 0; i < mods.Count; i++) { if (string.Equals(mods[i].Name, "HUD Settings", StringComparison.OrdinalIgnoreCase)) { _activeTab = i; break; } } HUDSettingsPanel.FirstRunPromptActive = true; } else { GameObject blockerRoot2 = _blockerRoot; if (blockerRoot2 != null) { blockerRoot2.SetActive(false); } RestoreInput(); Cursor.visible = _savedCursor; Cursor.lockState = _savedLock; SavePrefs(); } } private void SuppressInput() { try { Controls controls = InputManager.controls; if (controls != null) { TryDisable(controls.Interactions.Get()); TryDisable(controls.LandCharacter.Get()); TryDisable(controls.Movement.Get()); TryDisable(controls.Builder.Get()); TryDisable(controls.Camera.Get()); TryDisable(controls.Sail.Get()); TryDisable(controls.QuickBarNavigation.Get()); TryDisable(controls.MenuShortcuts.Get()); TryDisable(controls.Rowing.Get()); TryDisable(controls.RavenCharacter.Get()); TryDisable(controls.ResourceFinder.Get()); } } catch { } } private void RestoreInput() { try { foreach (InputActionMap item in _suppressed) { if (item != null && !item.enabled) { item.Enable(); } } } catch { } finally { _suppressed.Clear(); } } private void TryDisable(InputActionMap m) { if (m != null && m.enabled) { if (!_suppressed.Contains(m)) { _suppressed.Add(m); } m.Disable(); } } private void LoadPrefs() { try { _activeTab = PlayerPrefs.GetInt("ASKAUI_LastTab", 0); } catch { _activeTab = 0; } } private void SavePrefs() { try { PlayerPrefs.SetInt("ASKAUI_LastTab", _activeTab); PlayerPrefs.Save(); } catch { } } private void CreateBlocker() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) _blockerRoot = new GameObject("ASKAUI_Blocker"); Object.DontDestroyOnLoad((Object)(object)_blockerRoot); Canvas val = _blockerRoot.AddComponent(); val.renderMode = (RenderMode)0; val.sortingOrder = 32749; _blockerRoot.AddComponent(); GameObject val2 = new GameObject("DimPanel"); val2.transform.SetParent(_blockerRoot.transform, false); RectTransform val3 = val2.AddComponent(); val3.anchorMin = Vector2.zero; val3.anchorMax = Vector2.one; val3.offsetMin = Vector2.zero; val3.offsetMax = Vector2.zero; Image val4 = val2.AddComponent(); ((Graphic)val4).color = new Color(0f, 0f, 0f, 0.55f); ((Graphic)val4).raycastTarget = true; _blockerRoot.SetActive(false); } private void DrawRect(Rect r, Color c) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) Color color = GUI.color; GUI.color = c; GUI.DrawTexture(r, (Texture)(object)Texture2D.whiteTexture); GUI.color = color; } private static Texture2D MkTex(Color c) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_000e: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(1, 1, (TextureFormat)4, false); val.SetPixel(0, 0, c); val.Apply(); return val; } private static GUIStyle St(GUIStyle basis, Action configure) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown GUIStyle val = new GUIStyle(basis); configure(val); return val; } } public static class AskaUIRegistrar { private static bool _resolved; private static Type _registryType; private static MethodInfo _registerMethod; public static void Register(string name, Action draw) { Register(name, draw, "General"); } public static void Register(string name, Action draw, string category) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got Unknown if (string.IsNullOrWhiteSpace(name) || draw == null) { return; } try { if (!_resolved) { Resolve(); } if (!(_registerMethod == null)) { _registerMethod.Invoke(null, new object[3] { name, draw, category }); } } catch (Exception ex) { try { ManualLogSource val = Logger.CreateLogSource("AskaUIRegistrar"); ManualLogSource val2 = val; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(32, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(name); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("] ASKA UI registration failed: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex.Message); } val2.LogWarning(val3); } catch { } } } private static void Resolve() { //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Expected O, but got Unknown _resolved = true; try { string[] array = new string[3] { "AskaUI", "ASKAUI", "askaui" }; string[] array2 = array; bool flag = default(bool); foreach (string asmName in array2) { Assembly assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly a) => string.Equals(a.GetName().Name, asmName, StringComparison.OrdinalIgnoreCase)); if (assembly == null) { continue; } _registryType = assembly.GetType("ASKAUI.ASKAUIModRegistry"); if (_registryType == null) { continue; } _registerMethod = _registryType.GetMethod("RegisterPanel", BindingFlags.Static | BindingFlags.Public, null, new Type[3] { typeof(string), typeof(Action), typeof(string) }, null); if (!(_registerMethod != null)) { continue; } try { ManualLogSource val = Logger.CreateLogSource("AskaUIRegistrar"); ManualLogSource val2 = val; BepInExDebugLogInterpolatedStringHandler val3 = new BepInExDebugLogInterpolatedStringHandler(42, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("[AskaUIRegistrar] Resolved via assembly '"); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(asmName); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("'"); } val2.LogDebug(val3); break; } catch { break; } } } catch { } } } public enum TabEntryType { Toggle, Float, Int, Button, Label, Separator } public class TabSettingEntry { public TabEntryType Type; public string Label; public string Hint; public string Suffix; public Func GetBool; public Action SetBool; public Func GetFloat; public Action SetFloat; public float Min = 0f; public float Max = 100f; public float Step = 1f; public Func GetInt; public Action SetInt; public Action OnClick; } public class TabSection { public string ModName; public string Category; public List Entries = new List(); } public static class AskaUITabBuilder { private static readonly List _sections = new List(); public static void AddToggle(string modName, string category, string label, Func get, Action set, string hint = null) { _Get(modName, category).Entries.Add(new TabSettingEntry { Type = TabEntryType.Toggle, Label = label, Hint = hint, GetBool = get, SetBool = set }); } public static void AddFloat(string modName, string category, string label, Func get, Action set, float min = 0f, float max = 100f, float step = 1f, string suffix = "", string hint = null) { _Get(modName, category).Entries.Add(new TabSettingEntry { Type = TabEntryType.Float, Label = label, Hint = hint, Suffix = suffix, GetFloat = get, SetFloat = set, Min = min, Max = max, Step = step }); } public static void AddInt(string modName, string category, string label, Func get, Action set, int min = 0, int max = 100, string suffix = "", string hint = null) { _Get(modName, category).Entries.Add(new TabSettingEntry { Type = TabEntryType.Int, Label = label, Hint = hint, Suffix = suffix, GetInt = get, SetInt = set, Min = min, Max = max }); } public static void AddButton(string modName, string category, string label, Action onClick) { _Get(modName, category).Entries.Add(new TabSettingEntry { Type = TabEntryType.Button, Label = label, OnClick = onClick }); } public static void AddLabel(string modName, string category, string text) { _Get(modName, category).Entries.Add(new TabSettingEntry { Type = TabEntryType.Label, Label = text }); } public static void AddSeparator(string modName, string category) { _Get(modName, category).Entries.Add(new TabSettingEntry { Type = TabEntryType.Separator }); } public static List GetSections() { return _sections; } private static TabSection _Get(string modName, string category) { TabSection tabSection = _sections.Find((TabSection x) => x.ModName == modName && x.Category == category); if (tabSection != null) { return tabSection; } tabSection = new TabSection { ModName = modName, Category = category }; _sections.Add(tabSection); return tabSection; } } public class AskaUITabPage : TabPage { private bool _visible = false; private Vector2 _scroll = Vector2.zero; private int _activePanel; public AskaUITabPage(IntPtr ptr) : base(ptr) { }//IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) public override void Show(bool value, TabButton button) { _visible = value; ((Component)this).gameObject.SetActive(value); } public override void Init(TabButton button) { } public override bool IsBusyClosing() { return false; } private void OnGUI() { //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) if (_visible) { ASKAUIKit.EnsureBuilt(); RectTransform component = ((Component)this).GetComponent(); Rect val = default(Rect); if ((Object)(object)component != (Object)null) { Vector3[] array = (Vector3[])(object)new Vector3[4]; component.GetWorldCorners(Il2CppStructArray.op_Implicit(array)); float x = array[0].x; float num = (float)Screen.height - array[2].y; float num2 = array[2].x - array[0].x; float num3 = array[2].y - array[0].y; ((Rect)(ref val))..ctor(x, num, num2, num3); } else { ((Rect)(ref val))..ctor(260f, 60f, (float)Screen.width - 280f, (float)Screen.height - 80f); } GUILayout.BeginArea(val); _scroll = GUILayout.BeginScrollView(_scroll, false, false, GUIStyle.none, GUIStyle.none, Array.Empty()); _DrawContent(); GUILayout.EndScrollView(); GUILayout.EndArea(); } } private void _DrawContent() { List sections = AskaUITabBuilder.GetSections(); IReadOnlyList mods = ASKAUIModRegistry.Mods; if ((sections == null || sections.Count == 0) && (mods == null || mods.Count == 0)) { GUILayout.Space(20f); GUILayout.Label(" No mods registered yet.", ASKAUIKit.StMuted, (Il2CppReferenceArray)null); return; } if (sections != null && sections.Count > 0) { DrawStructuredSections(sections.ToArray()); } if (mods != null && mods.Count > 0) { ASKAUIModInfo[] array = new ASKAUIModInfo[mods.Count]; for (int i = 0; i < mods.Count; i++) { array[i] = mods[i]; } DrawRegisteredPanels(array); } GUILayout.Space(24f); } [HideFromIl2Cpp] private void DrawStructuredSections(TabSection[] sections) { string text = null; foreach (TabSection tabSection in sections) { if (tabSection.Category != text) { text = tabSection.Category; GUILayout.Space((text == sections[0].Category) ? 6f : 14f); ASKAUIKit.DrawSectionHeader(tabSection.Category); } GUILayout.Space(4f); GUILayout.Label(" " + tabSection.ModName, ASKAUIKit.StSection, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.ExpandWidth(true), GUILayout.Height(44f) }); GUILayout.Space(4f); foreach (TabSettingEntry entry in tabSection.Entries) { switch (entry.Type) { case TabEntryType.Toggle: { bool flag = false; try { flag = entry.GetBool?.Invoke() ?? false; } catch { } bool flag2 = ASKAUIKit.DrawBoolRow(entry.Label, flag, entry.Hint); if (flag2 != flag) { try { entry.SetBool?.Invoke(flag2); } catch { } } break; } case TabEntryType.Float: { float num = 0f; try { num = entry.GetFloat?.Invoke() ?? 0f; } catch { } float num2 = ASKAUIKit.DrawFloatRow(entry.Label, num, entry.Min, entry.Max, entry.Suffix, entry.Step); if (!Mathf.Approximately(num2, num)) { try { entry.SetFloat?.Invoke(num2); } catch { } } break; } case TabEntryType.Int: { int num3 = 0; try { num3 = entry.GetInt?.Invoke() ?? 0; } catch { } int num4 = ASKAUIKit.DrawIntRow(entry.Label, num3, (int)entry.Min, (int)entry.Max, entry.Suffix); if (num4 != num3) { try { entry.SetInt?.Invoke(num4); } catch { } } break; } case TabEntryType.Button: GUILayout.Space(4f); if (ASKAUIKit.DrawButton(entry.Label, 230f)) { try { entry.OnClick?.Invoke(); } catch { } } GUILayout.Space(4f); break; case TabEntryType.Label: GUILayout.Label(" " + entry.Label, ASKAUIKit.StMuted, (Il2CppReferenceArray)null); break; case TabEntryType.Separator: GUILayout.Space(6f); ASKAUIKit.DrawSeparator(); GUILayout.Space(6f); break; } } GUILayout.Space(10f); } } [HideFromIl2Cpp] private void DrawRegisteredPanels(ASKAUIModInfo[] panels) { //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) if (panels.Length == 0) { return; } _activePanel = Mathf.Clamp(_activePanel, 0, panels.Length - 1); GUILayout.Space(6f); ASKAUIKit.DrawSectionHeader("Registered Mod Panels"); GUILayout.Space(4f); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); for (int i = 0; i < panels.Length; i++) { string text = ((i == _activePanel) ? ("> " + panels[i].Name) : panels[i].Name); if (GUILayout.Button(text, GUI.skin.button, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(190f), GUILayout.Height(34f) })) { _activePanel = i; _scroll = Vector2.zero; } } GUILayout.EndHorizontal(); GUILayout.Space(8f); GUILayout.Label(" " + panels[_activePanel].Name, ASKAUIKit.StSection, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.ExpandWidth(true), GUILayout.Height(44f) }); GUILayout.Space(4f); try { panels[_activePanel].Draw?.Invoke(); } catch (Exception ex) { GUILayout.Label(" [Draw error] " + ex.Message, ASKAUIKit.StMuted, (Il2CppReferenceArray)null); } } } internal static class ConfigEditorPanel { private static Vector2 _scroll; public static void Draw() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) PK.Header("Config Editor", "Live edit third-party mod configurations."); _scroll = GUILayout.BeginScrollView(_scroll, (Il2CppReferenceArray)null); foreach (KeyValuePair> registeredConfig in ASKAUIModRegistry.RegisteredConfigs) { PK.BeginSection(registeredConfig.Key); foreach (ConfigEntryBase item in registeredConfig.Value) { if (item is ConfigEntry val) { val.Value = PK.BoolRow(item.Definition.Key, val.Value, item.Description.Description); continue; } if (item is ConfigEntry val2) { val2.Value = PK.FloatRow(item.Definition.Key, val2.Value, 0f, 100f); continue; } if (item is ConfigEntry val3) { val3.Value = PK.IntRow(item.Definition.Key, val3.Value, 0, 100); continue; } GUILayout.Label($"{item.Definition.Key}: {item.BoxedValue}", (Il2CppReferenceArray)null); } PK.EndSection(); } GUILayout.EndScrollView(); } } public static class HUDSettingsPanel { private static bool _registered; public static bool FirstRunPromptActive; public static void Reset() { } public static void Register(ConfigFile cfg) { if (!_registered) { _registered = true; ASKAHUDOverlay.CfgEnabled = cfg.Bind("HUD", "Enabled", false, "Enable the custom DEATH STUDIOS HUD overlay."); ASKAHUDOverlay.CfgHideVanilla = cfg.Bind("HUD", "HideVanilla", true, "Hide the vanilla HUD while the custom HUD is active."); ASKAHUDOverlay.CfgX = cfg.Bind("HUD", "X", 20f, "HUD X position."); ASKAHUDOverlay.CfgY = cfg.Bind("HUD", "Y", 20f, "HUD Y position."); ASKAHUDOverlay.CfgBarW = cfg.Bind("HUD", "BarWidth", 220f, "Bar width in pixels."); ASKAHUDOverlay.CfgBarH = cfg.Bind("HUD", "BarHeight", 22f, "Bar height in pixels."); ASKAHUDOverlay.CfgGap = cfg.Bind("HUD", "BarGap", 10f, "Gap between bars."); ASKAUIModRegistry.RegisterPanel("HUD Settings", DrawPanel, "DEATH STUDIOS"); ManualLogSource loggerInstance = ASKAUIPlugin.LoggerInstance; if (loggerInstance != null) { loggerInstance.LogInfo((object)"[ASKAUI-HUD] Settings panel registered."); } } } private static void DrawPanel() { ASKAUIKit.EnsureBuilt(); GUILayout.Space(6f); DrawKeybindSection(); GUILayout.Space(12f); ASKAUIKit.DrawSectionHeader("CUSTOM HUD OVERLAY"); ASKAUIKit.BeginCard(); bool flag = ASKAHUDOverlay.CfgEnabled?.Value ?? false; bool flag2 = ASKAUIKit.DrawBoolRow("Enable Custom HUD", flag, "Replaces the vanilla ASKA stat bars with the DEATH STUDIOS styled overlay."); if (flag2 != flag) { if (ASKAHUDOverlay.CfgEnabled != null) { ASKAHUDOverlay.CfgEnabled.Value = flag2; } if (!flag2) { ASKAHUDOverlay.Instance?.RestoreVanillaHUD(); } } bool flag3 = ASKAHUDOverlay.CfgHideVanilla?.Value ?? true; bool flag4 = ASKAUIKit.DrawBoolRow("Hide Vanilla HUD", flag3, "Hides the original ASKA HUD bars while the custom overlay is active."); if (flag4 != flag3) { if (ASKAHUDOverlay.CfgHideVanilla != null) { ASKAHUDOverlay.CfgHideVanilla.Value = flag4; } if (!flag4) { ASKAHUDOverlay.Instance?.RestoreVanillaHUD(); } } ASKAUIKit.EndCard(); GUILayout.Space(12f); ASKAUIKit.DrawSectionHeader("LIVE STAT PREVIEW"); ASKAUIKit.BeginCard(); HUDSnapshot hUDSnapshot = ASKAHUDOverlay.Instance?.Snap ?? default(HUDSnapshot); if (hUDSnapshot.Valid) { StatRow("Health", hUDSnapshot.Health, hUDSnapshot.HealthMax); StatRow("Warmth", hUDSnapshot.Warmth, hUDSnapshot.WarmthMax); StatRow("Food", hUDSnapshot.Food, hUDSnapshot.FoodMax); StatRow("Water", hUDSnapshot.Water, hUDSnapshot.WaterMax); StatRow("Stamina", hUDSnapshot.Stamina, hUDSnapshot.StaminaMax); } else { GUILayout.Label(" (No player data - load a save to see live values.)", ASKAUIKit.StMuted, (Il2CppReferenceArray)null); } ASKAUIKit.EndCard(); GUILayout.Space(12f); ASKAUIKit.DrawSectionHeader("POSITION & SIZE"); ASKAUIKit.BeginCard(); float value = ASKAUIKit.DrawFloatRow("HUD X Position", ASKAHUDOverlay.CfgX?.Value ?? 20f, 0f, 3840f, "px", 10f); if (ASKAHUDOverlay.CfgX != null) { ASKAHUDOverlay.CfgX.Value = value; } float value2 = ASKAUIKit.DrawFloatRow("HUD Y Position", ASKAHUDOverlay.CfgY?.Value ?? 20f, 0f, 2160f, "px", 10f); if (ASKAHUDOverlay.CfgY != null) { ASKAHUDOverlay.CfgY.Value = value2; } float value3 = ASKAUIKit.DrawFloatRow("Bar Width", ASKAHUDOverlay.CfgBarW?.Value ?? 220f, 80f, 800f, "px", 10f); if (ASKAHUDOverlay.CfgBarW != null) { ASKAHUDOverlay.CfgBarW.Value = value3; } float value4 = ASKAUIKit.DrawFloatRow("Bar Height", ASKAHUDOverlay.CfgBarH?.Value ?? 22f, 10f, 80f, "px"); if (ASKAHUDOverlay.CfgBarH != null) { ASKAHUDOverlay.CfgBarH.Value = value4; } float value5 = ASKAUIKit.DrawFloatRow("Bar Gap", ASKAHUDOverlay.CfgGap?.Value ?? 10f, 0f, 60f, "px", 2f); if (ASKAHUDOverlay.CfgGap != null) { ASKAHUDOverlay.CfgGap.Value = value5; } GUILayout.Space(8f); if (ASKAUIKit.DrawButton("Reset Layout to Defaults", 230f)) { if (ASKAHUDOverlay.CfgX != null) { ASKAHUDOverlay.CfgX.Value = 20f; } if (ASKAHUDOverlay.CfgY != null) { ASKAHUDOverlay.CfgY.Value = 20f; } if (ASKAHUDOverlay.CfgBarW != null) { ASKAHUDOverlay.CfgBarW.Value = 220f; } if (ASKAHUDOverlay.CfgBarH != null) { ASKAHUDOverlay.CfgBarH.Value = 22f; } if (ASKAHUDOverlay.CfgGap != null) { ASKAHUDOverlay.CfgGap.Value = 10f; } } ASKAUIKit.EndCard(); GUILayout.Space(12f); ASKAUIKit.DrawSectionHeader("ABOUT"); ASKAUIKit.BeginCard(); GUILayout.Label(" Reads the same live data as the vanilla HUD via VariableAttribute.GetNormalizedValue().\n Bars flash when any stat drops below 20%.\n Vanilla HUD is fully restored on disable or game exit.", ASKAUIKit.StMuted, (Il2CppReferenceArray)null); ASKAUIKit.EndCard(); GUILayout.Space(20f); } private static void DrawKeybindSection() { ASKAUIKit.DrawSectionHeader("HUB TOGGLE KEY"); ASKAUIKit.BeginCard(); if (FirstRunPromptActive) { ASKAUIKit.DrawInfoBox("Welcome! This key opens and closes the mod hub — it's set to Home by default. If your keyboard doesn't have a Home key (common on compact/extension keyboards), set your own below. It can be a single key or a combo (e.g. LeftAlt+Delete)."); if (ASKAUIKit.DrawButton("Got it", 100f)) { FirstRunPromptActive = false; } GUILayout.Space(6f); } if (ToggleKeybind.IsCapturing) { ASKAUIKit.DrawWarningBox("Listening… press your key or combo now. (" + ToggleKeybind.CapturePreview + ")\nPress ESC to cancel."); } else { GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Label("Open / Close Hub", ASKAUIKit.StLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(180f) }); GUILayout.FlexibleSpace(); GUILayout.Label(ToggleKeybind.CurrentComboDisplay, ASKAUIKit.StValue, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(220f) }); if (ASKAUIKit.DrawButton("Rebind", 110f)) { ToggleKeybind.BeginCapture(); } if (ASKAUIKit.DrawSmallButton("Reset", 90f)) { ToggleKeybind.ResetToDefault(); } GUILayout.EndHorizontal(); GUILayout.Label(" Click Rebind, then press any key or hold a combo (e.g. Alt + Delete) and release it to set it.", ASKAUIKit.StMuted, (Il2CppReferenceArray)null); } ASKAUIKit.EndCard(); } private static void StatRow(string label, float val, float max) { GUILayout.BeginHorizontal((Il2CppReferenceArray)null); GUILayout.Space(10f); GUILayout.Label(label, ASKAUIKit.StLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(80f) }); float value = ((max > 0f) ? (val / max * 100f) : 0f); GUILayout.Label($"{val:F1} / {max:F1} ({value:F0}%)", ASKAUIKit.StValue, (Il2CppReferenceArray)null); GUILayout.EndHorizontal(); GUILayout.Space(2f); } } public interface IASKAUIPanel { string Name { get; } void Draw(); } public sealed class BepInPluginInfo { public string Name; public string Guid; public string Version; public bool IsActive; } public static class PerformanceMonitor { private sealed class ModStat { public string Name; public double LastMs; public double AvgMs; public double PeakMs; public int Samples; } private const int MaxSamples = 240; private const float SampleWindow = 2f; private static Queue _frameSamples = new Queue(240); private static float _windowStart = 0f; private static readonly Dictionary _mods = new Dictionary(); private static readonly List> _sortedCache = new List>(); public static int Fps { get; private set; } public static float FrameAvgMs { get; private set; } public static float FrameMinMs { get; private set; } public static float FrameMaxMs { get; private set; } public static long ManagedBytes { get; private set; } public static long AllocBytes { get; private set; } public static long ReservedBytes { get; private set; } public static void Update() { try { SampleFrames(); ManagedBytes = GC.GetTotalMemory(forceFullCollection: false); AllocBytes = Profiler.GetTotalAllocatedMemoryLong(); ReservedBytes = Profiler.GetTotalReservedMemoryLong(); } catch { } } private static void SampleFrames() { float unscaledDeltaTime = Time.unscaledDeltaTime; if (unscaledDeltaTime <= 0f) { return; } _frameSamples.Enqueue(unscaledDeltaTime); while (_frameSamples.Count > 240) { _frameSamples.Dequeue(); } if (!(Time.unscaledTime - _windowStart >= 2f)) { return; } _windowStart = Time.unscaledTime; double num = 0.0; double num2 = double.MaxValue; double num3 = 0.0; foreach (float frameSample in _frameSamples) { num += (double)frameSample; if ((double)frameSample < num2) { num2 = frameSample; } if ((double)frameSample > num3) { num3 = frameSample; } } int count = _frameSamples.Count; if (count > 0) { float num4 = (float)(num / (double)count); FrameAvgMs = num4 * 1000f; FrameMinMs = (float)num2 * 1000f; FrameMaxMs = (float)num3 * 1000f; Fps = ((num4 > 0f) ? Mathf.RoundToInt(1f / num4) : 0); } _frameSamples.Clear(); } public static void RecordModDraw(string name, double ms) { try { if (!string.IsNullOrEmpty(name)) { if (!_mods.TryGetValue(name, out var value)) { value = new ModStat { Name = name }; _mods[name] = value; } value.LastMs = ms; value.Samples++; value.AvgMs += (ms - value.AvgMs) / (double)value.Samples; if (ms > value.PeakMs) { value.PeakMs = ms; } } } catch { } } public static void RecordTick(string modName, double ms) { RecordModDraw(modName, ms); } public static void TimeBlock(string modName, Action block) { Stopwatch stopwatch = Stopwatch.StartNew(); try { block?.Invoke(); } finally { stopwatch.Stop(); RecordTick(modName, stopwatch.Elapsed.TotalMilliseconds); } } public static List> SortedModDrawTimes() { _sortedCache.Clear(); foreach (KeyValuePair mod in _mods) { _sortedCache.Add(new KeyValuePair(mod.Key, mod.Value.AvgMs)); } _sortedCache.Sort((KeyValuePair a, KeyValuePair b) => b.Value.CompareTo(a.Value)); return _sortedCache; } public static List GetInstalledPlugins() { List list = new List(); try { IL2CPPChainloader instance = IL2CPPChainloader.Instance; if (instance != null && ((BaseChainloader)(object)instance).Plugins != null) { foreach (KeyValuePair plugin in ((BaseChainloader)(object)instance).Plugins) { PluginInfo value = plugin.Value; if (((value != null) ? value.Metadata : null) == null) { continue; } string version = "1.0"; try { PropertyInfo property = ((object)value.Metadata).GetType().GetProperty("Version"); if (property != null) { object value2 = property.GetValue(value.Metadata); if (value2 != null) { version = value2.ToString(); } } } catch { } list.Add(new BepInPluginInfo { Name = (value.Metadata.Name ?? value.Metadata.GUID), Guid = value.Metadata.GUID, Version = version, IsActive = (value.Instance != null) }); } } } catch { try { Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly in assemblies) { Type[] types = assembly.GetTypes(); foreach (Type element in types) { Attribute customAttribute = Attribute.GetCustomAttribute(element, typeof(BepInPlugin)); BepInPlugin val = (BepInPlugin)(object)((customAttribute is BepInPlugin) ? customAttribute : null); if (val == null) { continue; } string version2 = "1.0"; try { PropertyInfo property2 = ((object)val).GetType().GetProperty("Version"); if (property2 != null) { object value3 = property2.GetValue(val); if (value3 != null) { version2 = value3.ToString(); } } } catch { } list.Add(new BepInPluginInfo { Name = val.Name, Guid = val.GUID, Version = version2, IsActive = true }); } } } catch { } } return list; } public static void ResetModStats() { try { _mods.Clear(); _sortedCache.Clear(); } catch { } } public static void ResetFrameStats() { try { _frameSamples.Clear(); Fps = 0; FrameAvgMs = (FrameMinMs = (FrameMaxMs = 0f)); } catch { } } } public static class PerformanceMonitorPanel { public const string Name = "Performance Monitor"; public static void Draw() { PK.Header("Performance Monitor", "Live PC performance, UI render costs, and all installed BepInEx mods."); DrawPcSection(); DrawModsSection(); DrawInstalledPluginsSection(); PK.Footer("Live diagnostics across BepInEx plugins and ASKA UI hub."); } private static void DrawPcSection() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) PK.BeginSection("PC Performance"); PK.BeginCard(); float num = PerformanceMonitor.Fps; Color color = ((num >= 55f) ? Color.green : ((num >= 30f) ? Color.yellow : Color.red)); PK.ColoredStatRow("FPS", $"{num} fps", color); PK.StatRow("Frame Avg", $"{PerformanceMonitor.FrameAvgMs:0.0} ms"); PK.StatRow("Frame Min", $"{PerformanceMonitor.FrameMinMs:0.0} ms"); PK.StatRow("Frame Max", $"{PerformanceMonitor.FrameMaxMs:0.0} ms"); PK.Separator(); PK.StatRow("Managed Memory", MB(PerformanceMonitor.ManagedBytes)); PK.StatRow("Unity Allocated", MB(PerformanceMonitor.AllocBytes)); PK.StatRow("Unity Reserved", MB(PerformanceMonitor.ReservedBytes)); PK.Separator(); PK.StatRow("System RAM", (SystemInfo.systemMemorySize > 0) ? $"{SystemInfo.systemMemorySize / 1024} GB" : "n/a"); PK.StatRow("VRAM", (SystemInfo.graphicsMemorySize > 0) ? $"{SystemInfo.graphicsMemorySize / 1024} GB" : "n/a"); PK.EndCard(); PK.EndSection(); } private static void DrawModsSection() { //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: 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_0175: 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) PK.BeginSection("UI Hub Mod Costs"); PK.BeginCard(); List> list = PerformanceMonitor.SortedModDrawTimes(); Dictionary dictionary = new Dictionary(StringComparer.OrdinalIgnoreCase); foreach (KeyValuePair item in list) { dictionary[item.Key] = item.Value; } IReadOnlyList mods = ASKAUIModRegistry.Mods; if (mods == null || mods.Count == 0) { PK.HelpBox("No mod panels have been registered yet."); } else { List> list2 = new List>(); List list3 = new List(); foreach (ASKAUIModInfo item2 in mods) { if (dictionary.TryGetValue(item2.Name, out var value)) { list2.Add(new KeyValuePair(item2.Name, value)); } else { list3.Add(item2.Name); } } list2.Sort((KeyValuePair a, KeyValuePair b) => b.Value.CompareTo(a.Value)); foreach (KeyValuePair item3 in list2) { Color color = ((item3.Value >= 3.0) ? Color.red : ((item3.Value >= 1.0) ? Color.yellow : Color.white)); PK.ColoredStatRow(item3.Key, $"{item3.Value:0.00} ms avg", color); } foreach (string item4 in list3) { PK.ColoredStatRow(item4, "measuring…", Color.gray); } if (list3.Count > 0) { PK.Separator(); PK.HelpBox("Costs refresh live while the hub is open — every registered mod is sampled automatically."); } } if (PK.ActionButton("Reset Mod Stats")) { PerformanceMonitor.ResetModStats(); } if (PK.ActionButton("Reset Frame Stats")) { PerformanceMonitor.ResetFrameStats(); } PK.EndCard(); PK.EndSection(); } private static void DrawInstalledPluginsSection() { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00d9: Unknown result type (might be due to invalid IL or missing references) PK.BeginSection("Installed BepInEx Plugins"); PK.BeginCard(); List installedPlugins = PerformanceMonitor.GetInstalledPlugins(); if (installedPlugins == null || installedPlugins.Count == 0) { PK.HelpBox("No BepInEx plugins detected."); } else { PK.StatRow("Total Loaded", $"{installedPlugins.Count} plugin(s)"); PK.Separator(); foreach (BepInPluginInfo item in installedPlugins) { Color color = (item.IsActive ? Color.green : Color.gray); PK.ColoredStatRow(item.Name + " v" + item.Version, item.IsActive ? "Active" : "Inactive", color); } } PK.EndCard(); PK.EndSection(); } private static string MB(long bytes) { return (bytes >= 1048576) ? $"{(float)bytes / 1048576f:0.0} MB" : $"{(float)bytes / 1024f:0.0} KB"; } } [BepInPlugin("ASKAUI", "ASKA UI Framework", "0.0.6")] public class ASKAUIPlugin : BasePlugin { public static ManualLogSource LoggerInstance; private static Harmony _harmony; public ConfigFile Config { get; private set; } public override void Load() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Expected O, but got Unknown LoggerInstance = ((BasePlugin)this).Log; string text = Path.Combine(Paths.ConfigPath, "ASKAUI"); Directory.CreateDirectory(text); Config = new ConfigFile(Path.Combine(text, "ASKAUI.cfg"), true); ASKAHUDOverlay.BuildFieldCache(); _harmony = new Harmony("ASKAUI"); _harmony.PatchAll(typeof(PlayerWidgetPatches).Assembly); _harmony.PatchAll(typeof(AskaUIInGameTab)); LoggerInstance.LogInfo((object)"[ASKAUI] Harmony patches applied."); ClassInjector.RegisterTypeInIl2Cpp(); ClassInjector.RegisterTypeInIl2Cpp(); AskaUIInGameTab.RegisterIl2CppType(); GameObject val = new GameObject("ASKAUI_Root"); Object.DontDestroyOnLoad((Object)(object)val); val.AddComponent(); val.AddComponent(); ToggleKeybind.Load(Config); HUDSettingsPanel.Register(Config); ASKAUIModRegistry.RegisterPanel("Performance Monitor", PerformanceMonitorPanel.Draw, "System"); ASKAUIModRegistry.RegisterPanel("Third-Party Mods", ThirdPartyModsPanel.Draw, "Third-Party Mods"); ManualLogSource loggerInstance = LoggerInstance; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(39, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[ASKAUI] v0.0.6 loaded. "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ToggleKeybind.CurrentComboDisplay); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" opens the hub."); } loggerInstance.LogInfo(val2); } public override bool Unload() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } return ((BasePlugin)this).Unload(); } internal static void RunAutoDiscovery() { //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown bool flag = default(bool); try { Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly in assemblies) { try { Type[] types = assembly.GetTypes(); foreach (Type type in types) { try { MethodInfo[] methods = type.GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); foreach (MethodInfo methodInfo in methods) { if (methodInfo.GetCustomAttribute() != null && methodInfo.GetParameters().Length == 0) { methodInfo.Invoke(null, null); ManualLogSource loggerInstance = LoggerInstance; BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(27, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[ASKAUI] Auto-discovered: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(type.FullName); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("."); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(methodInfo.Name); } loggerInstance.LogDebug(val); } } } catch { } } } catch { } } } catch (Exception ex) { ManualLogSource loggerInstance2 = LoggerInstance; BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(30, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[ASKAUI] AutoDiscovery error: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } loggerInstance2.LogWarning(val2); } } } public static class ThirdPartyModsPanel { public const string Name = "Third-Party Mods"; public static void Draw() { PK.Header("Third-Party Mod Settings", "Live configuration editor for all loaded third-party BepInEx mods."); try { IL2CPPChainloader instance = IL2CPPChainloader.Instance; if (instance == null || ((BaseChainloader)(object)instance).Plugins == null || ((BaseChainloader)(object)instance).Plugins.Count == 0) { PK.HelpBox("No BepInEx plugins found via chainloader."); PK.Footer("Changes take effect immediately and auto-save to BepInEx config files."); return; } int num = 0; foreach (KeyValuePair plugin in ((BaseChainloader)(object)instance).Plugins) { PluginInfo value = plugin.Value; object obj = ((value != null) ? value.Instance : null); if (obj == null) { continue; } string text = value.Metadata.Name ?? ""; bool flag = false; foreach (ASKAUIModInfo mod in ASKAUIModRegistry.Mods) { if (mod.Name.Equals(text, StringComparison.OrdinalIgnoreCase)) { flag = true; break; } } if (flag || IsDeathStudiosManifest(obj)) { continue; } ConfigFile val = null; try { PropertyInfo property = obj.GetType().GetProperty("Config"); if (property != null) { object? value2 = property.GetValue(obj); val = (ConfigFile)((value2 is ConfigFile) ? value2 : null); } } catch { } string text2 = ""; try { PropertyInfo property2 = ((object)val).GetType().GetProperty("ConfigFilePath"); if (property2 != null) { text2 = ((property2.GetValue(val) as string) ?? "").ToLowerInvariant(); } } catch { } if (text2.Contains("smartvillagers") || text2.Contains("cleartheway") || text2.Contains("askaui") || text2.Contains("smart villagers")) { continue; } num++; string text3 = "1.0"; try { PropertyInfo property3 = ((object)value.Metadata).GetType().GetProperty("Version"); if (property3 != null) { object value3 = property3.GetValue(value.Metadata); if (value3 != null) { text3 = value3.ToString(); } } } catch { } PK.BeginSection(text + " (v" + text3 + ")"); PK.BeginCard(); if (val == null || val.Values.Count == 0) { PK.HelpBox("This mod has no BepInEx configuration available."); } else { foreach (ConfigEntryBase value4 in val.Values) { if (value4 == null) { continue; } string label = value4.Definition.Section + ": " + value4.Definition.Key; Type settingType = value4.SettingType; ConfigDescription description = value4.Description; string text4 = ((description != null) ? description.Description : null); if (settingType == typeof(bool)) { bool flag2 = (bool)value4.BoxedValue; bool flag3 = PK.BoolRow(label, flag2, text4); if (flag3 != flag2) { value4.BoxedValue = flag3; try { val.Save(); } catch { } } } else if (settingType == typeof(int)) { int num2 = (int)value4.BoxedValue; float num3 = PK.FloatRow(label, num2, -100000f, 100000f, text4); int num4 = Mathf.RoundToInt(num3); if (num4 != num2) { value4.BoxedValue = num4; try { val.Save(); } catch { } } } else if (settingType == typeof(float)) { float num5 = (float)value4.BoxedValue; float num6 = PK.FloatRow(label, num5, -100000f, 100000f, text4, 0.1f); if (!Mathf.Approximately(num6, num5)) { value4.BoxedValue = num6; try { val.Save(); } catch { } } } else { if (!(settingType == typeof(string))) { continue; } string text5 = (value4.BoxedValue as string) ?? ""; string text6 = PK.TextField(label, text5); if (text6 != text5) { value4.BoxedValue = text6; try { val.Save(); } catch { } } } } } PK.EndCard(); PK.EndSection(); } if (num == 0) { PK.HelpBox("No third-party mods were detected."); } } catch (Exception ex) { PK.HelpBox("Error rendering third-party configs: " + ex.Message, "error"); } PK.Footer("Changes take effect immediately and auto-save to BepInEx config files."); } private static bool IsDeathStudiosManifest(object pluginInstance) { try { Assembly assembly = pluginInstance.GetType().Assembly; if (assembly == null) { return false; } string location = assembly.Location; if (string.IsNullOrEmpty(location)) { return false; } string directoryName = Path.GetDirectoryName(location); if (string.IsNullOrEmpty(directoryName)) { return false; } string path = Path.Combine(directoryName, "manifest.json"); if (!File.Exists(path)) { return false; } string text = File.ReadAllText(path).ToLowerInvariant(); return text.Contains("death studios") || text.Contains("\"author\": \"death"); } catch { return false; } } } public static class ToggleKeybind { public const string DefaultCombo = "Home"; public static ConfigEntry CfgCombo; public static ConfigEntry CfgHasSeenPrompt; private static List _keys = new List { (Key)68 }; private static bool _capturing; private static readonly HashSet _captured = new HashSet(); public static string CurrentComboDisplay => (_keys.Count > 0) ? ComboToString(_keys) : "(unbound)"; public static bool IsCapturing => _capturing; public static string CapturePreview => (_captured.Count > 0) ? ComboToString(_captured) : "Press a key or combo…"; public static void Load(ConfigFile cfg) { CfgCombo = cfg.Bind("Keybinds", "ToggleHubKey", "Home", "Key or key combination that opens/closes the ASKA UI hub.\nSet this from the in-game HUD Settings panel, or edit it here directly.\nFormat: one or more UnityEngine.InputSystem.Key names separated by '+'.\nExamples: Home | LeftAlt+Delete | LeftCtrl+LeftShift+H"); CfgHasSeenPrompt = cfg.Bind("Keybinds", "HasSeenKeybindPrompt", false, "Internal — tracks whether the one-time first-run keybind prompt has been shown. Set to false to see the prompt again next launch."); ParseFromConfig(); CfgCombo.SettingChanged += delegate { ParseFromConfig(); }; } private static void ParseFromConfig() { List list = ParseCombo(CfgCombo?.Value); _keys = ((list.Count > 0) ? list : new List { (Key)68 }); } public static List ParseCombo(string combo) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) List list = new List(); if (string.IsNullOrWhiteSpace(combo)) { return list; } string[] array = combo.Split('+'); foreach (string text in array) { string text2 = text.Trim(); if (text2.Length != 0 && Enum.TryParse(text2, ignoreCase: true, out Key result)) { list.Add(result); } } return list; } public unsafe static string ComboToString(IEnumerable keys) { return string.Join("+", keys.Select((Key k) => ((object)(*(Key*)(&k))/*cast due to .constrained prefix*/).ToString())); } public static void SetCombo(List keys) { if (keys != null && keys.Count != 0) { string value = ComboToString(keys); if (CfgCombo != null) { CfgCombo.Value = value; } else { _keys = keys; } } } public static void ResetToDefault() { SetCombo(new List { (Key)68 }); } public static bool WasTriggeredThisFrame() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) if (Keyboard.current == null || _keys.Count == 0) { return false; } for (int i = 0; i < _keys.Count; i++) { KeyControl val = Keyboard.current[_keys[i]]; if (val == null || !((ButtonControl)val).isPressed) { return false; } } for (int j = 0; j < _keys.Count; j++) { KeyControl val2 = Keyboard.current[_keys[j]]; if (val2 != null && ((ButtonControl)val2).wasPressedThisFrame) { return true; } } return false; } public static void BeginCapture() { _capturing = true; _captured.Clear(); } public static void CancelCapture() { _capturing = false; _captured.Clear(); } public static void PumpCapture() { //IL_0070: Unknown result type (might be due to invalid IL or missing references) if (!_capturing || Keyboard.current == null) { return; } if (((ButtonControl)Keyboard.current.escapeKey).wasPressedThisFrame) { CancelCapture(); return; } bool flag = false; Enumerator enumerator = Keyboard.current.allKeys.GetEnumerator(); while (enumerator.MoveNext()) { KeyControl current = enumerator.Current; if (((ButtonControl)current).isPressed) { flag = true; _captured.Add(current.keyCode); } } if (!flag && _captured.Count > 0) { List combo = _captured.ToList(); _capturing = false; _captured.Clear(); SetCombo(combo); } } } }