using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.Json; using BepInEx; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using BepInEx.Unity.IL2CPP.Utils.Collections; using HarmonyLib; using Il2CppInterop.Runtime; using Il2CppInterop.Runtime.Attributes; using Il2CppInterop.Runtime.Injection; using Il2CppInterop.Runtime.InteropTypes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSystem; using Il2CppSystem.Collections.Generic; using Microsoft.CodeAnalysis; using OrdainUI.Core; using OrdainUI.Panels; using OrdainUI.Patches; using OrdainUI.Services; using ProjectM; using ProjectM.Network; using ProjectM.Physics; using ProjectM.UI; using Stunlock.Core; using Stunlock.Localization; using TMPro; using Unity.Collections; using Unity.Collections.LowLevel.Unsafe; using Unity.Entities; using Unity.Transforms; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("OrdainUI")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("0.2.1.0")] [assembly: AssemblyInformationalVersion("0.2.1")] [assembly: AssemblyProduct("OrdainUI")] [assembly: AssemblyTitle("OrdainUI")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.2.1.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace OrdainUI { public class OrdainUIBehaviour : MonoBehaviour { private static bool _uiReady = false; private static MainMenuScreen _mainMenu; private static GOMSStatsPanel _statsPanel; private static InspectPlayerPanel _inspectPanel; private static ImagePreviewPanel _imagePreviewPanel; private static UIDesignPanel _uiDesignPanel; private static FamiliarPanel _familiarPanel; private static ForgePanel _forgePanel; private static QuestPanel _questPanel; private static AchievementsPanel _achPanel; private static VFXPanel _vfxPanel; private static UISettingsPanel _settingsPanel; private static LeaderboardPanel _lbPanel; private static HUDOverlay _hud; private static EventHUD _eventHUD; private static EventPhaseBannerHUD _eventPhaseBanner; private static QuestTrackerHUD _questTrackerHUD; private static NotificationPopup _notificationPopup; private static NPCPromptHUD _npcPromptHUD; private static NPCDialoguePanel _npcDialoguePanel; private static RiteOfferingPanel _riteOfferingPanel; private static TimerHUD _timerHUD; private static IchorHUD _ichorHUD; private static bool _dragLocked = true; private static bool _cursorOverridden = false; private static CursorLockMode _savedLockMode; private static bool _savedCursorVisible; private static bool _dirtyMainMenu = true; private static bool _dirtyStats = true; private static bool _dirtyFamiliar = true; private static bool _dirtyForge = true; private static bool _dirtyQuest = true; private static bool _dirtyAchievements = true; private static bool _dirtyLeaderboard = true; private static bool _dirtySettings = true; private static bool _dirtyInspect = true; private static bool _inspectPanelActive = false; private static SystemFeedPanel _systemFeedPanel; public OrdainUIBehaviour(IntPtr ptr) : base(ptr) { } [HideFromIl2Cpp] public static void MarkMainMenuDirty() { _dirtyMainMenu = true; } [HideFromIl2Cpp] public static void MarkStatsDirty() { _dirtyStats = true; } [HideFromIl2Cpp] public static void MarkFamiliarDirty() { _dirtyFamiliar = true; } public static void MarkForgeDirty() { _dirtyForge = true; } [HideFromIl2Cpp] public static void MarkQuestDirty() { _dirtyQuest = true; } [HideFromIl2Cpp] public static void MarkAchievementsDirty() { _dirtyAchievements = true; } [HideFromIl2Cpp] public static void MarkLeaderboardDirty() { _dirtyLeaderboard = true; } [HideFromIl2Cpp] public static void MarkSettingsDirty() { _dirtySettings = true; } [HideFromIl2Cpp] public static void MarkInspectDirty() { _dirtyInspect = true; } [HideFromIl2Cpp] public static void MarkAllPanelsDirty() { _dirtyMainMenu = true; _dirtyStats = true; _dirtyFamiliar = true; _dirtyQuest = true; _dirtyAchievements = true; _dirtyLeaderboard = true; _dirtySettings = true; _dirtyInspect = true; } [HideFromIl2Cpp] public static void SetUIReady(bool ready) { _uiReady = ready; Plugin.Verbose($"[OrdainUI] UIReady = {ready}"); if (ready) { _hud = new HUDOverlay(); _hud.Create(); _eventHUD = new EventHUD(); _eventPhaseBanner = new EventPhaseBannerHUD(); _questTrackerHUD = new QuestTrackerHUD(); _notificationPopup = new NotificationPopup(); _npcPromptHUD = new NPCPromptHUD(); _npcPromptHUD.Create(); _npcDialoguePanel = new NPCDialoguePanel(); _npcDialoguePanel.Create(); _riteOfferingPanel = new RiteOfferingPanel(); _riteOfferingPanel.Create(); _timerHUD = new TimerHUD(); _timerHUD.Create(); _ichorHUD = new IchorHUD(); _ichorHUD.Create(); MarkAllPanelsDirty(); } } [HideFromIl2Cpp] public static void SetDragLocked(bool locked) { _dragLocked = locked; UIConfig.UILocked = locked; } [HideFromIl2Cpp] public static void ResetHUDPositions() { _hud?.Destroy(); _hud = new HUDOverlay(); _hud.Create(); _questTrackerHUD?.Destroy(); _questTrackerHUD = new QuestTrackerHUD(); _systemFeedPanel?.Destroy(); _npcPromptHUD?.Destroy(); _npcPromptHUD = new NPCPromptHUD(); _npcPromptHUD.Create(); } [HideFromIl2Cpp] public static void OpenNPCPanel(string npcId, string npcName, string npcType) { Plugin.Verbose($"[OrdainUI:NPC] OpenNPCPanel — id={npcId}, name={npcName}, type={npcType}"); MainMenuScreen mainMenu = _mainMenu; if (mainMenu != null && mainMenu.IsVisible) { _mainMenu.Hide(); } _npcDialoguePanel?.Show(npcId, npcName, npcType); } [HideFromIl2Cpp] public static void OpenInspectPanel(string targetName) { if (_uiReady && OrdainUI.Core.Core.Initialized) { EnsureInspectPanel(); _mainMenu?.Hide(); _statsPanel?.Hide(); _inspectPanelActive = true; UIData.InspectPanelOpen = true; _inspectPanel.Show(targetName); MarkInspectDirty(); } } [HideFromIl2Cpp] public static void CloseInspectPanel() { _inspectPanelActive = false; UIData.InspectPanelOpen = false; InspectPlayerPanel inspectPanel = _inspectPanel; if (inspectPanel != null && inspectPanel.IsVisible) { _inspectPanel.Hide(); } MarkInspectDirty(); } [HideFromIl2Cpp] public static void OpenImagePreviewPanel(string imagePath) { if (_uiReady && OrdainUI.Core.Core.Initialized) { EnsureImagePreviewPanel(); _imagePreviewPanel.Show(imagePath); } } [HideFromIl2Cpp] public static void CloseImagePreviewPanel() { ImagePreviewPanel imagePreviewPanel = _imagePreviewPanel; if (imagePreviewPanel != null && imagePreviewPanel.IsVisible) { _imagePreviewPanel.Hide(); } } [HideFromIl2Cpp] public static void OpenUIDesignPanel(string imagePath) { if (_uiReady && OrdainUI.Core.Core.Initialized) { EnsureUIDesignPanel(); _uiDesignPanel.Show(imagePath); } } [HideFromIl2Cpp] public static void CloseUIDesignPanel() { UIDesignPanel uiDesignPanel = _uiDesignPanel; if (uiDesignPanel != null && uiDesignPanel.IsVisible) { _uiDesignPanel.Hide(); } } [HideFromIl2Cpp] public static void SetNPCDialogueNode(string npcId, string nodeId, string text, int choiceCount) { _npcDialoguePanel?.SetNode(npcId, nodeId, text, choiceCount); } public static void TimerBegin(long endUtcMs, string label, bool flashOnZero) { _timerHUD?.Begin(endUtcMs, label, flashOnZero); } public static void TimerStop() { _timerHUD?.Stop(); } public static void IchorSet(long value) { _ichorHUD?.SetValue(value); } public static void IchorHide() { _ichorHUD?.HideCounter(); } [HideFromIl2Cpp] public static void AddNPCChoice(string choiceId, string choiceText, string action) { _npcDialoguePanel?.AddChoice(choiceId, choiceText, action); } [HideFromIl2Cpp] public static void OnNPCChoiceResult(bool success, string message) { _npcDialoguePanel?.OnChoiceResult(success, message); } [HideFromIl2Cpp] public static void ApplyUIScale(float scale) { GameObject[] array = (GameObject[])(object)new GameObject[0]; for (int i = 0; i < array.Length; i++) { _ = array[i]; } } [HideFromIl2Cpp] public static void ApplyOpacity(float opacity) { } [HideFromIl2Cpp] public static void EnqueueNotification(string text, string type, float duration) { _notificationPopup?.Enqueue(text, type, duration); } private void Update() { //IL_00ae: Unknown result type (might be due to invalid IL or missing references) if (!OrdainUI.Core.Core.Initialized || !_uiReady) { return; } NativeMenuWatcher.Tick(); MainMenuScreen mainMenu = _mainMenu; CameraInputPatch.OrdainMenuOpen = (mainMenu != null && mainMenu.IsVisible) || (_npcDialoguePanel?.IsVisible ?? false); ShadowHoverBox.Tick(); if (Input.GetKeyDown((KeyCode)282)) { CommandSender.FamQuickSummon(); } if (Input.GetKeyDown((KeyCode)287)) { NPCDialoguePanel npcDialoguePanel = _npcDialoguePanel; if (npcDialoguePanel == null || !npcDialoguePanel.IsVisible) { if (_mainMenu == null) { CreateMainMenu(); } _mainMenu.Toggle(); CommandSender.QuestUiOpened(); } } if (Input.GetKeyDown((KeyCode)289)) { _questTrackerHUD?.CycleMode(); } if (Input.GetKeyDown(UIConfig.NPCInteractKeyCode)) { NPCDialoguePanel npcDialoguePanel2 = _npcDialoguePanel; if (npcDialoguePanel2 == null || !npcDialoguePanel2.IsVisible) { RiteOfferingManager.OfferingRecord offeringRecord = _npcPromptHUD?.ActiveOffering; if (offeringRecord != null) { if (_riteOfferingPanel != null && !_riteOfferingPanel.IsVisible) { _riteOfferingPanel.Show(offeringRecord); } } else { NPCManager.NPCClientRecord nPCClientRecord = _npcPromptHUD?.ActiveNPC; if (nPCClientRecord != null) { CommandSender.NPCInteract(nPCClientRecord.Id); } } } } RiteOfferingPanel riteOfferingPanel = _riteOfferingPanel; if (riteOfferingPanel != null && riteOfferingPanel.IsVisible && !RiteOfferingManager.HasOffering) { _riteOfferingPanel.Hide(); } if (Input.GetKeyDown((KeyCode)27)) { HandleEscape(); } MainMenuScreen mainMenu2 = _mainMenu; int num; if (mainMenu2 == null || !mainMenu2.IsVisible) { GOMSStatsPanel statsPanel = _statsPanel; if (statsPanel == null || !statsPanel.IsVisible) { InspectPlayerPanel inspectPanel = _inspectPanel; if (inspectPanel == null || !inspectPanel.IsVisible) { ImagePreviewPanel imagePreviewPanel = _imagePreviewPanel; if (imagePreviewPanel == null || !imagePreviewPanel.IsVisible) { UIDesignPanel uiDesignPanel = _uiDesignPanel; if (uiDesignPanel == null || !uiDesignPanel.IsVisible) { FamiliarPanel familiarPanel = _familiarPanel; if (familiarPanel == null || !familiarPanel.IsVisible) { ForgePanel forgePanel = _forgePanel; if (forgePanel == null || !forgePanel.IsVisible) { QuestPanel questPanel = _questPanel; if (questPanel == null || !questPanel.IsVisible) { AchievementsPanel achPanel = _achPanel; if (achPanel == null || !achPanel.IsVisible) { VFXPanel vfxPanel = _vfxPanel; if (vfxPanel == null || !vfxPanel.IsVisible) { UISettingsPanel settingsPanel = _settingsPanel; if (settingsPanel == null || !settingsPanel.IsVisible) { LeaderboardPanel lbPanel = _lbPanel; if (lbPanel == null || !lbPanel.IsVisible) { num = ((_npcDialoguePanel?.IsVisible ?? false) ? 1 : 0); goto IL_025f; } } } } } } } } } } } } num = 1; goto IL_025f; IL_025f: UpdateCursor((byte)num != 0); MainMenuScreen mainMenu3 = _mainMenu; if (mainMenu3 != null && mainMenu3.IsVisible && _dirtyMainMenu) { _mainMenu.Refresh(); _dirtyMainMenu = false; } GOMSStatsPanel statsPanel2 = _statsPanel; if (statsPanel2 != null && statsPanel2.IsVisible && _dirtyStats) { _statsPanel.Refresh(); _dirtyStats = false; } InspectPlayerPanel inspectPanel2 = _inspectPanel; if (inspectPanel2 != null && inspectPanel2.IsVisible && _dirtyInspect) { _inspectPanel.Refresh(); _dirtyInspect = false; } FamiliarPanel familiarPanel2 = _familiarPanel; if (familiarPanel2 != null && familiarPanel2.IsVisible && _dirtyFamiliar) { _familiarPanel.Refresh(); _dirtyFamiliar = false; } ForgePanel forgePanel2 = _forgePanel; if (forgePanel2 != null && forgePanel2.IsVisible && _dirtyForge) { _forgePanel.Refresh(); _dirtyForge = false; } QuestPanel questPanel2 = _questPanel; if (questPanel2 != null && questPanel2.IsVisible && _dirtyQuest) { _questPanel.Refresh(); _dirtyQuest = false; } AchievementsPanel achPanel2 = _achPanel; if (achPanel2 != null && achPanel2.IsVisible && _dirtyAchievements) { _achPanel.Refresh(); _dirtyAchievements = false; } UISettingsPanel settingsPanel2 = _settingsPanel; if (settingsPanel2 != null && settingsPanel2.IsVisible && _dirtySettings) { _settingsPanel.Refresh(); _dirtySettings = false; } LeaderboardPanel lbPanel2 = _lbPanel; if (lbPanel2 != null && lbPanel2.IsVisible && _dirtyLeaderboard) { _lbPanel.Refresh(); _dirtyLeaderboard = false; } QuestPanel questPanel3 = _questPanel; if (questPanel3 != null && questPanel3.IsVisible) { _questPanel.TickInput(); } AchievementsPanel achPanel3 = _achPanel; if (achPanel3 != null && achPanel3.IsVisible) { _achPanel.TickInput(); } LeaderboardPanel lbPanel3 = _lbPanel; if (lbPanel3 != null && lbPanel3.IsVisible) { _lbPanel.TickInput(); } FamiliarPanel familiarPanel3 = _familiarPanel; if (familiarPanel3 != null && familiarPanel3.IsVisible) { _familiarPanel.TickInput(); } _hud?.Refresh(); _eventHUD?.Refresh(); _eventPhaseBanner?.Refresh(); _questTrackerHUD?.Refresh(); _notificationPopup?.Update(); _npcPromptHUD?.Refresh(); _timerHUD?.Tick(Time.deltaTime); CanvasService.ButtonUpdate(); if (num != 0 && !_dragLocked) { CanvasService.DragUpdate(); } } private void CreateMainMenu() { _mainMenu = new MainMenuScreen(delegate { EnsureStatsPanel(); _inspectPanel?.Hide(); UIData.InspectPanelOpen = false; _statsPanel.Show(); }, delegate { if (_familiarPanel == null) { _familiarPanel = new FamiliarPanel(delegate { _mainMenu?.Toggle(); }); } _familiarPanel.Show(); }, delegate { if (_questPanel == null) { _questPanel = new QuestPanel(delegate { _mainMenu?.Toggle(); }); } _questPanel.Show(); }, delegate { if (_achPanel == null) { _achPanel = new AchievementsPanel(delegate { _mainMenu?.Toggle(); }); } _achPanel.Show(); }, delegate { if (_settingsPanel == null) { _settingsPanel = new UISettingsPanel(delegate { _mainMenu?.Toggle(); }); } _settingsPanel.Show(); }, delegate { if (_lbPanel == null) { _lbPanel = new LeaderboardPanel(delegate { _mainMenu?.Toggle(); }); } _lbPanel.Show(); }, delegate { if (_forgePanel == null) { _forgePanel = new ForgePanel(delegate { _mainMenu?.Toggle(); }); } _forgePanel.Show(); }); } private static void EnsureStatsPanel() { if (_statsPanel == null) { _statsPanel = new GOMSStatsPanel(delegate { _mainMenu?.Toggle(); }); } } private static void EnsureInspectPanel() { if (_inspectPanel == null) { _inspectPanel = new InspectPlayerPanel(delegate { _inspectPanelActive = false; UIData.InspectPanelOpen = false; _inspectPanel?.Hide(); }); } } private static void EnsureImagePreviewPanel() { if (_imagePreviewPanel == null) { _imagePreviewPanel = new ImagePreviewPanel(); } } private static void EnsureUIDesignPanel() { if (_uiDesignPanel == null) { _uiDesignPanel = new UIDesignPanel(); } } private static void UpdateCursor(bool uiOpen) { //IL_003e: 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_0015: Unknown result type (might be due to invalid IL or missing references) InputPatches.BlockCursorLock = uiOpen; if (uiOpen) { if (!_cursorOverridden) { _savedLockMode = Cursor.lockState; _savedCursorVisible = Cursor.visible; _cursorOverridden = true; } Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; } else { if (!_cursorOverridden) { return; } Cursor.lockState = _savedLockMode; Cursor.visible = _savedCursorVisible; _cursorOverridden = false; try { EventSystem current = EventSystem.current; if ((Object)(object)current != (Object)null) { current.SetSelectedGameObject((GameObject)null); } } catch { } } } private void HandleEscape() { RiteOfferingPanel riteOfferingPanel = _riteOfferingPanel; if (riteOfferingPanel != null && riteOfferingPanel.IsVisible) { _riteOfferingPanel.Hide(); return; } NPCDialoguePanel npcDialoguePanel = _npcDialoguePanel; if (npcDialoguePanel != null && npcDialoguePanel.IsVisible) { _npcDialoguePanel.Hide(); return; } InspectPlayerPanel inspectPanel = _inspectPanel; if (inspectPanel != null && inspectPanel.IsVisible) { _inspectPanel.Hide(); _inspectPanelActive = false; UIData.InspectPanelOpen = false; return; } ImagePreviewPanel imagePreviewPanel = _imagePreviewPanel; if (imagePreviewPanel != null && imagePreviewPanel.IsVisible) { _imagePreviewPanel.Hide(); return; } UIDesignPanel uiDesignPanel = _uiDesignPanel; if (uiDesignPanel != null && uiDesignPanel.IsVisible) { _uiDesignPanel.Hide(); return; } LeaderboardPanel lbPanel = _lbPanel; if (lbPanel != null && lbPanel.IsVisible) { _lbPanel.Hide(); ShowMainMenu(); return; } UISettingsPanel settingsPanel = _settingsPanel; if (settingsPanel != null && settingsPanel.IsVisible) { _settingsPanel.Hide(); ShowMainMenu(); return; } AchievementsPanel achPanel = _achPanel; if (achPanel != null && achPanel.IsVisible) { _achPanel.Hide(); ShowMainMenu(); return; } ForgePanel forgePanel = _forgePanel; if (forgePanel != null && forgePanel.IsVisible) { _forgePanel.Hide(); ShowMainMenu(); return; } QuestPanel questPanel = _questPanel; if (questPanel != null && questPanel.IsVisible) { _questPanel.Hide(); ShowMainMenu(); return; } FamiliarPanel familiarPanel = _familiarPanel; if (familiarPanel != null && familiarPanel.IsVisible) { _familiarPanel.Hide(); ShowMainMenu(); return; } GOMSStatsPanel statsPanel = _statsPanel; if (statsPanel != null && statsPanel.IsVisible) { _statsPanel.Hide(); if (_inspectPanelActive) { _inspectPanelActive = false; _statsPanel.ClearInspectContext(); } else { ShowMainMenu(); } return; } VFXPanel vfxPanel = _vfxPanel; if (vfxPanel != null && vfxPanel.IsVisible) { _vfxPanel.Hide(); return; } MainMenuScreen mainMenu = _mainMenu; if (mainMenu != null && mainMenu.IsVisible) { _mainMenu.Hide(); } } private void ShowMainMenu() { if (_mainMenu == null) { CreateMainMenu(); } MainMenuScreen mainMenu = _mainMenu; if (mainMenu == null || !mainMenu.IsVisible) { _mainMenu?.Toggle(); } } private void OnDestroy() { _mainMenu?.Dispose(); _statsPanel?.Dispose(); _inspectPanel?.Dispose(); _imagePreviewPanel?.Dispose(); _uiDesignPanel?.Dispose(); _familiarPanel?.Dispose(); _questPanel?.Dispose(); _achPanel?.Dispose(); _vfxPanel?.Dispose(); _settingsPanel?.Dispose(); _lbPanel?.Dispose(); _hud?.Destroy(); _eventHUD?.Destroy(); _eventPhaseBanner?.Destroy(); _questTrackerHUD?.Destroy(); _notificationPopup?.Destroy(); _npcPromptHUD?.Destroy(); _npcPromptHUD = null; _npcDialoguePanel?.Dispose(); _npcDialoguePanel = null; _mainMenu = null; _statsPanel = null; _inspectPanel = null; _imagePreviewPanel = null; _uiDesignPanel = null; _familiarPanel = null; _questPanel = null; _achPanel = null; _vfxPanel = null; _settingsPanel = null; _lbPanel = null; _hud = null; _eventHUD = null; _eventPhaseBanner = null; _questTrackerHUD = null; _notificationPopup = null; _uiReady = false; _dragLocked = true; _inspectPanelActive = false; _cursorOverridden = false; MarkAllPanelsDirty(); InputPatches.BlockCursorLock = false; } } public static class UIConfig { private class SavedSettings { public bool ShowXPBar { get; set; } = true; public bool ShowClassHUD { get; set; } = true; public bool ShowFamiliarStatus { get; set; } = true; public bool ShowNotifications { get; set; } = true; public bool ShowEventHUD { get; set; } = true; public bool ShowQuestTracker { get; set; } = true; public bool ShowSystemFeed { get; set; } = true; public bool SuppressFamCommands { get; set; } = true; public float UIScale { get; set; } = 1f; public float UIPanelOpacity { get; set; } = 0.92f; } public static bool ShowXPBar = true; public static bool ShowClassHUD = true; public static bool ShowFamiliarStatus = true; public static bool ShowNotifications = true; public static bool ShowEventHUD = true; public static bool ShowQuestTracker = true; public static bool ShowSystemFeed = true; public static bool UILocked = true; public static bool SuppressFamCommands = true; public static float UIScale = 1f; public static float UIPanelOpacity = 0.92f; public static KeyCode NPCInteractKeyCode = (KeyCode)284; private static string SettingsPath => Path.Combine(Paths.ConfigPath, "OrdainUI_Settings.json"); public static string NPCInteractKey { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: 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_0009: Invalid comparison between Unknown and I4 //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Invalid comparison between Unknown and I4 //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected I4, but got Unknown //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Invalid comparison between Unknown and I4 KeyCode nPCInteractKeyCode = NPCInteractKeyCode; if ((int)nPCInteractKeyCode <= 103) { if ((int)nPCInteractKeyCode == 101) { return "E"; } if ((int)nPCInteractKeyCode == 103) { return "G"; } } else { if ((int)nPCInteractKeyCode == 116) { return "T"; } switch (nPCInteractKeyCode - 282) { case 0: return "F1"; case 1: return "F2"; case 2: return "F3"; case 3: return "F4"; case 4: return "F5"; case 8: return "F9"; case 9: return "F10"; } } return ((object)Unsafe.As(ref NPCInteractKeyCode)/*cast due to .constrained prefix*/).ToString(); } } public static void Load() { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown try { if (File.Exists(SettingsPath)) { SavedSettings savedSettings = JsonSerializer.Deserialize(File.ReadAllText(SettingsPath)); if (savedSettings != null) { ShowXPBar = savedSettings.ShowXPBar; ShowClassHUD = savedSettings.ShowClassHUD; ShowFamiliarStatus = savedSettings.ShowFamiliarStatus; ShowNotifications = savedSettings.ShowNotifications; ShowEventHUD = savedSettings.ShowEventHUD; ShowQuestTracker = savedSettings.ShowQuestTracker; ShowSystemFeed = savedSettings.ShowSystemFeed; SuppressFamCommands = savedSettings.SuppressFamCommands; UIScale = savedSettings.UIScale; UIPanelOpacity = savedSettings.UIPanelOpacity; } } } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(36, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[OrdainUI] Failed to load settings: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } logger.LogWarning(val); } } public static void Save() { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown try { SavedSettings value = new SavedSettings { ShowXPBar = ShowXPBar, ShowClassHUD = ShowClassHUD, ShowFamiliarStatus = ShowFamiliarStatus, ShowNotifications = ShowNotifications, ShowEventHUD = ShowEventHUD, ShowQuestTracker = ShowQuestTracker, ShowSystemFeed = ShowSystemFeed, SuppressFamCommands = SuppressFamCommands, UIScale = UIScale, UIPanelOpacity = UIPanelOpacity }; File.WriteAllText(SettingsPath, JsonSerializer.Serialize(value)); } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(36, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[OrdainUI] Failed to save settings: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } logger.LogWarning(val); } } } public static class UIData { public class BoxInfo { public string Name; public int Count; public int Max = 10; } public class FamiliarListEntry { public int Index; public string Name; public string Rarity; public bool IsShiny; public int Level; public bool IsActive; } public class TriviaScore { public string Name; public int Score; } public class PartyMember { public string Name; public string ClassName; public float HP; public float MaxHP; public bool IsDead; public bool IsDisconnected; } public class LBEntry { public int Rank { get; set; } public string Name { get; set; } public string Value { get; set; } } public class LeaderboardData { public string BoardType = ""; public List Entries = new List(); public LBEntry PlayerEntry; public bool Loading; } public class QuestEntry { public string Id; public string Category; public string Status; public string Title; public string Description; public string Requirements; public string Location; public string RewardPreview; public int Progress; public int Required; public bool Completed; public bool Claimed; public bool CanClaim; } public class QuestHistoryEntry { public string Timestamp; public string Message; } public class AchievementEntry { public string Id; public string Title; public string Description; public string Category; public int Tier; public bool Secret; public bool AdminOnly; public int Required; public int Points; public long Progress; public bool Unlocked; } public class ParagonPerkEntry { public string Key; public string Name; public string Alias; public int Rank; public int MaxRank; public int NextCost; public string NextDescription; } public static class Forge { public static bool HasWeapon = false; public static string WeaponId = ""; public static string WeaponName = ""; public static List Nodes = new List(); } public class ForgeNode { public int Slot; public int Guid; public string Name = ""; public float Cooldown; public bool Selected; } public static string PlayerName = ""; public static string EventDisplayName = "None Currently Active"; public static string QuestDisplayName = "To Be Added Later"; public static string ServerTimeText = "--:--"; public static bool HasActiveStoryQuest = false; public static string StoryQuestId = ""; public static string StoryQuestTitle = ""; public static string StoryStepText = ""; public static int StoryStepProgress = 0; public static int StoryStepRequired = 1; public static string StoryRewardPreview = ""; public static int StoryCompletedCount = 0; public static int StoryClaimableCount = 0; public static bool HasStoryTargetNpc = false; public static string StoryTargetNpcId = ""; public static string StoryTargetNpcName = ""; public static string StoryTargetNpcStage = ""; public static float StoryTargetNpcSpawnRange = 0f; public static string DailyResetText = ""; public static string WeeklyResetText = ""; public static List StoryQuests = new List(); public static List DailyQuests = new List(); public static List WeeklyQuests = new List(); public static List EventQuests = new List(); public static List CompletedQuests = new List(); public const int MaxQuestHistoryEntries = 5; public static List QuestHistory = new List(); public static int AchievementCatalogCount = 0; public static int AchievementCatalogHash = 0; public static int AchievementPoints = 0; public static int AchievementUnlockedCount = 0; public static int AchievementTotalCount = 0; public static int EventPoints = 0; public static int EventWins = 0; public static int EventParticipations = 0; public static Dictionary Achievements = new Dictionary(StringComparer.OrdinalIgnoreCase); public static LeaderboardData Leaderboard = new LeaderboardData(); public static bool InspectPanelOpen = false; public static string InspectName = ""; public static string InspectPortraitKey = ""; public static string InspectTitle = ""; public static string InspectTitleColor = "#FFD700"; public static string InspectClassName = "None"; public static int InspectLevel = 0; public static int InspectParagonLevel = 0; public static int InspectLevelRank = 0; public static int InspectVBloodRank = 0; public static int InspectMonsterRank = 0; public static int InspectWorldFirstRank = 0; public static int InspectFamiliarRank = 0; public static int InspectEventPointsRank = 0; public static int InspectEventWinsRank = 0; public static int InspectVBloodKills = 0; public static long InspectMonsterKills = 0L; public static int InspectWorldFirsts = 0; public static int InspectFamiliarsUnlocked = 0; public static int InspectEventPoints = 0; public static int InspectEventWins = 0; public static int InspectEventParticipations = 0; public static int Level = 0; public static float Experience = 0f; public static float ExperienceNeeded = 100f; public static int GearScore = 0; public static int UnspentAP = 0; public static bool IsParagon = false; public static int ParagonLevel = 0; public static int StatSTR = 0; public static int StatINT = 0; public static int StatDEX = 0; public static int StatLUK = 0; public static int StatCD = 0; public static int StatMS = 0; public static int StatHP = 0; public static int StatBE = 0; public static float AppliedPhysicalPower = 0f; public static float AppliedPhysicalLifeLeech = 0f; public static float AppliedSpellPower = 0f; public static float AppliedSpellLifeLeech = 0f; public static float AppliedAttackSpeed = 0f; public static float AppliedPhysicalCritChance = 0f; public static float AppliedSpellCritChance = 0f; public static float AppliedPhysicalCritDamage = 0f; public static float AppliedSpellCritDamage = 0f; public static float AppliedMovementSpeed = 0f; public static float AppliedMaxHealth = 0f; public static long IronBars = -1L; public static float AppliedReducedBloodDrain = 0f; public static float ParagonXP = 0f; public static float ParagonXPNeeded = 0f; public static int ParagonUnspentPoints = 0; public static int ParagonSpentPoints = 0; public static int ParagonMaxLevel = 300; public static Dictionary ParagonPerks = new Dictionary(StringComparer.OrdinalIgnoreCase); public static string ClassName = "None"; public static string ClassTitle = ""; public static string ClassPassive = ""; public static string ClassAscendance = ""; public static int Stacks = 0; public static int MaxStacks = 100; public static bool AscendanceActive = false; public static int AscendanceCooldown = 0; public static bool AscendanceLocked = false; public static string FamiliarName = ""; public static string FamiliarRarity = "Common"; public static bool FamiliarIsShiny = false; public static int FamiliarLevel = 0; public static float FamiliarHP = 0f; public static float FamiliarMaxHP = 100f; public static bool FamiliarActive = false; public static int FamiliarBondLevel = 1; public static string FamiliarBondName = "Stranger"; public static string FamiliarMode = ""; public static int FamiliarUnspentAP = 0; public static int FamiliarHPAlloc = 0; public static int FamiliarPhysAlloc = 0; public static int FamiliarSpellAlloc = 0; public static float FamiliarXP = 0f; public static float FamiliarXPNext = 100f; public static bool FamiliarEverstone = false; public static string ActiveBoxName = ""; public static List Boxes = new List(); public static List FamiliarList = new List(); public static string EventName = ""; public static string EventState = ""; public static string EventPhase = ""; public static float EventPhaseTimer = 0f; public static int EventActivePlayers = 0; public static int EventEliminatedPlayers = 0; public static string EventPlayerStatus = ""; public static bool InEvent = false; public static string TriviaQuestion = ""; public static int TriviaRound = 0; public static int TriviaTotalRounds = 0; public static List TriviaScores = new List(); public static string DungeonName = ""; public static int DungeonRoom = 0; public static int DungeonTotalRooms = 0; public static string DungeonRoomType = ""; public static float DungeonTime = 0f; public static bool InDungeon = false; public static string BossName = ""; public static float BossHP = 0f; public static float BossMaxHP = 0f; public static bool BossActive = false; public static List Party = new List(); public static void AddQuestHistory(string message) { if (string.IsNullOrWhiteSpace(message)) { return; } string text = message.Trim(); if (QuestHistory.Count <= 0 || !string.Equals(QuestHistory[0].Message, text, StringComparison.Ordinal)) { QuestHistory.Insert(0, new QuestHistoryEntry { Timestamp = DateTime.Now.ToString("HH:mm", CultureInfo.InvariantCulture), Message = text }); if (QuestHistory.Count > 5) { QuestHistory.RemoveRange(5, QuestHistory.Count - 5); } } } } public static class UIStyles { private const float TEXT_SCALE = 1.08f; public static readonly Color PanelBG = new Color(0.1f, 0.1f, 0.18f, 0.9f); public static readonly Color PanelBorder = new Color(0.16f, 0.16f, 0.3f, 1f); public static readonly Color HeaderBG = new Color(0.12f, 0.12f, 0.22f, 0.95f); public static readonly Color ButtonNormal = new Color(0.18f, 0.18f, 0.3f, 1f); public static readonly Color ButtonHover = new Color(0.25f, 0.25f, 0.4f, 1f); public static readonly Color TextPrimary = Color.white; public static readonly Color TextSecondary = new Color(0.62f, 0.62f, 0.62f, 1f); public static readonly Color TextGold = new Color(1f, 0.84f, 0f, 1f); public static readonly Color TextDanger = new Color(1f, 0.27f, 0.27f, 1f); public static readonly Color TextSuccess = new Color(0.27f, 1f, 0.27f, 1f); public static readonly Color TextPink = new Color(1f, 0.41f, 0.71f, 1f); public static readonly Color BarBG = new Color(0.2f, 0.2f, 0.2f, 0.8f); public static readonly Color BarBorder = new Color(0.3f, 0.3f, 0.3f, 1f); public static readonly Color Blood = new Color(1f, 0f, 0f, 1f); public static readonly Color Chaos = new Color(0.61f, 0.19f, 1f, 1f); public static readonly Color Frost = new Color(0f, 0.5f, 1f, 1f); public static readonly Color Storm = new Color(1f, 0.84f, 0f, 1f); public static readonly Color Illusion = new Color(0f, 1f, 1f, 1f); public static readonly Color Unholy = new Color(0f, 1f, 0f, 1f); public static readonly Color Common = new Color(0.7f, 0.7f, 0.7f, 1f); public static readonly Color Uncommon = new Color(0.12f, 0.8f, 0.12f, 1f); public static readonly Color Rare = new Color(0.25f, 0.5f, 1f, 1f); public static readonly Color Epic = new Color(0.64f, 0.21f, 0.93f, 1f); public static readonly Color Legendary = new Color(1f, 0.84f, 0f, 1f); private static Texture2D _whiteTex; private static Texture2D _barBGTex; private static bool _initialized = false; public static void Initialize() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (!_initialized) { _whiteTex = MakeTex(2, 2, Color.white); _barBGTex = MakeTex(2, 2, BarBG); _initialized = true; } } public static void DrawText(Rect rect, string text, Color color, int fontSize = 13, bool bold = false, bool centered = false) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_008e: Unknown result type (might be due to invalid IL or missing references) GUIStyle label = GUI.skin.label; Color textColor = label.normal.textColor; int fontSize2 = label.fontSize; FontStyle fontStyle = label.fontStyle; TextAnchor alignment = label.alignment; label.normal.textColor = color; label.fontSize = Mathf.Max(9, Mathf.RoundToInt((float)fontSize * 1.08f)); label.fontStyle = (FontStyle)(bold ? 1 : 0); label.alignment = (TextAnchor)(centered ? 4 : 3); GUI.Label(rect, text); label.normal.textColor = textColor; label.fontSize = fontSize2; label.fontStyle = fontStyle; label.alignment = alignment; } public static bool DrawButton(Rect rect, string text, Color textColor = default(Color)) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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_0019: Unknown result type (might be due to invalid IL or missing references) //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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_004e: 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_0041: 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_006b: Unknown result type (might be due to invalid IL or missing references) if (textColor == default(Color)) { textColor = TextPrimary; } DrawRect(rect, ButtonNormal); DrawBorder(rect, PanelBorder); if (((Rect)(ref rect)).Contains(Event.current.mousePosition)) { DrawRect(rect, ButtonHover); } DrawText(rect, text, textColor, 13, bold: false, centered: true); if ((int)Event.current.type == 0 && ((Rect)(ref rect)).Contains(Event.current.mousePosition)) { Event.current.Use(); return true; } return false; } public static void DrawBar(Rect rect, float fillPercent, Color fillColor) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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) Initialize(); GUI.DrawTexture(rect, (Texture)(object)_barBGTex); if (fillPercent > 0f) { Rect val = new Rect(((Rect)(ref rect)).x + 1f, ((Rect)(ref rect)).y + 1f, (((Rect)(ref rect)).width - 2f) * Mathf.Clamp01(fillPercent), ((Rect)(ref rect)).height - 2f); Color color = GUI.color; GUI.color = fillColor; GUI.DrawTexture(val, (Texture)(object)_whiteTex); GUI.color = color; } DrawBorder(rect, BarBorder); } public static void DrawRect(Rect rect, Color color) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: 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) Initialize(); Color color2 = GUI.color; GUI.color = color; GUI.DrawTexture(rect, (Texture)(object)_whiteTex); GUI.color = color2; } public static void DrawBorder(Rect rect, Color color) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: 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_0059: 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_00b1: Unknown result type (might be due to invalid IL or missing references) Initialize(); Color color2 = GUI.color; GUI.color = color; GUI.DrawTexture(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width, 1f), (Texture)(object)_whiteTex); GUI.DrawTexture(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).yMax - 1f, ((Rect)(ref rect)).width, 1f), (Texture)(object)_whiteTex); GUI.DrawTexture(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, 1f, ((Rect)(ref rect)).height), (Texture)(object)_whiteTex); GUI.DrawTexture(new Rect(((Rect)(ref rect)).xMax - 1f, ((Rect)(ref rect)).y, 1f, ((Rect)(ref rect)).height), (Texture)(object)_whiteTex); GUI.color = color2; } public static Color GetClassColor(string className) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_0056: 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_0082: 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) if (className == null) { return TextPrimary; } string text = className.ToLowerInvariant(); if (text.StartsWith("blood")) { return Blood; } if (text.StartsWith("chaos")) { return Chaos; } if (text.StartsWith("frost")) { return Frost; } if (text.StartsWith("storm")) { return Storm; } if (text.StartsWith("illusion")) { return Illusion; } if (text.StartsWith("unholy")) { return Unholy; } return TextPrimary; } private static Texture2D MakeTex(int width, int height, Color color) { //IL_000f: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown Color[] array = (Color[])(object)new Color[width * height]; for (int i = 0; i < array.Length; i++) { array[i] = color; } Texture2D val = new Texture2D(width, height); val.SetPixels(Il2CppStructArray.op_Implicit(array)); val.Apply(); ((Object)val).hideFlags = (HideFlags)61; return val; } } public static class MyPluginInfo { public const string PLUGIN_GUID = "ordain.ui"; public const string PLUGIN_NAME = "OrdainUI"; public const string PLUGIN_VERSION = "0.2.1"; } [BepInPlugin("ordain.ui", "OrdainUI", "0.2.1")] public class Plugin : BasePlugin { private Harmony _harmony; public static readonly bool VerboseLogs; internal static Plugin Instance { get; private set; } public static ManualLogSource Logger => ((BasePlugin)Instance).Log; public static void Verbose(string msg) { if (VerboseLogs) { Logger.LogInfo((object)msg); } } public override void Load() { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown UIConfig.Load(); Instance = this; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val; if (Application.productName == "VRisingServer") { ManualLogSource log = ((BasePlugin)this).Log; val = new BepInExInfoLogInterpolatedStringHandler(40, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("OrdainUI"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" is a client mod — skipping on server."); } log.LogInfo(val); return; } ClassInjector.RegisterTypeInIl2Cpp(); _harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null); ManualLogSource log2 = ((BasePlugin)this).Log; val = new BepInExInfoLogInterpolatedStringHandler(20, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("OrdainUI"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" v"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("0.2.1"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" loaded on client!"); } log2.LogInfo(val); } public override bool Unload() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } return true; } } } namespace OrdainUI.Services { internal static class ItemIdentityPatcher { private static readonly Dictionary _pending = new Dictionary(); private static bool _hasPending = false; private static readonly Dictionary _origDesc = new Dictionary(); public static void SetIdentities(Dictionary identities) { _pending.Clear(); foreach (KeyValuePair identity in identities) { _pending[identity.Key] = identity.Value; } _hasPending = true; Apply(); } public static void Apply() { //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Expected O, but got Unknown //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: 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_00f4: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) if (!_hasPending) { return; } ManagedDataRegistry registry = GetRegistry(); if (registry == null) { return; } Dictionary localizedStrings = Localization._LocalizedStrings; if (localizedStrings == null) { return; } int num = 0; int num2 = 0; PrefabGUID val = default(PrefabGUID); bool flag = default(bool); foreach (var (num4, tuple2) in _pending) { try { ((PrefabGUID)(ref val))..ctor(num4); ManagedItemData orDefault = registry.GetOrDefault(val, (ManagedItemData)null); if (orDefault == null) { num2++; continue; } if (!string.IsNullOrEmpty(tuple2.Item1)) { AssetGuid key = orDefault.Name.Key; localizedStrings[key] = tuple2.Item1; num++; } if (!string.IsNullOrEmpty(tuple2.Item2)) { _origDesc.TryAdd(num4, orDefault.Description); AssetGuid val2 = AssetGuid.FromString(Guid.NewGuid().ToString()); localizedStrings[val2] = tuple2.Item2; LocalizedStringBuilderBase description = orDefault.Description; description.Key = new LocalizationKey(val2); orDefault.Description = description; } } catch (Exception ex) { ManualLogSource log = OrdainUI.Core.Core.Log; BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(33, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("[OrdainUI:Identity] Failed for "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(num4); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(": "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex.Message); } log.LogWarning(val3); num2++; } } ManualLogSource log2 = OrdainUI.Core.Core.Log; BepInExDebugLogInterpolatedStringHandler val4 = new BepInExDebugLogInterpolatedStringHandler(52, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("[OrdainUI:Identity] Applied "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted(num); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral(" identit(ies), "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted(num2); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral(" skipped."); } log2.LogDebug(val4); } public static void Restore() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) ManagedDataRegistry registry = GetRegistry(); if (registry != null) { foreach (var (num2, description) in _origDesc) { try { ManagedItemData orDefault = registry.GetOrDefault(new PrefabGUID(num2), (ManagedItemData)null); if (orDefault != null) { orDefault.Description = description; } } catch { } } } _origDesc.Clear(); try { Localization.LoadDefaultLanguage(); } catch { } } private static ManagedDataRegistry GetRegistry() { try { World world = OrdainUI.Core.Core.World; object result; if (world == null) { result = null; } else { ManagedDataSystem existingSystemManaged = world.GetExistingSystemManaged(); result = ((existingSystemManaged != null) ? ((ManagedDataSystem_Base)existingSystemManaged).ManagedDataRegistry : null); } return (ManagedDataRegistry)result; } catch { return null; } } } internal class CanvasService { private struct ButtonEntry { public RectTransform Rect; public Image Bg; public Color Normal; public Color Hover; public Action OnClick; } private struct DragEntry { public RectTransform Root; public RectTransform Handle; } private const float TEXT_SCALE = 1.08f; private static TMP_FontAsset _nocturneSerifFont; private static DateTime _nextNocturneLookupUtc = DateTime.MinValue; private static readonly Dictionary _spriteCache = new Dictionary(StringComparer.OrdinalIgnoreCase); private static readonly HashSet _missingSpriteLog = new HashSet(StringComparer.OrdinalIgnoreCase); public static readonly Color BG_DARK = new Color(0.08f, 0.06f, 0.1f, 0.95f); public static readonly Color BG_PANEL = new Color(0.12f, 0.1f, 0.14f, 0.92f); public static readonly Color BG_HEADER = new Color(0.15f, 0.08f, 0.08f, 0.95f); public static readonly Color ACCENT_RED = new Color(0.7f, 0.15f, 0.15f, 1f); public static readonly Color ACCENT_GOLD = new Color(0.9f, 0.77f, 0.42f, 1f); public static readonly Color TEXT_PRIMARY = new Color(0.95f, 0.93f, 0.88f, 1f); public static readonly Color TEXT_SECONDARY = new Color(0.76f, 0.73f, 0.68f, 1f); public static readonly Color TEXT_DISABLED = new Color(0.52f, 0.5f, 0.46f, 1f); public static readonly Color BORDER_COLOR = new Color(0.55f, 0.24f, 0.24f, 0.82f); public static readonly Color BTN_NORMAL = new Color(0.14f, 0.12f, 0.16f, 0.85f); public static readonly Color BTN_HOVER = new Color(0.3f, 0.16f, 0.16f, 0.92f); public static readonly Color CLASS_BLOOD = new Color(1f, 0f, 0f, 1f); public static readonly Color CLASS_CHAOS = new Color(0.61f, 0.19f, 1f, 1f); public static readonly Color CLASS_FROST = new Color(0f, 0.5f, 1f, 1f); public static readonly Color CLASS_STORM = new Color(1f, 0.84f, 0f, 1f); public static readonly Color CLASS_ILLUSION = new Color(0f, 1f, 1f, 1f); public static readonly Color CLASS_UNHOLY = new Color(0f, 1f, 0f, 1f); public static readonly List RootWindows = new List(); private static readonly Dictionary _windowOrders = new Dictionary(); public static Canvas GameCanvasStatic; private static readonly List _buttons = new List(); private static Vector2 _lastMousePosition = new Vector2(float.MinValue, float.MinValue); private static readonly List _draggables = new List(); private static RectTransform _dragging; private static Vector2 _lastMouse; public UICanvasBase CanvasBase { get; private set; } public Canvas BottomBarCanvas { get; private set; } public int GameLayer { get; private set; } public CanvasService(UICanvasBase canvas) { CanvasBase = canvas; BottomBarCanvas = ((Component)canvas.BottomBarParent).gameObject.GetComponent(); GameCanvasStatic = BottomBarCanvas; GameLayer = ((Component)BottomBarCanvas).gameObject.layer; Plugin.Verbose($"[OrdainUI] CanvasService initialized. Layer: {GameLayer}"); } public GameObject CreateRootWindow(string name, float width, float height, int sortOrder = 100, bool aboveNativeUI = false) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0041: 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_0088: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("OrdainUI_" + name); RootWindows.Add(val); _windowOrders[val] = sortOrder; val.layer = GameLayer; Object.DontDestroyOnLoad((Object)(object)val); SceneManager.MoveGameObjectToScene(val, SceneManager.GetSceneByName("VRisingWorld")); val.transform.SetParent(((Component)BottomBarCanvas).transform, false); RectTransform obj = val.AddComponent(); obj.anchorMin = new Vector2(0.5f, 0.5f); obj.anchorMax = new Vector2(0.5f, 0.5f); obj.pivot = new Vector2(0.5f, 0.5f); obj.sizeDelta = new Vector2(width, height); obj.anchoredPosition = Vector2.zero; Canvas val2 = val.AddComponent(); if (aboveNativeUI) { val2.overrideSorting = true; val2.sortingOrder = sortOrder; } val.AddComponent(); ReorderWindowSiblings(); ((Graphic)val.AddComponent()).color = BG_DARK; return val; } private static void ReorderWindowSiblings() { foreach (GameObject item in (from w in RootWindows where (Object)(object)w != (Object)null && _windowOrders.ContainsKey(w) orderby _windowOrders[w] select w).ToList()) { item.transform.SetAsLastSibling(); } } public static GameObject CreatePanel(Transform parent, string name, float x, float y, float width, float height, Color? color = null) { //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_001d: 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_0043: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown GameObject val = new GameObject("Panel_" + name); val.transform.SetParent(parent, false); RectTransform obj = val.AddComponent(); obj.anchorMin = new Vector2(0f, 1f); obj.anchorMax = new Vector2(0f, 1f); obj.pivot = new Vector2(0f, 1f); obj.anchoredPosition = new Vector2(x, 0f - y); obj.sizeDelta = new Vector2(width, height); ((Graphic)val.AddComponent()).color = (Color)(((??)color) ?? BG_PANEL); return val; } public static GameObject CreateText(Transform parent, string name, string text, float x, float y, float width, float height, float fontSize = 14f, Color? color = null, TextAlignmentOptions alignment = (TextAlignmentOptions)257, bool applyNocturneFont = true) { //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_001d: 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_0043: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown GameObject val = new GameObject("Text_" + name); val.transform.SetParent(parent, false); RectTransform obj = val.AddComponent(); obj.anchorMin = new Vector2(0f, 1f); obj.anchorMax = new Vector2(0f, 1f); obj.pivot = new Vector2(0f, 1f); obj.anchoredPosition = new Vector2(x, 0f - y); obj.sizeDelta = new Vector2(width, height); TextMeshProUGUI val2 = val.AddComponent(); ((TMP_Text)val2).text = text; ((TMP_Text)val2).fontSize = Mathf.Max(8f, fontSize * 1.08f); ((Graphic)val2).color = (Color)(((??)color) ?? TEXT_PRIMARY); ((TMP_Text)val2).alignment = alignment; ((TMP_Text)val2).enableWordWrapping = true; ((TMP_Text)val2).overflowMode = (TextOverflowModes)1; if (applyNocturneFont) { TryApplyNocturneSerifFont(val2); } return val; } public static bool TryApplyNocturneSerifFont(TextMeshProUGUI target) { if ((Object)(object)target == (Object)null) { return false; } TMP_FontAsset val = ResolveNocturneSerifFont(); if ((Object)(object)val == (Object)null) { return false; } ((TMP_Text)target).font = val; target.UpdateFontAsset(); return true; } private static TMP_FontAsset ResolveNocturneSerifFont() { //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Expected O, but got Unknown if ((Object)(object)_nocturneSerifFont != (Object)null) { return _nocturneSerifFont; } if (DateTime.UtcNow < _nextNocturneLookupUtc) { return null; } _nextNocturneLookupUtc = DateTime.UtcNow.AddSeconds(5.0); TMP_FontAsset val = null; try { TMP_FontAsset[] array = Il2CppArrayBase.op_Implicit(Resources.FindObjectsOfTypeAll()); foreach (TMP_FontAsset val2 in array) { if ((Object)(object)val2 == (Object)null || string.IsNullOrWhiteSpace(((Object)val2).name)) { continue; } string name = ((Object)val2).name; bool flag = name.IndexOf("Nocturne", StringComparison.OrdinalIgnoreCase) >= 0; bool flag2 = name.IndexOf("Serif", StringComparison.OrdinalIgnoreCase) >= 0; if (flag) { if ((Object)(object)val == (Object)null) { val = val2; } if (flag2) { _nocturneSerifFont = val2; break; } } } if (_nocturneSerifFont == null) { _nocturneSerifFont = val; } if ((Object)(object)_nocturneSerifFont != (Object)null) { Plugin.Verbose("[OrdainUI:Font] Found test font asset: " + ((Object)_nocturneSerifFont).name); } } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; bool flag3 = default(bool); BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(31, 1, ref flag3); if (flag3) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("[OrdainUI:Font] Lookup failed: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex.Message); } logger.LogWarning(val3); _nocturneSerifFont = null; } return _nocturneSerifFont; } public static GameObject CreateButton(Transform parent, string name, string label, float x, float y, float width, float height, Action onClick, float fontSize = 14f, Color? bgColor = null, Color? textColor = null, Color? hoverColor = null, bool applyNocturneFont = true) { //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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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_0059: 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_0077: 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) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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_0113: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Expected O, but got Unknown GameObject val = new GameObject("Button_" + name); val.transform.SetParent(parent, false); RectTransform val2 = val.AddComponent(); val2.anchorMin = new Vector2(0f, 1f); val2.anchorMax = new Vector2(0f, 1f); val2.pivot = new Vector2(0f, 1f); val2.anchoredPosition = new Vector2(x, 0f - y); val2.sizeDelta = new Vector2(width, height); Image val3 = val.AddComponent(); ((Graphic)val3).color = (Color)(((??)bgColor) ?? BTN_NORMAL); CreateText(val.transform, name + "_Label", label, 8f, 0f, width - 16f, height, fontSize, (Color)(((??)textColor) ?? TEXT_PRIMARY), (TextAlignmentOptions)4097, applyNocturneFont); RegisterButton(val2, val3, (Color)(((??)bgColor) ?? BTN_NORMAL), (Color)(((??)hoverColor) ?? BTN_HOVER), onClick); return val; } public static GameObject CreateCloseButton(Transform parent, float parentWidth, Action onClose) { //IL_0039: 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_0061: Unknown result type (might be due to invalid IL or missing references) float num = 28f; float num2 = 6f; return CreateButton(parent, "Close", "X", parentWidth - num - num2, num2, num, num, onClose, 16f, (Color?)new Color(0.5f, 0.1f, 0.1f, 0.8f), (Color?)Color.white, (Color?)new Color(0.7f, 0.15f, 0.15f, 1f), applyNocturneFont: false); } public static GameObject CreateDivider(Transform parent, string name, float x, float y, float width, float thickness = 1f, Color? color = null) { //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_001d: 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_0043: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown GameObject val = new GameObject("Divider_" + name); val.transform.SetParent(parent, false); RectTransform obj = val.AddComponent(); obj.anchorMin = new Vector2(0f, 1f); obj.anchorMax = new Vector2(0f, 1f); obj.pivot = new Vector2(0f, 1f); obj.anchoredPosition = new Vector2(x, 0f - y); obj.sizeDelta = new Vector2(width, thickness); ((Graphic)val.AddComponent()).color = (Color)(((??)color) ?? BORDER_COLOR); return val; } public static GameObject CreateImage(Transform parent, string name, float x, float y, float width, float height, Sprite sprite = null, Color? tint = null, bool preserveAspect = true, bool raycastTarget = false) { //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_001d: 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_0043: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Expected O, but got Unknown GameObject val = new GameObject("Image_" + name); val.transform.SetParent(parent, false); RectTransform obj = val.AddComponent(); obj.anchorMin = new Vector2(0f, 1f); obj.anchorMax = new Vector2(0f, 1f); obj.pivot = new Vector2(0f, 1f); obj.anchoredPosition = new Vector2(x, 0f - y); obj.sizeDelta = new Vector2(width, height); Image obj2 = val.AddComponent(); obj2.sprite = sprite; ((Graphic)obj2).color = (Color)(((??)tint) ?? Color.white); obj2.preserveAspect = preserveAspect; ((Graphic)obj2).raycastTarget = raycastTarget; return val; } public static Sprite LoadSpriteFromModImages(string relativePath, float pixelsPerUnit = 100f) { if (string.IsNullOrWhiteSpace(relativePath)) { return null; } if (Path.IsPathRooted(relativePath)) { return LoadSpriteFromFile(relativePath, pixelsPerUnit); } string text = relativePath.Replace('/', Path.DirectorySeparatorChar).Replace('\\', Path.DirectorySeparatorChar); text = text.TrimStart(Path.DirectorySeparatorChar); List imageRootCandidates = GetImageRootCandidates(); for (int i = 0; i < imageRootCandidates.Count; i++) { Sprite val = LoadSpriteFromFile(Path.Combine(imageRootCandidates[i], text), pixelsPerUnit); if ((Object)(object)val != (Object)null) { return val; } } string item = "MISSING::" + text; if (_missingSpriteLog.Add(item)) { Plugin.Verbose("[OrdainUI:Image] Missing '" + text + "'. Searched roots: " + string.Join(" | ", imageRootCandidates)); } return null; } public static Sprite LoadSpriteFromFile(string path, float pixelsPerUnit = 100f) { //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) if (string.IsNullOrWhiteSpace(path)) { return null; } string fullPath; try { fullPath = Path.GetFullPath(path); } catch { return null; } if (_spriteCache.TryGetValue(fullPath, out var value) && (Object)(object)value != (Object)null) { return value; } if (!File.Exists(fullPath)) { return null; } try { byte[] array = File.ReadAllBytes(fullPath); if (array == null || array.Length == 0) { return null; } Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); ((Texture)val).wrapMode = (TextureWrapMode)1; ((Texture)val).filterMode = (FilterMode)1; if (!ImageConversion.LoadImage(val, Il2CppStructArray.op_Implicit(array), false)) { Object.Destroy((Object)(object)val); return null; } Sprite val2 = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), Mathf.Max(1f, pixelsPerUnit)); ((Object)val2).name = "OrdainUI_" + Path.GetFileNameWithoutExtension(fullPath); _spriteCache[fullPath] = val2; return val2; } catch (Exception ex) { if (_missingSpriteLog.Add(fullPath)) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(43, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("[OrdainUI:Image] Failed to load sprite '"); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(fullPath); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("': "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex.Message); } logger.LogWarning(val3); } return null; } } public static string GetModImageRootPath() { try { string text = Path.Combine(Paths.ConfigPath, "GOMS.Ordain", "Images"); Directory.CreateDirectory(text); return text; } catch { } return Path.Combine(Environment.CurrentDirectory, "BepInEx", "config", "GOMS.Ordain", "Images"); } private static string GetUIConfigImageRootPath() { try { string text = Path.Combine(Paths.ConfigPath, "ordain.ui", "Images"); Directory.CreateDirectory(text); return text; } catch { } return Path.Combine(Environment.CurrentDirectory, "BepInEx", "config", "ordain.ui", "Images"); } private static List GetImageRootCandidates() { List list = new List(6); list.Add(GetLegacyPluginImageRootPath()); list.Add(Path.Combine(Environment.CurrentDirectory, "BepInEx", "plugins", "OrdainUI", "Images")); list.Add(GetModImageRootPath()); list.Add(GetUIConfigImageRootPath()); list.Add(Path.Combine(Environment.CurrentDirectory, "BepInEx", "config", "GOMS.Ordain", "Images")); list.Add(Path.Combine(Environment.CurrentDirectory, "BepInEx", "config", "ordain.ui", "Images")); List list2 = list; HashSet hashSet = new HashSet(StringComparer.OrdinalIgnoreCase); for (int num = list2.Count - 1; num >= 0; num--) { string text = list2[num]; if (string.IsNullOrWhiteSpace(text)) { list2.RemoveAt(num); continue; } string fullPath; try { fullPath = Path.GetFullPath(text); } catch { list2.RemoveAt(num); continue; } if (!hashSet.Add(fullPath)) { list2.RemoveAt(num); } else { list2[num] = fullPath; } } return list2; } private static string GetLegacyPluginImageRootPath() { try { string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); if (!string.IsNullOrWhiteSpace(directoryName)) { return Path.Combine(directoryName, "Images"); } } catch { } return Path.Combine(Environment.CurrentDirectory, "BepInEx", "plugins", "OrdainUI", "Images"); } public static GameObject CreateBar(Transform parent, string name, float x, float y, float width, float height, Color fillColor, float fillPercent = 1f) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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) //IL_005d: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) GameObject val = CreatePanel(parent, name + "_bg", x, y, width, height, (Color?)new Color(0.15f, 0.15f, 0.15f, 0.8f)); GameObject val2 = new GameObject("Bar_" + name + "_fill"); val2.transform.SetParent(val.transform, false); RectTransform obj = val2.AddComponent(); obj.anchorMin = new Vector2(0f, 0f); obj.anchorMax = new Vector2(fillPercent, 1f); obj.offsetMin = Vector2.zero; obj.offsetMax = Vector2.zero; ((Graphic)val2.AddComponent()).color = fillColor; return val; } public static void RegisterClickable(GameObject go, Action onClick, Color normalColor, Color hoverColor) { //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) RectTransform component = go.GetComponent(); Image component2 = go.GetComponent(); if (!((Object)(object)component == (Object)null) && !((Object)(object)component2 == (Object)null)) { RegisterButton(component, component2, normalColor, hoverColor, onClick); } } public static void RegisterButton(RectTransform rect, Image bg, Color normal, Color hover, Action onClick) { //IL_001f: 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_0027: 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) _buttons.Add(new ButtonEntry { Rect = rect, Bg = bg, Normal = normal, Hover = hover, OnClick = onClick }); } public static void ButtonUpdate() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //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_001f: 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_002b: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) if (_buttons.Count == 0) { return; } Vector2 val = Vector2.op_Implicit(Input.mousePosition); bool mouseButtonDown = Input.GetMouseButtonDown(0); bool flag = val != _lastMousePosition; _lastMousePosition = val; if (!mouseButtonDown && !flag) { return; } bool flag2 = false; for (int num = _buttons.Count - 1; num >= 0; num--) { ButtonEntry buttonEntry = _buttons[num]; if ((Object)(object)buttonEntry.Rect == (Object)null) { _buttons.RemoveAt(num); } else if (((Component)buttonEntry.Rect).gameObject.activeInHierarchy) { bool flag3 = RectTransformUtility.RectangleContainsScreenPoint(buttonEntry.Rect, val, (Camera)null); if ((Object)(object)buttonEntry.Bg != (Object)null) { ((Graphic)buttonEntry.Bg).color = (flag3 ? buttonEntry.Hover : buttonEntry.Normal); } if (flag3 && mouseButtonDown && !flag2) { flag2 = true; try { buttonEntry.OnClick?.Invoke(); } catch (Exception ex) { Debug.LogWarning(Object.op_Implicit("[OrdainUI] Button error: " + ex.Message)); } } } } } public static void MakeDraggable(GameObject rootWindow, Transform dragHandle = null) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) RectTransform component = rootWindow.GetComponent(); if ((Object)(object)component == (Object)null) { return; } Transform val = dragHandle ?? rootWindow.transform; RectTransform component2 = ((Component)val).GetComponent(); if ((Object)(object)component2 == (Object)null) { return; } if ((Object)(object)((Component)val).GetComponent() == (Object)null) { ((Graphic)((Component)val).gameObject.AddComponent()).color = Color.clear; } for (int num = _draggables.Count - 1; num >= 0; num--) { if ((Object)(object)_draggables[num].Root == (Object)(object)component) { _draggables.RemoveAt(num); } } _draggables.Add(new DragEntry { Root = component, Handle = component2 }); } public static void DragUpdate() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: 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_0099: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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) Vector2 val = Vector2.op_Implicit(Input.mousePosition); if (Input.GetMouseButtonDown(0)) { foreach (DragEntry draggable in _draggables) { if (!((Object)(object)draggable.Root == (Object)null) && ((Component)draggable.Root).gameObject.activeInHierarchy && RectTransformUtility.RectangleContainsScreenPoint(draggable.Handle, val, (Camera)null)) { _dragging = draggable.Root; _lastMouse = val; break; } } } if (Input.GetMouseButton(0) && (Object)(object)_dragging != (Object)null) { Vector2 val2 = val - _lastMouse; _lastMouse = val; Canvas componentInParent = ((Component)_dragging).GetComponentInParent(); float num = (((Object)(object)componentInParent != (Object)null) ? componentInParent.scaleFactor : 1f); if (num > 0f) { val2 /= num; } RectTransform dragging = _dragging; dragging.anchoredPosition += val2; } if (!Input.GetMouseButtonUp(0)) { return; } if ((Object)(object)_dragging != (Object)null) { string text = ((Object)((Component)_dragging).gameObject).name; if (text.StartsWith("OrdainUI_")) { text = text.Substring("OrdainUI_".Length); } HUDPositionService.Save(text, _dragging.anchoredPosition); } _dragging = null; } private static Vector2 ScreenToLocal(RectTransform rt, Vector2 screenPoint) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) Canvas componentInParent = ((Component)rt).GetComponentInParent(); Camera val = (((Object)(object)componentInParent != (Object)null && (int)componentInParent.renderMode != 0) ? componentInParent.worldCamera : null); Transform parent = ((Transform)rt).parent; Vector2 result = default(Vector2); RectTransformUtility.ScreenPointToLocalPointInRectangle((RectTransform)(object)((parent is RectTransform) ? parent : null), screenPoint, val, ref result); return result; } public static Color GetClassColor(string className) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_0056: 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_0082: 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) if (className == null) { return TEXT_PRIMARY; } string text = className.ToLowerInvariant(); if (text.StartsWith("blood")) { return CLASS_BLOOD; } if (text.StartsWith("chaos")) { return CLASS_CHAOS; } if (text.StartsWith("frost")) { return CLASS_FROST; } if (text.StartsWith("storm")) { return CLASS_STORM; } if (text.StartsWith("illusion")) { return CLASS_ILLUSION; } if (text.StartsWith("unholy")) { return CLASS_UNHOLY; } return TEXT_PRIMARY; } } internal static class CommandSender { private static readonly Queue _queue = new Queue(); private static string _lastCmd = ""; private static float _lastCmdTime = 0f; private const float DEDUP_WINDOW = 0.5f; public static Action OnFamiliarListChanged; public static bool SuppressChat => UIConfig.SuppressFamCommands; public static void FamBind(int index) { foreach (UIData.FamiliarListEntry familiar in UIData.FamiliarList) { familiar.IsActive = familiar.Index == index; } UIData.FamiliarActive = true; OrdainUIBehaviour.MarkFamiliarDirty(); InvalidateFamiliarListHash(); Q($".fam bind {index}"); } public static void FamBindLast(int lastIndex) { UIData.FamiliarActive = true; OrdainUIBehaviour.MarkFamiliarDirty(); Q((lastIndex > 0) ? $".fam bind {lastIndex}" : ".fam call"); } public static void FamUnbind() { foreach (UIData.FamiliarListEntry familiar in UIData.FamiliarList) { familiar.IsActive = false; } UIData.FamiliarActive = false; OrdainUIBehaviour.MarkFamiliarDirty(); InvalidateFamiliarListHash(); Q(".fam ub"); } public static void FamCall() { Q(".fam call"); } public static void FamQuickSummon() { Q(".fam qs"); } public static void FamDismiss() { UIData.FamiliarActive = false; OrdainUIBehaviour.MarkFamiliarDirty(); Q(".fam dismiss"); } public static void FamAggressive() { UIData.FamiliarMode = "Aggressive"; OrdainUIBehaviour.MarkFamiliarDirty(); Q(".fam agg"); } public static void FamPassive() { UIData.FamiliarMode = "Passive"; OrdainUIBehaviour.MarkFamiliarDirty(); Q(".fam passive"); } public static void FamEverstone() { UIData.FamiliarEverstone = !UIData.FamiliarEverstone; OrdainUIBehaviour.MarkFamiliarDirty(); Q(".fam everstone"); } public static void FamBoxSwitch(string name) { UIData.ActiveBoxName = name; OrdainUIBehaviour.MarkFamiliarDirty(); Q(".fam box \"" + name + "\""); } public static void FamBoxCreate(string name) { Q(".fam box add \"" + name + "\""); } public static void FamMove(int index, string box) { Q($".fam move {index} \"{box}\""); } public static void FamAllocAP(string stat, int n) { if (UIData.FamiliarUnspentAP >= n) { UIData.FamiliarUnspentAP -= n; switch (stat) { case "hp": UIData.FamiliarHPAlloc += n; break; case "phys": UIData.FamiliarPhysAlloc += n; break; case "spell": UIData.FamiliarSpellAlloc += n; break; } } OrdainUIBehaviour.MarkFamiliarDirty(); Q($".fam alloc {stat} {n}"); } public static void RequestLeaderboard(string boardType) { UIData.Leaderboard.Loading = true; UIData.Leaderboard.BoardType = boardType; OrdainUIBehaviour.MarkLeaderboardDirty(); _queue.Enqueue(boardType switch { "Level" => ".ordlb level", "VBloodKills" => ".ordlb vblood", "MonsterKills" => ".ordlb monster", "WorldFirsts" => ".ordlb worldfirst", "Familiars" => ".ordlb familiars", "EventPoints" => ".ordlb eventpoints", "EventWins" => ".ordlb eventwins", _ => ".ordlb level", }); } public static void QuestUiOpened() { Q(".quest uiopened"); } public static void QuestClaimStory(string questId = "") { Q(string.IsNullOrWhiteSpace(questId) ? ".quest claim" : (".quest claim " + questId)); } public static void QuestClaimDaily(string questId = "") { Q(string.IsNullOrWhiteSpace(questId) ? ".quest claimdaily" : (".quest claimdaily " + questId)); } public static void QuestClaimWeekly(string questId = "") { Q(string.IsNullOrWhiteSpace(questId) ? ".quest claimweekly" : (".quest claimweekly " + questId)); } public static void StatsAlloc(string stat, int amount) { Q($".stats alloc {stat} {amount}"); } public static void ParagonSpend(string perkAlias) { Q(".pg sd " + perkAlias); } public static void ClassAscend() { Q(".class ascend"); } public static void RequestUISync(bool full = false) { Q(full ? ".ordui sync all" : ".ordui sync"); } public static void NPCInteract(string npcId) { if (!string.IsNullOrWhiteSpace(npcId)) { _queue.Enqueue("[ORD_CMD]|npc.interact|" + EscapeTransportField(npcId.Trim())); } } public static void NPCChoice(string npcId, string choiceId, string currentNodeId) { if (!string.IsNullOrWhiteSpace(npcId)) { _queue.Enqueue($"[ORD_CMD]|npc.choice|{EscapeTransportField(npcId.Trim())}|{EscapeTransportField(choiceId ?? "")}|{EscapeTransportField(currentNodeId ?? "")}"); } } public static void RiteOfferPick(int slot) { _queue.Enqueue($"[ORD_CMD]|rite.offer.pick|{slot}"); } public static bool HasPending() { return _queue.Count > 0; } public static string Dequeue() { if (_queue.Count <= 0) { return null; } return _queue.Dequeue(); } private static void InvalidateFamiliarListHash() { OnFamiliarListChanged?.Invoke(); } private static void Q(string cmd) { float realtimeSinceStartup = Time.realtimeSinceStartup; if (!(cmd == _lastCmd) || !(realtimeSinceStartup - _lastCmdTime < 0.5f)) { _lastCmd = cmd; _lastCmdTime = realtimeSinceStartup; _queue.Enqueue(cmd); } } public static void ForgeSelect(int slot, int abilityGuid, float cooldown) { Q((cooldown > 0f) ? $".forge skill {slot} {abilityGuid} {cooldown.ToString(CultureInfo.InvariantCulture)}" : $".forge skill {slot} {abilityGuid}"); } public static void ForgeClearSkills() { Q(".forge skillclear"); } private static string EscapeTransportField(string value) { if (string.IsNullOrEmpty(value)) { return ""; } return value.Replace("\\", "\\\\").Replace("|", "\\|"); } } internal static class HUDPositionService { private static readonly string FilePath = Path.Combine(Paths.ConfigPath, "OrdainUI_positions.json"); private static Dictionary _positions; private static Dictionary Positions { get { if (_positions == null) { Load(); } return _positions; } } public static void Save(string key, Vector2 pos) { //IL_000e: 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) Positions[key] = new float[2] { pos.x, pos.y }; Write(); } public static void ApplySaved(GameObject root, string key) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (Positions.TryGetValue(key, out var value)) { RectTransform component = root.GetComponent(); if ((Object)(object)component != (Object)null) { component.anchoredPosition = new Vector2(value[0], value[1]); } } } private static void Load() { _positions = new Dictionary(); try { if (!File.Exists(FilePath)) { return; } string[] array = File.ReadAllLines(FilePath); foreach (string text in array) { int num = text.IndexOf('='); if (num >= 0) { string key = text.Substring(0, num).Trim(); string[] array2 = text.Substring(num + 1).Split(','); if (array2.Length >= 2 && float.TryParse(array2[0], NumberStyles.Float, CultureInfo.InvariantCulture, out var result) && float.TryParse(array2[1], NumberStyles.Float, CultureInfo.InvariantCulture, out var result2)) { _positions[key] = new float[2] { result, result2 }; } } } } catch { _positions = new Dictionary(); } } private static void Write() { try { StringBuilder stringBuilder = new StringBuilder(); foreach (KeyValuePair position in _positions) { stringBuilder.AppendLine(FormattableString.Invariant($"{position.Key}={position.Value[0]},{position.Value[1]}")); } File.WriteAllText(FilePath, stringBuilder.ToString()); } catch { } } public static void ResetAll() { _positions = new Dictionary(); try { if (File.Exists(FilePath)) { File.Delete(FilePath); } } catch { } } } internal class MessageService { private sealed class QuestSnapshot { public bool HasStoryQuest { get; set; } public string StoryQuestId { get; set; } = ""; public string StoryQuestTitle { get; set; } = ""; public string StoryStepText { get; set; } = ""; public int StoryStepProgress { get; set; } public int StoryStepRequired { get; set; } = 1; public int StoryClaimableCount { get; set; } public string StoryRewardPreview { get; set; } = ""; public List DailyQuests { get; set; } = new List(); public List WeeklyQuests { get; set; } = new List(); } private sealed class QuestSnapshotEntry { public string Id { get; set; } = ""; public string Title { get; set; } = ""; public string Description { get; set; } = ""; public string RewardPreview { get; set; } = ""; public int Progress { get; set; } public int Required { get; set; } = 1; public bool Completed { get; set; } public bool Claimed { get; set; } } private sealed class QuestWirePayload { public bool HasStoryQuest { get; set; } public string StoryQuestId { get; set; } = ""; public string StoryQuestTitle { get; set; } = ""; public string StoryStepText { get; set; } = ""; public int StoryStepProgress { get; set; } public int StoryStepRequired { get; set; } = 1; public string StoryRewardPreview { get; set; } = ""; public int StoryCompletedCount { get; set; } public int StoryClaimableCount { get; set; } public string DailyResetText { get; set; } = ""; public string WeeklyResetText { get; set; } = ""; public List DailyQuests { get; set; } = new List(); public List WeeklyQuests { get; set; } = new List(); } private sealed class QuestWireEntry { public string Id { get; set; } = ""; public string Title { get; set; } = ""; public string Description { get; set; } = ""; public string RewardPreview { get; set; } = ""; public int Progress { get; set; } public int Required { get; set; } = 1; public bool Completed { get; set; } public bool Claimed { get; set; } } private const string PREFIX = "[ORD_UI]"; private QuestSnapshot _lastQuestSnapshot; private bool _questSnapshotInitialized; public void HandleMessage(string rawMessage) { //IL_0baa: Unknown result type (might be due to invalid IL or missing references) //IL_0bb1: Expected O, but got Unknown if (string.IsNullOrEmpty(rawMessage) || !rawMessage.StartsWith("[ORD_UI]", StringComparison.Ordinal)) { return; } try { string[] array = SplitPayload((rawMessage.Length > "[ORD_UI]".Length + 1) ? rawMessage.Substring("[ORD_UI]".Length + 1) : ""); if (array.Length == 0) { return; } string text = array[0]; if (text == null) { return; } switch (text.Length) { case 5: switch (text[0]) { case 'C': if (text == "CLASS") { HandleClass(array); } break; case 'Q': if (text == "QUEST") { HandleQuest(array); } break; case 'F': if (text == "FORGE") { HandleForge(array); } break; case 'I': if (text == "IDENT") { HandleIdent(array); } break; case 'P': if (text == "PARTY") { HandleParty(array); } break; case 'S': if (text == "STATS") { HandleStats(array); } break; } break; case 2: switch (text[0]) { case 'X': if (text == "XP") { HandleXP(array); } break; case 'L': if (text == "LB") { HandleLB(array); } break; } break; case 8: switch (text[0]) { case 'S': if (text == "SYS_FEED") { } break; case 'F': if (!(text == "FAMILIAR")) { if (text == "FAM_LIST") { HandleFamList(array); } } else { HandleFamiliar(array); } break; case 'T': if (text == "TRIVIA_Q") { HandleTriviaQuestion(array); } break; case 'L': if (text == "LB_BEGIN") { HandleLBBegin(array); } break; case 'N': if (text == "NPC_OPEN") { HandleNPCOpen(array); } break; } break; case 11: switch (text[6]) { case '_': if (text == "SERVER_TIME") { HandleServerTime(array); } break; case 'S': switch (text) { case "QUEST_STATE": HandleQuestState(array); break; case "QUEST_STORY": HandleQuestStory(array); break; case "EVENT_STATE": HandleEventState(array); break; case "TIMER_START": HandleTimerStart(array); break; } break; case 'D': if (text == "QUEST_DAILY") { HandleQuestDaily(array); } break; case 'E': if (text == "QUEST_EVENT") { HandleQuestEvent(array); } break; case 'P': if (text == "EVENT_PHASE") { HandleEventPhase(array); } break; case 'T': if (text == "INSPECT_SUM") { HandleInspectSummary(array); } break; case 'C': if (text == "IMAGE_CLOSE") { HandleImageClose(); } break; } break; case 16: switch (text[6]) { case 'T': if (text == "QUEST_TARGET_NPC") { HandleQuestTargetNpc(array); } break; case 'D': if (text == "QUEST_DAILY_ITEM") { HandleQuestDailyItem(array); } break; case 'S': if (text == "QUEST_STORY_ITEM") { HandleQuestStoryItem(array); } break; case 'E': if (text == "QUEST_EVENT_ITEM") { HandleQuestEventItem(array); } break; case 'F': if (!(text == "RITE_OFFER_BEGIN")) { if (text == "RITE_OFFER_CLEAR") { HandleRiteOfferClear(); } } else { HandleRiteOfferBegin(array); } break; } break; case 12: switch (text[0]) { case 'Q': if (text == "QUEST_WEEKLY") { HandleQuestWeekly(array); } break; case 'E': if (text == "EVENT_NOTIFY") { HandleEventNotify(array); } break; case 'T': if (text == "TRIVIA_SCORE") { HandleTriviaScore(array); } break; case 'I': if (text == "INSPECT_OPEN") { HandleInspectOpen(array); } break; case 'P': if (text == "PARAGON_PERK") { HandleParagonPerk(array); } break; case 'N': if (!(text == "NPC_REG_DONE")) { if (text == "NPC_DIALOGUE") { HandleNPCDialogue(array); } } else { HandleNPCRegDone(); } break; } break; case 17: switch (text[0]) { case 'Q': if (text == "QUEST_WEEKLY_ITEM") { HandleQuestWeeklyItem(array); } break; case 'N': if (text == "NPC_CHOICE_RESULT") { HandleNPCChoiceResult(array); } break; } break; case 15: switch (text[0]) { case 'Q': if (text == "QUEST_COMPLETED") { HandleQuestCompleted(array); } break; case 'R': if (text == "RITE_OFFER_DONE") { HandleRiteOfferDone(); } break; } break; case 10: switch (text[0]) { case 'F': if (text == "FAM_DETAIL") { HandleFamDetail(array); } break; case 'I': if (!(text == "IMAGE_OPEN")) { if (text == "ICHOR_HIDE") { HandleIchorHide(); } } else { HandleImageOpen(array); } break; case 'N': if (text == "NPC_CHOICE") { HandleNPCChoice(array); } break; case 'R': if (text == "RITE_OFFER") { HandleRiteOffer(array); } break; case 'T': if (text == "TIMER_STOP") { HandleTimerStop(); } break; } break; case 9: switch (text[5]) { case 'O': if (text == "FAM_BOXES") { HandleFamBoxes(array); } break; case 'E': if (text == "ACH_RESET") { HandleAchievementReset(array); } break; case 'T': if (text == "ACH_STATE") { HandleAchievementState(array); } break; case '_': if (text == "ICHOR_SET") { HandleIchorSet(array); } break; } break; case 7: switch (text[4]) { case 'E': if (!(text == "DUNGEON")) { if (text == "LB_SELF") { HandleLBSelf(array); } } else { HandleDungeon(array); } break; case 'O': if (text == "LB_DONE") { HandleLBDone(array); } break; case 'S': if (text == "ACH_SUM") { HandleAchievementSummary(array); } break; case 'D': if (text == "ACH_DEF") { HandleAchievementDefinition(array); } break; case 'G': if (text == "PARAGON") { HandleParagon(array); } break; case 'R': if (text == "NPC_REG") { HandleNPCReg(array); } break; } break; case 6: switch (text[0]) { case 'N': if (text == "NOTIFY") { HandleNotify(array); } break; case 'L': if (text == "LB_ROW") { HandleLBRow(array); } break; } break; case 13: switch (text[0]) { case 'I': if (text == "INSPECT_CLOSE") { HandleInspectClose(); } break; case 'U': if (text == "UIDESIGN_OPEN") { HandleUIDesignOpen(array); } break; case 'P': if (text == "PARAGON_RESET") { HandleParagonReset(array); } break; case 'N': if (text == "NPC_REG_BEGIN") { HandleNPCRegBegin(array); } break; } break; case 20: if (text == "QUEST_COMPLETED_ITEM") { HandleQuestCompletedItem(array); } break; case 4: if (text == "BOSS") { HandleBoss(array); } break; case 14: if (text == "UIDESIGN_CLOSE") { HandleUIDesignClose(); } break; case 3: case 18: case 19: break; } } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(32, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[OrdainUI:Message] Parse error: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } logger.LogWarning(val); } } private void HandleClass(string[] p) { if (p.Length >= 10) { UIData.ClassName = Unescape(p[1]); UIData.ClassTitle = p[2]; UIData.ClassPassive = Unescape(p[3]); UIData.ClassAscendance = Unescape(p[4]); UIData.Stacks = Int(p[5]); UIData.MaxStacks = Int(p[6]); UIData.AscendanceActive = Bool(p[7]); UIData.AscendanceCooldown = Int(p[8]); UIData.AscendanceLocked = Bool(p[9]); OrdainUIBehaviour.MarkStatsDirty(); OrdainUIBehaviour.MarkInspectDirty(); } } private void HandleXP(string[] p) { if (p.Length >= 8) { UIData.Level = Int(p[1]); UIData.Experience = Float(p[2]); UIData.ExperienceNeeded = Float(p[3]); UIData.UnspentAP = Int(p[4]); UIData.IsParagon = Bool(p[5]); UIData.ParagonLevel = Int(p[6]); UIData.GearScore = Int(p[7]); if (p.Length > 8) { UIData.PlayerName = Unescape(p[8]); } if (p.Length > 9) { UIData.EventDisplayName = Unescape(p[9]); } OrdainUIBehaviour.MarkStatsDirty(); OrdainUIBehaviour.MarkInspectDirty(); OrdainUIBehaviour.MarkMainMenuDirty(); } } private void HandleServerTime(string[] p) { if (p.Length >= 2) { UIData.ServerTimeText = Unescape(p[1]); OrdainUIBehaviour.MarkMainMenuDirty(); } } private void HandleQuest(string[] p) { //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Expected O, but got Unknown if (p.Length < 2) { return; } try { byte[] bytes = Convert.FromBase64String(p[1]); QuestWirePayload questWirePayload = JsonSerializer.Deserialize(Encoding.UTF8.GetString(bytes)); if (questWirePayload == null) { return; } UIData.HasActiveStoryQuest = questWirePayload.HasStoryQuest; UIData.StoryQuestId = questWirePayload.StoryQuestId ?? ""; UIData.StoryQuestTitle = questWirePayload.StoryQuestTitle ?? ""; UIData.StoryStepText = questWirePayload.StoryStepText ?? ""; UIData.StoryStepProgress = questWirePayload.StoryStepProgress; UIData.StoryStepRequired = Math.Max(1, questWirePayload.StoryStepRequired); UIData.StoryRewardPreview = questWirePayload.StoryRewardPreview ?? ""; UIData.StoryCompletedCount = questWirePayload.StoryCompletedCount; UIData.StoryClaimableCount = questWirePayload.StoryClaimableCount; UIData.DailyResetText = questWirePayload.DailyResetText ?? ""; UIData.WeeklyResetText = questWirePayload.WeeklyResetText ?? ""; UIData.QuestDisplayName = ((!UIData.HasActiveStoryQuest) ? "No Active Quest" : (string.IsNullOrWhiteSpace(UIData.StoryQuestTitle) ? UIData.StoryQuestId : UIData.StoryQuestTitle)); UIData.DailyQuests.Clear(); if (questWirePayload.DailyQuests != null) { for (int i = 0; i < questWirePayload.DailyQuests.Count; i++) { QuestWireEntry questWireEntry = questWirePayload.DailyQuests[i]; if (questWireEntry != null) { UIData.DailyQuests.Add(new UIData.QuestEntry { Id = (questWireEntry.Id ?? ""), Category = "Daily", Status = ((!questWireEntry.Completed) ? "Active" : (questWireEntry.Claimed ? "Claimed" : "Completed")), Title = (questWireEntry.Title ?? ""), Description = (questWireEntry.Description ?? ""), Requirements = (questWireEntry.Description ?? ""), Location = "", RewardPreview = (questWireEntry.RewardPreview ?? ""), Progress = questWireEntry.Progress, Required = Math.Max(1, questWireEntry.Required), Completed = questWireEntry.Completed, Claimed = questWireEntry.Claimed, CanClaim = (questWireEntry.Completed && !questWireEntry.Claimed) }); } } } UIData.WeeklyQuests.Clear(); if (questWirePayload.WeeklyQuests != null) { for (int j = 0; j < questWirePayload.WeeklyQuests.Count; j++) { QuestWireEntry questWireEntry2 = questWirePayload.WeeklyQuests[j]; if (questWireEntry2 != null) { UIData.WeeklyQuests.Add(new UIData.QuestEntry { Id = (questWireEntry2.Id ?? ""), Category = "Weekly", Status = ((!questWireEntry2.Completed) ? "Active" : (questWireEntry2.Claimed ? "Claimed" : "Completed")), Title = (questWireEntry2.Title ?? ""), Description = (questWireEntry2.Description ?? ""), Requirements = (questWireEntry2.Description ?? ""), Location = "", RewardPreview = (questWireEntry2.RewardPreview ?? ""), Progress = questWireEntry2.Progress, Required = Math.Max(1, questWireEntry2.Required), Completed = questWireEntry2.Completed, Claimed = questWireEntry2.Claimed, CanClaim = (questWireEntry2.Completed && !questWireEntry2.Claimed) }); } } } OnQuestDataMutated(); OrdainUIBehaviour.MarkQuestDirty(); OrdainUIBehaviour.MarkMainMenuDirty(); } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(40, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[OrdainUI:Message] QUEST decode failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } logger.LogWarning(val); } } private void HandleQuestState(string[] p) { if (p.Length >= 9) { UIData.HasActiveStoryQuest = Bool(p[1]); UIData.StoryQuestId = Unescape(p[2]); UIData.StoryQuestTitle = Unescape(p[3]); UIData.StoryStepText = Unescape(p[4]); UIData.StoryStepProgress = Int(p[5]); UIData.StoryStepRequired = Math.Max(1, Int(p[6])); UIData.StoryCompletedCount = Int(p[7]); UIData.StoryClaimableCount = Int(p[8]); UIData.StoryRewardPreview = ((p.Length > 9) ? Unescape(p[9]) : ""); UIData.QuestDisplayName = ((!UIData.HasActiveStoryQuest) ? "No Active Quest" : (string.IsNullOrWhiteSpace(UIData.StoryQuestTitle) ? UIData.StoryQuestId : UIData.StoryQuestTitle)); OnQuestDataMutated(); OrdainUIBehaviour.MarkQuestDirty(); OrdainUIBehaviour.MarkMainMenuDirty(); } } private void HandleQuestDaily(string[] p) { if (p.Length >= 2) { UIData.DailyResetText = Unescape(p[1]); int size = ((p.Length > 2) ? Math.Max(0, Int(p[2])) : 0); EnsureQuestSlots(UIData.DailyQuests, size); OnQuestDataMutated(); OrdainUIBehaviour.MarkQuestDirty(); } } private void HandleQuestDailyItem(string[] p) { if (p.Length < 8) { return; } if (int.TryParse(p[1], out var result)) { if (result < 0) { return; } EnsureQuestSlots(UIData.DailyQuests, result + 1); string text = Unescape(p[2]); string text2 = Unescape(p[3]); if (string.IsNullOrWhiteSpace(text) && string.IsNullOrWhiteSpace(text2)) { UIData.DailyQuests[result] = null; } else { UIData.DailyQuests[result] = new UIData.QuestEntry { Id = text, Category = "Daily", Status = (Bool(p[7]) ? "Claimed" : (Bool(p[6]) ? "Completed" : "Active")), Title = text2, Progress = Int(p[4]), Required = Math.Max(1, Int(p[5])), Completed = Bool(p[6]), Claimed = Bool(p[7]), Description = ((p.Length > 8) ? Unescape(p[8]) : ""), Requirements = ((p.Length > 8) ? Unescape(p[8]) : ""), Location = "", RewardPreview = ((p.Length > 9) ? Unescape(p[9]) : ""), CanClaim = (Bool(p[6]) && !Bool(p[7])) }; } } else { UIData.DailyQuests.Add(new UIData.QuestEntry { Id = Unescape(p[1]), Category = "Daily", Status = (Bool(p[6]) ? "Claimed" : (Bool(p[5]) ? "Completed" : "Active")), Title = Unescape(p[2]), Progress = Int(p[3]), Required = Math.Max(1, Int(p[4])), Completed = Bool(p[5]), Claimed = Bool(p[6]), Description = Unescape(p[7]), Requirements = Unescape(p[7]), Location = "", RewardPreview = ((p.Length > 8) ? Unescape(p[8]) : ""), CanClaim = (Bool(p[5]) && !Bool(p[6])) }); } OnQuestDataMutated(); OrdainUIBehaviour.MarkQuestDirty(); } private void HandleQuestWeekly(string[] p) { if (p.Length >= 2) { UIData.WeeklyResetText = Unescape(p[1]); int size = ((p.Length > 2) ? Math.Max(0, Int(p[2])) : 0); EnsureQuestSlots(UIData.WeeklyQuests, size); OnQuestDataMutated(); OrdainUIBehaviour.MarkQuestDirty(); } } private void HandleQuestWeeklyItem(string[] p) { if (p.Length < 8) { return; } if (int.TryParse(p[1], out var result)) { if (result < 0) { return; } EnsureQuestSlots(UIData.WeeklyQuests, result + 1); string text = Unescape(p[2]); string text2 = Unescape(p[3]); if (string.IsNullOrWhiteSpace(text) && string.IsNullOrWhiteSpace(text2)) { UIData.WeeklyQuests[result] = null; } else { UIData.WeeklyQuests[result] = new UIData.QuestEntry { Id = text, Category = "Weekly", Status = (Bool(p[7]) ? "Claimed" : (Bool(p[6]) ? "Completed" : "Active")), Title = text2, Progress = Int(p[4]), Required = Math.Max(1, Int(p[5])), Completed = Bool(p[6]), Claimed = Bool(p[7]), Description = ((p.Length > 8) ? Unescape(p[8]) : ""), Requirements = ((p.Length > 8) ? Unescape(p[8]) : ""), Location = "", RewardPreview = ((p.Length > 9) ? Unescape(p[9]) : ""), CanClaim = (Bool(p[6]) && !Bool(p[7])) }; } } else { UIData.WeeklyQuests.Add(new UIData.QuestEntry { Id = Unescape(p[1]), Category = "Weekly", Status = (Bool(p[6]) ? "Claimed" : (Bool(p[5]) ? "Completed" : "Active")), Title = Unescape(p[2]), Progress = Int(p[3]), Required = Math.Max(1, Int(p[4])), Completed = Bool(p[5]), Claimed = Bool(p[6]), Description = Unescape(p[7]), Requirements = Unescape(p[7]), Location = "", RewardPreview = ((p.Length > 8) ? Unescape(p[8]) : ""), CanClaim = (Bool(p[5]) && !Bool(p[6])) }); } OnQuestDataMutated(); OrdainUIBehaviour.MarkQuestDirty(); } private void HandleQuestStory(string[] p) { int size = ((p.Length > 1) ? Math.Max(0, Int(p[1])) : 0); EnsureQuestSlots(UIData.StoryQuests, size); OrdainUIBehaviour.MarkQuestDirty(); } private void HandleQuestStoryItem(string[] p) { if (p.Length >= 11 && int.TryParse(p[1], out var result) && result >= 0) { EnsureQuestSlots(UIData.StoryQuests, result + 1); string text = Unescape(p[2]); string text2 = Unescape(p[3]); if (string.IsNullOrWhiteSpace(text) && string.IsNullOrWhiteSpace(text2)) { UIData.StoryQuests[result] = null; } else { bool flag = p.Length > 11 && Bool(p[11]); bool flag2 = p.Length > 12 && Bool(p[12]); bool canClaim = ((p.Length > 13) ? Bool(p[13]) : (flag && !flag2)); int num = ((p.Length <= 8) ? 1 : Math.Max(1, Int(p[8]))); UIData.StoryQuests[result] = new UIData.QuestEntry { Id = text, Category = "Story", Status = ((p.Length > 9) ? Unescape(p[9]) : ((!flag) ? "Active" : (flag2 ? "Completed" : "Claimable"))), Title = text2, Description = ((p.Length > 4) ? Unescape(p[4]) : ""), Requirements = ((p.Length > 5) ? Unescape(p[5]) : ""), Location = ((p.Length > 6) ? Unescape(p[6]) : ""), Progress = ((p.Length > 7) ? Math.Clamp(Int(p[7]), 0, num) : 0), Required = num, RewardPreview = ((p.Length > 10) ? Unescape(p[10]) : ""), Completed = flag, Claimed = flag2, CanClaim = canClaim }; } OrdainUIBehaviour.MarkQuestDirty(); } } private void HandleQuestEvent(string[] p) { int size = ((p.Length > 1) ? Math.Max(0, Int(p[1])) : 0); EnsureQuestSlots(UIData.EventQuests, size); OrdainUIBehaviour.MarkQuestDirty(); } private void HandleQuestEventItem(string[] p) { if (p.Length >= 7 && int.TryParse(p[1], out var result) && result >= 0) { EnsureQuestSlots(UIData.EventQuests, result + 1); string text = Unescape(p[2]); string text2 = Unescape(p[3]); if (string.IsNullOrWhiteSpace(text) && string.IsNullOrWhiteSpace(text2)) { UIData.EventQuests[result] = null; } else { bool flag = p.Length > 7 && Bool(p[7]); bool flag2 = p.Length > 8 && Bool(p[8]); int num = ((p.Length <= 6) ? 1 : Math.Max(1, Int(p[6]))); UIData.EventQuests[result] = new UIData.QuestEntry { Id = text, Category = "Event", Status = ((!flag) ? "Active" : (flag2 ? "Claimed" : "Completed")), Title = text2, Description = ((p.Length > 4) ? Unescape(p[4]) : ""), Requirements = ((p.Length > 4) ? Unescape(p[4]) : ""), Location = "", Progress = ((p.Length > 5) ? Math.Clamp(Int(p[5]), 0, num) : 0), Required = num, Completed = flag, Claimed = flag2, RewardPreview = ((p.Length > 9) ? Unescape(p[9]) : ""), CanClaim = (flag && !flag2) }; } OrdainUIBehaviour.MarkQuestDirty(); } } private void HandleQuestCompleted(string[] p) { int size = ((p.Length > 1) ? Math.Max(0, Int(p[1])) : 0); EnsureQuestSlots(UIData.CompletedQuests, size); OrdainUIBehaviour.MarkQuestDirty(); } private void HandleQuestCompletedItem(string[] p) { if (p.Length >= 8 && int.TryParse(p[1], out var result) && result >= 0) { EnsureQuestSlots(UIData.CompletedQuests, result + 1); string text = Unescape(p[3]); string text2 = Unescape(p[4]); if (string.IsNullOrWhiteSpace(text) && string.IsNullOrWhiteSpace(text2)) { UIData.CompletedQuests[result] = null; } else { bool flag = p.Length > 8 && Bool(p[8]); UIData.CompletedQuests[result] = new UIData.QuestEntry { Id = text, Category = ((p.Length > 2) ? Unescape(p[2]) : "Story"), Status = (flag ? "Claimed" : "Unclaimed"), Title = text2, Description = ((p.Length > 5) ? Unescape(p[5]) : ""), Requirements = ((p.Length > 6) ? Unescape(p[6]) : ""), Location = "", RewardPreview = ((p.Length > 7) ? Unescape(p[7]) : ""), Progress = 1, Required = 1, Completed = true, Claimed = flag, CanClaim = !flag }; } OrdainUIBehaviour.MarkQuestDirty(); } } private void HandleQuestTargetNpc(string[] p) { if (p.Length >= 2) { if (!(UIData.HasStoryTargetNpc = Bool(p[1]))) { UIData.StoryTargetNpcId = ""; UIData.StoryTargetNpcName = ""; UIData.StoryTargetNpcStage = ""; UIData.StoryTargetNpcSpawnRange = 0f; } else { UIData.StoryTargetNpcId = ((p.Length > 2) ? Unescape(p[2]) : ""); UIData.StoryTargetNpcName = ((p.Length > 3) ? Unescape(p[3]) : ""); UIData.StoryTargetNpcStage = ((p.Length > 4) ? Unescape(p[4]) : ""); UIData.StoryTargetNpcSpawnRange = ((p.Length > 5) ? Math.Max(0f, Float(p[5])) : 0f); } OrdainUIBehaviour.MarkQuestDirty(); OrdainUIBehaviour.MarkMainMenuDirty(); } } private void HandleFamiliar(string[] p) { if (p.Length >= 8) { UIData.FamiliarName = Unescape(p[1]); UIData.FamiliarRarity = p[2]; UIData.FamiliarIsShiny = Bool(p[3]); UIData.FamiliarLevel = Int(p[4]); UIData.FamiliarHP = Float(p[5]); UIData.FamiliarMaxHP = Float(p[6]); UIData.FamiliarActive = Bool(p[7]); OrdainUIBehaviour.MarkFamiliarDirty(); } } private void HandleFamDetail(string[] p) { if (p.Length >= 17) { UIData.FamiliarName = Unescape(p[1]); UIData.FamiliarRarity = p[2]; UIData.FamiliarIsShiny = Bool(p[3]); UIData.FamiliarLevel = Int(p[4]); UIData.FamiliarHP = Float(p[5]); UIData.FamiliarMaxHP = Float(p[6]); UIData.FamiliarBondLevel = Int(p[7]); UIData.FamiliarBondName = p[8]; UIData.FamiliarMode = p[9]; UIData.FamiliarUnspentAP = Int(p[10]); UIData.FamiliarHPAlloc = Int(p[11]); UIData.FamiliarPhysAlloc = Int(p[12]); UIData.FamiliarSpellAlloc = Int(p[13]); UIData.FamiliarXP = Float(p[14]); UIData.FamiliarXPNext = Float(p[15]); UIData.FamiliarEverstone = Bool(p[16]); UIData.FamiliarActive = !string.IsNullOrEmpty(p[1]); SyncActiveFamiliarListEntry(); OrdainUIBehaviour.MarkFamiliarDirty(); } } private void HandleFamBoxes(string[] p) { if (p.Length < 2) { return; } UIData.ActiveBoxName = Unescape(p[1]); UIData.Boxes.Clear(); for (int i = 2; i < p.Length; i++) { string[] array = p[i].Split(':'); if (array.Length >= 2) { UIData.Boxes.Add(new UIData.BoxInfo { Name = Unescape(array[0]), Count = Int(array[1]), Max = 10 }); } } OrdainUIBehaviour.MarkFamiliarDirty(); } private void HandleFamList(string[] p) { if (p.Length < 4) { return; } UIData.FamiliarList.Clear(); for (int i = 4; i < p.Length; i++) { string[] array = p[i].Split(':'); if (array.Length >= 6) { UIData.FamiliarList.Add(new UIData.FamiliarListEntry { Index = Int(array[0]), Name = Unescape(array[1]), Rarity = array[2], IsShiny = Bool(array[3]), Level = Int(array[4]), IsActive = Bool(array[5]) }); } } OrdainUIBehaviour.MarkFamiliarDirty(); } private static void SyncActiveFamiliarListEntry() { if (UIData.FamiliarList == null || UIData.FamiliarList.Count == 0 || !UIData.FamiliarActive) { return; } UIData.FamiliarListEntry familiarListEntry = null; for (int i = 0; i < UIData.FamiliarList.Count; i++) { UIData.FamiliarListEntry familiarListEntry2 = UIData.FamiliarList[i]; if (familiarListEntry2 != null && familiarListEntry2.IsActive) { familiarListEntry = familiarListEntry2; break; } } if (familiarListEntry == null && !string.IsNullOrWhiteSpace(UIData.FamiliarName)) { for (int j = 0; j < UIData.FamiliarList.Count; j++) { UIData.FamiliarListEntry familiarListEntry3 = UIData.FamiliarList[j]; if (familiarListEntry3 != null && string.Equals(familiarListEntry3.Name, UIData.FamiliarName, StringComparison.OrdinalIgnoreCase)) { familiarListEntry = familiarListEntry3; break; } } } if (familiarListEntry == null) { return; } for (int k = 0; k < UIData.FamiliarList.Count; k++) { UIData.FamiliarListEntry familiarListEntry4 = UIData.FamiliarList[k]; if (familiarListEntry4 != null && familiarListEntry4 != familiarListEntry) { familiarListEntry4.IsActive = false; } } familiarListEntry.IsActive = true; familiarListEntry.Name = UIData.FamiliarName ?? familiarListEntry.Name; familiarListEntry.Rarity = UIData.FamiliarRarity ?? familiarListEntry.Rarity; familiarListEntry.IsShiny = UIData.FamiliarIsShiny; familiarListEntry.Level = UIData.FamiliarLevel; } private void HandleEventState(string[] p) { if (p.Length >= 7) { UIData.EventName = Unescape(p[1]); UIData.EventState = p[2]; UIData.EventActivePlayers = Int(p[3]); UIData.EventEliminatedPlayers = Int(p[4]); UIData.EventPlayerStatus = p[5]; UIData.InEvent = Bool(p[6]); if (!UIData.InEvent || string.Equals(UIData.EventState, "IDLE", StringComparison.OrdinalIgnoreCase)) { UIData.EventPhase = ""; UIData.EventPhaseTimer = 0f; } OrdainUIBehaviour.MarkMainMenuDirty(); } } private void HandleEventPhase(string[] p) { if (p.Length >= 3) { UIData.EventPhase = p[1]; UIData.EventPhaseTimer = Float(p[2]); } } private void HandleEventNotify(string[] p) { if (p.Length >= 4) { OrdainUIBehaviour.EnqueueNotification(Unescape(p[1]), p[2], Float(p[3])); } } private void HandleNotify(string[] p) { if (p.Length >= 4) { OrdainUIBehaviour.EnqueueNotification(Unescape(p[1]), p[2], Float(p[3])); } } private void HandleInspectOpen(string[] p) { string obj = ((p.Length > 1) ? Unescape(p[1]) : ""); UIData.InspectPanelOpen = true; UIData.InspectName = obj; OrdainUIBehaviour.MarkInspectDirty(); OrdainUIBehaviour.OpenInspectPanel(obj); } private void HandleInspectClose() { UIData.InspectPanelOpen = false; OrdainUIBehaviour.MarkInspectDirty(); OrdainUIBehaviour.CloseInspectPanel(); } private void HandleInspectSummary(string[] p) { if (p.Length >= 21) { UIData.InspectName = Unescape(p[1]); UIData.InspectTitle = Unescape(p[2]); UIData.InspectTitleColor = Unescape(p[3]); UIData.InspectClassName = Unescape(p[4]); UIData.InspectLevel = Math.Max(0, Int(p[5])); UIData.InspectParagonLevel = Math.Max(0, Int(p[6])); UIData.InspectLevelRank = Math.Max(0, Int(p[7])); UIData.InspectVBloodRank = Math.Max(0, Int(p[8])); UIData.InspectMonsterRank = Math.Max(0, Int(p[9])); UIData.InspectWorldFirstRank = Math.Max(0, Int(p[10])); UIData.InspectFamiliarRank = Math.Max(0, Int(p[11])); UIData.InspectEventPointsRank = Math.Max(0, Int(p[12])); UIData.InspectEventWinsRank = Math.Max(0, Int(p[13])); UIData.InspectVBloodKills = Math.Max(0, Int(p[14])); UIData.InspectMonsterKills = Math.Max(0L, Long(p[15])); UIData.InspectWorldFirsts = Math.Max(0, Int(p[16])); UIData.InspectFamiliarsUnlocked = Math.Max(0, Int(p[17])); UIData.InspectEventPoints = Math.Max(0, Int(p[18])); UIData.InspectEventWins = Math.Max(0, Int(p[19])); UIData.InspectEventParticipations = Math.Max(0, Int(p[20])); UIData.InspectPortraitKey = ((p.Length > 21) ? Unescape(p[21]) : ""); UIData.PlayerName = UIData.InspectName; UIData.EventPoints = UIData.InspectEventPoints; UIData.EventWins = UIData.InspectEventWins; UIData.EventParticipations = UIData.InspectEventParticipations; OrdainUIBehaviour.MarkInspectDirty(); OrdainUIBehaviour.MarkStatsDirty(); } } private void HandleImageOpen(string[] p) { OrdainUIBehaviour.OpenImagePreviewPanel((p.Length > 1) ? Unescape(p[1]) : ""); } private void HandleImageClose() { OrdainUIBehaviour.CloseImagePreviewPanel(); } private void HandleUIDesignOpen(string[] p) { OrdainUIBehaviour.OpenUIDesignPanel((p.Length > 1) ? Unescape(p[1]) : ""); } private void HandleUIDesignClose() { OrdainUIBehaviour.CloseUIDesignPanel(); } private void HandleTriviaQuestion(string[] p) { if (p.Length >= 4) { UIData.TriviaQuestion = Unescape(p[1]); UIData.TriviaRound = Int(p[2]); UIData.TriviaTotalRounds = Int(p[3]); } } private void HandleTriviaScore(string[] p) { UIData.TriviaScores.Clear(); for (int i = 1; i < p.Length; i++) { string[] array = p[i].Split(':'); if (array.Length == 2) { UIData.TriviaScores.Add(new UIData.TriviaScore { Name = array[0], Score = Int(array[1]) }); } } } private void HandleDungeon(string[] p) { if (p.Length >= 7) { UIData.DungeonName = p[1]; UIData.DungeonRoom = Int(p[2]); UIData.DungeonTotalRooms = Int(p[3]); UIData.DungeonRoomType = p[4]; UIData.DungeonTime = Float(p[5]); UIData.InDungeon = Bool(p[6]); } } private void HandleBoss(string[] p) { if (p.Length >= 5) { UIData.BossName = p[1]; UIData.BossHP = Float(p[2]); UIData.BossMaxHP = Float(p[3]); UIData.BossActive = Bool(p[4]); } } private void HandleParty(string[] p) { UIData.Party.Clear(); for (int i = 1; i < p.Length; i++) { string[] array = p[i].Split(':'); if (array.Length >= 6) { UIData.Party.Add(new UIData.PartyMember { Name = array[0], ClassName = array[1], HP = Float(array[2]), MaxHP = Float(array[3]), IsDead = Bool(array[4]), IsDisconnected = Bool(array[5]) }); } } } private void HandleLB(string[] p) { if (p.Length < 2) { return; } UIData.Leaderboard.BoardType = p[1]; UIData.Leaderboard.Entries.Clear(); UIData.Leaderboard.PlayerEntry = null; UIData.Leaderboard.Loading = false; for (int i = 2; i < p.Length; i++) { string text = p[i]; if (text.StartsWith("SELF:", StringComparison.Ordinal)) { string[] array = text.Substring(5).Split(':'); if (array.Length >= 3 && int.TryParse(array[0], out var result) && result > 0) { UIData.Leaderboard.PlayerEntry = new UIData.LBEntry { Rank = result, Name = Unescape(array[1]), Value = ((array.Length > 2) ? Unescape(array[2]) : "") }; } } else { string[] array2 = text.Split(':'); if (array2.Length >= 3 && int.TryParse(array2[0], out var result2)) { UIData.Leaderboard.Entries.Add(new UIData.LBEntry { Rank = result2, Name = Unescape(array2[1]), Value = ((array2.Length > 2) ? Unescape(array2[2]) : "") }); } } } OrdainUIBehaviour.MarkLeaderboardDirty(); } private void HandleLBBegin(string[] p) { if (p.Length >= 2) { UIData.Leaderboard.BoardType = p[1]; UIData.Leaderboard.Entries.Clear(); UIData.Leaderboard.PlayerEntry = null; UIData.Leaderboard.Loading = true; OrdainUIBehaviour.MarkLeaderboardDirty(); } } private void HandleLBRow(string[] p) { if (p.Length >= 4 && int.TryParse(p[1], out var result)) { UIData.Leaderboard.Entries.Add(new UIData.LBEntry { Rank = result, Name = Unescape(p[2]), Value = Unescape(p[3]) }); OrdainUIBehaviour.MarkLeaderboardDirty(); } } private void HandleLBSelf(string[] p) { if (p.Length >= 2) { if (!int.TryParse(p[1], out var result) || result <= 0) { UIData.Leaderboard.PlayerEntry = null; OrdainUIBehaviour.MarkLeaderboardDirty(); return; } UIData.Leaderboard.PlayerEntry = new UIData.LBEntry { Rank = result, Name = ((p.Length > 2) ? Unescape(p[2]) : ""), Value = ((p.Length > 3) ? Unescape(p[3]) : "") }; OrdainUIBehaviour.MarkLeaderboardDirty(); } } private void HandleLBDone(string[] p) { UIData.Leaderboard.Loading = false; if (p.Length > 1 && !string.IsNullOrWhiteSpace(p[1])) { UIData.Leaderboard.BoardType = p[1]; } OrdainUIBehaviour.MarkLeaderboardDirty(); } private void HandleStats(string[] p) { if (p.Length >= 21) { UIData.StatSTR = Int(p[1]); UIData.StatINT = Int(p[2]); UIData.StatDEX = Int(p[3]); UIData.StatLUK = Int(p[4]); UIData.StatCD = Int(p[5]); UIData.StatMS = Int(p[6]); UIData.StatHP = Int(p[7]); UIData.StatBE = Int(p[8]); UIData.AppliedPhysicalPower = Float(p[9]); UIData.AppliedPhysicalLifeLeech = Float(p[10]); UIData.AppliedSpellPower = Float(p[11]); UIData.AppliedSpellLifeLeech = Float(p[12]); UIData.AppliedAttackSpeed = Float(p[13]); UIData.AppliedPhysicalCritChance = Float(p[14]); UIData.AppliedSpellCritChance = Float(p[15]); UIData.AppliedPhysicalCritDamage = Float(p[16]); UIData.AppliedSpellCritDamage = Float(p[17]); UIData.AppliedMovementSpeed = Float(p[18]); UIData.AppliedMaxHealth = Float(p[19]); UIData.AppliedReducedBloodDrain = Float(p[20]); if (p.Length >= 22 && long.TryParse(p[21], out var result)) { UIData.IronBars = result; } OrdainUIBehaviour.MarkStatsDirty(); OrdainUIBehaviour.MarkInspectDirty(); } } private void HandleParagon(string[] p) { if (p.Length >= 7) { UIData.ParagonLevel = Int(p[1]); UIData.ParagonXP = Float(p[2]); UIData.ParagonXPNeeded = Float(p[3]); UIData.ParagonUnspentPoints = Math.Max(0, Int(p[4])); UIData.ParagonSpentPoints = Math.Max(0, Int(p[5])); UIData.ParagonMaxLevel = Math.Max(1, Int(p[6])); OrdainUIBehaviour.MarkStatsDirty(); OrdainUIBehaviour.MarkInspectDirty(); } } private void HandleParagonReset(string[] p) { UIData.ParagonPerks.Clear(); OrdainUIBehaviour.MarkStatsDirty(); OrdainUIBehaviour.MarkInspectDirty(); } private void HandleParagonPerk(string[] p) { if (p.Length < 8) { return; } string text = Unescape(p[1]); if (!string.IsNullOrWhiteSpace(text)) { if (!UIData.ParagonPerks.TryGetValue(text, out var value) || value == null) { value = new UIData.ParagonPerkEntry { Key = text }; UIData.ParagonPerks[text] = value; } value.Name = Unescape(p[2]); value.Alias = Unescape(p[3]); value.Rank = Math.Max(0, Int(p[4])); value.MaxRank = Math.Max(1, Int(p[5])); value.NextCost = Math.Max(0, Int(p[6])); value.NextDescription = Unescape(p[7]); OrdainUIBehaviour.MarkStatsDirty(); OrdainUIBehaviour.MarkInspectDirty(); } } private void HandleAchievementReset(string[] p) { UIData.Achievements.Clear(); UIData.AchievementCatalogCount = ((p.Length > 1) ? Math.Max(0, Int(p[1])) : 0); UIData.AchievementCatalogHash = ((p.Length > 2) ? Int(p[2]) : 0); OrdainUIBehaviour.MarkAchievementsDirty(); } private void HandleAchievementSummary(string[] p) { if (p.Length >= 7) { UIData.AchievementPoints = Math.Max(0, Int(p[1])); UIData.AchievementUnlockedCount = Math.Max(0, Int(p[2])); UIData.AchievementTotalCount = Math.Max(0, Int(p[3])); UIData.EventPoints = Math.Max(0, Int(p[4])); UIData.EventWins = Math.Max(0, Int(p[5])); UIData.EventParticipations = Math.Max(0, Int(p[6])); OrdainUIBehaviour.MarkAchievementsDirty(); } } private void HandleAchievementDefinition(string[] p) { if (p.Length < 10) { return; } string text = Unescape(p[1]); if (!string.IsNullOrWhiteSpace(text)) { if (!UIData.Achievements.TryGetValue(text, out var value) || value == null) { value = new UIData.AchievementEntry { Id = text }; UIData.Achievements[text] = value; } value.Tier = Math.Max(0, Int(p[2])); value.Secret = Bool(p[3]); value.AdminOnly = Bool(p[4]); value.Required = Math.Max(1, Int(p[5])); value.Points = Math.Max(0, Int(p[6])); value.Category = Unescape(p[7]); value.Title = Unescape(p[8]); value.Description = Unescape(p[9]); OrdainUIBehaviour.MarkAchievementsDirty(); } } private void HandleAchievementState(string[] p) { if (p.Length < 5) { return; } string text = Unescape(p[1]); if (!string.IsNullOrWhiteSpace(text)) { if (!UIData.Achievements.TryGetValue(text, out var value) || value == null) { value = new UIData.AchievementEntry { Id = text }; UIData.Achievements[text] = value; } value.Progress = Math.Max(0L, Long(p[2])); value.Required = Math.Max(1, Int(p[3])); value.Unlocked = Bool(p[4]); OrdainUIBehaviour.MarkAchievementsDirty(); } } private void HandleNPCRegBegin(string[] p) { NPCManager.OnRegistryBegin(); } private void HandleNPCReg(string[] p) { if (p.Length >= 7 && float.TryParse(p[4], NumberStyles.Float, CultureInfo.InvariantCulture, out var result) && float.TryParse(p[5], NumberStyles.Float, CultureInfo.InvariantCulture, out var result2) && float.TryParse(p[6], NumberStyles.Float, CultureInfo.InvariantCulture, out var result3)) { NPCManager.OnRegistryEntry(Unescape(p[1]), Unescape(p[2]), Unescape(p[3]), result, result2, result3); } } private void HandleNPCRegDone() { NPCManager.OnRegistryDone(); } private void HandleRiteOfferBegin(string[] p) { RiteOfferingManager.OnBegin(); } private void HandleRiteOffer(string[] p) { if (p.Length >= 9 && int.TryParse(p[1], out var result) && float.TryParse(p[6], NumberStyles.Float, CultureInfo.InvariantCulture, out var result2) && float.TryParse(p[7], NumberStyles.Float, CultureInfo.InvariantCulture, out var result3) && float.TryParse(p[8], NumberStyles.Float, CultureInfo.InvariantCulture, out var result4)) { RiteOfferingManager.OnEntry(result, Unescape(p[2]), Unescape(p[3]), Unescape(p[4]), Unescape(p[5]), result2, result3, result4); } } private void HandleRiteOfferDone() { RiteOfferingManager.OnDone(); } private void HandleRiteOfferClear() { RiteOfferingManager.Clear(); } private void HandleTimerStart(string[] p) { if (p.Length >= 4 && long.TryParse(p[1], NumberStyles.Integer, CultureInfo.InvariantCulture, out var result)) { string label = Unescape(p[2]); bool flashOnZero = p[3] == "1" || p[3].Equals("true", StringComparison.OrdinalIgnoreCase); OrdainUIBehaviour.TimerBegin(result, label, flashOnZero); } } private void HandleTimerStop() { OrdainUIBehaviour.TimerStop(); } private void HandleIchorSet(string[] p) { if (p.Length >= 2 && long.TryParse(p[1], NumberStyles.Integer, CultureInfo.InvariantCulture, out var result)) { OrdainUIBehaviour.IchorSet(result); } } private void HandleIchorHide() { OrdainUIBehaviour.IchorHide(); } private void HandleNPCOpen(string[] p) { if (p.Length >= 4) { OrdainUIBehaviour.OpenNPCPanel(Unescape(p[1]), Unescape(p[2]), Unescape(p[3])); } } private void HandleNPCDialogue(string[] p) { if (p.Length >= 5) { OrdainUIBehaviour.SetNPCDialogueNode(Unescape(p[1]), Unescape(p[2]), Unescape(p[3]), Int(p[4])); } } private void HandleNPCChoice(string[] p) { if (p.Length >= 4) { OrdainUIBehaviour.AddNPCChoice(Unescape(p[1]), Unescape(p[2]), Unescape(p[3])); } } private void HandleNPCChoiceResult(string[] p) { if (p.Length >= 3) { OrdainUIBehaviour.OnNPCChoiceResult(Bool(p[1]), Unescape(p[2])); } } private void OnQuestDataMutated() { QuestSnapshot questSnapshot = CaptureQuestSnapshot(); if (!_questSnapshotInitialized) { _lastQuestSnapshot = questSnapshot; _questSnapshotInitialized = true; } else { EmitQuestChanges(_lastQuestSnapshot, questSnapshot); _lastQuestSnapshot = questSnapshot; } } private static QuestSnapshot CaptureQuestSnapshot() { return new QuestSnapshot { HasStoryQuest = UIData.HasActiveStoryQuest, StoryQuestId = (UIData.StoryQuestId ?? ""), StoryQuestTitle = (UIData.StoryQuestTitle ?? ""), StoryStepText = (UIData.StoryStepText ?? ""), StoryStepProgress = Math.Max(0, UIData.StoryStepProgress), StoryStepRequired = Math.Max(1, UIData.StoryStepRequired), StoryClaimableCount = Math.Max(0, UIData.StoryClaimableCount), StoryRewardPreview = (UIData.StoryRewardPreview ?? ""), DailyQuests = CloneQuestEntries(UIData.DailyQuests), WeeklyQuests = CloneQuestEntries(UIData.WeeklyQuests) }; } private static List CloneQuestEntries(List source) { List list = new List(source?.Count ?? 0); if (source == null) { return list; } for (int i = 0; i < source.Count; i++) { UIData.QuestEntry questEntry = source[i]; if (questEntry == null) { list.Add(null); continue; } list.Add(new QuestSnapshotEntry { Id = (questEntry.Id ?? ""), Title = (questEntry.Title ?? ""), Description = (questEntry.Description ?? ""), RewardPreview = (questEntry.RewardPreview ?? ""), Progress = Math.Max(0, questEntry.Progress), Required = Math.Max(1, questEntry.Required), Completed = questEntry.Completed, Claimed = questEntry.Claimed }); } return list; } private static void EmitQuestChanges(QuestSnapshot previous, QuestSnapshot current) { if (previous == null || current == null) { return; } bool flag = !string.Equals(previous.StoryQuestId, current.StoryQuestId, StringComparison.OrdinalIgnoreCase) || previous.HasStoryQuest != current.HasStoryQuest; string storyDisplayName = GetStoryDisplayName(current); if (current.HasStoryQuest && flag && !string.IsNullOrWhiteSpace(storyDisplayName)) { OrdainUIBehaviour.EnqueueNotification("Quest Started: " + storyDisplayName, "gold", 2.6f); UIData.AddQuestHistory("Story started: " + storyDisplayName); } int num; if (previous.HasStoryQuest && current.HasStoryQuest) { num = (string.Equals(previous.StoryQuestId, current.StoryQuestId, StringComparison.OrdinalIgnoreCase) ? 1 : 0); if (num != 0 && !string.Equals(previous.StoryStepText, current.StoryStepText, StringComparison.Ordinal) && !string.IsNullOrWhiteSpace(current.StoryStepText)) { OrdainUIBehaviour.EnqueueNotification("New Objective: " + current.StoryStepText, "info", 2.8f); UIData.AddQuestHistory("Objective: " + current.StoryStepText); } } else { num = 0; } if (num != 0) { int num2 = Math.Max(1, previous.StoryStepRequired); int num3 = Math.Max(1, current.StoryStepRequired); if (previous.StoryStepProgress < num2 && current.StoryStepProgress >= num3) { UIData.AddQuestHistory("Story complete: " + storyDisplayName); } } EmitRotatingHistory("Daily", previous.DailyQuests, current.DailyQuests); EmitRotatingHistory("Weekly", previous.WeeklyQuests, current.WeeklyQuests); } private static void EmitRotatingHistory(string label, List previous, List current) { int num = Math.Max(previous?.Count ?? 0, current?.Count ?? 0); for (int i = 0; i < num; i++) { QuestSnapshotEntry questSnapshotEntry = ((previous != null && i < previous.Count) ? previous[i] : null); QuestSnapshotEntry questSnapshotEntry2 = ((current != null && i < current.Count) ? current[i] : null); if (questSnapshotEntry2 == null || string.IsNullOrWhiteSpace(questSnapshotEntry2.Id)) { continue; } if (questSnapshotEntry == null || string.IsNullOrWhiteSpace(questSnapshotEntry.Id) || !string.Equals(questSnapshotEntry.Id, questSnapshotEntry2.Id, StringComparison.OrdinalIgnoreCase)) { UIData.AddQuestHistory(label + " assigned: " + GetQuestDisplayName(questSnapshotEntry2)); continue; } if (!questSnapshotEntry.Completed && questSnapshotEntry2.Completed) { UIData.AddQuestHistory(label + " complete: " + GetQuestDisplayName(questSnapshotEntry2)); } if (!questSnapshotEntry.Claimed && questSnapshotEntry2.Claimed) { UIData.AddQuestHistory(label + " claimed: " + GetQuestDisplayName(questSnapshotEntry2)); } } } private static string GetQuestDisplayName(QuestSnapshotEntry entry) { if (entry == null) { return "Quest"; } if (!string.IsNullOrWhiteSpace(entry.Title)) { return entry.Title; } return entry.Id ?? "Quest"; } private static string GetStoryDisplayName(QuestSnapshot snapshot) { if (snapshot == null) { return "Story Quest"; } if (!string.IsNullOrWhiteSpace(snapshot.StoryQuestTitle)) { return snapshot.StoryQuestTitle; } if (!string.IsNullOrWhiteSpace(snapshot.StoryQuestId)) { return snapshot.StoryQuestId; } return "Story Quest"; } private static int Int(string s) { if (!int.TryParse(s, out var result)) { return 0; } return result; } private static long Long(string s) { if (!long.TryParse(s, out var result)) { return 0L; } return result; } private static float Float(string s) { if (!float.TryParse(s, NumberStyles.Float, CultureInfo.InvariantCulture, out var result)) { return 0f; } return result; } private static bool Bool(string s) { if (!(s == "1")) { return s == "true"; } return true; } private static string Unescape(string s) { if (string.IsNullOrEmpty(s)) { return ""; } StringBuilder stringBuilder = new StringBuilder(s.Length); bool flag = false; foreach (char c in s) { if (flag) { stringBuilder.Append(c); flag = false; } else if (c == '\\') { flag = true; } else { stringBuilder.Append(c); } } if (flag) { stringBuilder.Append('\\'); } return stringBuilder.ToString(); } private static string[] SplitPayload(string payload) { if (payload == null) { return Array.Empty(); } List list = new List(); StringBuilder stringBuilder = new StringBuilder(payload.Length); bool flag = false; foreach (char c in payload) { if (flag) { stringBuilder.Append(c); flag = false; continue; } switch (c) { case '\\': flag = true; break; case '|': list.Add(stringBuilder.ToString()); stringBuilder.Clear(); break; default: stringBuilder.Append(c); break; } } if (flag) { stringBuilder.Append('\\'); } list.Add(stringBuilder.ToString()); return list.ToArray(); } private void HandleIdent(string[] parts) { if (parts.Length < 2) { return; } Dictionary dictionary = new Dictionary(); if (parts[1] == "1") { for (int i = 2; i < parts.Length; i++) { string[] array = parts[i].Split('~'); if (array.Length >= 3 && int.TryParse(array[0], out var result)) { dictionary[result] = (array[1], array[2]); } } } ItemIdentityPatcher.SetIdentities(dictionary); } private void HandleForge(string[] parts) { if (parts.Length < 2) { return; } if (parts[1] != "1") { if (UIData.Forge.HasWeapon || UIData.Forge.Nodes.Count != 0) { UIData.Forge.HasWeapon = false; UIData.Forge.WeaponId = ""; UIData.Forge.WeaponName = ""; UIData.Forge.Nodes.Clear(); OrdainUIBehaviour.MarkForgeDirty(); } } else { if (parts.Length < 4) { return; } UIData.Forge.HasWeapon = true; UIData.Forge.WeaponId = parts[2]; UIData.Forge.WeaponName = parts[3]; UIData.Forge.Nodes.Clear(); for (int i = 4; i < parts.Length; i++) { string[] array = parts[i].Split('~'); if (array.Length >= 5 && int.TryParse(array[0], out var result) && int.TryParse(array[1], out var result2)) { float.TryParse(array[3], NumberStyles.Float, CultureInfo.InvariantCulture, out var result3); UIData.Forge.Nodes.Add(new UIData.ForgeNode { Slot = result, Guid = result2, Name = array[2], Cooldown = result3, Selected = (array[4] == "1") }); } } OrdainUIBehaviour.MarkForgeDirty(); } } private static void EnsureQuestSlots(List list, int size) { if (size <= 0) { list.Clear(); return; } if (list.Count > size) { list.RemoveRange(size, list.Count - size); } while (list.Count < size) { list.Add(null); } } } public static class NativeMenuWatcher { private static float _nextPoll; private static float _nextNotFoundWarn; private static bool _menuOpen; private static bool _loggedSceneInstance; private static readonly List _hiddenByMenu = new List(); private static EscapeMenuView _cachedMenu; public static bool MenuOpen => _menuOpen; public static void Tick() { if (Time.unscaledTime >= _nextPoll) { _nextPoll = Time.unscaledTime + 0.25f; bool flag = IsNativeMenuOpen(); if (flag && !_menuOpen) { _menuOpen = true; Plugin.Verbose("[OrdainUI] Native ESC menu OPENED — hiding Ordain UI"); int value = SweepHide(logNames: true); Plugin.Verbose($"[OrdainUI] Hid {value} window(s) ({CanvasService.RootWindows.Count} registered)"); } else if (!flag && _menuOpen) { _menuOpen = false; int num = 0; foreach (GameObject item in _hiddenByMenu) { if (!((Object)(object)item == (Object)null)) { item.SetActive(true); num++; } } _hiddenByMenu.Clear(); Plugin.Verbose($"[OrdainUI] Native ESC menu CLOSED — restored {num} window(s)"); } } if (_menuOpen) { SweepHide(logNames: false); } } private static int SweepHide(bool logNames) { int num = 0; foreach (GameObject rootWindow in CanvasService.RootWindows) { if (!((Object)(object)rootWindow == (Object)null) && rootWindow.activeSelf) { rootWindow.SetActive(false); if (!_hiddenByMenu.Contains(rootWindow)) { _hiddenByMenu.Add(rootWindow); } if (logNames) { Plugin.Verbose("[OrdainUI] hid (registry): " + ((Object)rootWindow).name); } num++; } } Canvas gameCanvasStatic = CanvasService.GameCanvasStatic; if ((Object)(object)gameCanvasStatic != (Object)null) { Transform transform = ((Component)gameCanvasStatic).transform; for (int i = 0; i < transform.childCount; i++) { GameObject gameObject = ((Component)transform.GetChild(i)).gameObject; if (!((Object)(object)gameObject == (Object)null) && gameObject.activeSelf && ((Object)gameObject).name.StartsWith("OrdainUI_") && !_hiddenByMenu.Contains(gameObject)) { gameObject.SetActive(false); _hiddenByMenu.Add(gameObject); if (logNames) { Plugin.Verbose("[OrdainUI] hid (name-scan): " + ((Object)gameObject).name); } num++; } } } return num; } private static bool IsNativeMenuOpen() { //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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) try { Scene scene; if ((Object)(object)_cachedMenu != (Object)null) { GameObject val = null; try { val = ((Component)_cachedMenu).gameObject; } catch { } if ((Object)(object)val != (Object)null) { scene = val.scene; if (((Scene)(ref scene)).IsValid()) { return val.activeInHierarchy; } } _cachedMenu = null; } Il2CppArrayBase val2 = Resources.FindObjectsOfTypeAll(); if (val2 == null || val2.Length == 0) { if (Time.unscaledTime >= _nextNotFoundWarn) { _nextNotFoundWarn = Time.unscaledTime + 10f; Plugin.Verbose("[OrdainUI] EscapeMenuView NOT FOUND — ESC-menu hiding inactive (will keep retrying)"); } return false; } foreach (EscapeMenuView item in val2) { if ((Object)(object)item == (Object)null) { continue; } GameObject gameObject = ((Component)item).gameObject; if ((Object)(object)gameObject == (Object)null) { continue; } scene = gameObject.scene; if (((Scene)(ref scene)).IsValid()) { _cachedMenu = item; if (!_loggedSceneInstance) { _loggedSceneInstance = true; Plugin.Verbose($"[OrdainUI] EscapeMenuView scene instance cached — active={gameObject.activeInHierarchy}"); } return gameObject.activeInHierarchy; } } return false; } catch { _cachedMenu = null; return false; } } } internal static class NPCManager { public class NPCClientRecord { public string Id { get; set; } = ""; public string Name { get; set; } = ""; public string Type { get; set; } = ""; public Vector3 WorldPos { get; set; } } private static readonly List _npcs = new List(); private static List _pendingBatch; public static IReadOnlyList All => _npcs; public static NPCClientRecord GetNearest(Vector3 playerPos, float maxDistance) { //IL_000a: 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_001b: 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) NPCClientRecord result = null; float num = maxDistance * maxDistance; for (int i = 0; i < _npcs.Count; i++) { Vector3 val = playerPos - _npcs[i].WorldPos; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude < num) { num = sqrMagnitude; result = _npcs[i]; } } return result; } public static NPCClientRecord GetNearestForPrompt(Vector3 playerPos, float maxDistance) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_002d: Unknown result type (might be due to invalid IL or missing references) if (UIData.HasStoryTargetNpc && !string.IsNullOrWhiteSpace(UIData.StoryTargetNpcId)) { NPCClientRecord nPCClientRecord = FindById(UIData.StoryTargetNpcId); if (nPCClientRecord != null) { Vector3 val = playerPos - nPCClientRecord.WorldPos; if (((Vector3)(ref val)).sqrMagnitude <= maxDistance * maxDistance) { return nPCClientRecord; } } } return GetNearest(playerPos, maxDistance); } public static void OnRegistryBegin() { _pendingBatch = new List(); } public static void OnRegistryEntry(string id, string name, string type, float x, float y, float z) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (_pendingBatch != null) { _pendingBatch.Add(new NPCClientRecord { Id = id, Name = name, Type = type, WorldPos = new Vector3(x, y, z) }); } } public static void OnRegistryDone() { if (_pendingBatch != null) { _npcs.Clear(); _npcs.AddRange(_pendingBatch); _pendingBatch = null; } } public static void Clear() { _npcs.Clear(); _pendingBatch = null; } private static NPCClientRecord FindById(string npcId) { if (string.IsNullOrWhiteSpace(npcId)) { return null; } for (int i = 0; i < _npcs.Count; i++) { NPCClientRecord nPCClientRecord = _npcs[i]; if (nPCClientRecord != null && !string.IsNullOrWhiteSpace(nPCClientRecord.Id) && string.Equals(nPCClientRecord.Id, npcId, StringComparison.OrdinalIgnoreCase)) { return nPCClientRecord; } } return null; } } internal static class RiteOfferingManager { public class OfferingRecord { public int Slot { get; set; } public string Name { get; set; } = ""; public string Boon { get; set; } = ""; public string Bane { get; set; } = ""; public string Color { get; set; } = "#C8C8C8"; public Vector3 WorldPos { get; set; } public bool IsStart { get; set; } } private static readonly List _offers = new List(); private static List _pendingBatch; public static IReadOnlyList All => _offers; public static bool HasOffering => _offers.Count > 0; public static OfferingRecord GetNearest(Vector3 playerPos, float maxDistance) { //IL_000a: 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_001b: 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) OfferingRecord result = null; float num = maxDistance * maxDistance; for (int i = 0; i < _offers.Count; i++) { Vector3 val = playerPos - _offers[i].WorldPos; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude < num) { num = sqrMagnitude; result = _offers[i]; } } return result; } public static void OnBegin() { _pendingBatch = new List(); } public static void OnEntry(int slot, string name, string boon, string bane, string color, float x, float y, float z) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) if (_pendingBatch != null) { _pendingBatch.Add(new OfferingRecord { Slot = slot, Name = name, Boon = boon, Bane = bane, Color = (string.IsNullOrWhiteSpace(color) ? "#C8C8C8" : color), WorldPos = new Vector3(x, y, z), IsStart = (slot < 0) }); } } public static void OnDone() { if (_pendingBatch != null) { _offers.Clear(); _offers.AddRange(_pendingBatch); _pendingBatch = null; } } public static void Clear() { _offers.Clear(); _pendingBatch = null; } } internal static class ShadowHoverBox { private static readonly int[] ShadowWeaponGuids = new int[1] { 1307774440 }; private static GameObject _box; private static bool _visible; private static int _lastGuid; public static void Tick() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown try { int hoveredShadowWeapon = GetHoveredShadowWeapon(); if (hoveredShadowWeapon != 0) { if (!_visible || hoveredShadowWeapon != _lastGuid) { Show(hoveredShadowWeapon); _lastGuid = hoveredShadowWeapon; } PositionFixed(); } else if (_visible) { Hide(); } } catch (Exception ex) { ManualLogSource log = OrdainUI.Core.Core.Log; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(38, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[OrdainUI:ShadowHoverBox] Tick error: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogWarning(val); } } private static int GetHoveredShadowWeapon() { //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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) EventSystem current = EventSystem.current; if ((Object)(object)current == (Object)null) { return 0; } PointerEventData val = new PointerEventData(current) { position = Vector2.op_Implicit(Input.mousePosition) }; List val2 = new List(); current.RaycastAll(val, val2); for (int i = 0; i < val2.Count; i++) { GameObject gameObject = val2[i].gameObject; if ((Object)(object)gameObject == (Object)null) { continue; } Transform val3 = gameObject.transform; for (int j = 0; j < 4; j++) { if (!((Object)(object)val3 != (Object)null)) { break; } ActionBarEntry component = ((Component)val3).GetComponent(); if ((Object)(object)component != (Object)null) { PrefabGUID entryId = component.EntryId; int guidHash = ((PrefabGUID)(ref entryId)).GuidHash; if (ShadowWeaponGuids.Contains(guidHash)) { return guidHash; } return 0; } val3 = val3.parent; } } return 0; } private static void Show(int guid) { if ((Object)(object)_box != (Object)null) { Object.Destroy((Object)(object)_box); _box = null; } Build(); if (!((Object)(object)_box == (Object)null)) { _box.SetActive(true); _visible = true; Plugin.Verbose($"[OrdainUI:ShadowHoverBox] shown for weapon {guid}"); } } private static void Hide() { if ((Object)(object)_box != (Object)null) { _box.SetActive(false); } _visible = false; } private static void Build() { //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService == null) { return; } List list = (from n in UIData.Forge.Nodes where n.Selected orderby n.Slot select n).ToList(); string text = (string.IsNullOrEmpty(UIData.Forge.WeaponName) ? "SHADOW WEAPON" : UIData.Forge.WeaponName.ToUpperInvariant()); float num = 26f; int num2 = Mathf.Max(1, list.Count); float num3 = 280f; float height = 28f + (float)num2 * num + 16f; _box = canvasService.CreateRootWindow("ShadowHoverBox", num3, height, 500, aboveNativeUI: true); CanvasService.CreateText(_box.transform, "Header", text, 12f, 6f, num3 - 24f, 24f, 16f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257); float num4 = 28f + 6f; if (list.Count == 0) { CanvasService.CreateText(_box.transform, "Empty", "No skills selected.", 12f, num4, num3 - 24f, num, 13f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257); return; } int num5 = 0; foreach (UIData.ForgeNode item in list) { string value = ((item.Slot == 1) ? "Q" : ((item.Slot == 4) ? "E" : item.Slot.ToString())); string value2 = ((item.Cooldown > 0f) ? $" ({item.Cooldown:0}s)" : ""); string text2 = $"[{value}] {item.Name}{value2}"; CanvasService.CreateText(_box.transform, $"Skill{num5}", text2, 12f, num4, num3 - 24f, num, 13f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257); num4 += num; num5++; } } private static void PositionFixed() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_box == (Object)null)) { RectTransform component = _box.GetComponent(); if (!((Object)(object)component == (Object)null)) { float num = (float)Screen.width * 0.32f; float num2 = (float)Screen.height * 0.5f; ((Transform)component).position = new Vector3(num, num2, 0f); } } } public static void Reset() { if ((Object)(object)_box != (Object)null) { Object.Destroy((Object)(object)_box); _box = null; } _visible = false; _lastGuid = 0; } } } namespace OrdainUI.Patches { [HarmonyPatch] internal static class CameraInputPatch { public static bool OrdainMenuOpen; private static float _nextDiagLog; private static bool _loggedError; [HarmonyPrefix] [HarmonyPatch(typeof(TopdownCameraSystem), "OnUpdate")] private static bool CameraOnUpdatePrefix() { if (!OrdainMenuOpen) { return true; } Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; return false; } [HarmonyPrefix] [HarmonyPatch(typeof(GameplayInputSystem), "HandleInput")] private unsafe static void HandleInputPrefix(ref InputState inputState) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown if (!OrdainMenuOpen) { return; } try { ((InputState)(ref inputState)).SetAnalogValue((AnalogInputAction)16, 0f); if (!inputState.InputsPressed.IsCreated || !((InputState)(ref inputState)).IsInputPressed((ButtonInputAction)500)) { return; } UnsafeList_Unboxed* listData = inputState.InputsPressed.m_ListData; for (int num = listData->Length - 1; num >= 0; num--) { if (((int*)listData->Ptr)[num] == 500) { listData->RemoveAt(num); } } } catch (Exception ex) { if (!_loggedError) { _loggedError = true; ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(46, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[OrdainUI] CameraGuard failed (falling open): "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } logger.LogWarning(val); } } } } [HarmonyPatch] internal static class ChatPatches { private const string ORD_UI_PREFIX = "[ORD_UI]"; private const string ORD_CMD_PREFIX = "[ORD_CMD]|"; private static readonly Dictionary _sentCommandCounts = new Dictionary(StringComparer.Ordinal); private static readonly ComponentType[] _networkEventComponents = (ComponentType[])(object)new ComponentType[4] { ComponentType.ReadOnly(Il2CppType.Of()), ComponentType.ReadOnly(Il2CppType.Of()), ComponentType.ReadOnly(Il2CppType.Of()), ComponentType.ReadOnly(Il2CppType.Of()) }; private static readonly NetworkEventType _networkEventType = new NetworkEventType { IsAdminEvent = false, EventId = NetworkEvents.EventId_ChatMessageEvent, IsDebugEvent = false }; private static EntityManager EntityManager => OrdainUI.Core.Core.EntityManager; [HarmonyPatch(typeof(ClientChatSystem), "ReceiveChatMessages")] [HarmonyPrefix] private static bool ReceiveChatMessagesPrefix(ClientChatSystem __instance, NetworkId localUserNetworkId, ChatColorsAsset colors, bool showTimeStamp, string timeStamp, NetworkIdLookupMap networkIdMap) { //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_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_0014: 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) //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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_003c: 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_0042: 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) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) EntityQuery receiveChatMessagesQuery = __instance._ReceiveChatMessagesQuery; NativeArray val = ((EntityQuery)(ref receiveChatMessagesQuery)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2)); try { for (int i = 0; i < val.Length; i++) { Entity val2 = val[i]; EntityManager entityManager = EntityManager; if (((EntityManager)(ref entityManager)).HasComponent(val2)) { entityManager = EntityManager; ChatMessageServerEvent componentData = ((EntityManager)(ref entityManager)).GetComponentData(val2); string value = ((FixedString512Bytes)(ref componentData.MessageText)).Value; if (TryConsumeSentCommand(value) || IsTransportCommand(value)) { entityManager = EntityManager; ((EntityManager)(ref entityManager)).DestroyEntity(val2); } } } } finally { val.Dispose(); } return true; } [HarmonyPatch(typeof(ClientChatSystem), "OnUpdate")] [HarmonyPrefix] private static void OnUpdatePrefix(ClientChatSystem __instance) { //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Expected O, but got Unknown //IL_0025: 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_002e: 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_003b: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) if (!OrdainUI.Core.Core.Initialized) { return; } while (CommandSender.HasPending()) { string text = CommandSender.Dequeue(); if (text != null) { RecordSentCommand(text); SendMessage(text); } } EntityQuery receiveChatMessagesQuery = __instance._ReceiveChatMessagesQuery; NativeArray val = ((EntityQuery)(ref receiveChatMessagesQuery)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2)); try { Enumerator enumerator = val.GetEnumerator(); while (enumerator.MoveNext()) { Entity current = enumerator.Current; EntityManager entityManager = EntityManager; if (!((EntityManager)(ref entityManager)).HasComponent(current)) { continue; } entityManager = EntityManager; ChatMessageServerEvent componentData = ((EntityManager)(ref entityManager)).GetComponentData(current); ref ServerChatMessageType messageType = ref componentData.MessageType; object obj = (object)(ServerChatMessageType)6; if (((object)Unsafe.As(ref messageType)/*cast due to .constrained prefix*/).Equals(obj)) { string value = ((FixedString512Bytes)(ref componentData.MessageText)).Value; if (value.Contains("[ORD_UI]")) { OrdainUI.Core.Core.MessageService?.HandleMessage(value.Substring(value.IndexOf("[ORD_UI]"))); entityManager = EntityManager; ((EntityManager)(ref entityManager)).DestroyEntity(current); } } } } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(16, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[OrdainUI:Chat] "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } logger.LogWarning(val2); } finally { val.Dispose(); } } private static void SendMessage(string text) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: 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_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_000d: 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_00d1: Expected O, but got Unknown //IL_0019: 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) //IL_002b: 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_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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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_006f: 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_007e: 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) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) try { Entity localUser = OrdainUI.Core.Core.LocalUser; Entity localCharacter = OrdainUI.Core.Core.LocalCharacter; if (!(localUser == Entity.Null) && !(localCharacter == Entity.Null)) { EntityManager entityManager = EntityManager; Entity val = ((EntityManager)(ref entityManager)).CreateEntity(_networkEventComponents); entityManager = EntityManager; ((EntityManager)(ref entityManager)).SetComponentData(val, new FromCharacter { Character = localCharacter, User = localUser }); entityManager = EntityManager; ((EntityManager)(ref entityManager)).SetComponentData(val, _networkEventType); entityManager = EntityManager; ChatMessageEvent val2 = new ChatMessageEvent { MessageText = new FixedString512Bytes(text), MessageType = (ChatMessageType)4 }; EntityManager entityManager2 = EntityManager; val2.ReceiverEntity = ((EntityManager)(ref entityManager2)).GetComponentData(localUser); ((EntityManager)(ref entityManager)).SetComponentData(val, val2); } } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(31, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("[OrdainUI] SendMessage failed: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex.Message); } logger.LogWarning(val3); } } private static bool IsTransportCommand(string text) { if (!string.IsNullOrEmpty(text)) { return text.StartsWith("[ORD_CMD]|", StringComparison.Ordinal); } return false; } private static void RecordSentCommand(string text) { if (!string.IsNullOrEmpty(text)) { if (_sentCommandCounts.TryGetValue(text, out var value)) { _sentCommandCounts[text] = value + 1; } else { _sentCommandCounts[text] = 1; } } } private static bool TryConsumeSentCommand(string text) { if (string.IsNullOrEmpty(text)) { return false; } if (!_sentCommandCounts.TryGetValue(text, out var value) || value <= 0) { return false; } if (value == 1) { _sentCommandCounts.Remove(text); } else { _sentCommandCounts[text] = value - 1; } return true; } public static void Reset() { _sentCommandCounts.Clear(); } } internal static class ForgeClientRegistrar { private static readonly (int forged, int baseGuid, string name, string desc)[] Defs = new(int, int, string, string)[1] { (-233574936, -223452038, "Ember Dust", "A smoldering reagent that should not exist. Forged by GOMS.") }; private static bool _done; private static bool _dumped; public static void Reset() { _done = false; } public static void TryApply() { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown if (_done || !OrdainUI.Core.Core.Initialized) { return; } ManagedDataRegistry val = null; try { World world = OrdainUI.Core.Core.World; object obj; if (world == null) { obj = null; } else { ManagedDataSystem existingSystemManaged = world.GetExistingSystemManaged(); obj = ((existingSystemManaged != null) ? ((ManagedDataSystem_Base)existingSystemManaged).ManagedDataRegistry : null); } val = (ManagedDataRegistry)obj; } catch { } if (val == null || Localization._LocalizedStrings == null) { return; } _done = true; if (!_dumped) { _dumped = true; DumpRegistrySurface(val); } (int, int, string, string)[] defs = Defs; bool flag = default(bool); for (int i = 0; i < defs.Length; i++) { (int, int, string, string) def = defs[i]; try { RegisterOne(val, def); } catch (Exception ex) { ManualLogSource log = OrdainUI.Core.Core.Log; BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(34, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[OrdainUI:ForgeClient] '"); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(def.Item3); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("' failed: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogWarning(val2); } } } private static void RegisterOne(ManagedDataRegistry registry, (int forged, int baseGuid, string name, string desc) def) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Expected O, but got Unknown //IL_0060: 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_0080: Expected O, but got Unknown //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: 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_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Expected O, but got Unknown //IL_01d6: Unknown result type (might be due to invalid IL or missing references) Dictionary localizedStrings = Localization._LocalizedStrings; PrefabGUID val = default(PrefabGUID); ((PrefabGUID)(ref val))..ctor(def.forged); if (registry.GetOrDefault(val, (ManagedItemData)null) != null) { Plugin.Verbose($"[OrdainUI:ForgeClient] {def.forged} already has ManagedItemData — skipping"); return; } ManagedItemData orDefault = registry.GetOrDefault(new PrefabGUID(def.baseGuid), (ManagedItemData)null); bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val2; if (orDefault == null) { ManualLogSource log = OrdainUI.Core.Core.Log; val2 = new BepInExWarningLogInterpolatedStringHandler(65, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[OrdainUI:ForgeClient] base "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(def.baseGuid); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" has no ManagedItemData — wrong base?"); } log.LogWarning(val2); return; } ManagedItemData val3; try { val3 = new ManagedItemData(); } catch (Exception ex) { ManualLogSource log2 = OrdainUI.Core.Core.Log; val2 = new BepInExWarningLogInterpolatedStringHandler(119, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[OrdainUI:ForgeClient] ManagedItemData ctor failed: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" — read the surface dump, we may need a different construction path"); } log2.LogWarning(val2); return; } int value = CopyMembers(orDefault, val3); Plugin.Verbose($"[OrdainUI:ForgeClient] cloned base ManagedItemData ({value} members copied)"); AssetGuid val4 = AssetGuid.FromString(Guid.NewGuid().ToString()); localizedStrings[val4] = def.name; val3.Name = new LocalizationKey(val4); AssetGuid val5 = AssetGuid.FromString(Guid.NewGuid().ToString()); localizedStrings[val5] = def.desc; LocalizedStringBuilderBase description = val3.Description; description.Key = new LocalizationKey(val5); val3.Description = description; if (TryInsert(registry, val, new PrefabGUID(def.baseGuid), val3)) { Plugin.Verbose((registry.GetOrDefault(val, (ManagedItemData)null) != null) ? $"[OrdainUI:ForgeClient] <<< REGISTERED '{def.name}' for {def.forged} — verify OK. Check the item in game!" : "[OrdainUI:ForgeClient] insert reported success but verify returned null — read the dump"); return; } ManualLogSource log3 = OrdainUI.Core.Core.Log; val2 = new BepInExWarningLogInterpolatedStringHandler(81, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[OrdainUI:ForgeClient] no insert method worked for "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(def.forged); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" — send the surface dump lines"); } log3.LogWarning(val2); } private static bool TryInsert(ManagedDataRegistry registry, PrefabGUID forgedGuid, PrefabGUID baseGuid, ManagedItemData fresh) { //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Expected O, but got Unknown //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Expected O, but got Unknown //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) ManualLogSource log = OrdainUI.Core.Core.Log; try { Dictionary dataLookupMap = registry._DataLookupMap; if (dataLookupMap == null) { log.LogWarning((object)"[OrdainUI:ForgeClient] _DataLookupMap is null"); return false; } Type type = ((object)dataLookupMap).GetType(); MethodInfo method = type.GetMethod("set_Item"); MethodInfo method2 = type.GetMethod("get_Count"); int value = ((method2 != null) ? ((int)method2.Invoke(dataLookupMap, null)) : (-1)); Plugin.Verbose($"[OrdainUI:ForgeClient] _DataLookupMap entry count: {value}"); Type val = null; int num = 0; int num2 = 0; DefaultInterpolatedStringHandler defaultInterpolatedStringHandler; try { object obj = type.GetMethod("GetEnumerator").Invoke(dataLookupMap, null); Type type2 = obj.GetType(); MethodInfo method3 = type2.GetMethod("MoveNext"); MethodInfo method4 = type2.GetMethod("get_Current"); while ((bool)method3.Invoke(obj, null)) { object obj2 = method4.Invoke(obj, null); Type type3 = obj2.GetType(); object? obj3 = type3.GetMethod("get_Key").Invoke(obj2, null); PrefabLookupKey val2 = (PrefabLookupKey)((obj3 is PrefabLookupKey) ? obj3 : null); object? obj4 = type3.GetMethod("get_Value").Invoke(obj2, null); Object val3 = (Object)((obj4 is Object) ? obj4 : null); if (val2 == null) { continue; } bool flag = ((val3 != null) ? ((Il2CppObjectBase)val3).TryCast() : null) != null; if (flag) { num++; } PrefabGUID prefabGUID = val2.PrefabGUID; if (((PrefabGUID)(ref prefabGUID)).GuidHash == ((PrefabGUID)(ref baseGuid)).GuidHash) { defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(75, 2); defaultInterpolatedStringHandler.AppendLiteral("[OrdainUI:ForgeClient] BASE entry found: ComponentType='"); Type componentType = val2.ComponentType; defaultInterpolatedStringHandler.AppendFormatted((componentType != null) ? componentType.FullName : null); defaultInterpolatedStringHandler.AppendLiteral("', valueIsItemData="); defaultInterpolatedStringHandler.AppendFormatted(flag); Plugin.Verbose(defaultInterpolatedStringHandler.ToStringAndClear()); if (flag) { val = val2.ComponentType; } } else if (num2 < 3 && flag) { num2++; defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(65, 2); defaultInterpolatedStringHandler.AppendLiteral("[OrdainUI:ForgeClient] sample item entry: guid "); prefabGUID = val2.PrefabGUID; defaultInterpolatedStringHandler.AppendFormatted(((PrefabGUID)(ref prefabGUID)).GuidHash); defaultInterpolatedStringHandler.AppendLiteral(", ComponentType='"); Type componentType2 = val2.ComponentType; defaultInterpolatedStringHandler.AppendFormatted((componentType2 != null) ? componentType2.FullName : null); defaultInterpolatedStringHandler.AppendLiteral("'"); Plugin.Verbose(defaultInterpolatedStringHandler.ToStringAndClear()); } } Plugin.Verbose($"[OrdainUI:ForgeClient] enumeration done: {num} ManagedItemData entrie(s) total"); } catch (Exception ex) { Plugin.Verbose("[OrdainUI:ForgeClient] enumeration failed (" + (ex.InnerException?.Message ?? ex.Message) + ") — proceeding to blind seed"); } PrefabLookupKey val4 = new PrefabLookupKey(); val4.PrefabGUID = forgedGuid; val4.ComponentType = val ?? Il2CppType.Of(); defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(76, 2); defaultInterpolatedStringHandler.AppendLiteral("[OrdainUI:ForgeClient] inserting with ComponentType='"); Type componentType3 = val4.ComponentType; defaultInterpolatedStringHandler.AppendFormatted((componentType3 != null) ? componentType3.FullName : null); defaultInterpolatedStringHandler.AppendLiteral("' (from stored entry: "); defaultInterpolatedStringHandler.AppendFormatted(val != (Type)null); defaultInterpolatedStringHandler.AppendLiteral(")"); Plugin.Verbose(defaultInterpolatedStringHandler.ToStringAndClear()); method.Invoke(dataLookupMap, new object[2] { val4, fresh }); Plugin.Verbose("[OrdainUI:ForgeClient] _DataLookupMap insert executed"); return true; } catch (Exception ex2) { bool flag2 = default(bool); BepInExWarningLogInterpolatedStringHandler val5 = new BepInExWarningLogInterpolatedStringHandler(53, 1, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val5).AppendLiteral("[OrdainUI:ForgeClient] _DataLookupMap insert failed: "); ((BepInExLogInterpolatedStringHandler)val5).AppendFormatted(ex2.InnerException?.Message ?? ex2.Message); } log.LogWarning(val5); return false; } } private static int CopyMembers(ManagedItemData source, ManagedItemData target) { int num = 0; Type typeFromHandle = typeof(ManagedItemData); PropertyInfo[] properties = typeFromHandle.GetProperties(BindingFlags.Instance | BindingFlags.Public); foreach (PropertyInfo propertyInfo in properties) { if (propertyInfo.CanRead && propertyInfo.CanWrite && propertyInfo.GetIndexParameters().Length == 0) { try { propertyInfo.SetValue(target, propertyInfo.GetValue(source)); num++; } catch { } } } FieldInfo[] fields = typeFromHandle.GetFields(BindingFlags.Instance | BindingFlags.Public); foreach (FieldInfo fieldInfo in fields) { try { fieldInfo.SetValue(target, fieldInfo.GetValue(source)); num++; } catch { } } return num; } private static void DumpRegistrySurface(ManagedDataRegistry registry) { //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Expected O, but got Unknown try { _ = OrdainUI.Core.Core.Log; Type type = ((object)registry).GetType(); Plugin.Verbose("--- ManagedDataRegistry surface (" + type.FullName + ") ---"); MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Public); foreach (MethodInfo methodInfo in methods) { if (!(methodInfo.DeclaringType == typeof(object))) { ParameterInfo[] parameters = methodInfo.GetParameters(); string[] array = new string[parameters.Length]; for (int j = 0; j < parameters.Length; j++) { array[j] = parameters[j].ParameterType.Name + " " + parameters[j].Name; } Plugin.Verbose($" method: {methodInfo.ReturnType.Name} {methodInfo.Name}({string.Join(", ", array)})" + (methodInfo.IsGenericMethodDefinition ? " " : "")); } } FieldInfo[] fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); foreach (FieldInfo fieldInfo in fields) { Plugin.Verbose(" field : " + fieldInfo.FieldType.Name + " " + fieldInfo.Name); } Plugin.Verbose("--- end registry surface ---"); Type typeFromHandle = typeof(ManagedItemData); Plugin.Verbose("--- ManagedItemData surface ---"); PropertyInfo[] properties = typeFromHandle.GetProperties(BindingFlags.Instance | BindingFlags.Public); foreach (PropertyInfo propertyInfo in properties) { Plugin.Verbose($" prop : {propertyInfo.PropertyType.Name} {propertyInfo.Name}{(propertyInfo.CanWrite ? "" : " (read-only)")}"); } fields = typeFromHandle.GetFields(BindingFlags.Instance | BindingFlags.Public); foreach (FieldInfo fieldInfo2 in fields) { Plugin.Verbose(" field : " + fieldInfo2.FieldType.Name + " " + fieldInfo2.Name); } Plugin.Verbose("--- end ManagedItemData surface ---"); } catch (Exception ex) { ManualLogSource log = OrdainUI.Core.Core.Log; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(44, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[OrdainUI:ForgeClient] surface dump failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogWarning(val); } } } [HarmonyPatch] internal static class InitializationPatches { private static bool _canvasSet; private static bool _behaviourCreated; [HarmonyPatch(typeof(GameDataManager), "OnUpdate")] [HarmonyPostfix] private static void GameDataManagerOnUpdatePostfix(GameDataManager __instance) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown if (!__instance.GameDataInitialized || !((ComponentSystemBase)__instance).World.IsCreated) { return; } try { if (!OrdainUI.Core.Core.Initialized) { OrdainUI.Core.Core.Initialize(__instance); if (OrdainUI.Core.Core.Initialized) { Plugin.Verbose("[OrdainUI] Core initialized via GameDataManager!"); } } } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(29, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[OrdainUI] Core init failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex); } logger.LogError(val); } ForgeClientRegistrar.TryApply(); } [HarmonyPatch(typeof(UICanvasSystem), "UpdateHideIfDisabled")] [HarmonyPostfix] private static void UICanvasSystemPostfix(UICanvasBase canvas) { if (!_canvasSet && OrdainUI.Core.Core.Initialized) { _canvasSet = true; OrdainUI.Core.Core.SetCanvas(canvas); if (!_behaviourCreated) { _behaviourCreated = true; CreateBehaviour(); } Plugin.Verbose("[OrdainUI] Canvas captured, UI ready!"); } } private static void CreateBehaviour() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown GameObject val = new GameObject("OrdainUI_Behaviour"); val.AddComponent(); Object.DontDestroyOnLoad((Object)val); SceneManager.MoveGameObjectToScene(val, SceneManager.GetSceneByName("VRisingWorld")); OrdainUIBehaviour.SetUIReady(ready: true); Plugin.Verbose("[OrdainUI] Behaviour created and attached."); } [HarmonyPatch(typeof(ClientBootstrapSystem), "OnDestroy")] [HarmonyPrefix] private static void ClientBootstrapOnDestroyPrefix() { OrdainUIBehaviour.SetUIReady(ready: false); _canvasSet = false; _behaviourCreated = false; ChatPatches.Reset(); ForgeClientRegistrar.Reset(); OrdainUI.Core.Core.Reset(); Plugin.Verbose("[OrdainUI] Cleaned up on world exit."); } } internal static class TooltipProbePatch { private static bool _done; public static void Probe() { //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Expected O, but got Unknown if (_done) { return; } _done = true; try { Assembly assembly = typeof(TooltipEntry).Assembly; Assembly assembly2 = typeof(UICanvasBase).Assembly; Type[] array = SafeTypes(assembly); Type[] item = SafeTypes(assembly2); string[] array2 = new string[3] { "TooltipSpellMods", "TooltipSpellModEntry", "TooltipItemStats" }; foreach (string target in array2) { Type type = array.FirstOrDefault((Type x) => x != null && x.Name == target); if (type != null) { DumpDeclared(type); } else { Plugin.Verbose("[OrdainUI:TooltipProbe4] (type '" + target + "' not found)"); } } Plugin.Verbose("[OrdainUI:TooltipProbe4] --- types that OWN tooltip sections ---"); (string, Type[])[] array3 = new(string, Type[])[2] { ("HUD", array), ("UI", item) }; for (int i = 0; i < array3.Length; i++) { (string, Type[]) tuple = array3[i]; Type[] item2 = tuple.Item2; foreach (Type type2 in item2) { if (type2 == null) { continue; } try { bool flag = false; FieldInfo[] fields = type2.GetFields(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public); foreach (FieldInfo fieldInfo in fields) { string name = fieldInfo.FieldType.Name; if (name.Contains("TooltipSpellMods") || name.Contains("TooltipItemStats") || name.Contains("TooltipItemUnlocks")) { Plugin.Verbose($"[OrdainUI:TooltipProbe4] [{tuple.Item1}] {type2.Name}.{fieldInfo.Name} : {name}"); flag = true; } } PropertyInfo[] properties = type2.GetProperties(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public); foreach (PropertyInfo propertyInfo in properties) { string name2 = propertyInfo.PropertyType.Name; if (name2.Contains("TooltipSpellMods") || name2.Contains("TooltipItemStats") || name2.Contains("TooltipItemUnlocks")) { Plugin.Verbose($"[OrdainUI:TooltipProbe4] [{tuple.Item1}] {type2.Name}.{propertyInfo.Name} : {name2} (prop)"); flag = true; } } if (flag) { Plugin.Verbose("[OrdainUI:TooltipProbe4] ^ CONTROLLER CANDIDATE: " + type2.FullName); } } catch { } } } Plugin.Verbose("[OrdainUI:TooltipProbe4] Done. Paste the lines above."); } catch (Exception ex) { ManualLogSource log = OrdainUI.Core.Core.Log; bool flag2 = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(33, 1, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[OrdainUI:TooltipProbe4] failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogWarning(val); } } private static Type[] SafeTypes(Assembly a) { try { return a.GetTypes(); } catch (ReflectionTypeLoadException ex) { return ex.Types.Where((Type t) => t != null).ToArray(); } } private static void DumpDeclared(Type t) { Plugin.Verbose($"[OrdainUI:TooltipProbe4] ===== {t.FullName} (base {t.BaseType?.Name}) ====="); try { MethodInfo[] methods = t.GetMethods(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public); foreach (MethodInfo methodInfo in methods) { string name = methodInfo.Name; if (!name.StartsWith("get_") && !name.StartsWith("set_")) { string value = string.Join(", ", from p in methodInfo.GetParameters() select p.ParameterType.Name + " " + p.Name); Plugin.Verbose($"[OrdainUI:TooltipProbe4] method: {methodInfo.ReturnType.Name} {name}({value})"); } } FieldInfo[] fields = t.GetFields(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public); foreach (FieldInfo fieldInfo in fields) { Plugin.Verbose("[OrdainUI:TooltipProbe4] field: " + fieldInfo.FieldType.Name + " " + fieldInfo.Name); } PropertyInfo[] properties = t.GetProperties(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public); foreach (PropertyInfo propertyInfo in properties) { Plugin.Verbose("[OrdainUI:TooltipProbe4] prop: " + propertyInfo.PropertyType.Name + " " + propertyInfo.Name); } } catch (Exception ex) { Plugin.Verbose("[OrdainUI:TooltipProbe4] (dump failed: " + ex.Message + ")"); } } } [HarmonyPatch] internal static class InputPatches { public static bool BlockCursorLock; [HarmonyPatch(typeof(InputActionSystem), "OnUpdate")] [HarmonyPrefix] private static bool OnUpdatePrefix() { if (!BlockCursorLock) { return true; } Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; return false; } } } namespace OrdainUI.Panels { internal class AchievementsPanel { private enum TabKind { All, Tier1, Tier2, Tier3, Tier4, Secret, Admin } private sealed class RowWidgets { public GameObject Root; public RectTransform Rect; public Image Bg; public TextMeshProUGUI Title; public TextMeshProUGUI Desc; public TextMeshProUGUI Meta; } private GameObject _root; private bool _visible; private readonly Action _onBack; private TextMeshProUGUI _txtSummary; private TextMeshProUGUI _txtEvent; private TextMeshProUGUI _txtEmpty; private RectTransform _viewportRect; private RectTransform _contentRect; private RectTransform _scrollTrackRect; private RectTransform _scrollThumbRect; private readonly List _rowPool = new List(); private readonly List _filtered = new List(); private readonly List _tabOrder = new List(); private readonly List _tabImages = new List(); private readonly List _tabLabels = new List(); private TabKind _activeTab; private float _scrollOffset; private float _contentHeight; private bool _draggingScroll; private int _lastHash = -1; private const float W = 700f; private const float H = 620f; private const float PAD = 14f; private const float LIST_Y = 136f; private const float LIST_H = 440f; private const float VIEW_X = 22f; private const float VIEW_Y = 144f; private const float VIEW_H = 424f; private const float VIEW_W = 642f; private const float TRACK_X = 674f; private const float TRACK_Y = 144f; private const float TRACK_W = 6f; private const float TRACK_H = 424f; private const float ROW_H = 72f; private const float ROW_GAP = 6f; private const float ROW_STEP = 78f; private static readonly Color TabActive = new Color(0.2f, 0.12f, 0.05f, 0.95f); private static readonly Color TabInactive = new Color(0.12f, 0.1f, 0.14f, 0.85f); public bool IsVisible => _visible; public AchievementsPanel(Action onBack = null) { _onBack = onBack; } public void Show() { if ((Object)(object)_root == (Object)null) { Create(); } _visible = true; _root.SetActive(true); _lastHash = -1; Refresh(); } public void Hide() { if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } _draggingScroll = false; _visible = false; } public void Refresh() { if (_visible && !((Object)(object)_root == (Object)null)) { int num = ComputeHash(); if (num != _lastHash) { _lastHash = num; RefreshSummary(); RebuildList(); } } } public void TickInput() { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) if (!_visible || (Object)(object)_root == (Object)null || (Object)(object)_viewportRect == (Object)null || (Object)(object)_scrollTrackRect == (Object)null) { return; } bool flag = IsPointerOver(_viewportRect); bool flag2 = IsPointerOver(_scrollTrackRect); bool flag3 = (Object)(object)_scrollThumbRect != (Object)null && ((Component)_scrollThumbRect).gameObject.activeSelf && IsPointerOver(_scrollThumbRect); float y = Input.mouseScrollDelta.y; if (Mathf.Abs(y) > 0.01f && (flag || flag2 || flag3)) { SetScrollOffset(_scrollOffset - y * 52f); } if (Input.GetMouseButtonDown(0) && (flag2 || flag3)) { _draggingScroll = true; UpdateScrollFromMouse(Input.mousePosition.y); } if (_draggingScroll) { if (Input.GetMouseButton(0)) { UpdateScrollFromMouse(Input.mousePosition.y); } else { _draggingScroll = false; } } } public void Dispose() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; _visible = false; _draggingScroll = false; } private void Create() { //IL_004f: 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) CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService != null) { _root = canvasService.CreateRootWindow("AchievementsPanel", 700f, 620f, 205); GameObject val = CanvasService.CreatePanel(_root.transform, "Header", 0f, 0f, 700f, 44f, CanvasService.BG_HEADER); CanvasService.CreateText(val.transform, "Title", "ACHIEVEMENTS", 16f, 12f, 640f, 24f, 16f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)4097); CanvasService.CreateCloseButton(_root.transform, 700f, delegate { Hide(); }); CanvasService.MakeDraggable(_root, val.transform); CanvasService.CreateDivider(_root.transform, "D0", 0f, 44f, 700f); BuildSummary(); BuildTabs(); BuildListView(); BuildBottomBar(); SetTabVisuals(); HUDPositionService.ApplySaved(_root, "AchievementsPanel"); _root.SetActive(false); } } private void BuildSummary() { //IL_0038: 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_00c5: Unknown result type (might be due to invalid IL or missing references) CanvasService.CreatePanel(_root.transform, "SummaryBg", 14f, 52f, 672f, 46f, (Color?)new Color(0.1f, 0.08f, 0.12f, 0.9f)); _txtSummary = CanvasService.CreateText(_root.transform, "Summary", "Unlocked 0/0 Points 0", 22f, 60f, 656f, 18f, 12f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); _txtEvent = CanvasService.CreateText(_root.transform, "EventStats", "Event Points 0 Wins 0 Participations 0", 22f, 78f, 656f, 16f, 10.5f, CanvasService.TEXT_DISABLED, (TextAlignmentOptions)257).GetComponent(); } private void BuildTabs() { //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) (TabKind, string)[] array = new(TabKind, string)[7] { (TabKind.All, "All"), (TabKind.Tier1, "Tier 1"), (TabKind.Tier2, "Tier 2"), (TabKind.Tier3, "Tier 3"), (TabKind.Tier4, "Tier 4"), (TabKind.Secret, "Secret"), (TabKind.Admin, "Admin") }; float num = 14f; for (int i = 0; i < array.Length; i++) { TabKind tab = array[i].Item1; string item = array[i].Item2; GameObject val = CanvasService.CreateButton(_root.transform, "Tab_" + item, item, num, 106f, 90f, 24f, delegate { SetTab(tab); }, 10.5f, TabInactive, CanvasService.TEXT_SECONDARY); _tabOrder.Add(tab); _tabImages.Add(val.GetComponent()); _tabLabels.Add(val.GetComponentInChildren()); num += 94f; } } private void BuildListView() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Expected O, but got Unknown //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: 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_0245: 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) CanvasService.CreatePanel(_root.transform, "ListBg", 14f, 136f, 672f, 440f, (Color?)new Color(0.07f, 0.07f, 0.1f, 0.9f)); GameObject val = new GameObject("AchievementViewport"); val.transform.SetParent(_root.transform, false); _viewportRect = val.AddComponent(); _viewportRect.anchorMin = new Vector2(0f, 1f); _viewportRect.anchorMax = new Vector2(0f, 1f); _viewportRect.pivot = new Vector2(0f, 1f); _viewportRect.anchoredPosition = new Vector2(22f, -144f); _viewportRect.sizeDelta = new Vector2(642f, 424f); ((Graphic)val.AddComponent()).color = new Color(0f, 0f, 0f, 0.01f); val.AddComponent(); GameObject val2 = new GameObject("AchievementContent"); val2.transform.SetParent(val.transform, false); _contentRect = val2.AddComponent(); _contentRect.anchorMin = new Vector2(0f, 1f); _contentRect.anchorMax = new Vector2(0f, 1f); _contentRect.pivot = new Vector2(0f, 1f); _contentRect.anchoredPosition = Vector2.zero; _contentRect.sizeDelta = new Vector2(638f, 0f); _txtEmpty = CanvasService.CreateText(val.transform, "EmptyText", "No achievements in this tab.", 0f, 6f, 636f, 24f, 12f, CanvasService.TEXT_DISABLED, (TextAlignmentOptions)514).GetComponent(); GameObject val3 = CanvasService.CreatePanel(_root.transform, "ScrollTrack", 674f, 144f, 6f, 424f, (Color?)new Color(0.2f, 0.13f, 0.13f, 0.9f)); _scrollTrackRect = val3.GetComponent(); GameObject val4 = CanvasService.CreatePanel(val3.transform, "ScrollThumb", 0f, 0f, 6f, 52f, (Color?)new Color(0.85f, 0.25f, 0.25f, 0.95f)); _scrollThumbRect = val4.GetComponent(); } private void BuildBottomBar() { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) CanvasService.CreateDivider(_root.transform, "DBottom", 0f, 580f, 700f); CanvasService.CreateButton(_root.transform, "BtnBack", "◀ Back", 14f, 586f, 96f, 24f, (Action)delegate { Hide(); _onBack?.Invoke(); }, 11f, (Color?)new Color(0.12f, 0.1f, 0.14f, 0.85f), (Color?)CanvasService.TEXT_SECONDARY, (Color?)null, applyNocturneFont: true); } private void SetTab(TabKind tab) { if (_activeTab != tab) { _activeTab = tab; _scrollOffset = 0f; SetTabVisuals(); RebuildList(); } } private void SetTabVisuals() { //IL_0057: 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_008b: 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) for (int i = 0; i < _tabImages.Count; i++) { bool flag = i < _tabOrder.Count && _tabOrder[i] == _activeTab; if ((Object)(object)_tabImages[i] != (Object)null) { ((Graphic)_tabImages[i]).color = (flag ? TabActive : TabInactive); } if ((Object)(object)_tabLabels[i] != (Object)null) { ((Graphic)_tabLabels[i]).color = (flag ? CanvasService.ACCENT_GOLD : CanvasService.TEXT_SECONDARY); } } } private void RefreshSummary() { if ((Object)(object)_txtSummary != (Object)null) { ((TMP_Text)_txtSummary).text = $"Unlocked {UIData.AchievementUnlockedCount}/{Math.Max(0, UIData.AchievementTotalCount)} Points {Math.Max(0, UIData.AchievementPoints)}"; } if ((Object)(object)_txtEvent != (Object)null) { ((TMP_Text)_txtEvent).text = $"Event Points {Math.Max(0, UIData.EventPoints)} Wins {Math.Max(0, UIData.EventWins)} Participations {Math.Max(0, UIData.EventParticipations)}"; } } private void RebuildList() { //IL_017f: Unknown result type (might be due to invalid IL or missing references) _filtered.Clear(); foreach (KeyValuePair achievement in UIData.Achievements) { UIData.AchievementEntry value = achievement.Value; if (value != null && MatchesActiveTab(value)) { _filtered.Add(value); } } _filtered.Sort(CompareEntries); EnsureRowPool(_filtered.Count); for (int i = 0; i < _filtered.Count; i++) { BindRow(_rowPool[i], _filtered[i], i); } for (int j = _filtered.Count; j < _rowPool.Count; j++) { if ((Object)(object)_rowPool[j].Root != (Object)null && _rowPool[j].Root.activeSelf) { _rowPool[j].Root.SetActive(false); } } _contentHeight = ((_filtered.Count <= 0) ? 0f : ((float)_filtered.Count * 78f)); if ((Object)(object)_contentRect != (Object)null) { _contentRect.sizeDelta = new Vector2(638f, _contentHeight); } if ((Object)(object)_txtEmpty != (Object)null) { bool flag = _filtered.Count > 0; ((Component)_txtEmpty).gameObject.SetActive(!flag); if (!flag) { ((TMP_Text)_txtEmpty).text = EmptyTextForTab(); } } SetScrollOffset(_scrollOffset); } private static int CompareEntries(UIData.AchievementEntry a, UIData.AchievementEntry b) { int num = b.Unlocked.CompareTo(a.Unlocked); if (num != 0) { return num; } num = a.Tier.CompareTo(b.Tier); if (num != 0) { return num; } num = string.Compare(a.Title, b.Title, StringComparison.OrdinalIgnoreCase); if (num != 0) { return num; } return string.Compare(a.Id, b.Id, StringComparison.OrdinalIgnoreCase); } private bool MatchesActiveTab(UIData.AchievementEntry entry) { if (entry == null) { return false; } return _activeTab switch { TabKind.All => true, TabKind.Tier1 => !entry.AdminOnly && entry.Tier == 1, TabKind.Tier2 => !entry.AdminOnly && entry.Tier == 2, TabKind.Tier3 => !entry.AdminOnly && entry.Tier == 3, TabKind.Tier4 => !entry.AdminOnly && entry.Tier == 4, TabKind.Secret => entry.Secret, TabKind.Admin => entry.AdminOnly, _ => true, }; } private string EmptyTextForTab() { return _activeTab switch { TabKind.Tier1 => "No tier 1 achievements available.", TabKind.Tier2 => "No tier 2 achievements available.", TabKind.Tier3 => "No tier 3 achievements available.", TabKind.Tier4 => "No tier 4 achievements available.", TabKind.Secret => "No secret achievements discovered yet.", TabKind.Admin => "No admin achievements available.", _ => "No achievements available.", }; } private void EnsureRowPool(int count) { while (_rowPool.Count < count) { _rowPool.Add(BuildRow(_rowPool.Count)); } } private RowWidgets BuildRow(int index) { //IL_0058: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) GameObject val = CanvasService.CreatePanel(((Component)_contentRect).transform, $"AchievementRow_{index}", 0f, 0f, 636f, 72f, (Color?)new Color(0.08f, 0.07f, 0.1f, 0.8f)); RectTransform component = val.GetComponent(); Image component2 = val.GetComponent(); TextMeshProUGUI component3 = CanvasService.CreateText(val.transform, $"Title_{index}", "", 8f, 6f, 616f, 20f, 12f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); TextMeshProUGUI component4 = CanvasService.CreateText(val.transform, $"Desc_{index}", "", 8f, 26f, 616f, 30f, 10.5f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257).GetComponent(); TextMeshProUGUI component5 = CanvasService.CreateText(val.transform, $"Meta_{index}", "", 8f, 56f, 616f, 14f, 10f, CanvasService.TEXT_DISABLED, (TextAlignmentOptions)257).GetComponent(); val.SetActive(false); return new RowWidgets { Root = val, Rect = component, Bg = component2, Title = component3, Desc = component4, Meta = component5 }; } private static void BindRow(RowWidgets row, UIData.AchievementEntry entry, int index) { //IL_007e: 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_0048: Unknown result type (might be due to invalid IL or missing references) if (row != null && !((Object)(object)row.Root == (Object)null) && entry != null) { row.Root.SetActive(true); ((Graphic)row.Bg).color = (entry.Unlocked ? new Color(0.08f, 0.14f, 0.1f, 0.9f) : ((index % 2 == 0) ? new Color(0.08f, 0.07f, 0.1f, 0.8f) : new Color(0.07f, 0.06f, 0.09f, 0.76f))); string text = (string.IsNullOrWhiteSpace(entry.Title) ? (entry.Id ?? "Achievement") : entry.Title); string text2 = (string.IsNullOrWhiteSpace(entry.Description) ? "No description." : entry.Description); string value = (string.IsNullOrWhiteSpace(entry.Category) ? "General" : entry.Category); int num = Math.Max(1, entry.Required); long num2 = entry.Progress; if (num2 < 0) { num2 = 0L; } if (num2 > num) { num2 = num; } string value2 = (entry.Unlocked ? "Unlocked" : $"Progress {num2}/{num}"); string text3 = (entry.AdminOnly ? "ADMIN" : (entry.Secret ? "SECRET" : $"T{Math.Clamp(entry.Tier, 1, 5)}")); if ((Object)(object)row.Title != (Object)null) { ((TMP_Text)row.Title).text = "[" + text3 + "] " + text; } if ((Object)(object)row.Desc != (Object)null) { ((TMP_Text)row.Desc).text = text2; } if ((Object)(object)row.Meta != (Object)null) { ((TMP_Text)row.Meta).text = $"{value2} +{Math.Max(0, entry.Points)} pts {value}"; } } } private void SetScrollOffset(float offset) { _scrollOffset = Mathf.Clamp(offset, 0f, GetMaxScroll()); UpdateRowPositions(); UpdateScrollbarVisual(); } private float GetMaxScroll() { return Mathf.Max(0f, _contentHeight - 424f); } private void UpdateRowPositions() { //IL_008d: Unknown result type (might be due to invalid IL or missing references) if (_rowPool.Count == 0) { return; } for (int i = 0; i < _filtered.Count && i < _rowPool.Count; i++) { RowWidgets rowWidgets = _rowPool[i]; if (!((Object)(object)rowWidgets?.Rect == (Object)null)) { float num = (float)i * 78f - _scrollOffset; bool flag = num + 72f >= 0f && num <= 424f; if (rowWidgets.Root.activeSelf != flag) { rowWidgets.Root.SetActive(flag); } if (flag) { rowWidgets.Rect.anchoredPosition = new Vector2(0f, 0f - num); } } } } private void UpdateScrollbarVisual() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_scrollThumbRect == (Object)null) && !((Object)(object)_scrollTrackRect == (Object)null)) { float maxScroll = GetMaxScroll(); Rect rect = _scrollTrackRect.rect; float height = ((Rect)(ref rect)).height; float thumbHeight = GetThumbHeight(height); _scrollThumbRect.sizeDelta = new Vector2(_scrollThumbRect.sizeDelta.x, thumbHeight); if (maxScroll <= 0.01f) { ((Component)_scrollThumbRect).gameObject.SetActive(false); return; } ((Component)_scrollThumbRect).gameObject.SetActive(true); float num = Mathf.Max(0f, height - thumbHeight); float num2 = _scrollOffset / maxScroll; _scrollThumbRect.anchoredPosition = new Vector2(0f, 0f - num * num2); } } private float GetThumbHeight(float trackHeight) { if (_contentHeight <= 0.01f) { return trackHeight; } float num = 424f / Mathf.Max(424f, _contentHeight); return Mathf.Clamp(trackHeight * num, 24f, trackHeight); } private void UpdateScrollFromMouse(float mouseY) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) float maxScroll = GetMaxScroll(); if (maxScroll <= 0.01f) { SetScrollOffset(0f); return; } Vector3[] array = (Vector3[])(object)new Vector3[4]; _scrollTrackRect.GetWorldCorners(Il2CppStructArray.op_Implicit(array)); float y = array[1].y; float y2 = array[0].y; Canvas component = _root.GetComponent(); float num = ((component != null) ? component.scaleFactor : 1f); Rect rect = _scrollTrackRect.rect; float num2 = GetThumbHeight(((Rect)(ref rect)).height) * num * 0.5f; float num3 = Mathf.Clamp(mouseY, y2 + num2, y - num2); float num4 = Mathf.InverseLerp(y - num2, y2 + num2, num3); SetScrollOffset(num4 * maxScroll); } private static bool IsPointerOver(RectTransform rect) { //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) if ((Object)(object)rect != (Object)null) { return RectTransformUtility.RectangleContainsScreenPoint(rect, Vector2.op_Implicit(Input.mousePosition), (Camera)null); } return false; } private int ComputeHash() { int num = 17; num = num * 31 + UIData.AchievementCatalogCount; num = num * 31 + UIData.AchievementCatalogHash; num = num * 31 + UIData.AchievementPoints; num = num * 31 + UIData.AchievementUnlockedCount; num = num * 31 + UIData.AchievementTotalCount; num = num * 31 + UIData.EventPoints; num = num * 31 + UIData.EventWins; num = num * 31 + UIData.EventParticipations; List list = new List(UIData.Achievements.Keys); list.Sort(StringComparer.OrdinalIgnoreCase); num = num * 31 + list.Count; for (int i = 0; i < list.Count; i++) { string text = list[i]; num = num * 31 + (text?.GetHashCode() ?? 0); if (!UIData.Achievements.TryGetValue(text, out var value) || value == null) { num *= 31; continue; } num = num * 31 + (value.Title?.GetHashCode() ?? 0); num = num * 31 + (value.Description?.GetHashCode() ?? 0); num = num * 31 + (value.Category?.GetHashCode() ?? 0); num = num * 31 + value.Tier; num = num * 31 + value.Secret.GetHashCode(); num = num * 31 + value.AdminOnly.GetHashCode(); num = num * 31 + value.Required; num = num * 31 + value.Points; num = num * 31 + value.Progress.GetHashCode(); num = num * 31 + value.Unlocked.GetHashCode(); } return num; } } internal class CharacterPanel { private GameObject _root; private bool _visible; private readonly Action _onBack; private TextMeshProUGUI _txtLevel; private TextMeshProUGUI _txtClass; private TextMeshProUGUI _txtGearScore; private TextMeshProUGUI _txtAP; private TextMeshProUGUI _txtXP; private Image _xpFill; public bool IsVisible => _visible; public CharacterPanel(Action onBack = null) { _onBack = onBack; } public void Toggle() { if ((Object)(object)_root == (Object)null) { Create(); } _visible = !_visible; _root.SetActive(_visible); } public void Show() { if ((Object)(object)_root == (Object)null) { Create(); } _visible = true; _root.SetActive(true); } public void Hide() { if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } _visible = false; } public void Refresh() { //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) if (_visible && !((Object)(object)_root == (Object)null)) { ((TMP_Text)_txtLevel).text = (UIData.IsParagon ? $"Paragon {UIData.ParagonLevel}" : $"Level {UIData.Level}"); ((TMP_Text)_txtClass).text = ((UIData.ClassName == "None" || string.IsNullOrEmpty(UIData.ClassName)) ? "No Class" : (UIData.ClassName + " — " + UIData.ClassTitle)); ((Graphic)_txtClass).color = CanvasService.GetClassColor(UIData.ClassName); ((TMP_Text)_txtGearScore).text = $"Gear Score: {UIData.GearScore}"; ((TMP_Text)_txtAP).text = ((UIData.UnspentAP > 0) ? $"Unspent AP: {UIData.UnspentAP}" : "Unspent AP: 0"); float num = ((UIData.ExperienceNeeded > 0f) ? (UIData.Experience / UIData.ExperienceNeeded) : 0f); num = Mathf.Clamp01(num); ((TMP_Text)_txtXP).text = $"XP: {UIData.Experience:F0} / {UIData.ExperienceNeeded:F0}"; if ((Object)(object)_xpFill != (Object)null) { ((Component)_xpFill).GetComponent().anchorMax = new Vector2(num, 1f); } } } public void Dispose() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; _visible = false; } private void Create() { //IL_004f: 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_0134: 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_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Expected O, but got Unknown //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_03b9: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService != null) { _root = canvasService.CreateRootWindow("CharacterPanel", 340f, 300f, 201); GameObject val = CanvasService.CreatePanel(_root.transform, "Header", 0f, 0f, 340f, 44f, CanvasService.BG_HEADER); CanvasService.CreateText(val.transform, "Title", "CHARACTER", 16f, 12f, 280f, 24f, 16f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)4097); CanvasService.CreateCloseButton(_root.transform, 340f, delegate { Hide(); }); CanvasService.MakeDraggable(_root, val.transform); CanvasService.CreateDivider(_root.transform, "D1", 0f, 44f, 340f); _txtLevel = CanvasService.CreateText(_root.transform, "Level", "Level 0", 20f, 58f, 300f, 26f, 18f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); _txtClass = CanvasService.CreateText(_root.transform, "Class", "No Class", 20f, 88f, 300f, 20f, 13f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257).GetComponent(); CanvasService.CreateDivider(_root.transform, "D2", 20f, 116f, 300f); _txtGearScore = CanvasService.CreateText(_root.transform, "GS", "Gear Score: 0", 20f, 126f, 300f, 20f, 13f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); _txtAP = CanvasService.CreateText(_root.transform, "AP", "Unspent AP: 0", 20f, 150f, 300f, 20f, 13f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); CanvasService.CreateDivider(_root.transform, "D3", 20f, 178f, 300f); _txtXP = CanvasService.CreateText(_root.transform, "XPLabel", "XP: 0 / 100", 20f, 188f, 300f, 18f, 12f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257).GetComponent(); GameObject val2 = CanvasService.CreatePanel(_root.transform, "XPBarBg", 20f, 210f, 300f, 14f, (Color?)new Color(0.1f, 0.1f, 0.1f, 0.9f)); GameObject val3 = new GameObject("XPFill"); val3.transform.SetParent(val2.transform, false); RectTransform obj = val3.AddComponent(); obj.anchorMin = Vector2.zero; obj.anchorMax = new Vector2(0f, 1f); obj.offsetMin = Vector2.zero; obj.offsetMax = Vector2.zero; _xpFill = val3.AddComponent(); ((Graphic)_xpFill).color = new Color(0.2f, 0.6f, 1f, 1f); CanvasService.CreateButton(_root.transform, "Back", "◀ Back", 20f, 262f, 80f, 26f, (Action)delegate { Hide(); _onBack?.Invoke(); }, 11f, (Color?)new Color(0.12f, 0.1f, 0.14f, 0.85f), (Color?)CanvasService.TEXT_SECONDARY, (Color?)null, applyNocturneFont: true); _root.SetActive(false); } } } internal class ClassPanel { private GameObject _root; private bool _visible; private readonly Action _onBack; private TextMeshProUGUI _txtName; private TextMeshProUGUI _txtTitle; private TextMeshProUGUI _txtPassive; private TextMeshProUGUI _txtAscendance; private TextMeshProUGUI _txtStackCount; private TextMeshProUGUI _txtAscStatus; private Image _stackFill; public bool IsVisible => _visible; public ClassPanel(Action onBack = null) { _onBack = onBack; } public void Toggle() { if ((Object)(object)_root == (Object)null) { Create(); } _visible = !_visible; _root.SetActive(_visible); } public void Show() { if ((Object)(object)_root == (Object)null) { Create(); } _visible = true; _root.SetActive(true); } public void Hide() { if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } _visible = false; } public void Refresh() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) if (_visible && !((Object)(object)_root == (Object)null)) { Color classColor = CanvasService.GetClassColor(UIData.ClassName); ((TMP_Text)_txtName).text = ((UIData.ClassName == "None" || string.IsNullOrEmpty(UIData.ClassName)) ? "NO CLASS" : UIData.ClassName.ToUpper()); ((Graphic)_txtName).color = classColor; ((TMP_Text)_txtTitle).text = UIData.ClassTitle; ((TMP_Text)_txtPassive).text = (string.IsNullOrEmpty(UIData.ClassPassive) ? "Passive: —" : ("Passive: " + UIData.ClassPassive)); ((TMP_Text)_txtAscendance).text = (string.IsNullOrEmpty(UIData.ClassAscendance) ? "Ascendance: —" : ("Ascendance: " + UIData.ClassAscendance)); int stacks = UIData.Stacks; int num = ((UIData.MaxStacks > 0) ? UIData.MaxStacks : 100); ((TMP_Text)_txtStackCount).text = $"Stacks: {stacks} / {num}"; ((Graphic)_txtStackCount).color = classColor; float num2 = Mathf.Clamp01((float)stacks / (float)num); if ((Object)(object)_stackFill != (Object)null) { ((Graphic)_stackFill).color = classColor; ((Component)_stackFill).GetComponent().anchorMax = new Vector2(num2, 1f); } if (UIData.AscendanceLocked) { ((TMP_Text)_txtAscStatus).text = "Ascendance: Locked (need Lv 50)"; } else if (UIData.AscendanceActive) { ((TMP_Text)_txtAscStatus).text = "ASCENDANCE ACTIVE"; } else if (UIData.AscendanceCooldown > 0) { ((TMP_Text)_txtAscStatus).text = $"Ascendance CD: {UIData.AscendanceCooldown}s"; } else { ((TMP_Text)_txtAscStatus).text = "Ascendance: Ready"; } ((Graphic)_txtAscStatus).color = (UIData.AscendanceActive ? CanvasService.ACCENT_GOLD : CanvasService.TEXT_SECONDARY); } } public void Dispose() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; _visible = false; } private void Create() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Expected O, but got Unknown //IL_0404: 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_0424: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_0483: Unknown result type (might be due to invalid IL or missing references) //IL_04f0: Unknown result type (might be due to invalid IL or missing references) //IL_04fa: Unknown result type (might be due to invalid IL or missing references) CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService != null) { _root = canvasService.CreateRootWindow("ClassPanel", 360f, 360f, 202); GameObject val = CanvasService.CreatePanel(_root.transform, "Header", 0f, 0f, 360f, 44f, CanvasService.BG_HEADER); CanvasService.CreateText(_root.transform, "Title", "CLASS", 16f, 12f, 300f, 24f, 16f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)4097); CanvasService.CreateCloseButton(_root.transform, 360f, delegate { Hide(); }); CanvasService.MakeDraggable(_root, val.transform); CanvasService.CreateDivider(_root.transform, "D1", 0f, 44f, 360f); _txtName = CanvasService.CreateText(_root.transform, "ClassName", "NO CLASS", 20f, 58f, 320f, 28f, 20f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); _txtTitle = CanvasService.CreateText(_root.transform, "ClassTitle", "", 20f, 90f, 320f, 20f, 13f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257).GetComponent(); CanvasService.CreateDivider(_root.transform, "D2", 20f, 118f, 320f); CanvasService.CreateText(_root.transform, "PassiveLabel", "PASSIVE", 20f, 128f, 320f, 16f, 10f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257); _txtPassive = CanvasService.CreateText(_root.transform, "Passive", "Passive: —", 20f, 146f, 320f, 34f, 12f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); ((TMP_Text)_txtPassive).enableWordWrapping = true; CanvasService.CreateText(_root.transform, "AscLabel", "ASCENDANCE ABILITY", 20f, 186f, 320f, 16f, 10f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257); _txtAscendance = CanvasService.CreateText(_root.transform, "Asc", "Ascendance: —", 20f, 204f, 320f, 34f, 12f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); ((TMP_Text)_txtAscendance).enableWordWrapping = true; CanvasService.CreateDivider(_root.transform, "D3", 20f, 246f, 320f); _txtStackCount = CanvasService.CreateText(_root.transform, "Stacks", "Stacks: 0 / 100", 20f, 256f, 320f, 20f, 13f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); GameObject val2 = CanvasService.CreatePanel(_root.transform, "StackBarBg", 20f, 280f, 320f, 14f, (Color?)new Color(0.1f, 0.1f, 0.1f, 0.9f)); GameObject val3 = new GameObject("StackFill"); val3.transform.SetParent(val2.transform, false); RectTransform obj = val3.AddComponent(); obj.anchorMin = Vector2.zero; obj.anchorMax = new Vector2(0f, 1f); obj.offsetMin = Vector2.zero; obj.offsetMax = Vector2.zero; _stackFill = val3.AddComponent(); ((Graphic)_stackFill).color = CanvasService.TEXT_PRIMARY; _txtAscStatus = CanvasService.CreateText(_root.transform, "AscStatus", "Ascendance: Ready", 20f, 302f, 320f, 20f, 12f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257).GetComponent(); CanvasService.CreateButton(_root.transform, "Back", "◀ Back", 20f, 322f, 80f, 26f, (Action)delegate { Hide(); _onBack?.Invoke(); }, 11f, (Color?)new Color(0.12f, 0.1f, 0.14f, 0.85f), (Color?)CanvasService.TEXT_SECONDARY, (Color?)null, applyNocturneFont: true); _root.SetActive(false); } } } internal class EventHUD { private GameObject _root; private bool _created; private TextMeshProUGUI _txtEventName; private TextMeshProUGUI _txtPhase; private TextMeshProUGUI _txtCounts; private TextMeshProUGUI _txtStatus; public void Refresh() { //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) bool flag = UIData.InEvent && UIData.EventState != "IDLE" && !string.IsNullOrEmpty(UIData.EventName) && UIConfig.ShowEventHUD; if (flag && !_created) { Create(); } if (!_created) { return; } _root.SetActive(flag); if (flag) { ((TMP_Text)_txtEventName).text = UIData.EventName.ToUpper(); if (!string.IsNullOrEmpty(UIData.EventPhase)) { string value = UIData.EventPhase.ToUpper() switch { "GREEN" => "#00FF88", "RED" => "#FF3333", "GRACE" => "#FFD700", _ => "#FFFFFF", }; string value2 = ((UIData.EventPhaseTimer > 0f) ? $" ({UIData.EventPhaseTimer:F0}s)" : ""); ((TMP_Text)_txtPhase).text = $"{UIData.EventPhase.ToUpper()}{value2}"; } else { ((TMP_Text)_txtPhase).text = UIData.EventState; } ((TMP_Text)_txtCounts).text = $"Active: {UIData.EventActivePlayers} Eliminated: {UIData.EventEliminatedPlayers}"; string eventPlayerStatus = UIData.EventPlayerStatus; TextMeshProUGUI txtStatus = _txtStatus; Color color = (Color)((eventPlayerStatus == "Eliminated") ? new Color(1f, 0.3f, 0.3f) : ((!(eventPlayerStatus == "Active")) ? CanvasService.TEXT_SECONDARY : new Color(0.3f, 1f, 0.4f))); ((Graphic)txtStatus).color = color; ((TMP_Text)_txtStatus).text = "You: " + eventPlayerStatus; } } public void Destroy() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _created = false; } private void Create() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService != null) { _root = canvasService.CreateRootWindow("HUD_Event", 280f, 110f, 60); RectTransform component = _root.GetComponent(); component.anchorMin = new Vector2(0.5f, 1f); component.anchorMax = new Vector2(0.5f, 1f); component.pivot = new Vector2(0.5f, 1f); component.anchoredPosition = new Vector2(0f, -30f); Image component2 = _root.GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Graphic)component2).color = new Color(0.06f, 0.04f, 0.08f, 0.92f); } CanvasService.CreateDivider(_root.transform, "TopBorder", 0f, 0f, 280f, 2f, CanvasService.ACCENT_RED); _txtEventName = CanvasService.CreateText(_root.transform, "EventName", "", 0f, 8f, 280f, 24f, 16f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)514).GetComponent(); _txtPhase = CanvasService.CreateText(_root.transform, "Phase", "", 0f, 36f, 280f, 22f, 15f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)514).GetComponent(); CanvasService.CreateDivider(_root.transform, "MidDiv", 20f, 64f, 240f); _txtCounts = CanvasService.CreateText(_root.transform, "Counts", "", 0f, 70f, 280f, 16f, 11f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)514).GetComponent(); _txtStatus = CanvasService.CreateText(_root.transform, "Status", "", 0f, 88f, 280f, 16f, 12f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)514).GetComponent(); CanvasService.CreateDivider(_root.transform, "BotBorder", 0f, 108f, 280f, 2f, CanvasService.ACCENT_RED); _root.SetActive(false); _created = true; } } } internal class EventPhaseBannerHUD { private const float DisplaySeconds = 1.6f; private GameObject _root; private TextMeshProUGUI _txt; private Image _bg; private Image _topBorder; private Image _bottomBorder; private bool _created; private string _lastPhase = ""; private float _visibleUntil = -1f; public void Refresh() { bool flag = UIConfig.ShowEventHUD && UIData.InEvent && string.Equals(UIData.EventState, "ACTIVE", StringComparison.OrdinalIgnoreCase) && IsRlglEvent(UIData.EventName); if (flag && !_created) { Create(); } if (!_created) { return; } if (!flag) { _lastPhase = ""; _visibleUntil = -1f; _root.SetActive(false); return; } string text = NormalizePhase(UIData.EventPhase); if (!string.IsNullOrEmpty(text) && !string.Equals(text, _lastPhase, StringComparison.OrdinalIgnoreCase)) { _lastPhase = text; _visibleUntil = Time.unscaledTime + 1.6f; ApplyPhaseVisuals(text); _root.SetActive(true); } if (_visibleUntil <= 0f || Time.unscaledTime > _visibleUntil) { _root.SetActive(false); return; } float alpha = 1f; float num = 0.25f; float num2 = _visibleUntil - Time.unscaledTime; if (num2 < num) { alpha = Mathf.Clamp01(num2 / num); } SetAlpha(alpha); } public void Destroy() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; _txt = null; _bg = null; _topBorder = null; _bottomBorder = null; _created = false; _lastPhase = ""; _visibleUntil = -1f; } private void Create() { //IL_0041: 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_006b: 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_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0177: 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) CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService != null) { _root = canvasService.CreateRootWindow("HUD_EventPhaseBanner", 780f, 118f, 295); RectTransform component = _root.GetComponent(); component.anchorMin = new Vector2(0.5f, 1f); component.anchorMax = new Vector2(0.5f, 1f); component.pivot = new Vector2(0.5f, 1f); component.anchoredPosition = new Vector2(0f, -215f); _bg = _root.GetComponent(); if ((Object)(object)_bg != (Object)null) { ((Graphic)_bg).color = new Color(0.05f, 0.04f, 0.06f, 0.86f); } _topBorder = CanvasService.CreateDivider(_root.transform, "PhaseTop", 0f, 0f, 780f, 2f, CanvasService.ACCENT_RED).GetComponent(); _bottomBorder = CanvasService.CreateDivider(_root.transform, "PhaseBottom", 0f, 116f, 780f, 2f, CanvasService.ACCENT_RED).GetComponent(); _txt = CanvasService.CreateText(_root.transform, "PhaseBannerText", "", 0f, 0f, 780f, 118f, 60f, CanvasService.ACCENT_RED, (TextAlignmentOptions)514).GetComponent(); ((TMP_Text)_txt).fontStyle = (FontStyles)1; ((TMP_Text)_txt).enableWordWrapping = false; ((TMP_Text)_txt).overflowMode = (TextOverflowModes)0; _root.SetActive(false); _created = true; } } private void ApplyPhaseVisuals(string phase) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_txt == (Object)null) { return; } if (string.Equals(phase, "GREEN", StringComparison.OrdinalIgnoreCase)) { Color color = default(Color); ((Color)(ref color))..ctor(0.2f, 1f, 0.36f, 1f); ((TMP_Text)_txt).text = "GREEN LIGHT"; ((Graphic)_txt).color = color; if ((Object)(object)_topBorder != (Object)null) { ((Graphic)_topBorder).color = color; } if ((Object)(object)_bottomBorder != (Object)null) { ((Graphic)_bottomBorder).color = color; } } else if (string.Equals(phase, "RED", StringComparison.OrdinalIgnoreCase)) { Color color2 = default(Color); ((Color)(ref color2))..ctor(1f, 0.24f, 0.24f, 1f); ((TMP_Text)_txt).text = "RED LIGHT"; ((Graphic)_txt).color = color2; if ((Object)(object)_topBorder != (Object)null) { ((Graphic)_topBorder).color = color2; } if ((Object)(object)_bottomBorder != (Object)null) { ((Graphic)_bottomBorder).color = color2; } } else { ((TMP_Text)_txt).text = ""; } SetAlpha(1f); } private void SetAlpha(float alpha) { //IL_002e: 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_0048: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_txt != (Object)null) { ((TMP_Text)_txt).alpha = alpha; } if ((Object)(object)_bg != (Object)null) { Color color = ((Graphic)_bg).color; color.a = 0.86f * alpha; ((Graphic)_bg).color = color; } if ((Object)(object)_topBorder != (Object)null) { Color color2 = ((Graphic)_topBorder).color; color2.a = alpha; ((Graphic)_topBorder).color = color2; } if ((Object)(object)_bottomBorder != (Object)null) { Color color3 = ((Graphic)_bottomBorder).color; color3.a = alpha; ((Graphic)_bottomBorder).color = color3; } } private static bool IsRlglEvent(string eventName) { if (!string.IsNullOrWhiteSpace(eventName)) { return eventName.IndexOf("Red Light Green Light", StringComparison.OrdinalIgnoreCase) >= 0; } return false; } private static string NormalizePhase(string phase) { if (string.IsNullOrWhiteSpace(phase)) { return ""; } string text = phase.Trim().ToUpperInvariant(); if (text.StartsWith("GREEN", StringComparison.Ordinal)) { return "GREEN"; } if (text.StartsWith("RED", StringComparison.Ordinal)) { return "RED"; } return ""; } } internal class FamiliarPanel { private GameObject _root; private bool _visible; private readonly Action _onBack; private TextMeshProUGUI _txtName; private TextMeshProUGUI _txtLevel; private TextMeshProUGUI _txtBond; private TextMeshProUGUI _txtMode; private TextMeshProUGUI _txtAP; private TextMeshProUGUI _txtEverstone; private TextMeshProUGUI _txtHP; private TextMeshProUGUI _txtXP; private Image _hpFill; private Image _xpFill; private TextMeshProUGUI _txtHPAlloc; private TextMeshProUGUI _txtPhysAlloc; private TextMeshProUGUI _txtSpellAlloc; private TextMeshProUGUI _txtBoxName; private GameObject _boxListContainer; private List _boxButtons = new List(); private List _recentBoxes = new List(); private GameObject _allBoxesPanel; private GameObject _famListContent; private List _famRows = new List(); private GameObject _movePanel; private int _lastKnownIndex = -1; private int _lastFamListHash = -1; private int _lastBoxHash = -1; private GameObject _newBoxPanel; private GameObject _newBoxInputGo; private TextMeshProUGUI _newBoxInputText; private TextMeshProUGUI _newBoxPlaceholder; private string _newBoxDraft = ""; private bool _newBoxFocused; private const float W = 460f; private const float H = 780f; private const float FAM_Y = 410f; private const float FAM_H = 310f; private const float BACK_Y = 744f; private const int NEW_BOX_MAX = 32; public bool IsVisible => _visible; public FamiliarPanel(Action onBack = null) { _onBack = onBack; CommandSender.OnFamiliarListChanged = (Action)Delegate.Combine(CommandSender.OnFamiliarListChanged, (Action)delegate { _lastFamListHash = -1; }); } public void Show() { if ((Object)(object)_root == (Object)null) { Create(); } _visible = true; _root.SetActive(true); } public void Hide() { HideNewBoxPanel(); CloseAllBoxesPanel(); if ((Object)(object)_movePanel != (Object)null) { Object.Destroy((Object)(object)_movePanel); _movePanel = null; } if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } _visible = false; try { EventSystem current = EventSystem.current; if ((Object)(object)current != (Object)null) { current.SetSelectedGameObject((GameObject)null); } } catch { } } public void Refresh() { if (!_visible || (Object)(object)_root == (Object)null) { return; } RefreshActiveFamiliar(); int num = ((UIData.ActiveBoxName ?? "").GetHashCode() * 397) ^ UIData.Boxes.Count; foreach (UIData.BoxInfo box in UIData.Boxes) { num = (num * 397) ^ box.Name.GetHashCode() ^ box.Count; } foreach (string recentBox in _recentBoxes) { num = (num * 397) ^ recentBox.GetHashCode(); } if (num != _lastBoxHash) { _lastBoxHash = num; RefreshBoxes(); } int num2 = UIData.FamiliarList.Count; foreach (UIData.FamiliarListEntry familiar in UIData.FamiliarList) { num2 = (num2 * 397) ^ familiar.Index; num2 = (num2 * 397) ^ (familiar.Name?.GetHashCode() ?? 0); num2 = (num2 * 397) ^ (familiar.Rarity?.GetHashCode() ?? 0); num2 = (num2 * 397) ^ familiar.Level; num2 = (num2 * 397) ^ (familiar.IsShiny ? 1 : 0); num2 = (num2 * 397) ^ (familiar.IsActive ? 1 : 0); } if (num2 != _lastFamListHash) { _lastFamListHash = num2; RefreshFamiliarList(); } } public void TickInput() { if (!_visible || (Object)(object)_root == (Object)null || (Object)(object)_newBoxPanel == (Object)null || !_newBoxPanel.activeSelf) { return; } if (Input.GetMouseButtonDown(0)) { GameObject newBoxInputGo = _newBoxInputGo; _newBoxFocused = IsPointerOver((newBoxInputGo != null) ? newBoxInputGo.GetComponent() : null); } bool flag = false; string inputString = Input.inputString; if (!string.IsNullOrEmpty(inputString) && _newBoxFocused) { for (int i = 0; i < inputString.Length; i++) { char c = inputString[i]; switch (c) { case '\b': if (_newBoxDraft.Length > 0) { _newBoxDraft = _newBoxDraft.Substring(0, _newBoxDraft.Length - 1); flag = true; } break; case '\n': case '\r': ConfirmCreateBox(); return; default: if (!char.IsControl(c) && _newBoxDraft.Length < 32) { _newBoxDraft += c; flag = true; } break; } } } if (_newBoxFocused && Input.GetKeyDown((KeyCode)13)) { ConfirmCreateBox(); return; } if (_newBoxFocused && Input.GetKeyDown((KeyCode)271)) { ConfirmCreateBox(); return; } if (Input.GetKeyDown((KeyCode)27)) { HideNewBoxPanel(); return; } if (_newBoxFocused && Input.GetKeyDown((KeyCode)8) && _newBoxDraft.Length > 0) { _newBoxDraft = _newBoxDraft.Substring(0, _newBoxDraft.Length - 1); flag = true; } if (flag) { UpdateNewBoxInputVisual(); } } public void Dispose() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; _visible = false; } private void Create() { //IL_004f: 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) CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService != null) { _root = canvasService.CreateRootWindow("FamiliarPanel", 460f, 780f, 203); GameObject val = CanvasService.CreatePanel(_root.transform, "Header", 0f, 0f, 460f, 44f, CanvasService.BG_HEADER); CanvasService.CreateText(val.transform, "Title", "FAMILIARS", 16f, 12f, 400f, 24f, 16f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)4097); CanvasService.CreateCloseButton(_root.transform, 460f, delegate { Hide(); }); CanvasService.MakeDraggable(_root, val.transform); CanvasService.CreateDivider(_root.transform, "D0", 0f, 44f, 460f); BuildActiveFamiliarSection(); BuildBoxSection(); BuildFamiliarListSection(); BuildBottomBar(); _root.SetActive(false); } } private void BuildActiveFamiliarSection() { //IL_0031: 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) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0181: 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_021d: 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_027c: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Unknown result type (might be due to invalid IL or missing references) //IL_04ba: Unknown result type (might be due to invalid IL or missing references) //IL_0607: Unknown result type (might be due to invalid IL or missing references) float num = 50f; _txtName = CanvasService.CreateText(_root.transform, "FamName", "No Familiar Bound", 16f, num, 428f, 26f, 17f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); _txtLevel = CanvasService.CreateText(_root.transform, "FamLevel", "", 16f, num + 28f, 160f, 16f, 11f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257).GetComponent(); _txtBond = CanvasService.CreateText(_root.transform, "FamBond", "", 180f, num + 28f, 150f, 16f, 11f, (Color?)new Color(1f, 0.42f, 0.71f), (TextAlignmentOptions)257, applyNocturneFont: true).GetComponent(); _txtMode = CanvasService.CreateText(_root.transform, "FamMode", "", 340f, num + 28f, 110f, 16f, 11f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257).GetComponent(); float num2 = num + 50f; CanvasService.CreateText(_root.transform, "HPLabel", "HP", 16f, num2, 30f, 14f, 10f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257); _txtHP = CanvasService.CreateText(_root.transform, "HPVal", "", 48f, num2, 160f, 14f, 10f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257).GetComponent(); _hpFill = MakeFill(CanvasService.CreatePanel(_root.transform, "HPBg", 16f, num2 + 16f, 428f, 10f, (Color?)new Color(0.1f, 0.1f, 0.1f, 0.9f)), new Color(0.9f, 0.2f, 0.2f)); float num3 = num2 + 32f; CanvasService.CreateText(_root.transform, "XPLabel", "XP", 16f, num3, 30f, 14f, 10f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257); _txtXP = CanvasService.CreateText(_root.transform, "XPVal", "", 48f, num3, 200f, 14f, 10f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257).GetComponent(); _xpFill = MakeFill(CanvasService.CreatePanel(_root.transform, "XPBg", 16f, num3 + 16f, 428f, 8f, (Color?)new Color(0.1f, 0.1f, 0.1f, 0.9f)), new Color(0.4f, 0.6f, 1f)); float num4 = num3 + 32f; _txtAP = CanvasService.CreateText(_root.transform, "APLabel", "AP: 0", 16f, num4, 80f, 16f, 11f, (Color?)new Color(0f, 1f, 0.5f), (TextAlignmentOptions)257, applyNocturneFont: true).GetComponent(); _txtHPAlloc = BuildAllocRow(num4 + 20f, "HP", "hp"); _txtPhysAlloc = BuildAllocRow(num4 + 38f, "Phys", "phys"); _txtSpellAlloc = BuildAllocRow(num4 + 56f, "Spell", "spell"); _txtEverstone = CanvasService.CreateText(_root.transform, "EverstoneLabel", "", 16f, num4 + 78f, 200f, 16f, 11f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257).GetComponent(); CanvasService.CreateButton(_root.transform, "BtnEverstone", "Toggle Everstone", 220f, num4 + 76f, 130f, 20f, (Action)delegate { CommandSender.FamEverstone(); }, 10f, (Color?)new Color(0.2f, 0.15f, 0.05f, 0.85f), (Color?)CanvasService.ACCENT_GOLD, (Color?)null, applyNocturneFont: true); float num5 = num4 + 104f; CanvasService.CreateButton(_root.transform, "BtnCall", "Call", 16f, num5, 68f, 26f, delegate { CommandSender.FamBindLast(_lastKnownIndex); }, 12f); CanvasService.CreateButton(_root.transform, "BtnDismiss", "Dismiss", 90f, num5, 68f, 26f, delegate { CommandSender.FamDismiss(); }, 12f); CanvasService.CreateButton(_root.transform, "BtnUnbind", "Unbind", 164f, num5, 68f, 26f, (Action)delegate { CommandSender.FamUnbind(); }, 12f, (Color?)new Color(0.3f, 0.05f, 0.05f, 0.85f), (Color?)null, (Color?)null, applyNocturneFont: true); CanvasService.CreateButton(_root.transform, "BtnAgg", "⚔ Aggro", 238f, num5, 76f, 26f, delegate { CommandSender.FamAggressive(); }, 11f); CanvasService.CreateButton(_root.transform, "BtnPass", "\ud83d\udee1 Passive", 320f, num5, 86f, 26f, delegate { CommandSender.FamPassive(); }, 11f); CanvasService.CreateDivider(_root.transform, "D1", 0f, num5 + 34f, 460f); } private TextMeshProUGUI BuildAllocRow(float y, string label, string stat) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) CanvasService.CreateText(_root.transform, "Lbl_" + stat, label + ":", 16f, y, 44f, 16f, 10f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257); TextMeshProUGUI component = CanvasService.CreateText(_root.transform, "Val_" + stat, "0", 64f, y, 40f, 16f, 10f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); CanvasService.CreateButton(_root.transform, "A1_" + stat, "+1", 108f, y, 32f, 16f, (Action)delegate { CommandSender.FamAllocAP(stat, 1); }, 9f, (Color?)new Color(0.1f, 0.2f, 0.1f, 0.85f), (Color?)CanvasService.ACCENT_GOLD, (Color?)null, applyNocturneFont: true); CanvasService.CreateButton(_root.transform, "A5_" + stat, "+5", 145f, y, 32f, 16f, (Action)delegate { CommandSender.FamAllocAP(stat, 5); }, 9f, (Color?)new Color(0.1f, 0.2f, 0.1f, 0.85f), (Color?)CanvasService.ACCENT_GOLD, (Color?)null, applyNocturneFont: true); return component; } private void ToggleNewBoxPanel() { if (!((Object)(object)_newBoxPanel == (Object)null)) { if (_newBoxPanel.activeSelf) { HideNewBoxPanel(); } else { ShowNewBoxPanel(); } } } private void BuildBoxSection() { //IL_0030: 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_00e0: 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_0154: 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_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: 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_0356: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0475: Expected O, but got Unknown //IL_04a7: 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_04d1: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: 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) float num = 330f; CanvasService.CreateText(_root.transform, "BoxHeader", "BOXES", 16f, num, 80f, 16f, 11f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257); _txtBoxName = CanvasService.CreateText(_root.transform, "ActiveBox", "", 100f, num, 260f, 16f, 11f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); CanvasService.CreateButton(_root.transform, "BtnAllBoxes", "All", 270f, num - 2f, 80f, 20f, (Action)delegate { ShowAllBoxesPanel(); }, 10f, (Color?)new Color(0.1f, 0.12f, 0.18f, 0.9f), (Color?)CanvasService.ACCENT_GOLD, (Color?)null, applyNocturneFont: true); CanvasService.CreateButton(_root.transform, "BtnNewBox", "+ New Box", 356f, num - 2f, 96f, 20f, (Action)delegate { ToggleNewBoxPanel(); }, 10f, (Color?)new Color(0.1f, 0.15f, 0.1f, 0.85f), (Color?)CanvasService.ACCENT_GOLD, (Color?)null, applyNocturneFont: true); _newBoxPanel = new GameObject("NewBoxPanel"); _newBoxPanel.transform.SetParent(_root.transform, false); RectTransform obj = _newBoxPanel.AddComponent(); obj.anchorMin = new Vector2(0f, 1f); obj.anchorMax = new Vector2(1f, 1f); obj.pivot = new Vector2(0f, 1f); obj.anchoredPosition = new Vector2(0f, 0f - (num + 22f)); obj.sizeDelta = new Vector2(0f, 28f); ((Graphic)_newBoxPanel.AddComponent()).color = new Color(0.08f, 0.1f, 0.08f, 0.95f); _newBoxInputGo = CanvasService.CreatePanel(_newBoxPanel.transform, "NewBoxInput", 8f, 2f, 342f, 24f, (Color?)new Color(0.12f, 0.12f, 0.12f, 0.92f)); CanvasService.RegisterClickable(_newBoxInputGo, delegate { _newBoxFocused = true; UpdateNewBoxInputVisual(); }, new Color(0.12f, 0.12f, 0.12f, 0.92f), new Color(0.16f, 0.16f, 0.18f, 0.95f)); _newBoxInputText = CanvasService.CreateText(_newBoxInputGo.transform, "Typed", "", 6f, 2f, 328f, 20f, 11f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)4097).GetComponent(); _newBoxPlaceholder = CanvasService.CreateText(_newBoxInputGo.transform, "Placeholder", "Box name...", 6f, 2f, 328f, 20f, 11f, CanvasService.TEXT_DISABLED, (TextAlignmentOptions)4097).GetComponent(); CanvasService.CreateButton(_newBoxPanel.transform, "BtnCreate", "Create", 354f, 2f, 60f, 24f, (Action)delegate { ConfirmCreateBox(); }, 10f, (Color?)new Color(0.1f, 0.2f, 0.1f, 0.85f), (Color?)CanvasService.ACCENT_GOLD, (Color?)null, applyNocturneFont: true); CanvasService.CreateButton(_newBoxPanel.transform, "BtnCancelBox", "X", 418f, 2f, 24f, 24f, (Action)delegate { HideNewBoxPanel(); }, 10f, (Color?)new Color(0.3f, 0.05f, 0.05f, 0.85f), (Color?)Color.white, (Color?)null, applyNocturneFont: true); _newBoxPanel.SetActive(false); _boxListContainer = new GameObject("BoxList"); _boxListContainer.transform.SetParent(_root.transform, false); RectTransform obj2 = _boxListContainer.AddComponent(); obj2.anchorMin = new Vector2(0f, 1f); obj2.anchorMax = new Vector2(0f, 1f); obj2.pivot = new Vector2(0f, 1f); obj2.anchoredPosition = new Vector2(16f, 0f - (num + 54f)); obj2.sizeDelta = new Vector2(428f, 28f); CanvasService.CreateDivider(_root.transform, "D2", 0f, num + 84f, 460f); } private void ShowNewBoxPanel() { if (!((Object)(object)_newBoxPanel == (Object)null)) { _newBoxDraft = ""; _newBoxFocused = true; _newBoxPanel.SetActive(true); UpdateNewBoxInputVisual(); } } private void HideNewBoxPanel() { if (!((Object)(object)_newBoxPanel == (Object)null)) { _newBoxPanel.SetActive(false); _newBoxFocused = false; } } private void ConfirmCreateBox() { string text = (_newBoxDraft ?? "").Trim(); if (string.IsNullOrEmpty(text)) { OrdainUIBehaviour.EnqueueNotification("Enter a box name first.", "warning", 1.8f); return; } CommandSender.FamBoxCreate(text); HideNewBoxPanel(); } private void UpdateNewBoxInputVisual() { //IL_0052: 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) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_newBoxInputText == (Object)null) && !((Object)(object)_newBoxPlaceholder == (Object)null)) { bool flag = !string.IsNullOrEmpty(_newBoxDraft); ((TMP_Text)_newBoxInputText).text = _newBoxDraft; ((Graphic)_newBoxInputText).color = (_newBoxFocused ? CanvasService.TEXT_PRIMARY : CanvasService.TEXT_SECONDARY); ((Component)_newBoxPlaceholder).gameObject.SetActive(!flag); ((Graphic)_newBoxPlaceholder).color = (Color)(_newBoxFocused ? new Color(0.75f, 0.75f, 0.75f, 0.75f) : CanvasService.TEXT_DISABLED); } } private void ShowAllBoxesPanel() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0149: 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_01b7: 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_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0348: 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_0371: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_root == (Object)null) { return; } if ((Object)(object)_allBoxesPanel != (Object)null) { Object.Destroy((Object)(object)_allBoxesPanel); } _allBoxesPanel = new GameObject("AllBoxesPanel"); _allBoxesPanel.transform.SetParent(_root.transform, false); int num = Math.Max(1, UIData.Boxes.Count); float num2 = Mathf.Clamp(74f + (float)num * 32f, 124f, 420f); RectTransform obj = _allBoxesPanel.AddComponent(); obj.anchorMin = new Vector2(0.5f, 0.5f); obj.anchorMax = new Vector2(0.5f, 0.5f); obj.pivot = new Vector2(0.5f, 0.5f); obj.anchoredPosition = new Vector2(0f, 16f); obj.sizeDelta = new Vector2(340f, num2); ((Graphic)_allBoxesPanel.AddComponent()).color = new Color(0.06f, 0.05f, 0.1f, 0.97f); CanvasService.CreateText(_allBoxesPanel.transform, "Title", "ALL BOXES", 12f, 10f, 260f, 20f, 12f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257); CanvasService.CreateButton(_allBoxesPanel.transform, "Close", "X", 304f, 6f, 24f, 22f, (Action)delegate { CloseAllBoxesPanel(); }, 11f, (Color?)new Color(0.4f, 0.1f, 0.1f, 0.85f), (Color?)Color.white, (Color?)null, applyNocturneFont: true); float num3 = 34f; if (UIData.Boxes.Count == 0) { CanvasService.CreateText(_allBoxesPanel.transform, "Empty", "No boxes found.", 12f, num3 + 8f, 300f, 20f, 11f, CanvasService.TEXT_DISABLED, (TextAlignmentOptions)257); return; } for (int num4 = 0; num4 < UIData.Boxes.Count; num4++) { UIData.BoxInfo boxInfo = UIData.Boxes[num4]; if (boxInfo != null) { bool flag = string.Equals(boxInfo.Name, UIData.ActiveBoxName, StringComparison.Ordinal); string boxName = boxInfo.Name; int value = Mathf.Max(0, boxInfo.Count); int value2 = ((boxInfo.Max > 0) ? boxInfo.Max : 10); CanvasService.CreateButton(_allBoxesPanel.transform, $"AllBox_{num4}", $"{boxName} ({value}/{value2})", 12f, num3, 316f, 26f, delegate { CommandSender.FamBoxSwitch(boxName); CloseAllBoxesPanel(); }, 10.5f, (Color)(flag ? new Color(0.2f, 0.12f, 0.05f, 0.9f) : CanvasService.BTN_NORMAL), flag ? CanvasService.ACCENT_GOLD : CanvasService.TEXT_PRIMARY); num3 += 30f; } } } private void CloseAllBoxesPanel() { if (!((Object)(object)_allBoxesPanel == (Object)null)) { Object.Destroy((Object)(object)_allBoxesPanel); _allBoxesPanel = null; } } private void RefreshBoxes() { //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_boxListContainer == (Object)null || (Object)(object)_txtBoxName == (Object)null) { return; } ((TMP_Text)_txtBoxName).text = UIData.ActiveBoxName; if (!string.IsNullOrEmpty(UIData.ActiveBoxName)) { _recentBoxes.Remove(UIData.ActiveBoxName); _recentBoxes.Insert(0, UIData.ActiveBoxName); } foreach (UIData.BoxInfo box in UIData.Boxes) { if (!_recentBoxes.Contains(box.Name)) { _recentBoxes.Add(box.Name); } } for (int num = _recentBoxes.Count - 1; num >= 0; num--) { bool flag = false; foreach (UIData.BoxInfo box2 in UIData.Boxes) { if (box2.Name == _recentBoxes[num]) { flag = true; break; } } if (!flag) { _recentBoxes.RemoveAt(num); } } while (_recentBoxes.Count > 3) { _recentBoxes.RemoveAt(_recentBoxes.Count - 1); } foreach (GameObject boxButton in _boxButtons) { if ((Object)(object)boxButton != (Object)null) { Object.DestroyImmediate((Object)(object)boxButton); } } _boxButtons.Clear(); float num2 = 0f; foreach (string recentBox in _recentBoxes) { UIData.BoxInfo boxInfo = null; foreach (UIData.BoxInfo box3 in UIData.Boxes) { if (box3.Name == recentBox) { boxInfo = box3; break; } } if (boxInfo != null) { bool flag2 = recentBox == UIData.ActiveBoxName; string name = recentBox; GameObject item = CanvasService.CreateButton(_boxListContainer.transform, "Box_" + name, $"{name} ({boxInfo.Count}/{((boxInfo.Max > 0) ? boxInfo.Max : 10)})", num2, 0f, 110f, 24f, delegate { CommandSender.FamBoxSwitch(name); }, 10f, (Color)(flag2 ? new Color(0.2f, 0.12f, 0.05f, 0.9f) : CanvasService.BTN_NORMAL), flag2 ? CanvasService.ACCENT_GOLD : CanvasService.TEXT_PRIMARY); _boxButtons.Add(item); num2 += 114f; } } if ((Object)(object)_allBoxesPanel != (Object)null) { ShowAllBoxesPanel(); } } private void BuildFamiliarListSection() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_007f: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: 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_00f6: Expected O, but got Unknown //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0158: 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) float num = 410f; CanvasService.CreateText(_root.transform, "ListHeader", "FAMILIARS IN BOX", 16f, num + 8f, 200f, 16f, 11f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257); GameObject val = new GameObject("FamClip"); val.transform.SetParent(_root.transform, false); RectTransform obj = val.AddComponent(); obj.anchorMin = new Vector2(0f, 1f); obj.anchorMax = new Vector2(1f, 1f); obj.pivot = new Vector2(0f, 1f); obj.anchoredPosition = new Vector2(0f, 0f - (num + 20f)); obj.sizeDelta = new Vector2(0f, 310f); val.AddComponent(); _famListContent = new GameObject("FamContent"); _famListContent.transform.SetParent(val.transform, false); RectTransform obj2 = _famListContent.AddComponent(); obj2.anchorMin = new Vector2(0f, 1f); obj2.anchorMax = new Vector2(1f, 1f); obj2.pivot = new Vector2(0f, 1f); obj2.anchoredPosition = Vector2.zero; obj2.sizeDelta = new Vector2(0f, 0f); } private void RefreshFamiliarList() { //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_famListContent == (Object)null) { return; } foreach (GameObject famRow in _famRows) { if ((Object)(object)famRow != (Object)null) { Object.DestroyImmediate((Object)(object)famRow); } } _famRows.Clear(); foreach (UIData.FamiliarListEntry familiar in UIData.FamiliarList) { if (familiar.IsActive) { _lastKnownIndex = familiar.Index; break; } } float num = 0f; foreach (UIData.FamiliarListEntry familiar2 in UIData.FamiliarList) { bool isLastKnown = !UIData.FamiliarActive && familiar2.Index == _lastKnownIndex; GameObject item = BuildFamiliarRow(familiar2, num, isLastKnown); _famRows.Add(item); num += 30f; } if (UIData.FamiliarList.Count == 0) { GameObject item2 = CanvasService.CreateText(_famListContent.transform, "Empty", "No familiars in this box.", 16f, 4f, 428f, 20f, 11f, CanvasService.TEXT_DISABLED, (TextAlignmentOptions)257); _famRows.Add(item2); num = 24f; } _famListContent.GetComponent().sizeDelta = new Vector2(0f, num); } private GameObject BuildFamiliarRow(UIData.FamiliarListEntry fam, float y, bool isLastKnown = false) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown //IL_0064: 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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_0377: 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) GameObject val = new GameObject($"Row_{fam.Index}"); val.transform.SetParent(_famListContent.transform, false); RectTransform obj = val.AddComponent(); obj.anchorMin = new Vector2(0f, 1f); obj.anchorMax = new Vector2(1f, 1f); obj.pivot = new Vector2(0f, 1f); obj.anchoredPosition = new Vector2(0f, 0f - y); obj.sizeDelta = new Vector2(0f, 28f); ((Graphic)val.AddComponent()).color = (fam.IsActive ? new Color(0.15f, 0.1f, 0.05f, 0.85f) : (isLastKnown ? new Color(0.08f, 0.1f, 0.15f, 0.85f) : ((y % 60f < 30f) ? new Color(0.08f, 0.07f, 0.09f, 0.7f) : new Color(0.06f, 0.05f, 0.07f, 0.7f)))); Color val2 = (Color)(fam.Rarity switch { "Uncommon" => new Color(0.3f, 0.9f, 0.3f), "Rare" => new Color(0.3f, 0.5f, 1f), "Epic" => new Color(0.8f, 0.3f, 1f), "Legendary" => new Color(1f, 0.75f, 0.1f), _ => CanvasService.TEXT_SECONDARY, }); string value = (fam.IsShiny ? " ✦" : ""); string value2 = (fam.IsActive ? " ◆" : (isLastKnown ? " ◈ last" : "")); Color value3 = (Color)((isLastKnown && !fam.IsActive) ? new Color(0.6f, 0.75f, 1f) : val2); CanvasService.CreateText(val.transform, "Label", $"[{fam.Index}] {fam.Name}{value} Lv.{fam.Level} [{fam.Rarity}]{value2}", 8f, 4f, 340f, 20f, 11f, value3, (TextAlignmentOptions)4097); int idx = fam.Index; if (!fam.IsActive) { CanvasService.CreateButton(val.transform, "BtnBind", "Bind", 350f, 2f, 44f, 22f, (Action)delegate { CommandSender.FamBind(idx); }, 10f, (Color?)new Color(0.1f, 0.2f, 0.1f, 0.85f), (Color?)CanvasService.ACCENT_GOLD, (Color?)null, applyNocturneFont: true); } CanvasService.CreateButton(val.transform, "BtnMove", "Move", 398f, 2f, 54f, 22f, delegate { ShowMovePanel(idx); }, 10f, CanvasService.BTN_NORMAL, CanvasService.TEXT_SECONDARY); return val; } private void ShowMovePanel(int famIndex) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_movePanel != (Object)null) { Object.Destroy((Object)(object)_movePanel); } _movePanel = new GameObject("MovePanel"); _movePanel.transform.SetParent(_root.transform, false); RectTransform obj = _movePanel.AddComponent(); obj.anchorMin = new Vector2(0.5f, 0.5f); obj.anchorMax = new Vector2(0.5f, 0.5f); obj.pivot = new Vector2(0.5f, 0.5f); obj.anchoredPosition = Vector2.zero; obj.sizeDelta = new Vector2(300f, 60f + (float)UIData.Boxes.Count * 34f); ((Graphic)_movePanel.AddComponent()).color = new Color(0.06f, 0.04f, 0.1f, 0.98f); CanvasService.CreateText(_movePanel.transform, "Title", $"Move familiar #{famIndex} to:", 10f, 10f, 260f, 20f, 12f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257); CanvasService.CreateButton(_movePanel.transform, "Close", "✕", 272f, 6f, 20f, 20f, (Action)delegate { Object.Destroy((Object)(object)_movePanel); _movePanel = null; }, 12f, (Color?)new Color(0.4f, 0.1f, 0.1f, 0.85f), (Color?)Color.white, (Color?)null, applyNocturneFont: true); float num = 36f; foreach (UIData.BoxInfo box in UIData.Boxes) { if (box.Name == UIData.ActiveBoxName) { continue; } bool full = box.Count >= box.Max; string boxName = box.Name; int idx = famIndex; CanvasService.CreateButton(_movePanel.transform, "MoveTo_" + boxName, $"{boxName} ({box.Count}/{box.Max})", 10f, num, 280f, 26f, delegate { if (!full) { CommandSender.FamMove(idx, boxName); Object.Destroy((Object)(object)_movePanel); _movePanel = null; } else { OrdainUIBehaviour.EnqueueNotification(boxName + " is full!", "red", 2f); } }, 11f, (Color)(full ? new Color(0.15f, 0.07f, 0.07f) : CanvasService.BTN_NORMAL), full ? CanvasService.TEXT_DISABLED : CanvasService.TEXT_PRIMARY); num += 32f; } } private void BuildBottomBar() { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) CanvasService.CreateDivider(_root.transform, "DBot", 0f, 736f, 460f); CanvasService.CreateButton(_root.transform, "BtnBack", "◀ Back", 16f, 744f, 80f, 26f, (Action)delegate { Hide(); _onBack?.Invoke(); }, 11f, (Color?)new Color(0.12f, 0.1f, 0.14f, 0.85f), (Color?)CanvasService.TEXT_SECONDARY, (Color?)null, applyNocturneFont: true); } private void RefreshActiveFamiliar() { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: 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_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: 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) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_04cd: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Unknown result type (might be due to invalid IL or missing references) if (!string.IsNullOrEmpty(UIData.FamiliarName) && !string.IsNullOrEmpty(UIData.FamiliarBondName) && UIData.FamiliarBondName != "Stranger") { _ = 1; } else if (UIData.FamiliarActive) { _ = !string.IsNullOrEmpty(UIData.FamiliarName); } else _ = 0; if (!UIData.FamiliarActive || string.IsNullOrEmpty(UIData.FamiliarName)) { ((TMP_Text)_txtName).text = "No Familiar Bound"; ((Graphic)_txtName).color = CanvasService.TEXT_DISABLED; TextMeshProUGUI txtLevel = _txtLevel; TextMeshProUGUI txtBond = _txtBond; TextMeshProUGUI txtMode = _txtMode; TextMeshProUGUI txtAP = _txtAP; TextMeshProUGUI txtHP = _txtHP; string text = (((TMP_Text)_txtXP).text = ""); string text3 = (((TMP_Text)txtHP).text = text); string text5 = (((TMP_Text)txtAP).text = text3); string text7 = (((TMP_Text)txtMode).text = text5); string text9 = (((TMP_Text)txtBond).text = text7); ((TMP_Text)txtLevel).text = text9; TextMeshProUGUI txtHPAlloc = _txtHPAlloc; TextMeshProUGUI txtPhysAlloc = _txtPhysAlloc; text7 = (((TMP_Text)_txtSpellAlloc).text = "0"); text9 = (((TMP_Text)txtPhysAlloc).text = text7); ((TMP_Text)txtHPAlloc).text = text9; ((TMP_Text)_txtEverstone).text = ""; SetFill(_hpFill, 0f); SetFill(_xpFill, 0f); return; } Color color = (Color)(UIData.FamiliarRarity switch { "Uncommon" => new Color(0.3f, 0.9f, 0.3f), "Rare" => new Color(0.3f, 0.5f, 1f), "Epic" => new Color(0.8f, 0.3f, 1f), "Legendary" => new Color(1f, 0.75f, 0.1f), _ => CanvasService.TEXT_SECONDARY, }); ((TMP_Text)_txtName).text = UIData.FamiliarName; ((Graphic)_txtName).color = color; ((TMP_Text)_txtLevel).text = $"Lv.{UIData.FamiliarLevel} [{UIData.FamiliarRarity}]"; ((TMP_Text)_txtBond).text = (string.IsNullOrEmpty(UIData.FamiliarBondName) ? "" : $"Bond: {UIData.FamiliarBondName} ({UIData.FamiliarBondLevel}/10)"); if (!string.IsNullOrEmpty(UIData.FamiliarMode)) { bool flag = UIData.FamiliarMode == "Aggressive"; ((TMP_Text)_txtMode).text = (flag ? "Aggressive" : "Passive"); ((Graphic)_txtMode).color = (flag ? new Color(1f, 0.35f, 0.35f) : new Color(0.55f, 0.8f, 1f)); } else { ((TMP_Text)_txtMode).text = ""; } ((TMP_Text)_txtAP).text = $"AP: {UIData.FamiliarUnspentAP}"; ((TMP_Text)_txtHPAlloc).text = UIData.FamiliarHPAlloc.ToString(); ((TMP_Text)_txtPhysAlloc).text = UIData.FamiliarPhysAlloc.ToString(); ((TMP_Text)_txtSpellAlloc).text = UIData.FamiliarSpellAlloc.ToString(); ((TMP_Text)_txtHP).text = $"{UIData.FamiliarHP:F0} / {UIData.FamiliarMaxHP:F0}"; SetFill(_hpFill, (UIData.FamiliarMaxHP > 0f) ? (UIData.FamiliarHP / UIData.FamiliarMaxHP) : 0f); ((TMP_Text)_txtXP).text = $"{UIData.FamiliarXP:F0} / {UIData.FamiliarXPNext:F0}"; SetFill(_xpFill, (UIData.FamiliarXPNext > 0f) ? (UIData.FamiliarXP / UIData.FamiliarXPNext) : 0f); ((TMP_Text)_txtEverstone).text = (UIData.FamiliarEverstone ? "⚑ Everstone ON" : "Everstone OFF"); ((Graphic)_txtEverstone).color = (UIData.FamiliarEverstone ? CanvasService.ACCENT_GOLD : CanvasService.TEXT_DISABLED); } private static bool IsPointerOver(RectTransform rect) { //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) if ((Object)(object)rect != (Object)null) { return RectTransformUtility.RectangleContainsScreenPoint(rect, Vector2.op_Implicit(Input.mousePosition), (Camera)null); } return false; } private Image MakeFill(GameObject bg, Color color) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: 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) //IL_0023: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: 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) GameObject val = new GameObject("Fill"); val.transform.SetParent(bg.transform, false); RectTransform obj = val.AddComponent(); obj.anchorMin = Vector2.zero; obj.anchorMax = new Vector2(0f, 1f); Vector2 offsetMin = (obj.offsetMax = Vector2.zero); obj.offsetMin = offsetMin; Image obj2 = val.AddComponent(); ((Graphic)obj2).color = color; return obj2; } private void SetFill(Image fill, float pct) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)fill == (Object)null)) { ((Component)fill).GetComponent().anchorMax = new Vector2(Mathf.Clamp01(pct), 1f); } } } internal class ForgePanel { private GameObject _root; private bool _visible; private readonly Action _onBack; private GameObject _treeContainer; private TextMeshProUGUI _txtWeaponName; private GameObject _emptyState; private int _lastHash = -1; private const float W = 720f; private const float H = 560f; private const float PAD = 16f; private const float NAME_BAR_Y = 56f; private const float NAME_BAR_H = 42f; private const float NODE_W = 150f; private const float NODE_H = 64f; private const float BRANCH_TOP_Y = 168f; private const float NODE_SPACING = 96f; private const float LEFT_COL_CX = 201.6f; private const float RIGHT_COL_CX = 518.4f; public bool IsVisible => _visible; public ForgePanel(Action onBack = null) { _onBack = onBack; } public void Show() { if ((Object)(object)_root == (Object)null) { Create(); } _visible = true; _root.SetActive(true); _lastHash = -1; Refresh(); } public void Hide() { if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } _visible = false; try { EventSystem current = EventSystem.current; if ((Object)(object)current != (Object)null) { current.SetSelectedGameObject((GameObject)null); } } catch { } } public void Refresh() { if (_visible && !((Object)(object)_root == (Object)null)) { int num = ComputeHash(); if (num != _lastHash) { _lastHash = num; RebuildTree(); } } } private void Create() { //IL_004f: 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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_012c: 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_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Expected O, but got Unknown //IL_0218: 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_0242: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService != null) { _root = canvasService.CreateRootWindow("ForgePanel", 720f, 560f, 204); GameObject val = CanvasService.CreatePanel(_root.transform, "Header", 0f, 0f, 720f, 44f, CanvasService.BG_HEADER); CanvasService.CreateText(val.transform, "Title", "FORGE", 16f, 12f, 660f, 24f, 16f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)4097); CanvasService.CreateCloseButton(_root.transform, 720f, delegate { Hide(); _onBack?.Invoke(); }); CanvasService.MakeDraggable(_root, val.transform); GameObject val2 = CanvasService.CreateText(CanvasService.CreatePanel(_root.transform, "WeaponBar", 16f, 56f, 688f, 42f, CanvasService.BG_PANEL).transform, "WeaponName", "", 0f, 8f, 688f, 26f, 15f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)514); _txtWeaponName = val2.GetComponent(); CanvasService.CreateText(_root.transform, "LblQ", "WEAPON SKILL — Q", 126.600006f, 142f, 150f, 18f, 11f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)514); CanvasService.CreateText(_root.transform, "LblE", "WEAPON SKILL — E", 443.40002f, 142f, 150f, 18f, 11f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)514); _treeContainer = new GameObject("TreeContainer"); _treeContainer.transform.SetParent(_root.transform, false); RectTransform obj = _treeContainer.AddComponent(); obj.anchorMin = new Vector2(0f, 1f); obj.anchorMax = new Vector2(0f, 1f); obj.pivot = new Vector2(0f, 1f); obj.anchoredPosition = Vector2.zero; obj.sizeDelta = new Vector2(720f, 560f); _emptyState = CanvasService.CreateText(_root.transform, "Empty", "Equip a Shadow Weapon to attune its skills.", 0f, 252f, 720f, 30f, 14f, CanvasService.TEXT_DISABLED, (TextAlignmentOptions)514); _emptyState.SetActive(false); } } private void RebuildTree() { for (int num = _treeContainer.transform.childCount - 1; num >= 0; num--) { Object.Destroy((Object)(object)((Component)_treeContainer.transform.GetChild(num)).gameObject); } if (!UIData.Forge.HasWeapon) { ((TMP_Text)_txtWeaponName).text = "—"; _emptyState.SetActive(true); return; } _emptyState.SetActive(false); ((TMP_Text)_txtWeaponName).text = UIData.Forge.WeaponName; List list = new List(); List list2 = new List(); List list3 = new List(); foreach (UIData.ForgeNode node in UIData.Forge.Nodes) { if (node.Slot == 1) { list.Add(node); } else if (node.Slot == 4) { list2.Add(node); } else { list3.Add(node); } } float x = 360f; float y = 98f; if (list.Count > 0) { DrawLine(x, y, 201.6f, 168f, 2f); } if (list2.Count > 0) { DrawLine(x, y, 518.4f, 168f, 2f); } BuildBranch(list, 201.6f); BuildBranch(list2, 518.4f); if (list3.Count > 0) { BuildBranch(list3, 360f); } } private void BuildBranch(List nodes, float colCenterX) { for (int i = 0; i < nodes.Count; i++) { float num = 168f + (float)i * 96f; if (i > 0) { float y = 168f + (float)(i - 1) * 96f + 64f; DrawLine(colCenterX, y, colCenterX, num, 2f); } BuildNode(nodes[i], colCenterX - 75f, num); } } private void BuildNode(UIData.ForgeNode node, float x, float y) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: 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_017b: Unknown result type (might be due to invalid IL or missing references) bool selected = node.Selected; if (selected) { CanvasService.CreatePanel(_treeContainer.transform, $"Sel_{node.Guid}", x - 2f, y - 2f, 154f, 68f, CanvasService.ACCENT_GOLD); } string text = ((node.Cooldown > 0f) ? $"{node.Cooldown:0.#}s cooldown" : "native cooldown"); string label = node.Name + "\n" + text + ""; int slot = node.Slot; int guid = node.Guid; float cd = node.Cooldown; string name = node.Name; CanvasService.CreateButton(_treeContainer.transform, $"Node_{guid}", label, x, y, 150f, 64f, delegate { OnNodeClicked(slot, guid, cd, name); }, 12f, (Color)(selected ? new Color(0.22f, 0.16f, 0.08f, 0.95f) : CanvasService.BTN_NORMAL), selected ? CanvasService.ACCENT_GOLD : CanvasService.TEXT_PRIMARY); } private void OnNodeClicked(int slot, int guid, float cooldown, string name) { foreach (UIData.ForgeNode node in UIData.Forge.Nodes) { if (node.Slot == slot) { node.Selected = node.Guid == guid; } } _lastHash = -1; Refresh(); CommandSender.ForgeSelect(slot, guid, cooldown); OrdainUIBehaviour.EnqueueNotification("Attuned " + name + ". Swap weapons to apply.", "info", 3f); } private void DrawLine(float x1, float y1, float x2, float y2, float thickness) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) float num = x2 - x1; float num2 = y2 - y1; float num3 = Mathf.Sqrt(num * num + num2 * num2); if (!(num3 < 1f)) { float num4 = (x1 + x2) / 2f; float num5 = (y1 + y2) / 2f; float num6 = (0f - Mathf.Atan2(num2, num)) * 57.29578f; GameObject val = new GameObject("Line"); val.transform.SetParent(_treeContainer.transform, false); RectTransform obj = val.AddComponent(); obj.anchorMin = new Vector2(0f, 1f); obj.anchorMax = new Vector2(0f, 1f); obj.pivot = new Vector2(0.5f, 0.5f); obj.anchoredPosition = new Vector2(num4, 0f - num5); obj.sizeDelta = new Vector2(num3, thickness); ((Transform)obj).localRotation = Quaternion.Euler(0f, 0f, num6); Image obj2 = val.AddComponent(); ((Graphic)obj2).color = CanvasService.BORDER_COLOR; ((Graphic)obj2).raycastTarget = false; val.transform.SetAsFirstSibling(); } } private int ComputeHash() { int num = (UIData.Forge.HasWeapon ? 1 : 0); num = (num * 397) ^ (UIData.Forge.WeaponId?.GetHashCode() ?? 0); num = (num * 397) ^ (UIData.Forge.WeaponName?.GetHashCode() ?? 0); foreach (UIData.ForgeNode node in UIData.Forge.Nodes) { num = (num * 397) ^ node.Slot; num = (num * 397) ^ node.Guid; num = (num * 397) ^ (node.Name?.GetHashCode() ?? 0); num = (num * 397) ^ node.Cooldown.GetHashCode(); num = (num * 397) ^ (node.Selected ? 1 : 0); } return num; } } internal class GOMSStatsPanel { private enum TabKind { Class, Stats, Paragon } private sealed class StatRow { public string Key; public TextMeshProUGUI Value; public TextMeshProUGUI Bonus; } private sealed class PerkRow { public string Key; public string Name; public string Alias; public string[] RankDescriptions; public int[] RankCosts; public GameObject Root; public TextMeshProUGUI NameTxt; public TextMeshProUGUI RankTxt; public TextMeshProUGUI DescTxt; public GameObject Btn; public TextMeshProUGUI BtnTxt; public bool CanUpgrade; } private static readonly (string key, string name, string alias, string[] desc, int[] cost)[] PerkDefs = new(string, string, string, string[], int[])[9] { ("Bloodrush", "Bloodrush", "br", new string[3] { "10% speed, 2s", "20% speed, 4s", "30% speed, 6s" }, new int[3] { 10, 15, 25 }), ("Momentum", "Momentum", "mom", new string[3] { "+3% dmg, 3 stacks", "+5% dmg, 4 stacks", "+8% dmg, 5 stacks" }, new int[3] { 10, 15, 25 }), ("TrophyHunter", "Trophy Hunter", "th", new string[3] { "+10% VBlood XP", "+25% VBlood XP", "+50% VBlood XP" }, new int[3] { 10, 20, 30 }), ("Executioner", "Life Tap", "lt", new string[3] { "5% proc, 2% max HP", "8% proc, 4% max HP", "10% proc, 6% max HP" }, new int[3] { 10, 15, 20 }), ("BloodEcho", "Blood Echo", "be", new string[3] { "2.5% proc, 2% blood", "4% proc, 5% blood", "5% proc, 8% blood" }, new int[3] { 10, 15, 20 }), ("EliteSlayer", "Elite Slayer", "es", new string[3] { "+5% dmg to elites", "+10% dmg to elites", "+20% dmg to elites" }, new int[3] { 10, 15, 25 }), ("SoulHarvest", "Soul Harvest", "sh", new string[3] { "+5% XP", "+10% XP", "+20% XP" }, new int[3] { 10, 15, 25 }), ("IronWill", "Iron Will", "iw", new string[3] { "-25% death penalty", "-50% death penalty", "-75% death penalty" }, new int[3] { 10, 15, 25 }), ("ApexPredator", "Apex Predator", "ap", new string[3] { "+50% elite drops", "+100% elite drops", "+150% elite drops" }, new int[3] { 20, 35, 50 }) }; private const string ClassRef = "Blood: Spell Leech + blood orb self-heal on hit.\nChaos: Spell Crit Damage focus.\nFrost: Projectile recast chance.\nStorm: Chain lightning on hit.\nIllusion: Floating weapon proc.\nUnholy: Condemn proc on hit.\n\nAscendance is each class's burst window (8s)."; private GameObject _root; private bool _visible; private readonly Action _onBack; private TabKind _tab = TabKind.Stats; private const string CurrencyName = "Ichor-Infused Iron Bar"; private Image _currencyIcon; private TextMeshProUGUI _currencyName; private TextMeshProUGUI _currencyAmount; private string _currencyLabel = "Ichor-Infused Iron Bar"; private long _currencyValue = -1L; private readonly List _tabBg = new List(); private readonly List _tabLabel = new List(); private TextMeshProUGUI _title; private string _inspectHeaderName = ""; private GameObject _classView; private TextMeshProUGUI _className; private TextMeshProUGUI _classTitle; private TextMeshProUGUI _classStacks; private TextMeshProUGUI _classAsc; private TextMeshProUGUI _classPassive; private TextMeshProUGUI _classBurst; private GameObject _statsView; private TextMeshProUGUI _level; private TextMeshProUGUI _gs; private TextMeshProUGUI _ap; private TextMeshProUGUI _xp; private Image _xpFill; private TextMeshProUGUI _applied; private readonly List _stats = new List(); private GameObject _paragonView; private TextMeshProUGUI _pLevel; private TextMeshProUGUI _pPoints; private TextMeshProUGUI _pXp; private Image _pXpFill; private readonly List _perks = new List(); private int _hash = -1; private const float W = 620f; private const float H = 700f; private const float PAD = 14f; private static readonly Color TabOn = new Color(0.2f, 0.12f, 0.05f, 0.95f); private static readonly Color TabOff = new Color(0.12f, 0.1f, 0.14f, 0.85f); public bool IsVisible => _visible; public GOMSStatsPanel(Action onBack = null) { _onBack = onBack; } public void Show() { if ((Object)(object)_root == (Object)null) { Create(); } _visible = true; _root.SetActive(true); _hash = -1; CommandSender.RequestUISync(); Refresh(); } public void ShowForInspect(string targetName) { _inspectHeaderName = (string.IsNullOrWhiteSpace(targetName) ? "" : targetName); if ((Object)(object)_root == (Object)null) { Create(); } SetTab(TabKind.Stats, force: true); Show(); } public void ClearInspectContext() { _inspectHeaderName = ""; _hash = -1; if (_visible) { Refresh(); } } public void Hide() { if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } _visible = false; } public void Dispose() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; _visible = false; } public void Refresh() { if (_visible && !((Object)(object)_root == (Object)null)) { int num = ComputeHash(); if (num != _hash) { _hash = num; RefreshHeader(); RefreshClass(); RefreshStats(); RefreshParagon(); } } } private void Create() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService != null) { _root = canvasService.CreateRootWindow("GOMSStatsPanel", 620f, 700f, 201); GameObject val = CanvasService.CreatePanel(_root.transform, "Header", 0f, 0f, 620f, 44f, CanvasService.BG_HEADER); _title = CanvasService.CreateText(val.transform, "Title", "GOMS Stats", 16f, 12f, 560f, 24f, 15f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)4097).GetComponent(); CanvasService.CreateCloseButton(_root.transform, 620f, delegate { Hide(); }); CanvasService.MakeDraggable(_root, val.transform); CanvasService.CreateDivider(_root.transform, "D0", 0f, 44f, 620f); BuildTabs(); BuildClassView(); BuildStatsView(); BuildParagonView(); CanvasService.CreateDivider(_root.transform, "DB", 0f, 660f, 620f); CanvasService.CreateButton(_root.transform, "Back", "â—€ Back", 14f, 666f, 96f, 24f, (Action)delegate { Hide(); _onBack?.Invoke(); }, 11f, (Color?)new Color(0.12f, 0.1f, 0.14f, 0.85f), (Color?)CanvasService.TEXT_SECONDARY, (Color?)null, applyNocturneFont: true); HUDPositionService.ApplySaved(_root, "GOMSStatsPanel"); SetTab(TabKind.Stats, force: true); _root.SetActive(false); } } private void BuildTabs() { //IL_003a: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_0100: Unknown result type (might be due to invalid IL or missing references) GameObject val = CanvasService.CreateButton(_root.transform, "TabStats", "Stats", 14f, 52f, 84f, 24f, delegate { SetTab(TabKind.Stats); }, 10.5f, TabOff, CanvasService.TEXT_SECONDARY); GameObject val2 = CanvasService.CreateButton(_root.transform, "TabClass", "Class", 104f, 52f, 84f, 24f, delegate { SetTab(TabKind.Class); }, 10.5f, TabOff, CanvasService.TEXT_SECONDARY); GameObject val3 = CanvasService.CreateButton(_root.transform, "TabParagon", "Paragon Board", 194f, 52f, 132f, 24f, delegate { SetTab(TabKind.Paragon); }, 10.5f, TabOff, CanvasService.TEXT_SECONDARY); _tabBg.Add(val.GetComponent()); _tabLabel.Add(val.GetComponentInChildren()); _tabBg.Add(val2.GetComponent()); _tabLabel.Add(val2.GetComponentInChildren()); _tabBg.Add(val3.GetComponent()); _tabLabel.Add(val3.GetComponentInChildren()); } private GameObject NewView(string name) { //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_001d: 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_0043: 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_006d: 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) //IL_008c: Expected O, but got Unknown GameObject val = new GameObject(name); val.transform.SetParent(_root.transform, false); RectTransform obj = val.AddComponent(); obj.anchorMin = new Vector2(0f, 1f); obj.anchorMax = new Vector2(1f, 1f); obj.pivot = new Vector2(0f, 1f); obj.anchoredPosition = new Vector2(0f, -84f); obj.sizeDelta = new Vector2(0f, 576f); return val; } private void BuildClassView() { //IL_0049: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_0124: 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_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_035b: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) _classView = NewView("ClassView"); CanvasService.CreatePanel(_classView.transform, "A", 14f, 0f, 592f, 210f, (Color?)new Color(0.1f, 0.08f, 0.12f, 0.9f)); _className = CanvasService.CreateText(_classView.transform, "CN", "NO CLASS", 22f, 24f, 240f, 24f, 18f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); _classTitle = CanvasService.CreateText(_classView.transform, "CT", "", 22f, 50f, 576f, 18f, 11f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257).GetComponent(); _classStacks = CanvasService.CreateText(_classView.transform, "CS", "Stacks: 0/100", 22f, 70f, 576f, 16f, 10.5f, CanvasService.TEXT_DISABLED, (TextAlignmentOptions)257).GetComponent(); _classAsc = CanvasService.CreateText(_classView.transform, "CA", "", 22f, 88f, 576f, 16f, 10.5f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257).GetComponent(); CanvasService.CreateText(_classView.transform, "PL", "Passive", 22f, 110f, 120f, 16f, 10.5f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257); _classPassive = CanvasService.CreateText(_classView.transform, "CP", "", 22f, 128f, 576f, 30f, 10.5f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); ((TMP_Text)_classPassive).enableWordWrapping = true; ((TMP_Text)_classPassive).overflowMode = (TextOverflowModes)0; CanvasService.CreateText(_classView.transform, "AL", "Ascendance", 22f, 162f, 120f, 16f, 10.5f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257); _classBurst = CanvasService.CreateText(_classView.transform, "CB", "", 22f, 180f, 576f, 24f, 10.5f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); ((TMP_Text)_classBurst).enableWordWrapping = true; ((TMP_Text)_classBurst).overflowMode = (TextOverflowModes)0; CanvasService.CreatePanel(_classView.transform, "B", 14f, 218f, 592f, 338f, (Color?)new Color(0.08f, 0.1f, 0.12f, 0.88f)); CanvasService.CreateText(_classView.transform, "RH", "Class Reference", 22f, 224f, 220f, 18f, 12f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257); TextMeshProUGUI component = CanvasService.CreateText(_classView.transform, "RT", "Blood: Spell Leech + blood orb self-heal on hit.\nChaos: Spell Crit Damage focus.\nFrost: Projectile recast chance.\nStorm: Chain lightning on hit.\nIllusion: Floating weapon proc.\nUnholy: Condemn proc on hit.\n\nAscendance is each class's burst window (8s).", 22f, 246f, 576f, 304f, 10f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); ((TMP_Text)component).enableWordWrapping = true; ((TMP_Text)component).overflowMode = (TextOverflowModes)0; } private void BuildStatsView() { //IL_0049: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_0124: 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_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) _statsView = NewView("StatsView"); CanvasService.CreatePanel(_statsView.transform, "A", 14f, 0f, 592f, 102f, (Color?)new Color(0.1f, 0.08f, 0.12f, 0.9f)); _level = CanvasService.CreateText(_statsView.transform, "L", "Level 0", 22f, 8f, 220f, 24f, 18f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); _gs = CanvasService.CreateText(_statsView.transform, "G", "GS: 0", 22f, 34f, 120f, 18f, 11.5f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257).GetComponent(); _ap = CanvasService.CreateText(_statsView.transform, "AP", "AP: 0", 150f, 34f, 180f, 18f, 11.5f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257).GetComponent(); _xp = CanvasService.CreateText(_statsView.transform, "XP", "XP: 0/0", 22f, 56f, 576f, 16f, 10.5f, CanvasService.TEXT_DISABLED, (TextAlignmentOptions)257).GetComponent(); GameObject bg = CanvasService.CreatePanel(_statsView.transform, "X", 22f, 76f, 576f, 12f, (Color?)new Color(0.1f, 0.1f, 0.1f, 0.9f)); _xpFill = MakeFill(bg, new Color(0.15f, 0.45f, 0.85f)); BuildCurrencyReadout(); CanvasService.CreatePanel(_statsView.transform, "B", 14f, 110f, 592f, 260f, (Color?)new Color(0.08f, 0.1f, 0.12f, 0.88f)); CanvasService.CreateText(_statsView.transform, "H", "Allocate AP", 22f, 116f, 140f, 18f, 12f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257); BuildStatRow(0, "STR", "str"); BuildStatRow(1, "INT", "int"); BuildStatRow(2, "DEX", "dex"); BuildStatRow(3, "LUK", "luk"); BuildStatRow(4, "CD", "cd"); BuildStatRow(5, "MS", "ms"); BuildStatRow(6, "HP", "hp"); BuildStatRow(7, "BE", "be"); CanvasService.CreatePanel(_statsView.transform, "C", 14f, 378f, 592f, 178f, (Color?)new Color(0.11f, 0.09f, 0.08f, 0.88f)); CanvasService.CreateText(_statsView.transform, "AH", "Applied Bonuses (from AP)", 22f, 384f, 300f, 18f, 12f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257); _applied = CanvasService.CreateText(_statsView.transform, "AT", "", 22f, 406f, 576f, 144f, 10.5f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); ((TMP_Text)_applied).enableWordWrapping = true; ((TMP_Text)_applied).overflowMode = (TextOverflowModes)0; } private void BuildStatRow(int i, string label, string key) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_0252: 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) float num = 138 + i * 30; float num2 = 22f; float num3 = 576f; CanvasService.CreatePanel(_statsView.transform, "R_" + key, num2, num, num3, 24f, (Color?)new Color(0.05f, 0.05f, 0.07f, 0.65f)); CanvasService.CreateText(_statsView.transform, "L_" + key, label, num2 + 6f, num + 3f, 40f, 18f, 11f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257); TextMeshProUGUI component = CanvasService.CreateText(_statsView.transform, "V_" + key, "0", num2 + 44f, num + 3f, 34f, 18f, 11f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); TextMeshProUGUI component2 = CanvasService.CreateText(_statsView.transform, "B_" + key, "", num2 + 82f, num + 3f, num3 - 170f, 18f, 10f, CanvasService.TEXT_DISABLED, (TextAlignmentOptions)257).GetComponent(); CanvasService.CreateButton(_statsView.transform, "P1_" + key, "+1", num2 + num3 - 82f, num + 2f, 34f, 20f, (Action)delegate { CommandSender.StatsAlloc(key, 1); }, 10f, (Color?)new Color(0.12f, 0.18f, 0.12f, 0.9f), (Color?)CanvasService.ACCENT_GOLD, (Color?)null, applyNocturneFont: true); CanvasService.CreateButton(_statsView.transform, "P5_" + key, "+5", num2 + num3 - 42f, num + 2f, 34f, 20f, (Action)delegate { CommandSender.StatsAlloc(key, 5); }, 10f, (Color?)new Color(0.12f, 0.18f, 0.12f, 0.9f), (Color?)CanvasService.ACCENT_GOLD, (Color?)null, applyNocturneFont: true); _stats.Add(new StatRow { Key = key, Value = component, Bonus = component2 }); } private void BuildParagonView() { //IL_0049: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_049c: Unknown result type (might be due to invalid IL or missing references) _paragonView = NewView("ParagonView"); CanvasService.CreatePanel(_paragonView.transform, "A", 14f, 0f, 592f, 104f, (Color?)new Color(0.1f, 0.08f, 0.12f, 0.9f)); _pLevel = CanvasService.CreateText(_paragonView.transform, "PL", "Paragon 0/300", 22f, 8f, 260f, 24f, 18f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257).GetComponent(); _pPoints = CanvasService.CreateText(_paragonView.transform, "PP", "PP: 0 unspent | 0 spent", 22f, 34f, 576f, 18f, 11f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257).GetComponent(); _pXp = CanvasService.CreateText(_paragonView.transform, "PX", "XP: 0/0", 22f, 56f, 576f, 16f, 10.5f, CanvasService.TEXT_DISABLED, (TextAlignmentOptions)257).GetComponent(); GameObject bg = CanvasService.CreatePanel(_paragonView.transform, "PB", 22f, 76f, 576f, 12f, (Color?)new Color(0.1f, 0.1f, 0.1f, 0.9f)); _pXpFill = MakeFill(bg, new Color(0.65f, 0.35f, 0.92f)); CanvasService.CreatePanel(_paragonView.transform, "B", 14f, 112f, 592f, 444f, (Color?)new Color(0.08f, 0.1f, 0.12f, 0.88f)); CanvasService.CreateText(_paragonView.transform, "H", "Perk Board", 22f, 118f, 180f, 18f, 12f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257); float num = 576f; for (int i = 0; i < PerkDefs.Length; i++) { float y = 140 + i * 44; (string, string, string, string[], int[]) tuple = PerkDefs[i]; GameObject val = CanvasService.CreatePanel(_paragonView.transform, "PR_" + tuple.Item1, 22f, y, num, 38f, (Color?)new Color(0.05f, 0.05f, 0.07f, 0.65f)); TextMeshProUGUI component = CanvasService.CreateText(val.transform, "N_" + tuple.Item1, tuple.Item2 + " (" + tuple.Item3 + ")", 6f, 4f, num - 190f, 16f, 11f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); TextMeshProUGUI component2 = CanvasService.CreateText(val.transform, "R_" + tuple.Item1, "R0/3", num - 182f, 4f, 56f, 16f, 10.5f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257).GetComponent(); TextMeshProUGUI component3 = CanvasService.CreateText(val.transform, "D_" + tuple.Item1, "", 6f, 20f, num - 92f, 16f, 10f, CanvasService.TEXT_DISABLED, (TextAlignmentOptions)257).GetComponent(); PerkRow row = new PerkRow { Key = tuple.Item1, Name = tuple.Item2, Alias = tuple.Item3, RankDescriptions = tuple.Item4, RankCosts = tuple.Item5, Root = val, NameTxt = component, RankTxt = component2, DescTxt = component3 }; GameObject val2 = CanvasService.CreateButton(val.transform, "U_" + tuple.Item1, "Upgrade", num - 82f, 8f, 74f, 22f, (Action)delegate { OnPerkUpgrade(row); }, 10f, (Color?)new Color(0.12f, 0.18f, 0.12f, 0.9f), (Color?)CanvasService.ACCENT_GOLD, (Color?)null, applyNocturneFont: true); row.Btn = val2; PerkRow perkRow = row; Transform obj = val2.transform.Find("Text_U_" + tuple.Item1 + "_Label"); perkRow.BtnTxt = ((obj != null) ? ((Component)obj).GetComponent() : null); _perks.Add(row); } } private void RefreshHeader() { string text = ((!string.IsNullOrWhiteSpace(_inspectHeaderName)) ? _inspectHeaderName : (string.IsNullOrEmpty(UIData.PlayerName) ? "Player" : UIData.PlayerName)); if ((Object)(object)_title != (Object)null) { ((TMP_Text)_title).text = text + "'s GOMS Stats"; } } private void RefreshClass() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_0072: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_classView == (Object)null) && _classView.activeSelf) { bool flag = !string.IsNullOrWhiteSpace(UIData.ClassName) && !string.Equals(UIData.ClassName, "None", StringComparison.OrdinalIgnoreCase); Color classColor = CanvasService.GetClassColor(UIData.ClassName); ((TMP_Text)_className).text = (flag ? UIData.ClassName.ToUpperInvariant() : "NO CLASS"); ((Graphic)_className).color = (flag ? classColor : CanvasService.TEXT_DISABLED); ((TMP_Text)_classTitle).text = UIData.ClassTitle ?? ""; ((TMP_Text)_classStacks).text = $"Stacks: {UIData.Stacks}/{Math.Max(1, UIData.MaxStacks)}"; if (UIData.AscendanceLocked) { ((TMP_Text)_classAsc).text = "Ascendance locked (Lv 50)"; } else if (UIData.AscendanceActive) { ((TMP_Text)_classAsc).text = "ASCENDANCE ACTIVE"; } else if (UIData.AscendanceCooldown > 0) { ((TMP_Text)_classAsc).text = $"Ascendance CD: {UIData.AscendanceCooldown}s"; } else { ((TMP_Text)_classAsc).text = ((UIData.Stacks >= Math.Max(1, UIData.MaxStacks)) ? "Ascendance: READY" : ""); } ((TMP_Text)_classPassive).text = (string.IsNullOrWhiteSpace(UIData.ClassPassive) ? "No passive available." : UIData.ClassPassive); ((TMP_Text)_classBurst).text = (string.IsNullOrWhiteSpace(UIData.ClassAscendance) ? "No ascendance available." : UIData.ClassAscendance); } } private void RefreshStats() { SetCurrency("Ichor-Infused Iron Bar", UIData.IronBars); if ((Object)(object)_statsView == (Object)null || !_statsView.activeSelf) { return; } ((TMP_Text)_level).text = (UIData.IsParagon ? $"Paragon {UIData.ParagonLevel}" : $"Level {UIData.Level}"); ((TMP_Text)_gs).text = $"GS: {UIData.GearScore}"; ((TMP_Text)_ap).text = ((UIData.UnspentAP > 0) ? $"AP: {UIData.UnspentAP}" : "AP: 0"); ((TMP_Text)_xp).text = $"XP: {UIData.Experience:F0} / {UIData.ExperienceNeeded:F0}"; SetFill(_xpFill, (UIData.ExperienceNeeded > 0f) ? (UIData.Experience / UIData.ExperienceNeeded) : 0f); using (List.Enumerator enumerator = _stats.GetEnumerator()) { StatRow current; int num; int num2; TextMeshProUGUI bonus; for (; enumerator.MoveNext(); num2 = num, ((TMP_Text)current.Value).text = num2.ToString(), bonus = current.Bonus, ((TMP_Text)bonus).text = current.Key switch { "str" => $"+{UIData.AppliedPhysicalPower:0.##} Phys Power, +{Pct(UIData.AppliedPhysicalLifeLeech)} Leech", "int" => $"+{UIData.AppliedSpellPower:0.##} Spell Power, +{Pct(UIData.AppliedSpellLifeLeech)} Leech", "dex" => "+" + Pct(UIData.AppliedAttackSpeed) + " Attack Speed", "luk" => $"+{Pct(UIData.AppliedPhysicalCritChance)} Phys Crit, +{Pct(UIData.AppliedSpellCritChance)} Spell Crit", "cd" => $"+{Pct(UIData.AppliedPhysicalCritDamage)} Phys CD, +{Pct(UIData.AppliedSpellCritDamage)} Spell CD", "ms" => "+" + Pct(UIData.AppliedMovementSpeed) + " Move Speed", "hp" => $"+{UIData.AppliedMaxHealth:0.#} Max Health", "be" => "+" + Pct(UIData.AppliedReducedBloodDrain) + " Blood Drain Reduction", _ => "", }) { current = enumerator.Current; string key = current.Key; if (key != null) { int length = key.Length; if (length != 2) { if (length == 3) { char c = key[0]; if ((uint)c <= 105u) { if (c != 'd') { if (c == 'i' && key == "int") { num = UIData.StatINT; continue; } } else if (key == "dex") { num = UIData.StatDEX; continue; } } else if (c != 'l') { if (c == 's' && key == "str") { num = UIData.StatSTR; continue; } } else if (key == "luk") { num = UIData.StatLUK; continue; } } } else { char c = key[0]; if ((uint)c <= 99u) { if (c != 'b') { if (c == 'c' && key == "cd") { num = UIData.StatCD; continue; } } else if (key == "be") { num = UIData.StatBE; continue; } } else if (c != 'h') { if (c == 'm' && key == "ms") { num = UIData.StatMS; continue; } } else if (key == "hp") { num = UIData.StatHP; continue; } } } num = 0; } } ((TMP_Text)_applied).text = $"Physical Power: +{UIData.AppliedPhysicalPower:0.##} Spell Power: +{UIData.AppliedSpellPower:0.##}\nPhysical Leech: +{Pct(UIData.AppliedPhysicalLifeLeech)} Spell Leech: +{Pct(UIData.AppliedSpellLifeLeech)}\nAttack Speed: +{Pct(UIData.AppliedAttackSpeed)} Move Speed: +{Pct(UIData.AppliedMovementSpeed)}\nPhys Crit: +{Pct(UIData.AppliedPhysicalCritChance)} / +{Pct(UIData.AppliedPhysicalCritDamage)} dmg\nSpell Crit: +{Pct(UIData.AppliedSpellCritChance)} / +{Pct(UIData.AppliedSpellCritDamage)} dmg\nMax Health: +{UIData.AppliedMaxHealth:0.#} Blood Drain Reduction: +{Pct(UIData.AppliedReducedBloodDrain)}"; } private void RefreshParagon() { //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_paragonView == (Object)null || !_paragonView.activeSelf) { return; } ((TMP_Text)_pLevel).text = $"Paragon {UIData.ParagonLevel}/{UIData.ParagonMaxLevel}"; ((TMP_Text)_pPoints).text = $"PP: {UIData.ParagonUnspentPoints} unspent | {UIData.ParagonSpentPoints} spent"; ((TMP_Text)_pXp).text = $"XP: {UIData.ParagonXP:F0} / {UIData.ParagonXPNeeded:F0}"; SetFill(_pXpFill, (UIData.ParagonXPNeeded > 0f) ? (UIData.ParagonXP / UIData.ParagonXPNeeded) : 0f); foreach (PerkRow perk in _perks) { UIData.ParagonPerkEntry value = null; UIData.ParagonPerks.TryGetValue(perk.Key, out value); int num = Math.Max(0, value?.Rank ?? 0); int num2 = Math.Max(1, value?.MaxRank ?? 3); if (num > num2) { num = num2; } bool flag = num >= num2; int num3 = ((!flag) ? Math.Max(0, value?.NextCost ?? ((num < perk.RankCosts.Length) ? perk.RankCosts[num] : 0)) : 0); string text = ((num > 0 && num - 1 < perk.RankDescriptions.Length) ? perk.RankDescriptions[num - 1] : "Not unlocked"); string value2 = (flag ? "MAXED" : ((!string.IsNullOrWhiteSpace(value?.NextDescription)) ? value.NextDescription : ((num < perk.RankDescriptions.Length) ? perk.RankDescriptions[num] : "Upgrade"))); string text2 = ((!string.IsNullOrWhiteSpace(value?.Alias)) ? value.Alias : perk.Alias); ((TMP_Text)perk.NameTxt).text = perk.Name + " (" + text2 + ")"; ((TMP_Text)perk.RankTxt).text = $"R{num}/{num2}"; ((Graphic)perk.RankTxt).color = (flag ? CanvasService.ACCENT_GOLD : CanvasService.TEXT_SECONDARY); ((TMP_Text)perk.DescTxt).text = (flag ? ("Current: " + text + " | MAXED") : $"Current: {text} | Next: {value2} ({num3} PP)"); perk.Alias = text2; perk.CanUpgrade = !flag && num3 > 0 && UIData.ParagonUnspentPoints >= num3; perk.Btn.SetActive(!flag); if ((Object)(object)perk.BtnTxt != (Object)null) { ((TMP_Text)perk.BtnTxt).text = (perk.CanUpgrade ? "Upgrade" : "Need PP"); } Image component = perk.Btn.GetComponent(); if ((Object)(object)component != (Object)null) { ((Graphic)component).color = (perk.CanUpgrade ? new Color(0.12f, 0.18f, 0.12f, 0.9f) : new Color(0.12f, 0.12f, 0.12f, 0.9f)); } } } private void OnPerkUpgrade(PerkRow row) { if (row == null || string.IsNullOrWhiteSpace(row.Alias)) { OrdainUIBehaviour.EnqueueNotification("Perk is unavailable.", "info", 1.8f); return; } if (!row.CanUpgrade) { OrdainUIBehaviour.EnqueueNotification("Not enough PP for that perk.", "info", 1.8f); return; } CommandSender.ParagonSpend(row.Alias); OrdainUIBehaviour.EnqueueNotification("Upgrade requested: " + row.Name, "info", 1.8f); } private void SetTab(TabKind t, bool force = false) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) if (force || _tab != t) { _tab = t; _classView.SetActive(t == TabKind.Class); _statsView.SetActive(t == TabKind.Stats); _paragonView.SetActive(t == TabKind.Paragon); ((Graphic)_tabBg[0]).color = ((t == TabKind.Stats) ? TabOn : TabOff); ((Graphic)_tabBg[1]).color = ((t == TabKind.Class) ? TabOn : TabOff); ((Graphic)_tabBg[2]).color = ((t == TabKind.Paragon) ? TabOn : TabOff); ((Graphic)_tabLabel[0]).color = ((t == TabKind.Stats) ? CanvasService.ACCENT_GOLD : CanvasService.TEXT_SECONDARY); ((Graphic)_tabLabel[1]).color = ((t == TabKind.Class) ? CanvasService.ACCENT_GOLD : CanvasService.TEXT_SECONDARY); ((Graphic)_tabLabel[2]).color = ((t == TabKind.Paragon) ? CanvasService.ACCENT_GOLD : CanvasService.TEXT_SECONDARY); if (t == TabKind.Stats || t == TabKind.Paragon) { CommandSender.RequestUISync(); } _hash = -1; Refresh(); } } private void BuildCurrencyReadout() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) float num = 406f; CanvasService.CreatePanel(_statsView.transform, "CurBg", num, 8f, 200f, 34f, (Color?)new Color(0.05f, 0.05f, 0.07f, 0.95f)); GameObject val = CanvasService.CreateImage(_statsView.transform, "CurIcon", num + 6f, 14f, 22f, 22f, CanvasService.LoadSpriteFromModImages("currency/currency.png"), (Color?)new Color(1f, 1f, 1f, 1f), preserveAspect: true, raycastTarget: false); _currencyIcon = (((Object)(object)val != (Object)null) ? val.GetComponent() : null); if ((Object)(object)_currencyIcon != (Object)null && (Object)(object)_currencyIcon.sprite == (Object)null) { ((Graphic)_currencyIcon).color = CanvasService.ACCENT_GOLD; } _currencyName = CanvasService.CreateText(_statsView.transform, "CurName", "Ichor-Infused Iron Bar".ToUpperInvariant(), num + 34f, 12f, 160f, 16f, 10.5f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257).GetComponent(); if ((Object)(object)_currencyName != (Object)null) { ((TMP_Text)_currencyName).enableAutoSizing = true; ((TMP_Text)_currencyName).fontSizeMin = 7f; ((TMP_Text)_currencyName).fontSizeMax = 10.5f; ((TMP_Text)_currencyName).enableWordWrapping = false; ((TMP_Text)_currencyName).overflowMode = (TextOverflowModes)1; } _currencyAmount = CanvasService.CreateText(_statsView.transform, "CurAmt", "—", num + 34f, 28f, 160f, 18f, 13f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257).GetComponent(); } public void SetCurrency(string label, long amount) { _currencyLabel = label ?? ""; _currencyValue = amount; if ((Object)(object)_currencyName != (Object)null) { ((TMP_Text)_currencyName).text = _currencyLabel.ToUpperInvariant(); } if ((Object)(object)_currencyAmount != (Object)null) { ((TMP_Text)_currencyAmount).text = ((amount < 0) ? "—" : amount.ToString("N0")); } } private static string Pct(float v) { return $"{Mathf.Max(0f, v) * 100f:0.#}%"; } private Image MakeFill(GameObject bg, Color c) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: 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) //IL_0023: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Fill"); val.transform.SetParent(bg.transform, false); RectTransform obj = val.AddComponent(); obj.anchorMin = Vector2.zero; obj.anchorMax = new Vector2(0f, 1f); obj.offsetMin = Vector2.zero; obj.offsetMax = Vector2.zero; Image obj2 = val.AddComponent(); ((Graphic)obj2).color = c; return obj2; } private void SetFill(Image f, float pct) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)f == (Object)null)) { ((Component)f).GetComponent().anchorMax = new Vector2(Mathf.Clamp01(pct), 1f); } } private int ComputeHash() { return (((((((((int)(17 * 31 + _tab) * 31 + UIData.Level + UIData.ParagonLevel + UIData.GearScore + UIData.UnspentAP) * 31 + (UIData.PlayerName ?? "").GetHashCode()) * 31 + (UIData.ClassName ?? "").GetHashCode() + (UIData.ClassTitle ?? "").GetHashCode()) * 31 + UIData.Stacks + UIData.MaxStacks + UIData.AscendanceCooldown) * 31 + UIData.Experience.GetHashCode() + UIData.ExperienceNeeded.GetHashCode()) * 31 + UIData.StatSTR + UIData.StatINT + UIData.StatDEX + UIData.StatLUK + UIData.StatCD + UIData.StatMS + UIData.StatHP + UIData.StatBE) * 31 + UIData.IronBars.GetHashCode()) * 31 + UIData.AppliedPhysicalPower.GetHashCode() + UIData.AppliedSpellPower.GetHashCode() + UIData.AppliedMaxHealth.GetHashCode()) * 31 + UIData.ParagonXP.GetHashCode() + UIData.ParagonXPNeeded.GetHashCode() + UIData.ParagonUnspentPoints + UIData.ParagonSpentPoints + UIData.ParagonPerks.Count; } } internal class HUDOverlay { private GameObject _xpBarRoot; private Image _xpFill; private TextMeshProUGUI _xpText; private GameObject _stacksRoot; private Image _stacksFill; private TextMeshProUGUI _stacksText; private TextMeshProUGUI _ascText; private GameObject _famRoot; private TextMeshProUGUI _famName; private TextMeshProUGUI _famHP; private Image _famHPFill; private bool _created; private const int CLASS_UNLOCK_LEVEL = 50; public void Create() { if (!_created) { CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService != null) { CreateXPBar(canvasService); CreateStacksBar(canvasService); CreateFamiliarStatus(canvasService); _created = true; } } } public void Refresh() { if (_created) { RefreshXP(); RefreshStacks(); RefreshFamiliar(); } } public void Destroy() { if ((Object)(object)_xpBarRoot != (Object)null) { Object.Destroy((Object)(object)_xpBarRoot); } if ((Object)(object)_stacksRoot != (Object)null) { Object.Destroy((Object)(object)_stacksRoot); } if ((Object)(object)_famRoot != (Object)null) { Object.Destroy((Object)(object)_famRoot); } _created = false; } private void CreateXPBar(CanvasService canvas) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Expected O, but got Unknown //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011f: 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_0188: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) _xpBarRoot = canvas.CreateRootWindow("HUD_XPBar", 600f, 20f, 50); RectTransform component = _xpBarRoot.GetComponent(); component.anchorMin = new Vector2(0.5f, 1f); component.anchorMax = new Vector2(0.5f, 1f); component.pivot = new Vector2(0.5f, 1f); component.anchoredPosition = new Vector2(0f, -4f); Image component2 = _xpBarRoot.GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Graphic)component2).color = new Color(0.08f, 0.06f, 0.1f, 0.85f); } CanvasService.MakeDraggable(_xpBarRoot); HUDPositionService.ApplySaved(_xpBarRoot, "HUD_XPBar"); GameObject val = new GameObject("XP_Fill"); val.transform.SetParent(_xpBarRoot.transform, false); RectTransform obj = val.AddComponent(); obj.anchorMin = Vector2.zero; obj.anchorMax = new Vector2(0f, 1f); obj.offsetMin = Vector2.zero; obj.offsetMax = Vector2.zero; _xpFill = val.AddComponent(); ((Graphic)_xpFill).color = new Color(0.15f, 0.45f, 0.85f, 0.9f); _xpText = CanvasService.CreateText(_xpBarRoot.transform, "XPText", "XP: 0 / 100", 0f, 0f, 600f, 20f, 11f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)514).GetComponent(); } private void RefreshXP() { //IL_0069: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_xpBarRoot == (Object)null)) { _xpBarRoot.SetActive(UIConfig.ShowXPBar && !NativeMenuWatcher.MenuOpen); if (UIConfig.ShowXPBar) { float num = ((UIData.ExperienceNeeded > 0f) ? Mathf.Clamp01(UIData.Experience / UIData.ExperienceNeeded) : 0f); ((Component)_xpFill).GetComponent().anchorMax = new Vector2(num, 1f); ((TMP_Text)_xpText).text = (UIData.IsParagon ? $"PARAGON {UIData.ParagonLevel} | {UIData.Experience:F0} XP" : $"Lv {UIData.Level} {UIData.Experience:F0} / {UIData.ExperienceNeeded:F0} XP"); } } } private void CreateStacksBar(CanvasService canvas) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Expected O, but got Unknown //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) _stacksRoot = canvas.CreateRootWindow("HUD_StacksBar", 320f, 36f, 50); RectTransform component = _stacksRoot.GetComponent(); component.anchorMin = new Vector2(0.5f, 1f); component.anchorMax = new Vector2(0.5f, 1f); component.pivot = new Vector2(0.5f, 1f); component.anchoredPosition = new Vector2(0f, -28f); Image component2 = _stacksRoot.GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Graphic)component2).color = new Color(0.06f, 0.05f, 0.08f, 0.88f); } CanvasService.MakeDraggable(_stacksRoot); HUDPositionService.ApplySaved(_stacksRoot, "HUD_StacksBar"); _stacksText = CanvasService.CreateText(_stacksRoot.transform, "StacksText", "", 0f, 2f, 320f, 16f, 11f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)514).GetComponent(); GameObject val = CanvasService.CreatePanel(_stacksRoot.transform, "StackBg", 10f, 20f, 300f, 10f, (Color?)new Color(0.1f, 0.1f, 0.1f, 0.9f)); GameObject val2 = new GameObject("Stacks_Fill"); val2.transform.SetParent(val.transform, false); RectTransform obj = val2.AddComponent(); obj.anchorMin = Vector2.zero; obj.anchorMax = new Vector2(0f, 1f); obj.offsetMin = Vector2.zero; obj.offsetMax = Vector2.zero; _stacksFill = val2.AddComponent(); ((Graphic)_stacksFill).color = CanvasService.TEXT_PRIMARY; _ascText = CanvasService.CreateText(_stacksRoot.transform, "AscText", "", 0f, 32f, 320f, 14f, 10f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)514).GetComponent(); } private void RefreshStacks() { //IL_006c: 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_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_stacksRoot == (Object)null) { return; } bool flag = UIData.ClassName != "None" && !string.IsNullOrEmpty(UIData.ClassName); bool flag2 = UIData.Level >= 50; _stacksRoot.SetActive(flag && flag2 && UIConfig.ShowClassHUD && !NativeMenuWatcher.MenuOpen); if (flag && flag2) { Color classColor = CanvasService.GetClassColor(UIData.ClassName); int stacks = UIData.Stacks; int num = ((UIData.MaxStacks > 0) ? UIData.MaxStacks : 100); ((TMP_Text)_stacksText).text = $"{UIData.ClassName.ToUpper()} — {stacks}/{num}"; ((Graphic)_stacksText).color = classColor; float num2 = Mathf.Clamp01((float)stacks / (float)num); ((Graphic)_stacksFill).color = classColor; ((Component)_stacksFill).GetComponent().anchorMax = new Vector2(num2, 1f); if (UIData.AscendanceActive) { ((TMP_Text)_ascText).text = "✦ ASCENDANCE ACTIVE ✦"; ((Graphic)_ascText).color = CanvasService.ACCENT_GOLD; } else if (UIData.AscendanceCooldown > 0) { ((TMP_Text)_ascText).text = $"Ascendance CD: {UIData.AscendanceCooldown}s"; ((Graphic)_ascText).color = CanvasService.TEXT_DISABLED; } else if (UIData.AscendanceLocked) { ((TMP_Text)_ascText).text = "Ascendance locked (Lv 50)"; ((Graphic)_ascText).color = CanvasService.TEXT_DISABLED; } else { ((TMP_Text)_ascText).text = ((stacks >= num) ? "Ascendance: READY" : ""); ((Graphic)_ascText).color = CanvasService.ACCENT_GOLD; } } } private void CreateFamiliarStatus(CanvasService canvas) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Expected O, but got Unknown //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: 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_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) _famRoot = canvas.CreateRootWindow("HUD_FamiliarStatus", 180f, 54f, 50); RectTransform component = _famRoot.GetComponent(); component.anchorMin = new Vector2(1f, 0f); component.anchorMax = new Vector2(1f, 0f); component.pivot = new Vector2(1f, 0f); component.anchoredPosition = new Vector2(-8f, 180f); Image component2 = _famRoot.GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Graphic)component2).color = new Color(0.06f, 0.05f, 0.08f, 0.88f); } CanvasService.MakeDraggable(_famRoot); HUDPositionService.ApplySaved(_famRoot, "HUD_FamiliarStatus"); _famName = CanvasService.CreateText(_famRoot.transform, "FamName", "No Familiar", 8f, 6f, 164f, 18f, 12f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); _famHP = CanvasService.CreateText(_famRoot.transform, "FamHP", "", 8f, 24f, 164f, 14f, 10f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257).GetComponent(); GameObject val = CanvasService.CreatePanel(_famRoot.transform, "FamHPBg", 8f, 40f, 164f, 8f, (Color?)new Color(0.1f, 0.1f, 0.1f, 0.9f)); GameObject val2 = new GameObject("FamHP_Fill"); val2.transform.SetParent(val.transform, false); RectTransform obj = val2.AddComponent(); obj.anchorMin = Vector2.zero; obj.anchorMax = new Vector2(1f, 1f); obj.offsetMin = Vector2.zero; obj.offsetMax = Vector2.zero; _famHPFill = val2.AddComponent(); ((Graphic)_famHPFill).color = new Color(0.2f, 0.75f, 0.3f, 0.9f); } private void RefreshFamiliar() { //IL_00ce: 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_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_famRoot == (Object)null)) { _famRoot.SetActive(UIData.FamiliarActive && UIConfig.ShowFamiliarStatus && !NativeMenuWatcher.MenuOpen); if (UIData.FamiliarActive) { string text = UIData.FamiliarRarity ?? "Common"; string text2 = (UIData.FamiliarIsShiny ? " ✦" : ""); string text3 = (string.IsNullOrEmpty(UIData.FamiliarName) ? "Familiar" : UIData.FamiliarName); ((TMP_Text)_famName).text = text3 + text2; Color color = (Color)(text switch { "Uncommon" => new Color(0.3f, 0.8f, 0.3f), "Rare" => new Color(0.3f, 0.5f, 1f), "Epic" => new Color(0.7f, 0.3f, 1f), "Legendary" => new Color(1f, 0.7f, 0.1f), _ => CanvasService.TEXT_SECONDARY, }); ((Graphic)_famName).color = color; float num = ((UIData.FamiliarMaxHP > 0f) ? Mathf.Clamp01(UIData.FamiliarHP / UIData.FamiliarMaxHP) : 1f); ((TMP_Text)_famHP).text = $"HP: {UIData.FamiliarHP:F0} / {UIData.FamiliarMaxHP:F0}"; ((Component)_famHPFill).GetComponent().anchorMax = new Vector2(num, 1f); } } } } internal class IchorHUD { private const float W = 200f; private const float H = 34f; private const float OffsetX = 0f; private const float OffsetY = 150f; private GameObject _root; private TextMeshProUGUI _label; private bool _created; private bool _visible; private long _value; public bool IsVisible => _visible; public void Create() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) if (_created) { return; } CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService != null) { _root = canvasService.CreateRootWindow("HUD_Ichor", 200f, 34f, 59); RectTransform component = _root.GetComponent(); component.anchorMin = new Vector2(0.5f, 0f); component.anchorMax = new Vector2(0.5f, 0f); component.pivot = new Vector2(0.5f, 0f); component.anchoredPosition = new Vector2(0f, 150f); Image component2 = _root.GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Graphic)component2).color = new Color(0f, 0f, 0f, 0.4f); } _label = CanvasService.CreateText(_root.transform, "IchorLabel", "Ichor: 0", 0f, 4f, 200f, 26f, 16f, (Color?)new Color(0.85f, 0.5f, 0.95f, 1f), (TextAlignmentOptions)514, applyNocturneFont: true).GetComponent(); _root.SetActive(false); _created = true; } } public void SetValue(long value) { if (_created) { _value = value; if ((Object)(object)_label != (Object)null) { ((TMP_Text)_label).text = "Ichor: " + _value.ToString(CultureInfo.InvariantCulture); } if (!_visible) { _root.SetActive(true); _visible = true; } } } public void HideCounter() { _value = 0L; if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } _visible = false; } public void Dispose() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _created = false; _visible = false; } } internal class ImagePreviewPanel { private const float Width = 820f; private const float Height = 640f; private const float Pad = 16f; private GameObject _root; private bool _visible; private string _lastRequest = ""; private TextMeshProUGUI _title; private TextMeshProUGUI _pathText; private TextMeshProUGUI _statusText; private Image _previewImage; public bool IsVisible => _visible; public void Show(string imageRequest) { if ((Object)(object)_root == (Object)null) { Create(); } _visible = true; _root.SetActive(true); Refresh(imageRequest); } public void Hide() { if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } _visible = false; } public void Dispose() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; _visible = false; } public void Refresh(string imageRequest) { if (!_visible || (Object)(object)_root == (Object)null) { return; } _lastRequest = imageRequest ?? ""; if ((Object)(object)_title != (Object)null) { ((TMP_Text)_title).text = "Image Preview"; } if ((Object)(object)_pathText != (Object)null) { ((TMP_Text)_pathText).text = (string.IsNullOrWhiteSpace(_lastRequest) ? "Requested: default" : ("Requested: " + _lastRequest)); } string resolvedPath; Sprite val = ResolveSprite(_lastRequest, out resolvedPath); if ((Object)(object)val != (Object)null) { if ((Object)(object)_previewImage != (Object)null) { _previewImage.sprite = val; ((Behaviour)_previewImage).enabled = true; } if ((Object)(object)_statusText != (Object)null) { ((TMP_Text)_statusText).text = (string.IsNullOrWhiteSpace(resolvedPath) ? "" : ("Loaded: " + resolvedPath)); } } else { if ((Object)(object)_previewImage != (Object)null) { _previewImage.sprite = null; ((Behaviour)_previewImage).enabled = false; } if ((Object)(object)_statusText != (Object)null) { ((TMP_Text)_statusText).text = "Image not found.\nTry: titles/slayer or players/spence or classes/frost"; } } } private void Create() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0271: 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) CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService != null) { _root = canvasService.CreateRootWindow("ImagePreviewPanel", 820f, 640f, 214); GameObject val = CanvasService.CreatePanel(_root.transform, "Header", 0f, 0f, 820f, 44f, CanvasService.BG_HEADER); _title = CanvasService.CreateText(val.transform, "Title", "Image Preview", 12f, 10f, 752f, 24f, 15f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)4097).GetComponent(); CanvasService.CreateCloseButton(_root.transform, 820f, delegate { Hide(); }); CanvasService.MakeDraggable(_root, val.transform); float num = 54f; float num2 = 640f - num - 58f; GameObject val2 = CanvasService.CreatePanel(_root.transform, "Body", 16f, num, 788f, num2, (Color?)new Color(0.1f, 0.1f, 0.13f, 0.95f)); float num3 = 776f; float num4 = num2 - 76f; _previewImage = CanvasService.CreateImage(val2.transform, "Image", 6f, 6f, num3, num4, null, Color.white).GetComponent(); ((Behaviour)_previewImage).enabled = false; _pathText = CanvasService.CreateText(val2.transform, "PathText", "Requested: default", 8f, num4 + 14f, num3 - 4f, 20f, 11.5f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)4097).GetComponent(); _statusText = CanvasService.CreateText(val2.transform, "StatusText", "", 8f, num4 + 36f, num3 - 4f, 32f, 11f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)4097).GetComponent(); CanvasService.CreateButton(_root.transform, "Back", "< Back", 16f, 606f, 104f, 24f, (Action)delegate { Hide(); }, 11f, (Color?)new Color(0.12f, 0.1f, 0.14f, 0.85f), (Color?)CanvasService.TEXT_SECONDARY, (Color?)null, applyNocturneFont: true); HUDPositionService.ApplySaved(_root, "ImagePreviewPanel"); _root.SetActive(false); } } private static Sprite ResolveSprite(string request, out string resolvedPath) { resolvedPath = ""; string normalizedKey = NormalizeToken(request); List list = BuildCandidates(request, normalizedKey); for (int i = 0; i < list.Count; i++) { string text = list[i]; Sprite val = CanvasService.LoadSpriteFromModImages(text); if ((Object)(object)val != (Object)null) { resolvedPath = text; return val; } } return null; } private static List BuildCandidates(string raw, string normalizedKey) { List list = new List(20); string text = (raw ?? "").Trim(); if (!string.IsNullOrWhiteSpace(text)) { string text2 = text.Replace('\\', '/').TrimStart('/'); list.Add(text2); if (!HasKnownExtension(text2)) { list.Add(text2 + ".png"); list.Add(text2 + ".jpg"); list.Add(text2 + ".jpeg"); } } if (!string.IsNullOrWhiteSpace(normalizedKey)) { list.Add("titles/" + normalizedKey + ".png"); list.Add("titles/" + normalizedKey + ".jpg"); list.Add("titles/" + normalizedKey + ".jpeg"); list.Add("players/" + normalizedKey + ".png"); list.Add("players/" + normalizedKey + ".jpg"); list.Add("players/" + normalizedKey + ".jpeg"); list.Add("classes/" + normalizedKey + ".png"); list.Add("classes/" + normalizedKey + ".jpg"); list.Add("classes/" + normalizedKey + ".jpeg"); list.Add(normalizedKey + ".png"); list.Add(normalizedKey + ".jpg"); list.Add(normalizedKey + ".jpeg"); } list.Add("default.png"); list.Add("default.jpg"); HashSet hashSet = new HashSet(StringComparer.OrdinalIgnoreCase); List list2 = new List(list.Count); for (int i = 0; i < list.Count; i++) { string text3 = list[i]; if (!string.IsNullOrWhiteSpace(text3) && hashSet.Add(text3)) { list2.Add(text3); } } return list2; } private static bool HasKnownExtension(string value) { if (string.IsNullOrWhiteSpace(value)) { return false; } string text = value.ToLowerInvariant(); if (!text.EndsWith(".png") && !text.EndsWith(".jpg")) { return text.EndsWith(".jpeg"); } return true; } private static string NormalizeToken(string value) { if (string.IsNullOrWhiteSpace(value)) { return ""; } string text = value.Trim().ToLowerInvariant(); StringBuilder stringBuilder = new StringBuilder(text.Length); bool flag = false; foreach (char c in text) { if (char.IsLetterOrDigit(c) || c == '-' || c == '.') { stringBuilder.Append(c); flag = false; } else if ((char.IsWhiteSpace(c) || c == '_') && !flag) { stringBuilder.Append('_'); flag = true; } } return stringBuilder.ToString().Trim('_'); } } internal class InspectPlayerPanel { private const float Width = 760f; private const float Height = 720f; private const float Pad = 18f; private GameObject _root; private bool _visible; private readonly Action _onClose; private string _targetHint = ""; private int _hash = -1; private TextMeshProUGUI _title; private Image _portraitImage; private TextMeshProUGUI _portraitText; private TextMeshProUGUI _classLine; private TextMeshProUGUI _levelLine; private TextMeshProUGUI _titleLine; private TextMeshProUGUI _leaderboardBody; private TextMeshProUGUI _appliedLevelsBody; private TextMeshProUGUI _appliedParagonBody; public bool IsVisible => _visible; public InspectPlayerPanel(Action onClose = null) { _onClose = onClose; } public void Show(string targetName = "") { _targetHint = targetName ?? ""; if ((Object)(object)_root == (Object)null) { Create(); } _visible = true; _root.SetActive(true); _hash = -1; Refresh(); } public void Hide() { if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } _visible = false; } public void Dispose() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; _visible = false; } public void Refresh() { if (_visible && !((Object)(object)_root == (Object)null)) { int num = ComputeHash(); if (num != _hash) { _hash = num; RefreshHeaderAndIdentity(); RefreshLeaderboardBlock(); RefreshAppliedStatsBlock(); } } } private void Create() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_046e: Unknown result type (might be due to invalid IL or missing references) //IL_04af: Unknown result type (might be due to invalid IL or missing references) //IL_04f7: Unknown result type (might be due to invalid IL or missing references) //IL_0569: Unknown result type (might be due to invalid IL or missing references) //IL_05ae: Unknown result type (might be due to invalid IL or missing references) //IL_0633: Unknown result type (might be due to invalid IL or missing references) //IL_063d: Unknown result type (might be due to invalid IL or missing references) CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService != null) { _root = canvasService.CreateRootWindow("InspectPlayerPanel", 760f, 720f, 206); GameObject val = CanvasService.CreatePanel(_root.transform, "Header", 0f, 0f, 760f, 44f, CanvasService.BG_HEADER); _title = CanvasService.CreateText(val.transform, "Title", "Inspect Player", 12f, 10f, 692f, 24f, 15f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)4097).GetComponent(); CanvasService.CreateCloseButton(_root.transform, 760f, delegate { CloseFromUI(); }); CanvasService.MakeDraggable(_root, val.transform); float num = 56f; float num2 = 118f; float num3 = 118f; float num4 = 18f + num2 + 12f; float num5 = 742f - num4; float height = num3; GameObject val2 = CanvasService.CreatePanel(_root.transform, "PortraitCard", 18f, num, num2, num3, (Color?)new Color(0.16f, 0.14f, 0.18f, 0.94f)); _portraitImage = CanvasService.CreateImage(val2.transform, "Portrait", 5f, 5f, num2 - 10f, num3 - 10f, null, Color.white).GetComponent(); ((Behaviour)_portraitImage).enabled = false; _portraitText = CanvasService.CreateText(val2.transform, "PortraitText", "PLAYER", 0f, 0f, num2, num3, 17f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)514).GetComponent(); CanvasService.CreatePanel(_root.transform, "IdentityCard", num4, num, num5, height, (Color?)new Color(0.18f, 0.17f, 0.19f, 0.94f)); _classLine = CanvasService.CreateText(_root.transform, "IdentityClass", "Class: None", num4 + 14f, num + 16f, num5 - 28f, 24f, 15f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); _levelLine = CanvasService.CreateText(_root.transform, "IdentityLevel", "Level: 0 Paragon: 0", num4 + 14f, num + 46f, num5 - 28f, 24f, 15f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); _titleLine = CanvasService.CreateText(_root.transform, "IdentityTitle", "Title: None", num4 + 14f, num + 76f, num5 - 28f, 24f, 15f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); float num6 = num + num3 + 12f; float num7 = 128f; CanvasService.CreatePanel(_root.transform, "LeaderboardCard", 18f, num6, 724f, num7, (Color?)new Color(0.17f, 0.17f, 0.18f, 0.94f)); CanvasService.CreateText(_root.transform, "LeaderboardHeading", "Leaderboard information", 30f, num6 + 10f, 300f, 22f, 14f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257); _leaderboardBody = CanvasService.CreateText(_root.transform, "LeaderboardBody", "", 30f, num6 + 34f, 700f, num7 - 42f, 11.2f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); ((TMP_Text)_leaderboardBody).enableWordWrapping = true; ((TMP_Text)_leaderboardBody).overflowMode = (TextOverflowModes)0; float num8 = num6 + num7 + 12f; float num9 = 720f - num8 - 52f; CanvasService.CreatePanel(_root.transform, "AppliedCard", 18f, num8, 724f, num9, (Color?)new Color(0.15f, 0.15f, 0.17f, 0.94f)); CanvasService.CreateText(_root.transform, "AppliedHeading", "Applied stats", 30f, num8 + 10f, 220f, 22f, 14f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257); _appliedLevelsBody = CanvasService.CreateText(_root.transform, "AppliedLevelsBody", "", 30f, num8 + 38f, 700f, 130f, 11.2f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); ((TMP_Text)_appliedLevelsBody).enableWordWrapping = true; ((TMP_Text)_appliedLevelsBody).overflowMode = (TextOverflowModes)0; CanvasService.CreateDivider(_root.transform, "AppliedSplit", 28f, num8 + 176f, 704f, 1f, (Color?)new Color(0.44f, 0.42f, 0.38f, 0.7f)); _appliedParagonBody = CanvasService.CreateText(_root.transform, "AppliedParagonBody", "", 30f, num8 + 188f, 700f, num9 - 198f, 11.2f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); ((TMP_Text)_appliedParagonBody).enableWordWrapping = true; ((TMP_Text)_appliedParagonBody).overflowMode = (TextOverflowModes)0; CanvasService.CreateButton(_root.transform, "Back", "< Back", 18f, 686f, 104f, 24f, (Action)delegate { CloseFromUI(); }, 11f, (Color?)new Color(0.12f, 0.1f, 0.14f, 0.85f), (Color?)CanvasService.TEXT_SECONDARY, (Color?)null, applyNocturneFont: true); HUDPositionService.ApplySaved(_root, "InspectPlayerPanel"); _root.SetActive(false); } } private void CloseFromUI() { Hide(); _onClose?.Invoke(); } private void RefreshHeaderAndIdentity() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) string text = ResolveInspectName(); string text2 = ResolveClassName(); int value = ResolveLevel(); int value2 = ResolveParagonLevel(); if ((Object)(object)_title != (Object)null) { ((TMP_Text)_title).text = "Inspect: " + EscapeRichText(text); } if ((Object)(object)_portraitText != (Object)null) { ((TMP_Text)_portraitText).text = BuildPortraitLabel(text); } if ((Object)(object)_classLine != (Object)null) { string value3 = ColorToHex(CanvasService.GetClassColor(text2)); ((TMP_Text)_classLine).text = $"Class: {EscapeRichText(text2)}"; } RefreshPortrait(text, text2); if ((Object)(object)_levelLine != (Object)null) { ((TMP_Text)_levelLine).text = $"Level: {value} Paragon: {value2}"; } if ((Object)(object)_titleLine != (Object)null) { if (string.IsNullOrWhiteSpace(UIData.InspectTitle)) { ((TMP_Text)_titleLine).text = "Title: None"; return; } string value4 = NormalizeHexColor(UIData.InspectTitleColor); ((TMP_Text)_titleLine).text = $"Title: {EscapeRichText(UIData.InspectTitle)}"; } } private void RefreshLeaderboardBlock() { if (!((Object)(object)_leaderboardBody == (Object)null)) { StringBuilder stringBuilder = new StringBuilder(300); stringBuilder.Append("Level ").Append(FormatRank(UIData.InspectLevelRank)); stringBuilder.Append(" VBlood ").Append(FormatRank(UIData.InspectVBloodRank)); stringBuilder.Append(" Monster ").Append(FormatRank(UIData.InspectMonsterRank)).Append('\n'); stringBuilder.Append("WorldFirst ").Append(FormatRank(UIData.InspectWorldFirstRank)); stringBuilder.Append(" Familiars ").Append(FormatRank(UIData.InspectFamiliarRank)); stringBuilder.Append(" EventPts ").Append(FormatRank(UIData.InspectEventPointsRank)); stringBuilder.Append(" EventWins ").Append(FormatRank(UIData.InspectEventWinsRank)).Append('\n'); stringBuilder.Append("Totals: "); stringBuilder.Append(UIData.InspectVBloodKills.ToString("N0", CultureInfo.InvariantCulture)).Append(" vblood, "); stringBuilder.Append(UIData.InspectMonsterKills.ToString("N0", CultureInfo.InvariantCulture)).Append(" monster kills, "); stringBuilder.Append(UIData.InspectWorldFirsts.ToString("N0", CultureInfo.InvariantCulture)).Append(" world firsts, "); stringBuilder.Append(UIData.InspectFamiliarsUnlocked.ToString("N0", CultureInfo.InvariantCulture)).Append(" familiars, "); stringBuilder.Append(UIData.InspectEventPoints.ToString("N0", CultureInfo.InvariantCulture)).Append(" event points, "); stringBuilder.Append(UIData.InspectEventWins.ToString("N0", CultureInfo.InvariantCulture)).Append(" wins, "); stringBuilder.Append(UIData.InspectEventParticipations.ToString("N0", CultureInfo.InvariantCulture)).Append(" participations"); ((TMP_Text)_leaderboardBody).text = stringBuilder.ToString(); } } private void RefreshAppliedStatsBlock() { if ((Object)(object)_appliedLevelsBody != (Object)null) { ((TMP_Text)_appliedLevelsBody).text = "Applied Stats from levels\n" + $"Physical Power +{UIData.AppliedPhysicalPower:0.##} Spell Power +{UIData.AppliedSpellPower:0.##}\n" + $"Physical Leech +{Percent(UIData.AppliedPhysicalLifeLeech)} Spell Leech +{Percent(UIData.AppliedSpellLifeLeech)}\n" + $"Attack Speed +{Percent(UIData.AppliedAttackSpeed)} Move Speed +{Percent(UIData.AppliedMovementSpeed)}\n" + $"Phys Crit +{Percent(UIData.AppliedPhysicalCritChance)} / +{Percent(UIData.AppliedPhysicalCritDamage)} dmg\n" + $"Spell Crit +{Percent(UIData.AppliedSpellCritChance)} / +{Percent(UIData.AppliedSpellCritDamage)} dmg\n" + $"Max Health +{UIData.AppliedMaxHealth:0.#} Blood Drain Reduction +{Percent(UIData.AppliedReducedBloodDrain)}"; } if (!((Object)(object)_appliedParagonBody != (Object)null)) { return; } int value = ResolveParagonLevel(); StringBuilder stringBuilder = new StringBuilder(280); stringBuilder.Append("Applied Stats from Paragons\n"); stringBuilder.Append("Paragon Level ").Append(value); stringBuilder.Append(" Spent PP ").Append(Math.Max(0, UIData.ParagonSpentPoints)); stringBuilder.Append(" Unspent PP ").Append(Math.Max(0, UIData.ParagonUnspentPoints)).Append('\n'); List list = CollectUnlockedPerks(); if (list.Count == 0) { stringBuilder.Append("No unlocked paragon perks."); } else { int num = Math.Min(6, list.Count); for (int i = 0; i < num; i++) { UIData.ParagonPerkEntry paragonPerkEntry = list[i]; string value2 = (string.IsNullOrWhiteSpace(paragonPerkEntry.Name) ? paragonPerkEntry.Key : paragonPerkEntry.Name); stringBuilder.Append(EscapeRichText(value2)); stringBuilder.Append(" R").Append(Math.Max(0, paragonPerkEntry.Rank)).Append("/") .Append(Math.Max(1, paragonPerkEntry.MaxRank)); if (i < num - 1) { stringBuilder.Append(" | "); } } if (list.Count > num) { stringBuilder.Append(" | +").Append(list.Count - num).Append(" more"); } } ((TMP_Text)_appliedParagonBody).text = stringBuilder.ToString(); } private static List CollectUnlockedPerks() { List list = new List(); foreach (KeyValuePair paragonPerk in UIData.ParagonPerks) { UIData.ParagonPerkEntry value = paragonPerk.Value; if (value != null && value.Rank > 0) { list.Add(value); } } list.Sort(delegate(UIData.ParagonPerkEntry a, UIData.ParagonPerkEntry b) { string strA = (string.IsNullOrWhiteSpace(a.Name) ? a.Key : a.Name); string strB = (string.IsNullOrWhiteSpace(b.Name) ? b.Key : b.Name); return string.Compare(strA, strB, StringComparison.OrdinalIgnoreCase); }); return list; } private string ResolveInspectName() { if (!string.IsNullOrWhiteSpace(UIData.InspectName)) { return UIData.InspectName; } if (!string.IsNullOrWhiteSpace(_targetHint)) { return _targetHint; } if (!string.IsNullOrWhiteSpace(UIData.PlayerName)) { return UIData.PlayerName; } return "Player"; } private string ResolveClassName() { if (!string.IsNullOrWhiteSpace(UIData.InspectClassName)) { return UIData.InspectClassName; } if (!string.IsNullOrWhiteSpace(UIData.ClassName)) { return UIData.ClassName; } return "None"; } private int ResolveLevel() { if (UIData.InspectLevel > 0) { return UIData.InspectLevel; } return Math.Max(0, UIData.Level); } private int ResolveParagonLevel() { if (UIData.InspectParagonLevel > 0) { return UIData.InspectParagonLevel; } return Math.Max(0, UIData.ParagonLevel); } private int ComputeHash() { int num = 17; num = num * 31 + (_targetHint ?? "").GetHashCode(); num = num * 31 + (UIData.InspectName ?? "").GetHashCode(); num = num * 31 + (UIData.InspectPortraitKey ?? "").GetHashCode(); num = num * 31 + (UIData.InspectTitle ?? "").GetHashCode(); num = num * 31 + (UIData.InspectTitleColor ?? "").GetHashCode(); num = num * 31 + (UIData.InspectClassName ?? "").GetHashCode(); num = num * 31 + UIData.InspectLevel + UIData.InspectParagonLevel; num = num * 31 + UIData.Level + UIData.ParagonLevel; num = num * 31 + UIData.InspectLevelRank + UIData.InspectVBloodRank + UIData.InspectMonsterRank; num = num * 31 + UIData.InspectWorldFirstRank + UIData.InspectFamiliarRank + UIData.InspectEventPointsRank + UIData.InspectEventWinsRank; num = num * 31 + UIData.InspectVBloodKills + UIData.InspectWorldFirsts + UIData.InspectFamiliarsUnlocked; num = num * 31 + UIData.InspectEventPoints + UIData.InspectEventWins + UIData.InspectEventParticipations; num = num * 31 + UIData.InspectMonsterKills.GetHashCode(); num = num * 31 + UIData.AppliedPhysicalPower.GetHashCode() + UIData.AppliedSpellPower.GetHashCode(); num = num * 31 + UIData.AppliedPhysicalLifeLeech.GetHashCode() + UIData.AppliedSpellLifeLeech.GetHashCode(); num = num * 31 + UIData.AppliedAttackSpeed.GetHashCode() + UIData.AppliedMovementSpeed.GetHashCode(); num = num * 31 + UIData.AppliedPhysicalCritChance.GetHashCode() + UIData.AppliedSpellCritChance.GetHashCode(); num = num * 31 + UIData.AppliedPhysicalCritDamage.GetHashCode() + UIData.AppliedSpellCritDamage.GetHashCode(); num = num * 31 + UIData.AppliedMaxHealth.GetHashCode() + UIData.AppliedReducedBloodDrain.GetHashCode(); num = num * 31 + UIData.ParagonSpentPoints + UIData.ParagonUnspentPoints + UIData.ParagonPerks.Count; int num2 = 0; foreach (KeyValuePair paragonPerk in UIData.ParagonPerks) { UIData.ParagonPerkEntry value = paragonPerk.Value; if (value != null) { num2 ^= (paragonPerk.Key?.GetHashCode() ?? 0) ^ (value.Rank * 397) ^ (value.MaxRank * 97); } } return num * 31 + num2; } private static string FormatRank(int rank) { if (rank <= 0) { return "-"; } return $"#{rank}"; } private static string Percent(float value) { return $"{Mathf.Max(0f, value) * 100f:0.#}%"; } private void RefreshPortrait(string inspectName, string className) { if (!((Object)(object)_portraitImage == (Object)null) && !((Object)(object)_portraitText == (Object)null)) { Sprite val = ResolvePortraitSprite(inspectName, className); if ((Object)(object)val != (Object)null) { _portraitImage.sprite = val; ((Behaviour)_portraitImage).enabled = true; ((TMP_Text)_portraitText).text = ""; } else { ((Behaviour)_portraitImage).enabled = false; _portraitImage.sprite = null; ((TMP_Text)_portraitText).text = BuildPortraitLabel(inspectName); } } } private static Sprite ResolvePortraitSprite(string inspectName, string className) { List list = new List(24); AddDirectPathCandidates(list, UIData.InspectPortraitKey); AddPortraitCandidates(list, "titles", UIData.InspectPortraitKey); AddPortraitCandidates(list, "titles", UIData.InspectTitle); AddPortraitCandidates(list, "players", inspectName); AddPortraitCandidates(list, "classes", className); AddFlatCandidates(list, UIData.InspectPortraitKey); AddFlatCandidates(list, UIData.InspectTitle); AddFlatCandidates(list, inspectName); list.Add("default.png"); list.Add("default.jpg"); for (int i = 0; i < list.Count; i++) { Sprite val = CanvasService.LoadSpriteFromModImages(list[i]); if ((Object)(object)val != (Object)null) { return val; } } return null; } private static void AddDirectPathCandidates(List candidates, string rawKey) { string text = NormalizePathAssetToken(rawKey); if (!string.IsNullOrWhiteSpace(text)) { if (HasKnownExtension(text)) { candidates.Add(text); return; } candidates.Add(text + ".png"); candidates.Add(text + ".jpg"); candidates.Add(text + ".jpeg"); } } private static void AddPortraitCandidates(List candidates, string folder, string rawKey) { string text = NormalizeAssetToken(rawKey); if (!string.IsNullOrWhiteSpace(text)) { candidates.Add(folder + "/" + text + ".png"); candidates.Add(folder + "/" + text + ".jpg"); candidates.Add(folder + "/" + text + ".jpeg"); } } private static void AddFlatCandidates(List candidates, string rawKey) { string text = NormalizeAssetToken(rawKey); if (!string.IsNullOrWhiteSpace(text)) { candidates.Add(text + ".png"); candidates.Add(text + ".jpg"); candidates.Add(text + ".jpeg"); } } private static string BuildPortraitLabel(string name) { if (string.IsNullOrWhiteSpace(name)) { return "PLAYER"; } string text = name.Trim(); int num = text.IndexOf(' '); if (num > 0) { text = text.Substring(0, num); } if (text.Length > 12) { text = text.Substring(0, 12); } return text.ToUpperInvariant(); } private static string NormalizeAssetToken(string value) { if (string.IsNullOrWhiteSpace(value)) { return ""; } string text = value.Trim().ToLowerInvariant(); StringBuilder stringBuilder = new StringBuilder(text.Length); bool flag = false; foreach (char c in text) { if (char.IsLetterOrDigit(c) || c == '-' || c == '.') { stringBuilder.Append(c); flag = false; } else if ((char.IsWhiteSpace(c) || c == '_') && !flag) { stringBuilder.Append('_'); flag = true; } } return stringBuilder.ToString().Trim('_'); } private static string NormalizePathAssetToken(string value) { if (string.IsNullOrWhiteSpace(value)) { return ""; } string text = value.Trim().Replace('\\', '/').ToLowerInvariant(); if (text.Contains("..", StringComparison.Ordinal)) { return ""; } StringBuilder stringBuilder = new StringBuilder(text.Length); bool flag = false; bool flag2 = false; foreach (char c in text) { if (!char.IsLetterOrDigit(c)) { switch (c) { case '-': case '.': case '_': break; case '/': if (!flag && stringBuilder.Length > 0) { stringBuilder.Append('/'); flag = true; flag2 = false; } continue; default: if (char.IsWhiteSpace(c) && !flag2) { stringBuilder.Append('_'); flag2 = true; flag = false; } continue; } } stringBuilder.Append(c); flag = false; flag2 = false; } return stringBuilder.ToString().Trim('/').Trim('_'); } private static bool HasKnownExtension(string value) { if (string.IsNullOrWhiteSpace(value)) { return false; } string text = value.ToLowerInvariant(); if (!text.EndsWith(".png", StringComparison.Ordinal) && !text.EndsWith(".jpg", StringComparison.Ordinal)) { return text.EndsWith(".jpeg", StringComparison.Ordinal); } return true; } private static string NormalizeHexColor(string value) { if (string.IsNullOrWhiteSpace(value)) { return "#FFD700"; } string text = value.Trim(); if (!text.StartsWith("#", StringComparison.Ordinal)) { return "#FFD700"; } if (text.Length != 7 && text.Length != 9) { return "#FFD700"; } return text; } private static string ColorToHex(Color color) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return "#" + ColorUtility.ToHtmlStringRGB(color); } private static string EscapeRichText(string value) { if (string.IsNullOrEmpty(value)) { return ""; } return value.Replace("<", "").Replace(">", ""); } } internal class LeaderboardPanel { private sealed class RowWidgets { public GameObject Root; public RectTransform Rect; public Image Bg; public TextMeshProUGUI Rank; public TextMeshProUGUI Name; public TextMeshProUGUI Value; } private sealed class BoardDef { public string Type; public string Label; } private GameObject _root; private bool _visible; private readonly Action _onBack; private TextMeshProUGUI _txtStatus; private TextMeshProUGUI _txtSelf; private readonly List _boards = new List(); private readonly List _tabImages = new List(); private readonly List _tabLabels = new List(); private RectTransform _viewportRect; private RectTransform _contentRect; private RectTransform _scrollTrackRect; private RectTransform _scrollThumbRect; private readonly List _rowPool = new List(); private string _activeBoardType = "Level"; private float _scrollOffset; private float _contentHeight; private bool _draggingScroll; private int _lastHash = -1; private const float W = 480f; private const float H = 560f; private const float PAD = 14f; private const float LIST_Y = 134f; private const float LIST_H = 382f; private const float VIEW_X = 22f; private const float VIEW_Y = 142f; private const float VIEW_H = 366f; private const float VIEW_W = 422f; private const float TRACK_X = 454f; private const float TRACK_Y = 142f; private const float TRACK_W = 6f; private const float TRACK_H = 366f; private const float ROW_H = 34f; private const float ROW_GAP = 4f; private const float ROW_STEP = 38f; private static readonly Color TabActive = new Color(0.2f, 0.12f, 0.05f, 0.95f); private static readonly Color TabInactive = new Color(0.12f, 0.1f, 0.14f, 0.85f); public bool IsVisible => _visible; public LeaderboardPanel(Action onBack = null) { _onBack = onBack; } public void Show() { if ((Object)(object)_root == (Object)null) { Create(); } _visible = true; _root.SetActive(true); _lastHash = -1; RequestBoard(force: true); Refresh(); } public void Hide() { if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } _draggingScroll = false; _visible = false; } public void Refresh() { if (_visible && !((Object)(object)_root == (Object)null)) { int num = ComputeHash(); if (num != _lastHash) { _lastHash = num; RefreshStatus(); RebuildRows(); } } } public void TickInput() { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) if (!_visible || (Object)(object)_root == (Object)null || (Object)(object)_viewportRect == (Object)null || (Object)(object)_scrollTrackRect == (Object)null) { return; } bool flag = IsPointerOver(_viewportRect); bool flag2 = IsPointerOver(_scrollTrackRect); bool flag3 = (Object)(object)_scrollThumbRect != (Object)null && ((Component)_scrollThumbRect).gameObject.activeSelf && IsPointerOver(_scrollThumbRect); float y = Input.mouseScrollDelta.y; if (Mathf.Abs(y) > 0.01f && (flag || flag2 || flag3)) { SetScrollOffset(_scrollOffset - y * 44f); } if (Input.GetMouseButtonDown(0) && (flag2 || flag3)) { _draggingScroll = true; UpdateScrollFromMouse(Input.mousePosition.y); } if (_draggingScroll) { if (Input.GetMouseButton(0)) { UpdateScrollFromMouse(Input.mousePosition.y); } else { _draggingScroll = false; } } } public void Dispose() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; _visible = false; _draggingScroll = false; } private void Create() { //IL_004f: 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) CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService != null) { _root = canvasService.CreateRootWindow("LeaderboardPanel", 480f, 560f, 202); GameObject val = CanvasService.CreatePanel(_root.transform, "Header", 0f, 0f, 480f, 44f, CanvasService.BG_HEADER); CanvasService.CreateText(val.transform, "Title", "LEADERBOARDS", 16f, 12f, 420f, 24f, 16f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)4097); CanvasService.CreateCloseButton(_root.transform, 480f, delegate { Hide(); }); CanvasService.MakeDraggable(_root, val.transform); CanvasService.CreateDivider(_root.transform, "D0", 0f, 44f, 480f); BuildBoards(); BuildTabs(); BuildList(); BuildBottom(); HUDPositionService.ApplySaved(_root, "LeaderboardPanel"); SetTabVisuals(); _root.SetActive(false); } } private void BuildBoards() { _boards.Clear(); _boards.Add(new BoardDef { Type = "Level", Label = "Level" }); _boards.Add(new BoardDef { Type = "VBloodKills", Label = "VBlood" }); _boards.Add(new BoardDef { Type = "MonsterKills", Label = "Monster" }); _boards.Add(new BoardDef { Type = "WorldFirsts", Label = "World1st" }); _boards.Add(new BoardDef { Type = "Familiars", Label = "Familiars" }); _boards.Add(new BoardDef { Type = "EventPoints", Label = "EPoints" }); _boards.Add(new BoardDef { Type = "EventWins", Label = "EWins" }); } private void BuildTabs() { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) float num = 14f; for (int i = 0; i < _boards.Count; i++) { int index = i; BoardDef boardDef = _boards[i]; GameObject val = CanvasService.CreateButton(_root.transform, "Tab_" + boardDef.Type, boardDef.Label, num, 58f, 60f, 24f, delegate { SetBoard(_boards[index].Type); }, 9.5f, TabInactive, CanvasService.TEXT_SECONDARY); _tabImages.Add(val.GetComponent()); _tabLabels.Add(val.GetComponentInChildren()); num += 64f; } _txtStatus = CanvasService.CreateText(_root.transform, "Status", "", 14f, 88f, 452f, 20f, 11f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257).GetComponent(); CanvasService.CreateDivider(_root.transform, "D1", 14f, 114f, 452f); } private void BuildList() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Expected O, but got Unknown //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: 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) CanvasService.CreatePanel(_root.transform, "ListBg", 14f, 134f, 452f, 382f, (Color?)new Color(0.07f, 0.07f, 0.1f, 0.9f)); GameObject val = new GameObject("LeaderboardViewport"); val.transform.SetParent(_root.transform, false); _viewportRect = val.AddComponent(); _viewportRect.anchorMin = new Vector2(0f, 1f); _viewportRect.anchorMax = new Vector2(0f, 1f); _viewportRect.pivot = new Vector2(0f, 1f); _viewportRect.anchoredPosition = new Vector2(22f, -142f); _viewportRect.sizeDelta = new Vector2(422f, 366f); ((Graphic)val.AddComponent()).color = new Color(0f, 0f, 0f, 0.01f); val.AddComponent(); GameObject val2 = new GameObject("LeaderboardContent"); val2.transform.SetParent(val.transform, false); _contentRect = val2.AddComponent(); _contentRect.anchorMin = new Vector2(0f, 1f); _contentRect.anchorMax = new Vector2(0f, 1f); _contentRect.pivot = new Vector2(0f, 1f); _contentRect.anchoredPosition = Vector2.zero; _contentRect.sizeDelta = new Vector2(418f, 0f); GameObject val3 = CanvasService.CreatePanel(_root.transform, "ScrollTrack", 454f, 142f, 6f, 366f, (Color?)new Color(0.2f, 0.13f, 0.13f, 0.9f)); _scrollTrackRect = val3.GetComponent(); GameObject val4 = CanvasService.CreatePanel(val3.transform, "ScrollThumb", 0f, 0f, 6f, 52f, (Color?)new Color(0.85f, 0.25f, 0.25f, 0.95f)); _scrollThumbRect = val4.GetComponent(); } private void BuildBottom() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) CanvasService.CreateDivider(_root.transform, "DBottom", 0f, 520f, 480f); _txtSelf = CanvasService.CreateText(_root.transform, "SelfRank", "Your rank: --", 14f, 526f, 346f, 24f, 10.5f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257).GetComponent(); CanvasService.CreateButton(_root.transform, "BtnBack", "◀ Back", 370f, 526f, 96f, 24f, (Action)delegate { Hide(); _onBack?.Invoke(); }, 11f, (Color?)new Color(0.12f, 0.1f, 0.14f, 0.85f), (Color?)CanvasService.TEXT_SECONDARY, (Color?)null, applyNocturneFont: true); } private void SetBoard(string boardType) { if (!string.IsNullOrWhiteSpace(boardType) && !string.Equals(_activeBoardType, boardType, StringComparison.OrdinalIgnoreCase)) { _activeBoardType = boardType; _scrollOffset = 0f; _lastHash = -1; SetTabVisuals(); RequestBoard(force: true); Refresh(); } } private void SetTabVisuals() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_008d: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < _tabImages.Count; i++) { bool flag = i < _boards.Count && string.Equals(_boards[i].Type, _activeBoardType, StringComparison.OrdinalIgnoreCase); if ((Object)(object)_tabImages[i] != (Object)null) { ((Graphic)_tabImages[i]).color = (flag ? TabActive : TabInactive); } if ((Object)(object)_tabLabels[i] != (Object)null) { ((Graphic)_tabLabels[i]).color = (flag ? CanvasService.ACCENT_GOLD : CanvasService.TEXT_SECONDARY); } } } private void RequestBoard(bool force) { if (force || !string.Equals(UIData.Leaderboard.BoardType, _activeBoardType, StringComparison.OrdinalIgnoreCase) || UIData.Leaderboard.Loading) { CommandSender.RequestLeaderboard(_activeBoardType); } } private void RefreshStatus() { string boardLabel = GetBoardLabel(_activeBoardType); if ((Object)(object)_txtStatus != (Object)null) { if (UIData.Leaderboard.Loading && string.Equals(UIData.Leaderboard.BoardType, _activeBoardType, StringComparison.OrdinalIgnoreCase)) { ((TMP_Text)_txtStatus).text = boardLabel + ": Loading..."; } else if (!string.Equals(UIData.Leaderboard.BoardType, _activeBoardType, StringComparison.OrdinalIgnoreCase)) { ((TMP_Text)_txtStatus).text = boardLabel + ": Waiting for server..."; } else if (UIData.Leaderboard.Entries.Count == 0) { ((TMP_Text)_txtStatus).text = boardLabel + ": No data."; } else { ((TMP_Text)_txtStatus).text = $"{boardLabel}: Top {UIData.Leaderboard.Entries.Count}"; } } if ((Object)(object)_txtSelf != (Object)null) { UIData.LBEntry playerEntry = UIData.Leaderboard.PlayerEntry; if (playerEntry == null || playerEntry.Rank <= 0) { ((TMP_Text)_txtSelf).text = "Your rank: --"; return; } ((TMP_Text)_txtSelf).text = $"Your rank: #{playerEntry.Rank} {playerEntry.Name} - {playerEntry.Value}"; } } private void RebuildRows() { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) if (!string.Equals(UIData.Leaderboard.BoardType, _activeBoardType, StringComparison.OrdinalIgnoreCase)) { for (int i = 0; i < _rowPool.Count; i++) { if ((Object)(object)_rowPool[i].Root != (Object)null && _rowPool[i].Root.activeSelf) { _rowPool[i].Root.SetActive(false); } } _contentHeight = 0f; if ((Object)(object)_contentRect != (Object)null) { _contentRect.sizeDelta = new Vector2(418f, 0f); } SetScrollOffset(0f); return; } int count = UIData.Leaderboard.Entries.Count; EnsureRowPool(count); for (int j = 0; j < count; j++) { BindRow(_rowPool[j], UIData.Leaderboard.Entries[j], j); } for (int k = count; k < _rowPool.Count; k++) { if ((Object)(object)_rowPool[k].Root != (Object)null && _rowPool[k].Root.activeSelf) { _rowPool[k].Root.SetActive(false); } } _contentHeight = ((count <= 0) ? 0f : ((float)count * 38f)); if ((Object)(object)_contentRect != (Object)null) { _contentRect.sizeDelta = new Vector2(418f, _contentHeight); } SetScrollOffset(_scrollOffset); } private void EnsureRowPool(int count) { while (_rowPool.Count < count) { _rowPool.Add(BuildRow(_rowPool.Count)); } } private RowWidgets BuildRow(int index) { //IL_0057: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) GameObject val = CanvasService.CreatePanel(((Component)_contentRect).transform, $"LBRow_{index}", 0f, 0f, 416f, 34f, (Color?)new Color(0.08f, 0.06f, 0.1f, 0.6f)); RectTransform component = val.GetComponent(); Image component2 = val.GetComponent(); TextMeshProUGUI component3 = CanvasService.CreateText(val.transform, $"Rank_{index}", "", 8f, 8f, 44f, 20f, 12f, CanvasService.TEXT_DISABLED, (TextAlignmentOptions)257).GetComponent(); TextMeshProUGUI component4 = CanvasService.CreateText(val.transform, $"Name_{index}", "", 52f, 8f, 240f, 20f, 12f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); TextMeshProUGUI component5 = CanvasService.CreateText(val.transform, $"Value_{index}", "", 300f, 8f, 112f, 20f, 11f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)4100).GetComponent(); val.SetActive(false); return new RowWidgets { Root = val, Rect = component, Bg = component2, Rank = component3, Name = component4, Value = component5 }; } private static void BindRow(RowWidgets row, UIData.LBEntry entry, int index) { //IL_005b: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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_0080: Unknown result type (might be due to invalid IL or missing references) if (row != null && !((Object)(object)row.Root == (Object)null) && entry != null) { row.Root.SetActive(true); ((Graphic)row.Bg).color = ((index % 2 == 0) ? new Color(0.08f, 0.06f, 0.1f, 0.6f) : new Color(0.06f, 0.04f, 0.08f, 0.4f)); Color color = (Color)((entry.Rank == 1) ? new Color(1f, 0.84f, 0f) : ((entry.Rank == 2) ? new Color(0.75f, 0.75f, 0.75f) : ((entry.Rank == 3) ? new Color(0.8f, 0.5f, 0.2f) : CanvasService.TEXT_DISABLED))); if ((Object)(object)row.Rank != (Object)null) { ((TMP_Text)row.Rank).text = $"#{entry.Rank}"; ((Graphic)row.Rank).color = color; } if ((Object)(object)row.Name != (Object)null) { ((TMP_Text)row.Name).text = entry.Name ?? ""; } if ((Object)(object)row.Value != (Object)null) { ((TMP_Text)row.Value).text = entry.Value ?? ""; } } } private string GetBoardLabel(string type) { for (int i = 0; i < _boards.Count; i++) { if (string.Equals(_boards[i].Type, type, StringComparison.OrdinalIgnoreCase)) { return _boards[i].Label; } } return type ?? "Board"; } private void SetScrollOffset(float offset) { _scrollOffset = Mathf.Clamp(offset, 0f, GetMaxScroll()); UpdateRowPositions(); UpdateScrollbarVisual(); } private float GetMaxScroll() { return Mathf.Max(0f, _contentHeight - 366f); } private void UpdateRowPositions() { //IL_0093: Unknown result type (might be due to invalid IL or missing references) int count = UIData.Leaderboard.Entries.Count; for (int i = 0; i < count && i < _rowPool.Count; i++) { RowWidgets rowWidgets = _rowPool[i]; if (!((Object)(object)rowWidgets?.Rect == (Object)null)) { float num = (float)i * 38f - _scrollOffset; bool flag = num + 34f >= 0f && num <= 366f; if (rowWidgets.Root.activeSelf != flag) { rowWidgets.Root.SetActive(flag); } if (flag) { rowWidgets.Rect.anchoredPosition = new Vector2(0f, 0f - num); } } } } private void UpdateScrollbarVisual() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_scrollThumbRect == (Object)null) && !((Object)(object)_scrollTrackRect == (Object)null)) { float maxScroll = GetMaxScroll(); Rect rect = _scrollTrackRect.rect; float height = ((Rect)(ref rect)).height; float thumbHeight = GetThumbHeight(height); _scrollThumbRect.sizeDelta = new Vector2(_scrollThumbRect.sizeDelta.x, thumbHeight); if (maxScroll <= 0.01f) { ((Component)_scrollThumbRect).gameObject.SetActive(false); return; } ((Component)_scrollThumbRect).gameObject.SetActive(true); float num = Mathf.Max(0f, height - thumbHeight); float num2 = _scrollOffset / maxScroll; _scrollThumbRect.anchoredPosition = new Vector2(0f, 0f - num * num2); } } private float GetThumbHeight(float trackHeight) { if (_contentHeight <= 0.01f) { return trackHeight; } float num = 366f / Mathf.Max(366f, _contentHeight); return Mathf.Clamp(trackHeight * num, 24f, trackHeight); } private void UpdateScrollFromMouse(float mouseY) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) float maxScroll = GetMaxScroll(); if (maxScroll <= 0.01f) { SetScrollOffset(0f); return; } Vector3[] array = (Vector3[])(object)new Vector3[4]; _scrollTrackRect.GetWorldCorners(Il2CppStructArray.op_Implicit(array)); float y = array[1].y; float y2 = array[0].y; Canvas component = _root.GetComponent(); float num = ((component != null) ? component.scaleFactor : 1f); Rect rect = _scrollTrackRect.rect; float num2 = GetThumbHeight(((Rect)(ref rect)).height) * num * 0.5f; float num3 = Mathf.Clamp(mouseY, y2 + num2, y - num2); float num4 = Mathf.InverseLerp(y - num2, y2 + num2, num3); SetScrollOffset(num4 * maxScroll); } private static bool IsPointerOver(RectTransform rect) { //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) if ((Object)(object)rect != (Object)null) { return RectTransformUtility.RectangleContainsScreenPoint(rect, Vector2.op_Implicit(Input.mousePosition), (Camera)null); } return false; } private int ComputeHash() { int num = 17; num = num * 31 + (_activeBoardType?.GetHashCode() ?? 0); num = num * 31 + (UIData.Leaderboard.BoardType?.GetHashCode() ?? 0); num = num * 31 + UIData.Leaderboard.Loading.GetHashCode(); num = num * 31 + UIData.Leaderboard.Entries.Count; for (int i = 0; i < UIData.Leaderboard.Entries.Count; i++) { UIData.LBEntry lBEntry = UIData.Leaderboard.Entries[i]; if (lBEntry == null) { num *= 31; continue; } num = num * 31 + lBEntry.Rank; num = num * 31 + (lBEntry.Name?.GetHashCode() ?? 0); num = num * 31 + (lBEntry.Value?.GetHashCode() ?? 0); } UIData.LBEntry playerEntry = UIData.Leaderboard.PlayerEntry; if (playerEntry != null) { num = num * 31 + playerEntry.Rank; num = num * 31 + (playerEntry.Name?.GetHashCode() ?? 0); num = num * 31 + (playerEntry.Value?.GetHashCode() ?? 0); } return num; } } internal class MainMenuScreen { private GameObject _root; private bool _visible; private TextMeshProUGUI _txtEvent; private TextMeshProUGUI _txtQuestTitle; private TextMeshProUGUI _txtQuestStep; private TextMeshProUGUI _txtStatsBtn; private TextMeshProUGUI _txtServerTime; private readonly Action _openStats; private readonly Action _openFamiliars; private readonly Action _openQuests; private readonly Action _openAchievements; private readonly Action _openSettings; private readonly Action _openLeaderboard; private readonly Action _openForge; public bool IsVisible => _visible; public MainMenuScreen(Action openStats, Action openFamiliars, Action openQuests = null, Action openAchievements = null, Action openSettings = null, Action openLeaderboard = null, Action openForge = null) { _openStats = openStats; _openFamiliars = openFamiliars; _openQuests = openQuests; _openAchievements = openAchievements; _openSettings = openSettings; _openLeaderboard = openLeaderboard; _openForge = openForge; } public void Toggle() { if ((Object)(object)_root == (Object)null) { Create(); } _visible = !_visible; _root.SetActive(_visible); if (_visible) { CommandSender.RequestUISync(); Refresh(); } } public void Hide() { if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } _visible = false; } public void Refresh() { if (!((Object)(object)_root == (Object)null) && _visible) { if ((Object)(object)_txtEvent != (Object)null) { ((TMP_Text)_txtEvent).text = ((string.IsNullOrEmpty(UIData.EventDisplayName) || UIData.EventDisplayName == "None Currently Active") ? "Events: None Currently Active" : ("Event: " + UIData.EventDisplayName)); } if ((Object)(object)_txtQuestTitle != (Object)null && (Object)(object)_txtQuestStep != (Object)null) { BuildQuestSummary(out var title, out var step); ((TMP_Text)_txtQuestTitle).text = title; ((TMP_Text)_txtQuestStep).text = step; } if ((Object)(object)_txtStatsBtn != (Object)null) { ((TMP_Text)_txtStatsBtn).text = (string.IsNullOrEmpty(UIData.PlayerName) ? "GOMS Stats" : (UIData.PlayerName + "'s GOMS Stats")); } if ((Object)(object)_txtServerTime != (Object)null) { string text = (string.IsNullOrWhiteSpace(UIData.ServerTimeText) ? "--:--" : UIData.ServerTimeText); ((TMP_Text)_txtServerTime).text = "Server Time: " + text; } } } public void Dispose() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; _visible = false; } private void Create() { //IL_004f: 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_00c7: 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_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_06a9: Unknown result type (might be due to invalid IL or missing references) CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService == null) { return; } _root = canvasService.CreateRootWindow("MainMenu", 360f, 510f, 200); GameObject val = CanvasService.CreatePanel(_root.transform, "Banner", 0f, 0f, 360f, 54f, CanvasService.BG_HEADER); CanvasService.CreateText(val.transform, "ServerName", "GOMS - Project Ordain", 0f, 10f, 360f, 22f, 16f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)514); CanvasService.CreateText(val.transform, "Sub", "The Ordain MMORPG Experience", 0f, 34f, 360f, 14f, 10f, CanvasService.TEXT_DISABLED, (TextAlignmentOptions)514); CanvasService.MakeDraggable(_root, val.transform); CanvasService.CreateCloseButton(_root.transform, 360f, delegate { Hide(); }); CanvasService.CreateDivider(_root.transform, "D0", 0f, 54f, 360f); CanvasService.CreatePanel(_root.transform, "InfoBg", 14f, 60f, 332f, 82f, (Color?)new Color(0.1f, 0.08f, 0.12f, 0.85f)); _txtEvent = CanvasService.CreateText(_root.transform, "EventTxt", "Events: None Currently Active", 22f, 68f, 316f, 18f, 11f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257).GetComponent(); _txtQuestTitle = CanvasService.CreateText(_root.transform, "QuestTitleTxt", "Current Quest: None", 22f, 88f, 316f, 18f, 11.5f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); _txtQuestStep = CanvasService.CreateText(_root.transform, "QuestStepTxt", "Open Quests to begin.", 22f, 108f, 316f, 28f, 10f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257).GetComponent(); ((TMP_Text)_txtQuestStep).enableWordWrapping = true; ((TMP_Text)_txtQuestStep).overflowMode = (TextOverflowModes)3; CanvasService.CreateDivider(_root.transform, "D1", 14f, 148f, 332f); GameObject val2 = CanvasService.CreateButton(_root.transform, "BtnStats", "GOMS Stats", 14f, 156f, 332f, 42f, (Action)delegate { Hide(); _openStats?.Invoke(); }, 13f, (Color?)new Color(0.18f, 0.1f, 0.08f, 0.9f), (Color?)CanvasService.ACCENT_GOLD, (Color?)null, applyNocturneFont: true); Transform obj = val2.transform.Find("Text_BtnStats_Label"); _txtStatsBtn = ((obj != null) ? ((Component)obj).GetComponent() : null); CanvasService.CreateDivider(_root.transform, "D2", 14f, 204f, 332f); float num = 212f; CanvasService.CreateButton(_root.transform, "BtnFamiliars", "Familiars", 14f, num, 162f, 42f, delegate { Hide(); _openFamiliars?.Invoke(); }, 12f); CanvasService.CreateButton(_root.transform, "BtnQuests", "Quests", 184f, num, 162f, 42f, delegate { Hide(); _openQuests?.Invoke(); }, 12f); num += 50f; CanvasService.CreateButton(_root.transform, "BtnAchievements", "Achievements", 14f, num, 162f, 42f, delegate { if (_openAchievements == null) { TBA("Achievements"); } else { Hide(); _openAchievements(); } }, 12f); CanvasService.CreateButton(_root.transform, "BtnVDRM", "VDRM Stats", 184f, num, 162f, 42f, delegate { TBA("VDRM Stats"); }, 12f); num += 50f; CanvasService.CreateButton(_root.transform, "BtnLeaderboard", "Leaderboard", 14f, num, 162f, 42f, delegate { Hide(); _openLeaderboard?.Invoke(); }, 12f); CanvasService.CreateButton(_root.transform, "BtnForge", "Forge", 184f, num, 162f, 42f, delegate { Hide(); _openForge?.Invoke(); }, 12f); num += 50f; CreateLockedCard("Locked2", 14f, num, 162f, 42f, "Feature slot locked. Planned for future content."); CanvasService.CreateButton(_root.transform, "BtnUISettings", "UI Settings", 184f, num, 162f, 42f, delegate { Hide(); _openSettings?.Invoke(); }, 12f); CanvasService.CreateDivider(_root.transform, "D3", 14f, 482f, 332f); _txtServerTime = CanvasService.CreateText(_root.transform, "ServerTimeTxt", "Server Time: --:--", 18f, 486f, 324f, 16f, 11.5f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)514).GetComponent(); HUDPositionService.ApplySaved(_root, "MainMenu"); _root.SetActive(false); } private static void BuildQuestSummary(out string title, out string step) { string title2; string step2; string title3; string step3; if (UIData.HasActiveStoryQuest && (!string.IsNullOrWhiteSpace(UIData.StoryQuestTitle) || !string.IsNullOrWhiteSpace(UIData.StoryQuestId))) { string text = ((!string.IsNullOrWhiteSpace(UIData.StoryQuestTitle)) ? UIData.StoryQuestTitle : UIData.StoryQuestId); int num = Math.Max(1, UIData.StoryStepRequired); int value = Mathf.Clamp(UIData.StoryStepProgress, 0, num); string value2 = (string.IsNullOrWhiteSpace(UIData.StoryStepText) ? "Complete the current objective." : UIData.StoryStepText); title = "Current Quest: " + text; step = $"{value2} ({value}/{num})"; } else if (TryGetRotatingQuest(UIData.DailyQuests, "Daily", out title2, out step2)) { title = title2; step = step2; } else if (TryGetRotatingQuest(UIData.WeeklyQuests, "Weekly", out title3, out step3)) { title = title3; step = step3; } else { title = "Current Quest: None"; step = "Open Quests to begin the storyline."; } } private static bool TryGetRotatingQuest(List entries, string label, out string title, out string step) { title = ""; step = ""; if (entries == null || entries.Count == 0) { return false; } UIData.QuestEntry questEntry = null; for (int i = 0; i < entries.Count; i++) { UIData.QuestEntry questEntry2 = entries[i]; if (questEntry2 != null) { if (questEntry == null) { questEntry = questEntry2; } if (!questEntry2.Completed && !questEntry2.Claimed) { questEntry = questEntry2; break; } } } if (questEntry == null) { return false; } string text = ((!string.IsNullOrWhiteSpace(questEntry.Title)) ? questEntry.Title : questEntry.Id); string value = ((!string.IsNullOrWhiteSpace(questEntry.Description)) ? questEntry.Description : "Complete objective."); int num = Math.Max(1, questEntry.Required); int value2 = Mathf.Clamp(questEntry.Progress, 0, num); title = "Current Quest: " + label + " - " + text; step = $"{value} ({value2}/{num})"; return true; } private void CreateLockedCard(string id, float x, float y, float width, float height, string tooltip) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) GameObject obj = CanvasService.CreateButton(_root.transform, "Btn" + id, "LOCKED", x, y, width, height, (Action)delegate { OrdainUIBehaviour.EnqueueNotification(tooltip, "info", 2.4f); }, 11f, (Color?)new Color(0.08f, 0.08f, 0.1f, 0.72f), (Color?)CanvasService.TEXT_DISABLED, (Color?)new Color(0.11f, 0.11f, 0.14f, 0.82f), applyNocturneFont: true); Transform obj2 = obj.transform.Find("Text_Btn" + id + "_Label"); TextMeshProUGUI val = ((obj2 != null) ? ((Component)obj2).GetComponent() : null); if ((Object)(object)val != (Object)null) { ((TMP_Text)val).alignment = (TextAlignmentOptions)514; ((TMP_Text)val).fontStyle = (FontStyles)1; ((Graphic)val).color = CanvasService.TEXT_DISABLED; } ((TMP_Text)CanvasService.CreateText(obj.transform, id + "_Sub", "Coming Soon", 0f, height - 16f, width, 12f, 9f, CanvasService.TEXT_DISABLED, (TextAlignmentOptions)514).GetComponent()).enableWordWrapping = false; } private void TBA(string name) { OrdainUIBehaviour.EnqueueNotification(name + " — Coming Soon", "info", 2.5f); } } internal class NotificationPopup { private struct NotifyEntry { public string Text; public string Type; public float Duration; public float TimeLeft; } private GameObject _root; private TextMeshProUGUI _txt; private bool _created; private readonly Queue _queue = new Queue(); private NotifyEntry _current; private bool _showing; public void Enqueue(string text, string type, float duration) { _queue.Enqueue(new NotifyEntry { Text = text, Type = type, Duration = duration, TimeLeft = duration }); } public void Update() { if (!_created) { TryCreate(); } if (!_created) { return; } if (_showing) { _current.TimeLeft -= Time.deltaTime; if (_current.TimeLeft <= 0f) { _showing = false; _root.SetActive(false); } else { float alpha = ((_current.TimeLeft < 0.5f) ? (_current.TimeLeft / 0.5f) : 1f); ((TMP_Text)_txt).alpha = alpha; } } if (!_showing && _queue.Count > 0) { _current = _queue.Dequeue(); ShowCurrent(); } } public void Destroy() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _created = false; } private void ShowCurrent() { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_00de: 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_00f5: 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_010c: Unknown result type (might be due to invalid IL or missing references) if (_created) { ((TMP_Text)_txt).text = _current.Text; ((TMP_Text)_txt).alpha = 1f; TextMeshProUGUI txt = _txt; ((Graphic)txt).color = (Color)(_current.Type switch { "green" => new Color(0.1f, 1f, 0.3f), "red" => new Color(1f, 0.2f, 0.2f), "gold" => new Color(1f, 0.85f, 0.1f), "eliminated" => new Color(1f, 0.2f, 0.2f), "winner" => new Color(1f, 0.85f, 0.1f), _ => new Color(0.9f, 0.88f, 0.82f), }); if (UIConfig.ShowNotifications) { _root.SetActive(true); _showing = true; } } } private void TryCreate() { //IL_0041: 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_006b: 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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService != null) { _root = canvasService.CreateRootWindow("HUD_Notification", 700f, 120f, 300); RectTransform component = _root.GetComponent(); component.anchorMin = new Vector2(0.5f, 0.5f); component.anchorMax = new Vector2(0.5f, 0.5f); component.pivot = new Vector2(0.5f, 0.5f); component.anchoredPosition = new Vector2(0f, 80f); Image component2 = _root.GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Graphic)component2).color = Color.clear; } _txt = CanvasService.CreateText(_root.transform, "NotifyText", "", 0f, 0f, 700f, 120f, 48f, Color.white, (TextAlignmentOptions)514).GetComponent(); ((TMP_Text)_txt).fontStyle = (FontStyles)1; ((TMP_Text)_txt).enableWordWrapping = false; ((TMP_Text)_txt).overflowMode = (TextOverflowModes)0; _root.SetActive(false); _created = true; } } } internal class NPCDialoguePanel { private const float W = 520f; private const float HeaderH = 72f; private const float DialogueH = 160f; private const float DivH = 1f; private const float ChoiceH = 44f; private const int MaxChoices = 5; private const float Pad = 16f; private const float PortraitSize = 52f; private GameObject _root; private bool _created; private bool _visible; private Image _portrait; private TextMeshProUGUI _npcNameLabel; private TextMeshProUGUI _npcTypeLabel; private TextMeshProUGUI _dialogueText; private GameObject _choicesContainer; private readonly List _choiceRows = new List(); private string _currentNpcId = ""; private string _currentNodeId = ""; private int _pendingChoices; private int _receivedChoices; public bool IsVisible => _visible; public void Create() { //IL_004c: 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_006b: 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) if (!_created) { CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService != null) { float height = 470f; _root = canvasService.CreateRootWindow("NPCDialogue", 520f, height, 200); RectTransform component = _root.GetComponent(); component.anchorMin = new Vector2(0.5f, 0.5f); component.anchorMax = new Vector2(0.5f, 0.5f); component.anchoredPosition = Vector2.zero; ((Graphic)_root.GetComponent()).color = new Color(0.07f, 0.05f, 0.09f, 0.97f); BuildHeader(); BuildHRule(72f); BuildDialogueArea(); BuildHRule(233f); BuildChoicesContainer(); _root.SetActive(false); _created = true; } } } public void Show(string npcId, string npcName, string npcType) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (_created) { _currentNpcId = npcId; if ((Object)(object)_portrait != (Object)null) { ((Graphic)_portrait).color = TypeColor(npcType); } if ((Object)(object)_npcNameLabel != (Object)null) { ((TMP_Text)_npcNameLabel).text = npcName; } if ((Object)(object)_npcTypeLabel != (Object)null) { ((TMP_Text)_npcTypeLabel).text = TypeLabel(npcType); } ClearChoices(); if ((Object)(object)_dialogueText != (Object)null) { ((TMP_Text)_dialogueText).text = ""; } _root.SetActive(true); _visible = true; } } public void Hide() { if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } _visible = false; _currentNpcId = ""; _currentNodeId = ""; ClearChoices(); } public void Dispose() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _created = false; _visible = false; } public void SetNode(string npcId, string nodeId, string text, int choiceCount) { if (_created) { _currentNpcId = npcId; _currentNodeId = nodeId; _pendingChoices = Mathf.Clamp(choiceCount, 0, 5); _receivedChoices = 0; if ((Object)(object)_dialogueText != (Object)null) { ((TMP_Text)_dialogueText).text = text; } ClearChoices(); } } public void AddChoice(string choiceId, string choiceText, string action) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0239: 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_0263: 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_0290: Unknown result type (might be due to invalid IL or missing references) if (_created && !((Object)(object)_choicesContainer == (Object)null) && _receivedChoices < _pendingChoices && _receivedChoices < 5) { int receivedChoices = _receivedChoices; _receivedChoices++; GameObject val = new GameObject("ChoiceRow_" + choiceId); val.transform.SetParent(_choicesContainer.transform, false); RectTransform obj = val.AddComponent(); obj.anchorMin = new Vector2(0f, 1f); obj.anchorMax = new Vector2(1f, 1f); obj.pivot = new Vector2(0f, 1f); obj.offsetMin = new Vector2(0f, 0f - ((float)receivedChoices * 44f + 44f)); obj.offsetMax = new Vector2(0f, 0f - (float)receivedChoices * 44f); ((Graphic)val.AddComponent()).color = Color.clear; GameObject val2 = new GameObject("Check"); val2.transform.SetParent(val.transform, false); RectTransform obj2 = val2.AddComponent(); obj2.anchorMin = new Vector2(0f, 0.5f); obj2.anchorMax = new Vector2(0f, 0.5f); obj2.pivot = new Vector2(0f, 0.5f); obj2.anchoredPosition = new Vector2(16f, 0f); obj2.sizeDelta = new Vector2(13f, 13f); ((Graphic)val2.AddComponent()).color = new Color(0.35f, 0.3f, 0.28f, 0.85f); ((TMP_Text)CanvasService.CreateText(val.transform, "ChoiceLabel_" + choiceId, choiceText, 36f, 0f, 468f, 44f, 13f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)4097).GetComponent()).enableWordWrapping = false; if (receivedChoices < _pendingChoices - 1) { GameObject val3 = new GameObject("RowDiv"); val3.transform.SetParent(val.transform, false); RectTransform obj3 = val3.AddComponent(); obj3.anchorMin = new Vector2(0.02f, 0f); obj3.anchorMax = new Vector2(0.98f, 0f); obj3.sizeDelta = new Vector2(0f, 1f); obj3.anchoredPosition = Vector2.zero; ((Graphic)val3.AddComponent()).color = new Color(0.25f, 0.2f, 0.28f, 0.7f); } string cId = choiceId; string act = action; CanvasService.RegisterClickable(val, delegate { OnChoiceClicked(cId, act); }, Color.clear, new Color(0.22f, 0.13f, 0.28f, 0.55f)); _choiceRows.Add(val); } } public void OnChoiceResult(bool success, string message) { if (_created) { if (message == "close") { Hide(); } else if (!success && (Object)(object)_dialogueText != (Object)null) { ((TMP_Text)_dialogueText).text = "" + message + ""; ClearChoices(); } } } private void BuildHeader() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0033: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: 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_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Expected O, but got Unknown //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Header"); val.transform.SetParent(_root.transform, false); RectTransform obj = val.AddComponent(); obj.anchorMin = new Vector2(0f, 1f); obj.anchorMax = new Vector2(1f, 1f); obj.pivot = new Vector2(0f, 1f); obj.offsetMin = new Vector2(0f, -72f); obj.offsetMax = Vector2.zero; ((Graphic)val.AddComponent()).color = new Color(0.1f, 0.07f, 0.13f, 0.98f); GameObject val2 = new GameObject("PortraitBorder"); val2.transform.SetParent(val.transform, false); RectTransform obj2 = val2.AddComponent(); obj2.anchorMin = new Vector2(0f, 0.5f); obj2.anchorMax = new Vector2(0f, 0.5f); obj2.pivot = new Vector2(0f, 0.5f); obj2.anchoredPosition = new Vector2(14f, 0f); obj2.sizeDelta = new Vector2(56f, 56f); ((Graphic)val2.AddComponent()).color = CanvasService.BORDER_COLOR; GameObject val3 = new GameObject("Portrait"); val3.transform.SetParent(val.transform, false); RectTransform obj3 = val3.AddComponent(); obj3.anchorMin = new Vector2(0f, 0.5f); obj3.anchorMax = new Vector2(0f, 0.5f); obj3.pivot = new Vector2(0f, 0.5f); obj3.anchoredPosition = new Vector2(16f, 0f); obj3.sizeDelta = new Vector2(52f, 52f); _portrait = val3.AddComponent(); ((Graphic)_portrait).color = CanvasService.ACCENT_GOLD; float num = 80f; float width = 520f - num - 44f; _npcNameLabel = CanvasService.CreateText(val.transform, "NPCName", "", num, 10f, width, 26f, 18f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); _npcTypeLabel = CanvasService.CreateText(val.transform, "NPCType", "", num, 38f, width, 18f, 11f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257).GetComponent(); CanvasService.CreateButton(val.transform, "Close", "✕", 482f, 10f, 28f, 28f, (Action)delegate { Hide(); }, 14f, (Color?)CanvasService.ACCENT_RED, (Color?)CanvasService.TEXT_PRIMARY, (Color?)new Color(0.9f, 0.15f, 0.15f, 1f), applyNocturneFont: true); } private void BuildHRule(float yFromTop) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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) GameObject val = new GameObject("HRule"); val.transform.SetParent(_root.transform, false); RectTransform obj = val.AddComponent(); obj.anchorMin = new Vector2(0f, 1f); obj.anchorMax = new Vector2(1f, 1f); obj.pivot = new Vector2(0f, 1f); obj.offsetMin = new Vector2(0f, 0f - (yFromTop + 1f)); obj.offsetMax = new Vector2(0f, 0f - yFromTop); ((Graphic)val.AddComponent()).color = CanvasService.BORDER_COLOR; } private void BuildDialogueArea() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_007b: 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_00c0: Unknown result type (might be due to invalid IL or missing references) float num = 73f; GameObject val = new GameObject("DialogueArea"); val.transform.SetParent(_root.transform, false); RectTransform obj = val.AddComponent(); obj.anchorMin = new Vector2(0f, 1f); obj.anchorMax = new Vector2(1f, 1f); obj.pivot = new Vector2(0f, 1f); obj.offsetMin = new Vector2(0f, 0f - (num + 160f)); obj.offsetMax = new Vector2(0f, 0f - num); _dialogueText = CanvasService.CreateText(val.transform, "DialogueText", "", 16f, 16f, 488f, 128f, 13.5f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); if ((Object)(object)_dialogueText != (Object)null) { ((TMP_Text)_dialogueText).enableWordWrapping = true; } } private void BuildChoicesContainer() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0048: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) float num = 234f; _choicesContainer = new GameObject("ChoicesContainer"); _choicesContainer.transform.SetParent(_root.transform, false); RectTransform obj = _choicesContainer.AddComponent(); obj.anchorMin = new Vector2(0f, 1f); obj.anchorMax = new Vector2(1f, 1f); obj.pivot = new Vector2(0f, 1f); obj.offsetMin = new Vector2(0f, 0f - (num + 220f)); obj.offsetMax = new Vector2(0f, 0f - num); } private void ClearChoices() { foreach (GameObject choiceRow in _choiceRows) { if ((Object)(object)choiceRow != (Object)null) { Object.Destroy((Object)(object)choiceRow); } } _choiceRows.Clear(); _receivedChoices = 0; } private void OnChoiceClicked(string choiceId, string action) { if (action == "close") { Hide(); } else { CommandSender.NPCChoice(_currentNpcId, choiceId, _currentNodeId); } } private static Color TypeColor(string type) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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) return (Color)(type switch { "quest" => CanvasService.ACCENT_GOLD, "vendor" => new Color(0.2f, 0.6f, 1f, 1f), "dialogue" => new Color(0.6f, 0.2f, 1f, 1f), "service" => new Color(0.2f, 0.8f, 0.4f, 1f), _ => CanvasService.TEXT_DISABLED, }); } private static string TypeLabel(string type) { return type switch { "quest" => "Quest Giver", "vendor" => "Merchant", "dialogue" => "Storyteller", "service" => "Service", _ => "NPC", }; } } internal class NPCPromptHUD { private const float ShowRange = 5f; private const float HideRange = 5.5f; private const float WorldYOffset = 3.8f; private const float FadeSpeed = 6f; private GameObject _root; private RectTransform _rootRect; private TextMeshProUGUI _label; private CanvasGroup _canvasGroup; private NPCManager.NPCClientRecord _currentNPC; private RiteOfferingManager.OfferingRecord _currentOffering; private float _alpha; private bool _created; private string _keyName = "F3"; public NPCManager.NPCClientRecord ActiveNPC => _currentNPC; public RiteOfferingManager.OfferingRecord ActiveOffering => _currentOffering; public void Create() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown //IL_007c: 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_00b0: 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_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Expected O, but got Unknown //IL_0184: 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_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: 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) if (!_created) { CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService != null) { _root = new GameObject("OrdainUI_NPCPrompt"); _root.layer = canvasService.GameLayer; Object.DontDestroyOnLoad((Object)(object)_root); _root.transform.SetParent(((Component)canvasService.BottomBarCanvas).transform, false); _rootRect = _root.AddComponent(); _rootRect.anchorMin = new Vector2(0.5f, 0.5f); _rootRect.anchorMax = new Vector2(0.5f, 0.5f); _rootRect.pivot = new Vector2(0.5f, 0f); _rootRect.sizeDelta = new Vector2(260f, 36f); Canvas obj = _root.AddComponent(); obj.overrideSorting = true; obj.sortingOrder = 60; _root.AddComponent(); ((Graphic)_root.AddComponent()).color = new Color(0.06f, 0.04f, 0.08f, 0.88f); _canvasGroup = _root.AddComponent(); _canvasGroup.alpha = 0f; _canvasGroup.interactable = false; _canvasGroup.blocksRaycasts = false; GameObject val = new GameObject("NPCPrompt_Label"); val.transform.SetParent(_root.transform, false); RectTransform obj2 = val.AddComponent(); obj2.anchorMin = Vector2.zero; obj2.anchorMax = Vector2.one; obj2.offsetMin = new Vector2(8f, 4f); obj2.offsetMax = new Vector2(-8f, -4f); _label = val.AddComponent(); ((TMP_Text)_label).text = ""; ((TMP_Text)_label).fontSize = 13f; ((Graphic)_label).color = CanvasService.TEXT_PRIMARY; ((TMP_Text)_label).alignment = (TextAlignmentOptions)514; ((TMP_Text)_label).fontStyle = (FontStyles)0; _root.SetActive(false); _created = true; } } } public void Refresh() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0066: 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_008e: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0306: 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_030d: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) if (!_created) { return; } if ((Object)(object)_root == (Object)null || (Object)(object)_rootRect == (Object)null || (Object)(object)_canvasGroup == (Object)null || (Object)(object)_label == (Object)null) { _created = false; return; } float deltaTime = Time.deltaTime; Vector3 playerWorldPos = GetPlayerWorldPos(); bool num = playerWorldPos != Vector3.zero; NPCManager.NPCClientRecord nPCClientRecord = (num ? NPCManager.GetNearestForPrompt(playerWorldPos, 5.5f) : null); RiteOfferingManager.OfferingRecord offeringRecord = (num ? RiteOfferingManager.GetNearest(playerWorldPos, 5.5f) : null); if (nPCClientRecord != null && _currentNPC == null && Vector3.Distance(playerWorldPos, nPCClientRecord.WorldPos) > 5f) { nPCClientRecord = null; } if (offeringRecord != null && _currentOffering == null && Vector3.Distance(playerWorldPos, offeringRecord.WorldPos) > 5f) { offeringRecord = null; } if (nPCClientRecord != null && offeringRecord != null) { Vector3 val = playerWorldPos - nPCClientRecord.WorldPos; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; val = playerWorldPos - offeringRecord.WorldPos; if (((Vector3)(ref val)).sqrMagnitude <= sqrMagnitude) { nPCClientRecord = null; } else { offeringRecord = null; } } _currentNPC = nPCClientRecord; _currentOffering = offeringRecord; bool flag = _currentNPC != null || _currentOffering != null; float num2 = (flag ? 1f : 0f); _alpha = Mathf.MoveTowards(_alpha, num2, 6f * deltaTime); bool flag2 = _alpha > 0.01f; _root.SetActive(flag2); if (!flag2 || !flag) { return; } _canvasGroup.alpha = _alpha; string nPCInteractKey = UIConfig.NPCInteractKey; Vector3 worldPos; if (_currentOffering != null) { string value = (string.IsNullOrWhiteSpace(_currentOffering.Color) ? "#9FDFFF" : _currentOffering.Color); string value2 = (_currentOffering.IsStart ? "Interact:" : "Choose"); ((TMP_Text)_label).text = $"[ {nPCInteractKey} ] {value2} {_currentOffering.Name}"; worldPos = _currentOffering.WorldPos; } else { ((TMP_Text)_label).text = $"[ {nPCInteractKey} ] Talk to {_currentNPC.Name}"; worldPos = _currentNPC.WorldPos; } Camera main = Camera.main; if ((Object)(object)main == (Object)null) { return; } Vector3 val2 = worldPos + new Vector3(0f, 3.8f, 0f); Vector3 val3 = main.WorldToScreenPoint(val2); if (val3.z < 0f) { _root.SetActive(false); } else { if (OrdainUI.Core.Core.CanvasService == null || (Object)(object)OrdainUI.Core.Core.CanvasService.BottomBarCanvas == (Object)null) { return; } RectTransform component = ((Component)OrdainUI.Core.Core.CanvasService.BottomBarCanvas).GetComponent(); if (!((Object)(object)component == (Object)null)) { float scaleFactor = OrdainUI.Core.Core.CanvasService.BottomBarCanvas.scaleFactor; Rect rect = component.rect; float width = ((Rect)(ref rect)).width; rect = component.rect; float height = ((Rect)(ref rect)).height; if (!(scaleFactor <= 0f) && !(width <= 0f) && !(height <= 0f)) { float num3 = val3.x / scaleFactor - width * 0.5f; float num4 = val3.y / scaleFactor - height * 0.5f; _rootRect.anchoredPosition = new Vector2(num3, num4); } } } } public void Destroy() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _created = false; _currentNPC = null; _currentOffering = null; _alpha = 0f; } private static Vector3 GetPlayerWorldPos() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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) try { Entity localCharacter = OrdainUI.Core.Core.LocalCharacter; if (localCharacter == Entity.Null) { return Vector3.zero; } EntityManager entityManager = OrdainUI.Core.Core.EntityManager; if (!((EntityManager)(ref entityManager)).HasComponent(localCharacter)) { return Vector3.zero; } entityManager = OrdainUI.Core.Core.EntityManager; LocalToWorld componentData = ((EntityManager)(ref entityManager)).GetComponentData(localCharacter); return new Vector3(((LocalToWorld)(ref componentData)).Position.x, ((LocalToWorld)(ref componentData)).Position.y, ((LocalToWorld)(ref componentData)).Position.z); } catch { return Vector3.zero; } } } internal class QuestPanel { private enum TabKind { Active, Story, Daily, Weekly, Event, Completed } private sealed class RowWidgets { public GameObject Root; public RectTransform Rect; public Image Bg; public TextMeshProUGUI Title; public TextMeshProUGUI Desc; public TextMeshProUGUI Progress; public TextMeshProUGUI Meta; public GameObject ClaimButton; public TextMeshProUGUI ClaimLabel; public Action ClaimAction; } private sealed class QuestListItem { public string Id; public string Title; public string Description; public string ProgressText; public string MetaText; public bool ShowClaim; public string ClaimText; public Action ClaimAction; public bool Highlight; } private GameObject _root; private bool _visible; private readonly Action _onBack; private TextMeshProUGUI _txtSummary; private TextMeshProUGUI _txtSub; private readonly List _tabs = new List(); private readonly List _tabImages = new List(); private readonly List _tabLabels = new List(); private RectTransform _viewportRect; private RectTransform _contentRect; private RectTransform _scrollTrackRect; private RectTransform _scrollThumbRect; private readonly List _rowPool = new List(); private readonly List _items = new List(); private TabKind _activeTab; private float _scrollOffset; private float _contentHeight; private bool _draggingScroll; private int _lastHash = -1; private const float W = 640f; private const float H = 560f; private const float PAD = 14f; private const float LIST_Y = 134f; private const float LIST_H = 382f; private const float VIEW_X = 22f; private const float VIEW_Y = 142f; private const float VIEW_H = 366f; private const float VIEW_W = 582f; private const float TRACK_X = 614f; private const float TRACK_Y = 142f; private const float TRACK_W = 6f; private const float TRACK_H = 366f; private const float ROW_H = 84f; private const float ROW_GAP = 6f; private const float ROW_STEP = 90f; private static readonly Color TabActive = new Color(0.2f, 0.12f, 0.05f, 0.95f); private static readonly Color TabInactive = new Color(0.12f, 0.1f, 0.14f, 0.85f); public bool IsVisible => _visible; public QuestPanel(Action onBack = null) { _onBack = onBack; } public void Show() { if ((Object)(object)_root == (Object)null) { Create(); } _visible = true; _root.SetActive(true); _lastHash = -1; Refresh(); } public void Hide() { if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } _draggingScroll = false; _visible = false; } public void Refresh() { if (_visible && !((Object)(object)_root == (Object)null)) { int num = ComputeHash(); if (num != _lastHash) { _lastHash = num; RefreshSummary(); RebuildItems(); RebuildRows(); } } } public void TickInput() { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) if (!_visible || (Object)(object)_root == (Object)null || (Object)(object)_viewportRect == (Object)null || (Object)(object)_scrollTrackRect == (Object)null) { return; } bool flag = IsPointerOver(_viewportRect); bool flag2 = IsPointerOver(_scrollTrackRect); bool flag3 = (Object)(object)_scrollThumbRect != (Object)null && ((Component)_scrollThumbRect).gameObject.activeSelf && IsPointerOver(_scrollThumbRect); float y = Input.mouseScrollDelta.y; if (Mathf.Abs(y) > 0.01f && (flag || flag2 || flag3)) { SetScrollOffset(_scrollOffset - y * 52f); } if (Input.GetMouseButtonDown(0) && (flag2 || flag3)) { _draggingScroll = true; UpdateScrollFromMouse(Input.mousePosition.y); } if (_draggingScroll) { if (Input.GetMouseButton(0)) { UpdateScrollFromMouse(Input.mousePosition.y); } else { _draggingScroll = false; } } } public void Dispose() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; _visible = false; _draggingScroll = false; } private void Create() { //IL_004f: 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_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService != null) { _root = canvasService.CreateRootWindow("QuestPanel", 640f, 560f, 206); GameObject val = CanvasService.CreatePanel(_root.transform, "Header", 0f, 0f, 640f, 44f, CanvasService.BG_HEADER); CanvasService.CreateText(val.transform, "Title", "QUESTS", 16f, 12f, 520f, 24f, 16f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)4097); CanvasService.CreateCloseButton(_root.transform, 640f, delegate { Hide(); }); CanvasService.MakeDraggable(_root, val.transform); CanvasService.CreateDivider(_root.transform, "D0", 0f, 44f, 640f); BuildSummary(); BuildTabs(); BuildList(); CanvasService.CreateDivider(_root.transform, "DBottom", 0f, 520f, 640f); CanvasService.CreateButton(_root.transform, "BtnBack", "< Back", 14f, 526f, 96f, 24f, (Action)delegate { Hide(); _onBack?.Invoke(); }, 11f, (Color?)new Color(0.12f, 0.1f, 0.14f, 0.85f), (Color?)CanvasService.TEXT_SECONDARY, (Color?)null, applyNocturneFont: true); HUDPositionService.ApplySaved(_root, "QuestPanel"); SetTabVisuals(); _root.SetActive(false); } } private void BuildSummary() { //IL_0038: 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_00c5: Unknown result type (might be due to invalid IL or missing references) CanvasService.CreatePanel(_root.transform, "SummaryBg", 14f, 52f, 612f, 46f, (Color?)new Color(0.1f, 0.08f, 0.12f, 0.9f)); _txtSummary = CanvasService.CreateText(_root.transform, "Summary", "", 22f, 60f, 596f, 18f, 12f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); _txtSub = CanvasService.CreateText(_root.transform, "Sub", "", 22f, 78f, 596f, 16f, 10.5f, CanvasService.TEXT_DISABLED, (TextAlignmentOptions)257).GetComponent(); } private void BuildTabs() { //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) (TabKind, string)[] array = new(TabKind, string)[6] { (TabKind.Active, "Active"), (TabKind.Story, "Story"), (TabKind.Daily, "Daily"), (TabKind.Weekly, "Weekly"), (TabKind.Event, "Event"), (TabKind.Completed, "Completed") }; float num = 14f; for (int i = 0; i < array.Length; i++) { TabKind tab = array[i].Item1; string item = array[i].Item2; GameObject val = CanvasService.CreateButton(_root.transform, "Tab_" + item, item, num, 106f, 94f, 24f, delegate { SetTab(tab); }, 10.5f, TabInactive, CanvasService.TEXT_SECONDARY); _tabs.Add(tab); _tabImages.Add(val.GetComponent()); _tabLabels.Add(val.GetComponentInChildren()); num += 98f; } } private void BuildList() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Expected O, but got Unknown //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: 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) CanvasService.CreatePanel(_root.transform, "ListBg", 14f, 134f, 612f, 382f, (Color?)new Color(0.07f, 0.07f, 0.1f, 0.9f)); GameObject val = new GameObject("QuestViewport"); val.transform.SetParent(_root.transform, false); _viewportRect = val.AddComponent(); _viewportRect.anchorMin = new Vector2(0f, 1f); _viewportRect.anchorMax = new Vector2(0f, 1f); _viewportRect.pivot = new Vector2(0f, 1f); _viewportRect.anchoredPosition = new Vector2(22f, -142f); _viewportRect.sizeDelta = new Vector2(582f, 366f); ((Graphic)val.AddComponent()).color = new Color(0f, 0f, 0f, 0.01f); val.AddComponent(); GameObject val2 = new GameObject("QuestContent"); val2.transform.SetParent(val.transform, false); _contentRect = val2.AddComponent(); _contentRect.anchorMin = new Vector2(0f, 1f); _contentRect.anchorMax = new Vector2(0f, 1f); _contentRect.pivot = new Vector2(0f, 1f); _contentRect.anchoredPosition = Vector2.zero; _contentRect.sizeDelta = new Vector2(578f, 0f); GameObject val3 = CanvasService.CreatePanel(_root.transform, "ScrollTrack", 614f, 142f, 6f, 366f, (Color?)new Color(0.2f, 0.13f, 0.13f, 0.9f)); _scrollTrackRect = val3.GetComponent(); GameObject val4 = CanvasService.CreatePanel(val3.transform, "ScrollThumb", 0f, 0f, 6f, 52f, (Color?)new Color(0.85f, 0.25f, 0.25f, 0.95f)); _scrollThumbRect = val4.GetComponent(); } private void SetTab(TabKind tab) { if (_activeTab != tab) { _activeTab = tab; _scrollOffset = 0f; SetTabVisuals(); RefreshSummary(); RebuildItems(); RebuildRows(); } } private void SetTabVisuals() { //IL_0057: 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_008b: 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) for (int i = 0; i < _tabImages.Count; i++) { bool flag = i < _tabs.Count && _tabs[i] == _activeTab; if ((Object)(object)_tabImages[i] != (Object)null) { ((Graphic)_tabImages[i]).color = (flag ? TabActive : TabInactive); } if ((Object)(object)_tabLabels[i] != (Object)null) { ((Graphic)_tabLabels[i]).color = (flag ? CanvasService.ACCENT_GOLD : CanvasService.TEXT_SECONDARY); } } } private void RefreshSummary() { if (!((Object)(object)_txtSummary == (Object)null) && !((Object)(object)_txtSub == (Object)null)) { switch (_activeTab) { case TabKind.Active: ((TMP_Text)_txtSummary).text = "Active Quests"; ((TMP_Text)_txtSub).text = BuildActiveSummaryText(); break; case TabKind.Story: ((TMP_Text)_txtSummary).text = "Storyline Quests"; ((TMP_Text)_txtSub).text = $"Story quests: {CountNonNull(UIData.StoryQuests)} | Completed: {UIData.StoryCompletedCount}"; break; case TabKind.Daily: ((TMP_Text)_txtSummary).text = "Daily Quests"; ((TMP_Text)_txtSub).text = (string.IsNullOrWhiteSpace(UIData.DailyResetText) ? "Reset: --" : ("Reset: " + UIData.DailyResetText)); break; case TabKind.Weekly: ((TMP_Text)_txtSummary).text = "Weekly Quests"; ((TMP_Text)_txtSub).text = (string.IsNullOrWhiteSpace(UIData.WeeklyResetText) ? "Reset: --" : ("Reset: " + UIData.WeeklyResetText)); break; case TabKind.Event: ((TMP_Text)_txtSummary).text = "Event Quests"; ((TMP_Text)_txtSub).text = $"Active event quests: {CountNonNull(UIData.EventQuests)}"; break; case TabKind.Completed: ((TMP_Text)_txtSummary).text = "Completed Quests"; ((TMP_Text)_txtSub).text = $"Entries: {CountNonNull(UIData.CompletedQuests)} | Story complete: {UIData.StoryCompletedCount}"; break; } } } private static string BuildActiveSummaryText() { int num = (UIData.HasActiveStoryQuest ? 1 : 0); if (UIData.StoryClaimableCount > 0) { num++; } int num2 = CountNonNull(UIData.DailyQuests); int num3 = CountNonNull(UIData.WeeklyQuests); int num4 = CountNonNull(UIData.EventQuests); int value = num + num2 + num3 + num4; return $"Total: {value} | Story: {num} | Daily: {num2} | Weekly: {num3} | Event: {num4}"; } private void RebuildItems() { _items.Clear(); switch (_activeTab) { case TabKind.Active: BuildActiveItems(); break; case TabKind.Story: BuildStoryCatalogItems(); break; case TabKind.Daily: BuildRotatingItems(UIData.DailyQuests, "Daily", 2, includeEmptySlots: true, allowClaim: true); break; case TabKind.Weekly: BuildRotatingItems(UIData.WeeklyQuests, "Weekly", 1, includeEmptySlots: true, allowClaim: true); break; case TabKind.Event: BuildEventItems(); break; case TabKind.Completed: BuildCompletedItems(); break; } } private void BuildActiveItems() { if (UIData.HasActiveStoryQuest) { int num = Math.Max(1, UIData.StoryStepRequired); int value = Math.Clamp(UIData.StoryStepProgress, 0, num); string text = (string.IsNullOrWhiteSpace(UIData.StoryQuestTitle) ? UIData.StoryQuestId : UIData.StoryQuestTitle); if (string.IsNullOrWhiteSpace(text)) { text = "Story Quest"; } _items.Add(new QuestListItem { Id = (UIData.StoryQuestId ?? ""), Title = "[Story] " + text, Description = (string.IsNullOrWhiteSpace(UIData.StoryStepText) ? "Complete objective." : UIData.StoryStepText), ProgressText = $"Progress: {value}/{num}", MetaText = BuildStoryMetaText(), ShowClaim = false, ClaimText = "", ClaimAction = null, Highlight = true }); } if (UIData.StoryClaimableCount > 0) { int num2 = Math.Max(1, UIData.StoryClaimableCount); string value2 = ((num2 == 1) ? "reward" : "rewards"); _items.Add(new QuestListItem { Id = "story_claimable", Title = "[Story] Turn-In Rewards Available", Description = $"You have {num2} story quest {value2} ready to claim.", ProgressText = $"Claimable: {num2}", MetaText = BuildStoryClaimMetaText(), ShowClaim = true, ClaimText = "Claim", ClaimAction = ClaimStoryRewards, Highlight = true }); } AddActiveRotatingItems(UIData.DailyQuests, "Daily"); AddActiveRotatingItems(UIData.WeeklyQuests, "Weekly"); AddActiveRotatingItems(UIData.EventQuests, "Event"); if (_items.Count == 0) { AddEmptyState("No active quests", "Active quests will appear here."); } } private void AddActiveRotatingItems(List quests, string kind) { if (quests == null || quests.Count == 0) { return; } for (int i = 0; i < quests.Count; i++) { UIData.QuestEntry questEntry = quests[i]; if (questEntry != null && !string.IsNullOrWhiteSpace(questEntry.Id)) { int num = Math.Max(1, questEntry.Required); int value = Math.Clamp(questEntry.Progress, 0, num); bool flag = questEntry.CanClaim || (questEntry.Completed && !questEntry.Claimed); Action action = (flag ? BuildClaimAction(questEntry, kind) : null); _items.Add(new QuestListItem { Id = (questEntry.Id ?? ""), Title = "[" + kind + "] " + (string.IsNullOrWhiteSpace(questEntry.Title) ? questEntry.Id : questEntry.Title), Description = (string.IsNullOrWhiteSpace(questEntry.Description) ? "Complete objective." : questEntry.Description), ProgressText = $"Progress: {value}/{num}", MetaText = BuildEntryMeta(questEntry), ShowClaim = (flag && action != null), ClaimText = "Claim", ClaimAction = action, Highlight = flag }); } } } private void BuildStoryCatalogItems() { int num = 0; if (UIData.StoryQuests != null) { for (int i = 0; i < UIData.StoryQuests.Count; i++) { UIData.QuestEntry entry = UIData.StoryQuests[i]; if (entry != null && !string.IsNullOrWhiteSpace(entry.Id)) { num++; int num2 = Math.Max(1, entry.Required); int value = Math.Clamp(entry.Progress, 0, num2); bool flag = entry.CanClaim || (entry.Completed && !entry.Claimed); string text = ((!string.IsNullOrWhiteSpace(entry.Status)) ? entry.Status : ((!entry.Completed) ? "Active" : (entry.Claimed ? "Completed" : "Claimable"))); _items.Add(new QuestListItem { Id = (entry.Id ?? ""), Title = (string.IsNullOrWhiteSpace(entry.Title) ? entry.Id : entry.Title) + " [" + text + "]", Description = (string.IsNullOrWhiteSpace(entry.Description) ? "No description." : entry.Description), ProgressText = $"Progress: {value}/{num2}", MetaText = BuildEntryMeta(entry), ShowClaim = flag, ClaimText = (flag ? "Claim" : ""), ClaimAction = (flag ? ((Action)delegate { CommandSender.QuestClaimStory(entry.Id); }) : null), Highlight = (flag || text.Equals("Active", StringComparison.OrdinalIgnoreCase)) }); } } } if (num == 0) { AddEmptyState("No story quests", "Story quest data will appear here when synced."); } } private void BuildRotatingItems(List quests, string kind, int defaultSlots, bool includeEmptySlots, bool allowClaim) { int num = Math.Max(defaultSlots, quests?.Count ?? 0); if (num <= 0 && includeEmptySlots) { num = Math.Max(1, defaultSlots); } for (int i = 0; i < num; i++) { UIData.QuestEntry questEntry = ((quests != null && i < quests.Count) ? quests[i] : null); if (questEntry == null) { if (includeEmptySlots) { _items.Add(new QuestListItem { Id = "", Title = $"Slot {i + 1} - Empty", Description = "No assigned " + kind.ToLowerInvariant() + " quest in this slot.", ProgressText = "Progress: 0/0", MetaText = "Wait for reset cycle.", ShowClaim = false, ClaimText = "", ClaimAction = null, Highlight = false }); } } else { int num2 = Math.Max(1, questEntry.Required); int value = Math.Clamp(questEntry.Progress, 0, num2); bool flag = allowClaim && (questEntry.CanClaim || (questEntry.Completed && !questEntry.Claimed)); Action action = (flag ? BuildClaimAction(questEntry, kind) : null); _items.Add(new QuestListItem { Id = (questEntry.Id ?? ""), Title = (string.IsNullOrWhiteSpace(questEntry.Title) ? $"{kind} Quest {i + 1}" : questEntry.Title), Description = (string.IsNullOrWhiteSpace(questEntry.Description) ? "No description." : questEntry.Description), ProgressText = $"Progress: {value}/{num2}", MetaText = BuildEntryMeta(questEntry), ShowClaim = (flag && action != null), ClaimText = "Claim", ClaimAction = action, Highlight = (questEntry.Completed && !questEntry.Claimed) }); } } if (_items.Count == 0) { AddEmptyState("No " + kind.ToLowerInvariant() + " quests", "No quests are currently assigned."); } } private void BuildEventItems() { int count = _items.Count; BuildRotatingItems(UIData.EventQuests, "Event", 0, includeEmptySlots: false, allowClaim: false); if (_items.Count == count) { AddEmptyState("No event quests", "Event objectives will appear here during quest events."); } } private void BuildCompletedItems() { int num = 0; if (UIData.CompletedQuests != null) { for (int i = 0; i < UIData.CompletedQuests.Count; i++) { UIData.QuestEntry questEntry = UIData.CompletedQuests[i]; if (questEntry != null && !string.IsNullOrWhiteSpace(questEntry.Id)) { num++; string text = (string.IsNullOrWhiteSpace(questEntry.Category) ? "Story" : questEntry.Category); string text2 = (string.IsNullOrWhiteSpace(questEntry.Requirements) ? "No requirement details." : questEntry.Requirements); bool flag = questEntry.CanClaim || (!questEntry.Claimed && string.Equals(text, "Story", StringComparison.OrdinalIgnoreCase)); Action action = (flag ? BuildClaimAction(questEntry, text) : null); string status = (questEntry.Claimed ? "Claimed" : "Unclaimed"); _items.Add(new QuestListItem { Id = (questEntry.Id ?? ""), Title = "[" + text + "] " + (string.IsNullOrWhiteSpace(questEntry.Title) ? questEntry.Id : questEntry.Title), Description = (string.IsNullOrWhiteSpace(questEntry.Description) ? "No description." : questEntry.Description), ProgressText = "Required: " + text2, MetaText = BuildCompletedMeta(questEntry, status), ShowClaim = (flag && action != null), ClaimText = "Claim", ClaimAction = action, Highlight = flag }); } } } if (num == 0) { AddEmptyState("No completed quests", "Completed quests will list name, requirements, and rewards."); } } private static string BuildStoryMetaText() { string text = $"Completed: {UIData.StoryCompletedCount} | Claimable: {UIData.StoryClaimableCount}"; if (UIData.HasStoryTargetNpc) { string text2 = (string.IsNullOrWhiteSpace(UIData.StoryTargetNpcName) ? UIData.StoryTargetNpcId : UIData.StoryTargetNpcName); if (!string.IsNullOrWhiteSpace(text2)) { string text3 = (string.Equals(UIData.StoryTargetNpcStage, "turnin", StringComparison.OrdinalIgnoreCase) ? " (Turn-In)" : ""); text = text + " | Next NPC: " + text2 + text3; } } if (string.IsNullOrWhiteSpace(UIData.StoryRewardPreview)) { return text; } return text + " | Rewards: " + UIData.StoryRewardPreview; } private static string BuildStoryClaimMetaText() { string text = $"Completed: {UIData.StoryCompletedCount} | Claimable: {UIData.StoryClaimableCount}"; if (!UIData.HasStoryTargetNpc) { return text; } if (!string.Equals(UIData.StoryTargetNpcStage, "turnin", StringComparison.OrdinalIgnoreCase)) { return text; } string text2 = (string.IsNullOrWhiteSpace(UIData.StoryTargetNpcName) ? UIData.StoryTargetNpcId : UIData.StoryTargetNpcName); if (string.IsNullOrWhiteSpace(text2)) { return text; } return text + " | Turn in at: " + text2; } private static string BuildEntryMeta(UIData.QuestEntry entry) { if (entry == null) { return ""; } List list = new List(4); if (!string.IsNullOrWhiteSpace(entry.Id)) { list.Add("ID: " + entry.Id); } if (!string.IsNullOrWhiteSpace(entry.Location)) { list.Add("Location: " + entry.Location); } if (!string.IsNullOrWhiteSpace(entry.Status)) { list.Add("Status: " + entry.Status); } if (!string.IsNullOrWhiteSpace(entry.RewardPreview)) { list.Add("Rewards: " + entry.RewardPreview); } return string.Join(" | ", list); } private static string BuildCompletedMeta(UIData.QuestEntry entry, string status) { List list = new List(4); if (!string.IsNullOrWhiteSpace(entry?.Id)) { list.Add("ID: " + entry.Id); } if (!string.IsNullOrWhiteSpace(entry?.Category)) { list.Add("Type: " + entry.Category); } list.Add("Status: " + status); if (!string.IsNullOrWhiteSpace(entry?.RewardPreview)) { list.Add("Rewards: " + entry.RewardPreview); } return string.Join(" | ", list); } private static Action BuildClaimAction(UIData.QuestEntry entry, string kind) { if (entry == null || string.IsNullOrWhiteSpace(entry.Id)) { return null; } string a = (string.IsNullOrWhiteSpace(kind) ? (entry.Category ?? "") : kind); if (string.Equals(a, "Daily", StringComparison.OrdinalIgnoreCase)) { return delegate { CommandSender.QuestClaimDaily(entry.Id); }; } if (string.Equals(a, "Weekly", StringComparison.OrdinalIgnoreCase)) { return delegate { CommandSender.QuestClaimWeekly(entry.Id); }; } if (string.Equals(a, "Story", StringComparison.OrdinalIgnoreCase)) { return delegate { CommandSender.QuestClaimStory(entry.Id); }; } return null; } private void AddEmptyState(string title, string description) { _items.Add(new QuestListItem { Id = "", Title = title, Description = description, ProgressText = "", MetaText = "", ShowClaim = false, ClaimText = "", ClaimAction = null, Highlight = false }); } private static int CountNonNull(List entries) { if (entries == null || entries.Count == 0) { return 0; } int num = 0; for (int i = 0; i < entries.Count; i++) { UIData.QuestEntry questEntry = entries[i]; if (questEntry != null && (!string.IsNullOrWhiteSpace(questEntry.Id) || !string.IsNullOrWhiteSpace(questEntry.Title))) { num++; } } return num; } private void RebuildRows() { //IL_00f9: Unknown result type (might be due to invalid IL or missing references) EnsureRowPool(_items.Count); for (int i = 0; i < _items.Count; i++) { BindRow(_rowPool[i], _items[i], i); } for (int j = _items.Count; j < _rowPool.Count; j++) { if ((Object)(object)_rowPool[j].Root != (Object)null && _rowPool[j].Root.activeSelf) { _rowPool[j].Root.SetActive(false); } } _contentHeight = ((_items.Count <= 0) ? 0f : ((float)_items.Count * 90f)); if ((Object)(object)_contentRect != (Object)null) { _contentRect.sizeDelta = new Vector2(578f, _contentHeight); } SetScrollOffset(_scrollOffset); } private void EnsureRowPool(int count) { while (_rowPool.Count < count) { _rowPool.Add(BuildRow(_rowPool.Count)); } } private RowWidgets BuildRow(int index) { //IL_005e: 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_0128: 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_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) GameObject val = CanvasService.CreatePanel(((Component)_contentRect).transform, $"QuestRow_{index}", 0f, 0f, 576f, 84f, (Color?)new Color(0.08f, 0.07f, 0.1f, 0.8f)); RectTransform component = val.GetComponent(); Image component2 = val.GetComponent(); TextMeshProUGUI component3 = CanvasService.CreateText(val.transform, $"Title_{index}", "", 8f, 6f, 464f, 20f, 12f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); TextMeshProUGUI component4 = CanvasService.CreateText(val.transform, $"Desc_{index}", "", 8f, 24f, 464f, 28f, 10.5f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257).GetComponent(); TextMeshProUGUI component5 = CanvasService.CreateText(val.transform, $"Progress_{index}", "", 8f, 54f, 220f, 16f, 10.5f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); TextMeshProUGUI component6 = CanvasService.CreateText(val.transform, $"Meta_{index}", "", 230f, 54f, 238f, 16f, 10f, CanvasService.TEXT_DISABLED, (TextAlignmentOptions)257).GetComponent(); RowWidgets rowWidgets = new RowWidgets { Root = val, Rect = component, Bg = component2, Title = component3, Desc = component4, Progress = component5, Meta = component6 }; GameObject val2 = CanvasService.CreateButton(val.transform, $"Claim_{index}", "Claim", 476f, 28f, 92f, 24f, (Action)delegate { rowWidgets.ClaimAction?.Invoke(); }, 10.5f, (Color?)new Color(0.2f, 0.12f, 0.05f, 0.92f), (Color?)CanvasService.ACCENT_GOLD, (Color?)null, applyNocturneFont: true); rowWidgets.ClaimButton = val2; RowWidgets rowWidgets2 = rowWidgets; Transform obj = val2.transform.Find($"Text_Claim_{index}_Label"); rowWidgets2.ClaimLabel = ((obj != null) ? ((Component)obj).GetComponent() : null); rowWidgets.ClaimAction = null; val.SetActive(false); return rowWidgets; } private static void BindRow(RowWidgets row, QuestListItem item, int index) { //IL_007e: 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_0048: Unknown result type (might be due to invalid IL or missing references) if (row != null && !((Object)(object)row.Root == (Object)null) && item != null) { row.Root.SetActive(true); ((Graphic)row.Bg).color = (item.Highlight ? new Color(0.1f, 0.13f, 0.1f, 0.9f) : ((index % 2 == 0) ? new Color(0.08f, 0.07f, 0.1f, 0.8f) : new Color(0.07f, 0.06f, 0.09f, 0.76f))); if ((Object)(object)row.Title != (Object)null) { ((TMP_Text)row.Title).text = item.Title ?? ""; } if ((Object)(object)row.Desc != (Object)null) { ((TMP_Text)row.Desc).text = item.Description ?? ""; } if ((Object)(object)row.Progress != (Object)null) { ((TMP_Text)row.Progress).text = item.ProgressText ?? ""; } if ((Object)(object)row.Meta != (Object)null) { ((TMP_Text)row.Meta).text = item.MetaText ?? ""; } row.ClaimAction = item.ClaimAction; if ((Object)(object)row.ClaimButton != (Object)null) { row.ClaimButton.SetActive(item.ShowClaim); } if ((Object)(object)row.ClaimLabel != (Object)null) { ((TMP_Text)row.ClaimLabel).text = item.ClaimText ?? "Claim"; } } } private void ClaimStoryRewards() { if (UIData.StoryClaimableCount > 0) { CommandSender.QuestClaimStory(); } } private void SetScrollOffset(float offset) { _scrollOffset = Mathf.Clamp(offset, 0f, GetMaxScroll()); UpdateRowPositions(); UpdateScrollbarVisual(); } private float GetMaxScroll() { return Mathf.Max(0f, _contentHeight - 366f); } private void UpdateRowPositions() { //IL_008d: Unknown result type (might be due to invalid IL or missing references) if (_rowPool.Count == 0) { return; } for (int i = 0; i < _items.Count && i < _rowPool.Count; i++) { RowWidgets rowWidgets = _rowPool[i]; if (!((Object)(object)rowWidgets?.Rect == (Object)null)) { float num = (float)i * 90f - _scrollOffset; bool flag = num + 84f >= 0f && num <= 366f; if (rowWidgets.Root.activeSelf != flag) { rowWidgets.Root.SetActive(flag); } if (flag) { rowWidgets.Rect.anchoredPosition = new Vector2(0f, 0f - num); } } } } private void UpdateScrollbarVisual() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_scrollThumbRect == (Object)null) && !((Object)(object)_scrollTrackRect == (Object)null)) { float maxScroll = GetMaxScroll(); Rect rect = _scrollTrackRect.rect; float height = ((Rect)(ref rect)).height; float thumbHeight = GetThumbHeight(height); _scrollThumbRect.sizeDelta = new Vector2(_scrollThumbRect.sizeDelta.x, thumbHeight); if (maxScroll <= 0.01f) { ((Component)_scrollThumbRect).gameObject.SetActive(false); return; } ((Component)_scrollThumbRect).gameObject.SetActive(true); float num = Mathf.Max(0f, height - thumbHeight); float num2 = _scrollOffset / maxScroll; _scrollThumbRect.anchoredPosition = new Vector2(0f, 0f - num * num2); } } private float GetThumbHeight(float trackHeight) { if (_contentHeight <= 0.01f) { return trackHeight; } float num = 366f / Mathf.Max(366f, _contentHeight); return Mathf.Clamp(trackHeight * num, 24f, trackHeight); } private void UpdateScrollFromMouse(float mouseY) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) float maxScroll = GetMaxScroll(); if (maxScroll <= 0.01f) { SetScrollOffset(0f); return; } Vector3[] array = (Vector3[])(object)new Vector3[4]; _scrollTrackRect.GetWorldCorners(Il2CppStructArray.op_Implicit(array)); float y = array[1].y; float y2 = array[0].y; Canvas component = _root.GetComponent(); float num = ((component != null) ? component.scaleFactor : 1f); Rect rect = _scrollTrackRect.rect; float num2 = GetThumbHeight(((Rect)(ref rect)).height) * num * 0.5f; float num3 = Mathf.Clamp(mouseY, y2 + num2, y - num2); float num4 = Mathf.InverseLerp(y - num2, y2 + num2, num3); SetScrollOffset(num4 * maxScroll); } private static bool IsPointerOver(RectTransform rect) { //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) if ((Object)(object)rect != (Object)null) { return RectTransformUtility.RectangleContainsScreenPoint(rect, Vector2.op_Implicit(Input.mousePosition), (Camera)null); } return false; } private int ComputeHash() { return HashQuestList(HashQuestList(HashQuestList(HashQuestList(HashQuestList((((((((((((((((int)(17 * 31 + _activeTab) * 31 + UIData.HasActiveStoryQuest.GetHashCode()) * 31 + (UIData.StoryQuestId ?? "").GetHashCode()) * 31 + (UIData.StoryQuestTitle ?? "").GetHashCode()) * 31 + (UIData.StoryStepText ?? "").GetHashCode()) * 31 + UIData.StoryStepProgress) * 31 + UIData.StoryStepRequired) * 31 + (UIData.StoryRewardPreview ?? "").GetHashCode()) * 31 + UIData.StoryCompletedCount) * 31 + UIData.StoryClaimableCount) * 31 + UIData.HasStoryTargetNpc.GetHashCode()) * 31 + (UIData.StoryTargetNpcId ?? "").GetHashCode()) * 31 + (UIData.StoryTargetNpcName ?? "").GetHashCode()) * 31 + (UIData.StoryTargetNpcStage ?? "").GetHashCode()) * 31 + (UIData.DailyResetText ?? "").GetHashCode()) * 31 + (UIData.WeeklyResetText ?? "").GetHashCode(), UIData.StoryQuests), UIData.DailyQuests), UIData.WeeklyQuests), UIData.EventQuests), UIData.CompletedQuests); } private static int HashQuestList(int seed, List entries) { int num = seed * 31 + (entries?.Count ?? 0); if (entries == null || entries.Count == 0) { return num; } for (int i = 0; i < entries.Count; i++) { num = HashQuestEntry(num, entries[i]); } return num; } private static int HashQuestEntry(int seed, UIData.QuestEntry entry) { if (entry == null) { return seed * 31; } return ((((((((((((seed * 31 + (entry.Id ?? "").GetHashCode()) * 31 + (entry.Category ?? "").GetHashCode()) * 31 + (entry.Status ?? "").GetHashCode()) * 31 + (entry.Title ?? "").GetHashCode()) * 31 + (entry.Description ?? "").GetHashCode()) * 31 + (entry.Requirements ?? "").GetHashCode()) * 31 + (entry.Location ?? "").GetHashCode()) * 31 + (entry.RewardPreview ?? "").GetHashCode()) * 31 + entry.Progress) * 31 + entry.Required) * 31 + entry.Completed.GetHashCode()) * 31 + entry.Claimed.GetHashCode()) * 31 + entry.CanClaim.GetHashCode(); } } internal class QuestTrackerHUD { private enum TrackerMode { Story, Daily, Weekly } private struct QuestView { public string Kind; public string Id; public string Title; public string Step; public string RewardPreview; public int Progress; public int Required; public bool Completed; public bool Claimed; } private const float STEP_FONT_NORMAL = 11.2f; private const float STEP_FONT_KILL = 16f; private const float WIDTH = 320f; private const float HEIGHT = 112f; private const float COMPLETE_PULSE_SECONDS = 2.1f; private static readonly Color KIND_DAILY = new Color(0.5f, 0.85f, 1f, 1f); private static readonly Color KIND_WEEKLY = new Color(0.65f, 1f, 0.65f, 1f); private static readonly Color STATE_ACTIVE = new Color(0.76f, 0.58f, 0.25f, 0.95f); private static readonly Color STATE_COMPLETE = new Color(0.93f, 0.77f, 0.36f, 0.98f); private static readonly Color STATE_CLAIMED = new Color(0.36f, 0.36f, 0.38f, 0.92f); private static readonly Color STATE_PULSE = new Color(1f, 0.92f, 0.58f, 1f); private static readonly Color BG_ACTIVE = new Color(0.06f, 0.05f, 0.08f, 0.9f); private static readonly Color BG_COMPLETE = new Color(0.1f, 0.08f, 0.06f, 0.92f); private static readonly Color BG_CLAIMED = new Color(0.06f, 0.06f, 0.07f, 0.9f); private GameObject _root; private RectTransform _rootRect; private RectTransform _progressBarRect; private RectTransform _progressFillRect; private Image _rootBg; private Image _topDivider; private bool _created; private TextMeshProUGUI _txtKind; private TextMeshProUGUI _txtTitle; private TextMeshProUGUI _txtStep; private TextMeshProUGUI _txtProgress; private TextMeshProUGUI _txtClaim; private Image _progressFill; private RectTransform _titleRect; private RectTransform _stepRect; private TrackerMode _mode; private float _completionPulseUntilUnscaled; private bool _hasLastView; private QuestView _lastView; public string CycleMode() { _mode = (TrackerMode)((int)(_mode + 1) % 3); return ModeLabel(_mode); } public void Refresh() { if (!_created) { Create(); } if (!_created) { return; } QuestView view; bool flag = TryBuildCurrentQuest(out view); bool flag2 = UIConfig.ShowQuestTracker && flag; _root.SetActive(flag2 && !NativeMenuWatcher.MenuOpen); if (!flag2) { _hasLastView = false; return; } if (_hasLastView && !_lastView.Completed && view.Completed) { _completionPulseUntilUnscaled = Time.unscaledTime + 2.1f; } ApplyStateVisuals(view); _lastView = view; _hasLastView = true; } public void Destroy() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; _rootRect = null; _progressBarRect = null; _progressFillRect = null; _rootBg = null; _topDivider = null; _progressFill = null; _created = false; _hasLastView = false; } private void Create() { //IL_0049: 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_007d: 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_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_013f: 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_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: 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_0365: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Expected O, but got Unknown //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03b9: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService != null) { _root = canvasService.CreateRootWindow("HUD_QuestTracker", 320f, 112f, 58); _rootRect = _root.GetComponent(); _rootRect.anchorMin = new Vector2(1f, 1f); _rootRect.anchorMax = new Vector2(1f, 1f); _rootRect.pivot = new Vector2(1f, 1f); _rootRect.anchoredPosition = new Vector2(-12f, -300f); _rootBg = _root.GetComponent(); if ((Object)(object)_rootBg != (Object)null) { ((Graphic)_rootBg).color = BG_ACTIVE; } GameObject val = CanvasService.CreateDivider(_root.transform, "Top", 0f, 0f, 320f, 2f, STATE_ACTIVE); _topDivider = val.GetComponent(); _txtKind = CanvasService.CreateText(_root.transform, "Kind", "STORY", 10f, 8f, 120f, 14f, 10f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257).GetComponent(); _txtProgress = CanvasService.CreateText(_root.transform, "Progress", "0/1", 220f, 48f, 90f, 26f, 20f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)4100).GetComponent(); ((TMP_Text)_txtProgress).fontStyle = (FontStyles)1; _txtTitle = CanvasService.CreateText(_root.transform, "Title", "Quest Title", 10f, 24f, 204f, 20f, 12f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)257).GetComponent(); _titleRect = ((Component)_txtTitle).GetComponent(); ((TMP_Text)_txtTitle).enableWordWrapping = false; ((TMP_Text)_txtTitle).overflowMode = (TextOverflowModes)1; _txtStep = CanvasService.CreateText(_root.transform, "Step", "Complete objective.", 10f, 44f, 204f, 34f, 10f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)257).GetComponent(); _stepRect = ((Component)_txtStep).GetComponent(); ((TMP_Text)_txtStep).enableWordWrapping = true; ((TMP_Text)_txtStep).overflowMode = (TextOverflowModes)1; _txtClaim = CanvasService.CreateText(_root.transform, "Claim", "", 10f, 78f, 300f, 16f, 9.8f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)4097).GetComponent(); ((TMP_Text)_txtClaim).enableWordWrapping = false; ((TMP_Text)_txtClaim).overflowMode = (TextOverflowModes)1; GameObject val2 = CanvasService.CreatePanel(_root.transform, "ProgressBG", 10f, 100f, 300f, 6f, (Color?)new Color(0.08f, 0.08f, 0.1f, 0.95f)); _progressBarRect = val2.GetComponent(); GameObject val3 = new GameObject("ProgressFill"); val3.transform.SetParent(val2.transform, false); _progressFillRect = val3.AddComponent(); _progressFillRect.anchorMin = Vector2.zero; _progressFillRect.anchorMax = new Vector2(0f, 1f); _progressFillRect.offsetMin = Vector2.zero; _progressFillRect.offsetMax = Vector2.zero; _progressFill = val3.AddComponent(); ((Graphic)_progressFill).color = STATE_ACTIVE; CanvasService.MakeDraggable(_root); HUDPositionService.ApplySaved(_root, "HUD_QuestTracker"); ApplyExpanded(); _root.SetActive(false); _created = true; } } private void ApplyExpanded() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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_00b0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_rootRect != (Object)null) { _rootRect.sizeDelta = new Vector2(320f, 112f); } if ((Object)(object)_progressBarRect != (Object)null) { _progressBarRect.anchoredPosition = new Vector2(10f, -100f); } if ((Object)(object)_titleRect != (Object)null) { _titleRect.anchoredPosition = new Vector2(10f, -24f); } if ((Object)(object)_stepRect != (Object)null) { _stepRect.anchoredPosition = new Vector2(10f, -46f); _stepRect.sizeDelta = new Vector2(204f, 30f); } if ((Object)(object)_txtStep != (Object)null) { ((Component)_txtStep).gameObject.SetActive(true); } if ((Object)(object)_txtClaim != (Object)null) { ((Component)_txtClaim).gameObject.SetActive(true); } } private void ApplyStateVisuals(QuestView view) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_0060: 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) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_0357: 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_0360: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: 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_03c1: Unknown result type (might be due to invalid IL or missing references) ((TMP_Text)_txtKind).text = view.Kind.ToUpperInvariant(); TextMeshProUGUI txtKind = _txtKind; ((Graphic)txtKind).color = (Color)(view.Kind switch { "Story" => CanvasService.ACCENT_GOLD, "Daily" => KIND_DAILY, "Weekly" => KIND_WEEKLY, _ => CanvasService.TEXT_SECONDARY, }); ((TMP_Text)_txtTitle).text = (string.IsNullOrWhiteSpace(view.Title) ? "Quest" : view.Title); ((TMP_Text)_txtStep).text = (string.IsNullOrWhiteSpace(view.Step) ? "Complete objective." : view.Step); bool flag = IsNumberedKillObjective(view.Step, view.Title); ((TMP_Text)_txtStep).fontSize = (flag ? 16f : 11.2f); ((TMP_Text)_txtStep).fontStyle = (FontStyles)(flag ? 1 : 0); ((TMP_Text)_txtStep).alignment = (TextAlignmentOptions)4097; ((Graphic)_txtStep).color = (flag ? CanvasService.TEXT_PRIMARY : CanvasService.TEXT_SECONDARY); int num = Math.Max(1, view.Required); int num2 = Mathf.Clamp(view.Progress, 0, num); if (view.Claimed) { ((TMP_Text)_txtProgress).text = "DONE"; ((Graphic)_txtProgress).color = CanvasService.TEXT_DISABLED; } else if (view.Completed) { ((TMP_Text)_txtProgress).text = "READY"; ((Graphic)_txtProgress).color = CanvasService.ACCENT_GOLD; } else { ((TMP_Text)_txtProgress).text = $"{num2}/{num}"; ((Graphic)_txtProgress).color = CanvasService.TEXT_PRIMARY; } string text = ""; if (string.Equals(view.Kind, "Story", StringComparison.OrdinalIgnoreCase) && UIData.HasStoryTargetNpc) { string text2 = (string.IsNullOrWhiteSpace(UIData.StoryTargetNpcName) ? UIData.StoryTargetNpcId : UIData.StoryTargetNpcName); if (!string.IsNullOrWhiteSpace(text2)) { text = (string.Equals(UIData.StoryTargetNpcStage, "turnin", StringComparison.OrdinalIgnoreCase) ? ("Turn in at: " + text2) : ("Next NPC: " + text2)); } } if (!string.IsNullOrWhiteSpace(text)) { ((TMP_Text)_txtClaim).text = text; ((Graphic)_txtClaim).color = (string.Equals(UIData.StoryTargetNpcStage, "turnin", StringComparison.OrdinalIgnoreCase) ? CanvasService.ACCENT_GOLD : CanvasService.TEXT_SECONDARY); } else { ((TMP_Text)_txtClaim).text = ""; } float num3 = ((num > 0) ? ((float)num2 / (float)num) : 0f); if (view.Completed || view.Claimed) { num3 = 1f; } if ((Object)(object)_progressFillRect != (Object)null) { _progressFillRect.anchorMax = new Vector2(Mathf.Clamp01(num3), 1f); } Color val = (view.Claimed ? STATE_CLAIMED : (view.Completed ? STATE_COMPLETE : STATE_ACTIVE)); if (view.Completed && !view.Claimed && Time.unscaledTime < _completionPulseUntilUnscaled) { float num4 = (Mathf.Sin(Time.unscaledTime * 18f) + 1f) * 0.5f; val = Color.Lerp(val, STATE_PULSE, num4); } if ((Object)(object)_progressFill != (Object)null) { ((Graphic)_progressFill).color = val; } if ((Object)(object)_topDivider != (Object)null) { ((Graphic)_topDivider).color = val; } if ((Object)(object)_rootBg != (Object)null) { ((Graphic)_rootBg).color = (view.Claimed ? BG_CLAIMED : (view.Completed ? BG_COMPLETE : BG_ACTIVE)); } } private bool TryBuildCurrentQuest(out QuestView view) { QuestView view2; bool flag = TryGetStory(out view2); QuestView view3; bool flag2 = TryGetRotating(UIData.DailyQuests, "Daily", out view3); QuestView view4; bool flag3 = TryGetRotating(UIData.WeeklyQuests, "Weekly", out view4); TrackerMode[] array = _mode switch { TrackerMode.Daily => new TrackerMode[3] { TrackerMode.Daily, TrackerMode.Story, TrackerMode.Weekly }, TrackerMode.Weekly => new TrackerMode[3] { TrackerMode.Weekly, TrackerMode.Daily, TrackerMode.Story }, _ => new TrackerMode[3] { TrackerMode.Story, TrackerMode.Daily, TrackerMode.Weekly }, }; foreach (TrackerMode trackerMode in array) { if (trackerMode == TrackerMode.Story && flag) { view = view2; return true; } if (trackerMode == TrackerMode.Daily && flag2) { view = view3; return true; } if (trackerMode == TrackerMode.Weekly && flag3) { view = view4; return true; } } view = default(QuestView); return false; } private static bool TryGetStory(out QuestView view) { if (UIData.HasActiveStoryQuest && (!string.IsNullOrWhiteSpace(UIData.StoryQuestTitle) || !string.IsNullOrWhiteSpace(UIData.StoryQuestId))) { view = new QuestView { Kind = "Story", Id = (UIData.StoryQuestId ?? ""), Title = ((!string.IsNullOrWhiteSpace(UIData.StoryQuestTitle)) ? UIData.StoryQuestTitle : UIData.StoryQuestId), Step = (string.IsNullOrWhiteSpace(UIData.StoryStepText) ? "Complete objective." : UIData.StoryStepText), RewardPreview = (UIData.StoryRewardPreview ?? ""), Progress = Math.Max(0, UIData.StoryStepProgress), Required = Math.Max(1, UIData.StoryStepRequired), Completed = (UIData.StoryStepProgress >= Math.Max(1, UIData.StoryStepRequired)), Claimed = false }; return true; } view = default(QuestView); return false; } private static bool TryGetRotating(List entries, string kind, out QuestView view) { view = default(QuestView); if (entries == null || entries.Count == 0) { return false; } UIData.QuestEntry questEntry = null; for (int i = 0; i < entries.Count; i++) { UIData.QuestEntry questEntry2 = entries[i]; if (questEntry2 != null) { if (questEntry == null) { questEntry = questEntry2; } if (!questEntry2.Completed && !questEntry2.Claimed) { questEntry = questEntry2; break; } } } if (questEntry == null) { return false; } view = new QuestView { Kind = kind, Id = (questEntry.Id ?? ""), Title = ((!string.IsNullOrWhiteSpace(questEntry.Title)) ? questEntry.Title : questEntry.Id), Step = (string.IsNullOrWhiteSpace(questEntry.Description) ? "Complete objective." : questEntry.Description), RewardPreview = (questEntry.RewardPreview ?? ""), Progress = Math.Max(0, questEntry.Progress), Required = Math.Max(1, questEntry.Required), Completed = questEntry.Completed, Claimed = questEntry.Claimed }; return true; } private static bool SameObjective(QuestView a, QuestView b) { if (string.Equals(a.Kind, b.Kind, StringComparison.Ordinal) && string.Equals(a.Id, b.Id, StringComparison.OrdinalIgnoreCase)) { return string.Equals(a.Step, b.Step, StringComparison.Ordinal); } return false; } private static string ModeLabel(TrackerMode mode) { return mode switch { TrackerMode.Daily => "Daily", TrackerMode.Weekly => "Weekly", _ => "Story", }; } private static bool IsNumberedKillObjective(string step, string title) { string text = (title + " " + step).ToLowerInvariant(); if (!text.Contains("kill") && !text.Contains("defeat") && !text.Contains("slay") && !text.Contains("eliminate")) { return false; } for (int i = 0; i < text.Length; i++) { if (char.IsDigit(text[i])) { return true; } } return false; } } internal class RiteOfferingPanel { private const float W = 420f; private const float H = 296f; private const float Pad = 16f; private GameObject _root; private CanvasGroup _canvasGroup; private TextMeshProUGUI _titleLabel; private TextMeshProUGUI _nameLabel; private TextMeshProUGUI _boonLabel; private TextMeshProUGUI _baneLabel; private TextMeshProUGUI _primaryBtnLabel; private TextMeshProUGUI _dismissBtnLabel; private bool _created; private bool _visible; private int _currentSlot = -1; private RiteOfferingManager.OfferingRecord _currentOffer; private bool _isStart; private bool _awaitingConfirm; private static readonly string[] StartTitles = new string[2] { "BEGIN THE RITE", "THE HORDE AWAITS" }; private static int _startTitleIndex = 0; private const int SlotStartStatue = -1; private const int SlotExchange = -2; private const int SlotBossStatue = -3; public bool IsVisible => _visible; public void Create() { //IL_004a: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) if (!_created) { CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService != null) { _root = canvasService.CreateRootWindow("RiteOffering", 420f, 296f, 210); RectTransform component = _root.GetComponent(); component.anchorMin = new Vector2(0.5f, 0.5f); component.anchorMax = new Vector2(0.5f, 0.5f); component.anchoredPosition = Vector2.zero; ((Graphic)_root.GetComponent()).color = new Color(0.07f, 0.05f, 0.09f, 0.97f); _canvasGroup = _root.AddComponent(); _titleLabel = CanvasService.CreateText(_root.transform, "OfferTitle", "CHOOSE AN OFFERING", 16f, 16f, 388f, 24f, 16f, (Color?)new Color(1f, 0.84f, 0.2f, 1f), (TextAlignmentOptions)258, applyNocturneFont: true).GetComponent(); CanvasService.CreateDivider(_root.transform, "OfferDiv1", 16f, 48f, 388f, 1f, (Color?)new Color(1f, 1f, 1f, 0.15f)); _nameLabel = CanvasService.CreateText(_root.transform, "OfferName", "", 16f, 58f, 388f, 28f, 20f, Color.white, (TextAlignmentOptions)258).GetComponent(); _boonLabel = CanvasService.CreateText(_root.transform, "OfferBoon", "", 16f, 94f, 388f, 50f, 14f, (Color?)new Color(0.55f, 0.9f, 0.55f, 1f), (TextAlignmentOptions)258, applyNocturneFont: true).GetComponent(); _baneLabel = CanvasService.CreateText(_root.transform, "OfferBane", "", 16f, 146f, 388f, 40f, 14f, (Color?)new Color(0.95f, 0.42f, 0.42f, 1f), (TextAlignmentOptions)258, applyNocturneFont: true).GetComponent(); _primaryBtnLabel = CanvasService.CreateButton(_root.transform, "OfferConfirm", "Choose This Offering", 16f, 208f, 388f, 32f, (Action)OnConfirm, 14f, (Color?)new Color(0.2f, 0.45f, 0.2f, 1f), (Color?)Color.white, (Color?)new Color(0.3f, 0.6f, 0.3f, 1f), applyNocturneFont: true).GetComponentInChildren(); _dismissBtnLabel = CanvasService.CreateButton(_root.transform, "OfferDismiss", "Let me think about it...", 16f, 248f, 388f, 30f, (Action)OnDismiss, 13f, (Color?)new Color(0.22f, 0.22f, 0.26f, 1f), (Color?)new Color(0.8f, 0.8f, 0.85f, 1f), (Color?)new Color(0.32f, 0.32f, 0.38f, 1f), applyNocturneFont: true).GetComponentInChildren(); _root.SetActive(false); _created = true; } } } public void Show(RiteOfferingManager.OfferingRecord offer) { if (_created && offer != null) { _currentSlot = offer.Slot; _currentOffer = offer; _isStart = offer.IsStart; _awaitingConfirm = false; if (_isStart) { ShowSentinelPrompt(offer); } else { ShowOfferingDetail(offer); } _root.SetActive(true); _visible = true; } } private void ShowOfferingDetail(RiteOfferingManager.OfferingRecord offer) { if ((Object)(object)_titleLabel != (Object)null) { ((TMP_Text)_titleLabel).text = "CHOOSE AN OFFERING"; } string value = (string.IsNullOrWhiteSpace(offer.Color) ? "#C8C8C8" : offer.Color); if ((Object)(object)_nameLabel != (Object)null) { ((TMP_Text)_nameLabel).text = $"{offer.Name}"; } if ((Object)(object)_boonLabel != (Object)null) { ((TMP_Text)_boonLabel).text = (string.IsNullOrWhiteSpace(offer.Boon) ? "" : ("Boon: " + offer.Boon)); } if ((Object)(object)_baneLabel != (Object)null) { ((TMP_Text)_baneLabel).text = (string.IsNullOrWhiteSpace(offer.Bane) ? "" : ("Bane: " + offer.Bane)); } if ((Object)(object)_primaryBtnLabel != (Object)null) { ((TMP_Text)_primaryBtnLabel).text = "Choose This Offering"; } if ((Object)(object)_dismissBtnLabel != (Object)null) { ((TMP_Text)_dismissBtnLabel).text = "Let me think about it..."; } } private void ShowSentinelPrompt(RiteOfferingManager.OfferingRecord offer) { string text; string text2; string text3; switch (offer?.Slot ?? (-1)) { case -2: text = "THE EXCHANGE"; text2 = "Trade"; text3 = "Not now"; break; case -3: text = "THE HORDE LEADER"; text2 = "Enter the Lair"; text3 = "Wait"; break; default: text = StartTitles[_startTitleIndex % StartTitles.Length]; _startTitleIndex++; text2 = "Begin the Horde"; text3 = "Not yet..."; break; } if ((Object)(object)_titleLabel != (Object)null) { ((TMP_Text)_titleLabel).text = text; } string value = ((offer == null || string.IsNullOrWhiteSpace(offer.Color)) ? "#FFD700" : offer.Color); string value2 = ((offer == null || string.IsNullOrWhiteSpace(offer.Name)) ? "Begin the Horde" : offer.Name); string text4 = ((offer == null || string.IsNullOrWhiteSpace(offer.Boon)) ? "Interact to summon the first wave." : offer.Boon); if ((Object)(object)_nameLabel != (Object)null) { ((TMP_Text)_nameLabel).text = $"{value2}"; } if ((Object)(object)_boonLabel != (Object)null) { ((TMP_Text)_boonLabel).text = text4; } if ((Object)(object)_baneLabel != (Object)null) { ((TMP_Text)_baneLabel).text = ""; } if ((Object)(object)_primaryBtnLabel != (Object)null) { ((TMP_Text)_primaryBtnLabel).text = text2; } if ((Object)(object)_dismissBtnLabel != (Object)null) { ((TMP_Text)_dismissBtnLabel).text = text3; } } private void ShowSentinelConfirm() { _awaitingConfirm = true; string text; string text2; string text3; string text4; switch (_currentSlot) { case -2: text = "Trade Ichor for Iron?"; text2 = "Ichor vanishes when the lair closes; Iron does not. You can trade again as long as you can afford it."; text3 = "Trade"; text4 = "Not now"; break; case -3: text = "Face the Horde Leader?"; text2 = "Your whole party will be pulled into the lair."; text3 = "Enter the Lair"; text4 = "Wait"; break; default: text = "Are you ready?"; text2 = "Do you have all your party members? They will not be able to join once the Rite starts."; text3 = "Yes, begin!"; text4 = "Wait"; break; } if ((Object)(object)_nameLabel != (Object)null) { ((TMP_Text)_nameLabel).text = "" + text + ""; } if ((Object)(object)_boonLabel != (Object)null) { ((TMP_Text)_boonLabel).text = text2; } if ((Object)(object)_baneLabel != (Object)null) { ((TMP_Text)_baneLabel).text = ""; } if ((Object)(object)_primaryBtnLabel != (Object)null) { ((TMP_Text)_primaryBtnLabel).text = text3; } if ((Object)(object)_dismissBtnLabel != (Object)null) { ((TMP_Text)_dismissBtnLabel).text = text4; } } public void Hide() { if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } _visible = false; _currentSlot = -1; _isStart = false; _awaitingConfirm = false; } public void Dispose() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _created = false; _visible = false; } private void OnConfirm() { if (_isStart) { if (!_awaitingConfirm) { ShowSentinelConfirm(); return; } CommandSender.RiteOfferPick(_currentSlot); Hide(); } else { if (_currentSlot >= 0) { CommandSender.RiteOfferPick(_currentSlot); } Hide(); } } private void OnDismiss() { if (_isStart && _awaitingConfirm) { _awaitingConfirm = false; ShowSentinelPrompt(_currentOffer); } else { Hide(); } } } public class SystemFeedPanel { private static readonly bool DEV_VISIBLE_CHROME = false; private const float WIDTH = 240f; private const float HEIGHT = 370f; private const int BUFFER_MAX = 200; private const int VISIBLE_LINES = 24; private const float IDLE_BEFORE_FADE = 10f; private const float FADE_DURATION = 1.5f; private const float LINE_LIFETIME = 30f; private static readonly List<(float Time, string Text)> _lines = new List<(float, string)>(); private static SystemFeedPanel _instance; private static bool _dirty; private static float _lastActivity; private GameObject _root; private TextMeshProUGUI _txtBody; private CanvasGroup _fadeGroup; private static readonly Dictionary _categoryColors = new Dictionary { { "xp", "#7FD47F" }, { "quest", "#E7C46B" }, { "familiar", "#9FD0FF" }, { "class", "#D49FFF" }, { "error", "#FF7A7A" } }; private static float _lastAppliedAlpha = -1f; private static float _nextExpiryCheck; public SystemFeedPanel() { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) _instance?.Destroy(); CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService == null) { return; } _root = canvasService.CreateRootWindow("HUD_SystemFeed", 240f, 370f, 52); RectTransform component = _root.GetComponent(); if (!DEV_VISIBLE_CHROME) { Image component2 = _root.GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Graphic)component2).color = new Color(0f, 0f, 0f, 0f); } } component.anchorMin = new Vector2(1f, 0f); component.anchorMax = new Vector2(1f, 0f); component.pivot = new Vector2(1f, 0f); component.anchoredPosition = new Vector2(-14f, 26f); if (DEV_VISIBLE_CHROME) { CanvasService.CreateText(_root.transform, "Header", "SYSTEM", 8f, 4f, 120f, 14f, 10f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257); CanvasService.CreateDivider(_root.transform, "HeaderLine", 0f, 20f, 240f, 1f, (Color?)new Color(1f, 1f, 1f, 0.15f)); } _txtBody = CanvasService.CreateText(_root.transform, "Body", "", 8f, 24f, 224f, 340f, 11f, CanvasService.TEXT_PRIMARY, (TextAlignmentOptions)1025).GetComponent(); ((TMP_Text)_txtBody).richText = true; ((TMP_Text)_txtBody).overflowMode = (TextOverflowModes)3; ((TMP_Text)_txtBody).enableWordWrapping = true; ((TMP_Text)_txtBody).outlineWidth = 0.18f; ((TMP_Text)_txtBody).outlineColor = new Color32((byte)0, (byte)0, (byte)0, (byte)200); _fadeGroup = _root.AddComponent(); _fadeGroup.alpha = 1f; _fadeGroup.blocksRaycasts = true; HUDPositionService.ApplySaved(_root, "HUD_SystemFeed"); CanvasService.MakeDraggable(_root, _root.transform); _instance = this; _dirty = true; Refresh(); } public static void Enqueue(string category, string text) { if (!string.IsNullOrWhiteSpace(text)) { string value2; string value = (_categoryColors.TryGetValue(category ?? "", out value2) ? value2 : "#CCCCCC"); _lines.Add((Time.unscaledTime, $"{text}")); if (_lines.Count > 200) { _lines.RemoveRange(0, _lines.Count - 200); } _lastActivity = Time.unscaledTime; _dirty = true; _instance?.Refresh(); } } public void Refresh() { if ((Object)(object)_root == (Object)null) { return; } bool flag = UIConfig.ShowSystemFeed && !NativeMenuWatcher.MenuOpen; _root.SetActive(flag); if (flag && _dirty) { _dirty = false; int num = Mathf.Max(0, _lines.Count - 24); StringBuilder stringBuilder = new StringBuilder(); for (int i = num; i < _lines.Count; i++) { stringBuilder.AppendLine(_lines[i].Text); } ((TMP_Text)_txtBody).text = stringBuilder.ToString(); } } public static void RefreshVisibility() { _dirty = true; _lastActivity = Time.unscaledTime; _instance?.Refresh(); } public static void Tick() { SystemFeedPanel instance = _instance; if (instance == null || (Object)(object)instance._root == (Object)null || !instance._root.activeSelf) { return; } float unscaledTime = Time.unscaledTime; if (unscaledTime >= _nextExpiryCheck) { _nextExpiryCheck = unscaledTime + 0.5f; int i; for (i = 0; i < _lines.Count && unscaledTime - _lines[i].Time > 30f; i++) { } if (i > 0) { _lines.RemoveRange(0, i); _dirty = true; instance.Refresh(); } } if ((Object)(object)instance._fadeGroup != (Object)null) { float num = unscaledTime - _lastActivity; float num2 = ((num <= 10f) ? 1f : Mathf.Clamp01(1f - (num - 10f) / 1.5f)); if (Mathf.Abs(num2 - _lastAppliedAlpha) > 0.001f) { _lastAppliedAlpha = num2; instance._fadeGroup.alpha = num2; instance._fadeGroup.blocksRaycasts = num2 > 0.05f; } } } public void Destroy() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } if (_instance == this) { _instance = null; } } } internal class TimerHUD { private const float W = 160f; private const float H = 72f; private const float OffsetX = -470f; private const float OffsetY = -20f; private GameObject _root; private CanvasGroup _group; private TextMeshProUGUI _caption; private TextMeshProUGUI _time; private bool _created; private bool _running; private long _endUtcMs; private bool _flashOnZero; private bool _flashing; private int _flashesRemaining; private float _flashTimer; private const float FlashInterval = 0.25f; public bool IsRunning => _running; public void Create() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) if (_created) { return; } CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService != null) { _root = canvasService.CreateRootWindow("HUD_Timer", 160f, 72f, 60); RectTransform component = _root.GetComponent(); component.anchorMin = new Vector2(1f, 1f); component.anchorMax = new Vector2(1f, 1f); component.pivot = new Vector2(1f, 1f); component.anchoredPosition = new Vector2(-470f, -20f); Image component2 = _root.GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Graphic)component2).color = new Color(0f, 0f, 0f, 0.35f); } _group = _root.AddComponent(); _caption = CanvasService.CreateText(_root.transform, "TimerCaption", "", 0f, 6f, 160f, 22f, 14f, (Color?)new Color(1f, 0.84f, 0.2f, 1f), (TextAlignmentOptions)514, applyNocturneFont: true).GetComponent(); _time = CanvasService.CreateText(_root.transform, "TimerValue", "0:00", 0f, 28f, 160f, 44f, 28f, Color.white, (TextAlignmentOptions)514).GetComponent(); _root.SetActive(false); _created = true; } } public void Begin(long endUtcMs, string label, bool flashOnZero) { if (_created) { _endUtcMs = endUtcMs; _flashOnZero = flashOnZero; _running = true; _flashing = false; _flashesRemaining = 0; if ((Object)(object)_caption != (Object)null) { ((TMP_Text)_caption).text = label ?? ""; } if ((Object)(object)_group != (Object)null) { _group.alpha = 1f; } _root.SetActive(true); UpdateDisplay(NowMs()); } } public void Stop() { _running = false; _flashing = false; _flashesRemaining = 0; if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } } public void Tick(float dt) { if (!_created || !_running) { return; } if (_flashing) { TickFlash(dt); return; } long num = NowMs(); if (_endUtcMs - num <= 0) { if ((Object)(object)_time != (Object)null) { ((TMP_Text)_time).text = "0:00"; } if (_flashOnZero) { _flashing = true; _flashesRemaining = 3; _flashTimer = 0f; if ((Object)(object)_group != (Object)null) { _group.alpha = 1f; } } else { Stop(); } } else { UpdateDisplay(num); } } private void TickFlash(float dt) { _flashTimer += dt; if (_flashTimer < 0.25f) { return; } _flashTimer = 0f; if (!((Object)(object)_group != (Object)null)) { return; } if (_group.alpha > 0.5f) { _group.alpha = 0f; return; } _group.alpha = 1f; _flashesRemaining--; if (_flashesRemaining <= 0) { Stop(); } } private void UpdateDisplay(long now) { long num = _endUtcMs - now; if (num < 0) { num = 0L; } int num2 = (int)(num / 1000); int value = num2 / 60; int value2 = num2 % 60; if ((Object)(object)_time != (Object)null) { ((TMP_Text)_time).text = $"{value}:{value2:D2}"; } } private static long NowMs() { return DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); } public void Dispose() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _created = false; _running = false; } } internal class UIDesignPanel { private const float Width = 620f; private const float Height = 980f; private GameObject _root; private Image _frameImage; private TextMeshProUGUI _statusText; private bool _visible; public bool IsVisible => _visible; public void Show(string imagePath) { if ((Object)(object)_root == (Object)null) { Create(); } _visible = true; _root.SetActive(true); Refresh(imagePath); } public void Hide() { if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } _visible = false; } public void Dispose() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; _visible = false; } private void Refresh(string imagePath) { if ((Object)(object)_root == (Object)null) { return; } string text = (string.IsNullOrWhiteSpace(imagePath) ? "ui/custom_frame.png" : imagePath.Trim()); Sprite val = null; string text2 = ""; List list = BuildCandidates(text); for (int i = 0; i < list.Count; i++) { string text3 = list[i]; val = CanvasService.LoadSpriteFromModImages(text3); if ((Object)(object)val != (Object)null) { text2 = text3; break; } } if ((Object)(object)_frameImage != (Object)null) { _frameImage.sprite = val; ((Behaviour)_frameImage).enabled = (Object)(object)val != (Object)null; } if (!((Object)(object)_statusText == (Object)null)) { if ((Object)(object)val != (Object)null) { ((TMP_Text)_statusText).text = "Design frame loaded: " + text2; } else { ((TMP_Text)_statusText).text = "Frame not found: " + text; } } } private void Create() { //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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) CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService != null) { _root = canvasService.CreateRootWindow("UIDesignPanel", 620f, 980f, 230); Image component = _root.GetComponent(); if ((Object)(object)component != (Object)null) { ((Graphic)component).color = new Color(0.06f, 0.05f, 0.09f, 0.9f); } _frameImage = CanvasService.CreateImage(_root.transform, "Frame", 0f, 0f, 620f, 980f, null, Color.white).GetComponent(); ((Behaviour)_frameImage).enabled = false; _statusText = CanvasService.CreateText(_root.transform, "Status", "", 12f, 950f, 530f, 20f, 11f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)4097).GetComponent(); ((TMP_Text)_statusText).enableWordWrapping = false; CanvasService.CreateCloseButton(_root.transform, 620f, delegate { Hide(); }); GameObject val = CanvasService.CreatePanel(_root.transform, "DesignDragHandle", 0f, 0f, 620f, 34f, (Color?)new Color(0f, 0f, 0f, 0f)); Image component2 = val.GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Graphic)component2).raycastTarget = true; } CanvasService.MakeDraggable(_root, val.transform); HUDPositionService.ApplySaved(_root, "UIDesignPanel"); _root.SetActive(false); } } private static List BuildCandidates(string request) { List list = new List(6); if (string.IsNullOrWhiteSpace(request)) { list.Add("ui/custom_frame.png"); return list; } string text = request.Trim().Replace('\\', '/'); list.Add(text); if (!text.EndsWith(".png", StringComparison.OrdinalIgnoreCase) && !text.EndsWith(".jpg", StringComparison.OrdinalIgnoreCase) && !text.EndsWith(".jpeg", StringComparison.OrdinalIgnoreCase)) { list.Add(text + ".png"); list.Add(text + ".jpg"); list.Add(text + ".jpeg"); } return list; } } internal class UISettingsPanel { private GameObject _root; private bool _visible; private readonly Action _onBack; private TextMeshProUGUI _lblLock; private TextMeshProUGUI _lblXPBar; private TextMeshProUGUI _lblStacks; private TextMeshProUGUI _lblFamHP; private TextMeshProUGUI _lblNotify; private TextMeshProUGUI _lblEventHUD; private TextMeshProUGUI _lblQuestHUD; private TextMeshProUGUI _lblSystemFeed; private const float W = 360f; private const float H = 540f; public bool IsVisible => _visible; public UISettingsPanel(Action onBack = null) { _onBack = onBack; } public void Show() { if ((Object)(object)_root == (Object)null) { Create(); } _visible = true; _root.SetActive(true); Refresh(); } public void Hide() { if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } _visible = false; } public void Refresh() { if (!((Object)(object)_root == (Object)null)) { UpdateLabels(); } } public void Dispose() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; } private void UpdateLabels() { SetToggle(_lblLock, !UIConfig.UILocked, "UI Unlocked — drag to move", "UI Locked"); SetToggle(_lblXPBar, UIConfig.ShowXPBar, "XP Bar: ON", "XP Bar: OFF"); SetToggle(_lblStacks, UIConfig.ShowClassHUD, "Stacks Bar: ON", "Stacks Bar: OFF"); SetToggle(_lblFamHP, UIConfig.ShowFamiliarStatus, "Familiar HP: ON", "Familiar HP: OFF"); SetToggle(_lblNotify, UIConfig.ShowNotifications, "Notifications: ON", "Notifications: OFF"); SetToggle(_lblEventHUD, UIConfig.ShowEventHUD, "Event HUD: ON", "Event HUD: OFF"); SetToggle(_lblQuestHUD, UIConfig.ShowQuestTracker, "Quest Tracker: ON", "Quest Tracker: OFF"); SetToggle(_lblSystemFeed, UIConfig.ShowSystemFeed, "System Feed: ON", "System Feed: OFF"); } private void SetToggle(TextMeshProUGUI lbl, bool state, string onText, string offText) { //IL_0023: 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) if (!((Object)(object)lbl == (Object)null)) { ((TMP_Text)lbl).text = (state ? onText : offText); ((Graphic)lbl).color = (state ? CanvasService.ACCENT_GOLD : CanvasService.TEXT_DISABLED); } } private void Create() { //IL_004f: 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_0135: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: 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_0455: Unknown result type (might be due to invalid IL or missing references) //IL_045f: Unknown result type (might be due to invalid IL or missing references) //IL_04e0: Unknown result type (might be due to invalid IL or missing references) //IL_04ea: Unknown result type (might be due to invalid IL or missing references) //IL_056b: Unknown result type (might be due to invalid IL or missing references) //IL_0575: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Unknown result type (might be due to invalid IL or missing references) //IL_0600: Unknown result type (might be due to invalid IL or missing references) //IL_0681: Unknown result type (might be due to invalid IL or missing references) //IL_068b: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService != null) { _root = canvasService.CreateRootWindow("UISettingsPanel", 360f, 540f, 205); GameObject val = CanvasService.CreatePanel(_root.transform, "Header", 0f, 0f, 360f, 44f, CanvasService.BG_HEADER); CanvasService.CreateText(val.transform, "Title", "UI SETTINGS", 16f, 12f, 300f, 24f, 16f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)4097); CanvasService.CreateCloseButton(_root.transform, 360f, delegate { Hide(); }); CanvasService.MakeDraggable(_root, val.transform); CanvasService.CreateDivider(_root.transform, "D0", 0f, 44f, 360f); float num = 54f; CanvasService.CreateText(_root.transform, "SecPos", "POSITIONS", 16f, num, 328f, 14f, 10f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257); num += 18f; GameObject btn = CanvasService.CreateButton(_root.transform, "BtnLock", "", 16f, num, 328f, 32f, (Action)delegate { UIConfig.UILocked = !UIConfig.UILocked; OrdainUIBehaviour.SetDragLocked(UIConfig.UILocked); Refresh(); }, 11f, (Color?)new Color(0.12f, 0.1f, 0.16f, 0.85f), (Color?)CanvasService.TEXT_PRIMARY, (Color?)null, applyNocturneFont: true); _lblLock = GetBtnLabel(btn, "BtnLock"); num += 40f; CanvasService.CreateButton(_root.transform, "BtnReset", "Reset All Positions", 16f, num, 328f, 32f, (Action)delegate { HUDPositionService.ResetAll(); OrdainUIBehaviour.ResetHUDPositions(); OrdainUIBehaviour.EnqueueNotification("Positions reset. Reopen panels to see defaults.", "gold", 3f); }, 11f, (Color?)new Color(0.2f, 0.08f, 0.08f, 0.85f), (Color?)new Color(1f, 0.5f, 0.5f), (Color?)null, applyNocturneFont: true); num += 40f; CanvasService.CreateDivider(_root.transform, "D1", 16f, num, 328f); num += 10f; CanvasService.CreateText(_root.transform, "SecHUD", "HUD VISIBILITY", 16f, num, 328f, 14f, 10f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)257); num += 18f; GameObject btn2 = CanvasService.CreateButton(_root.transform, "BtnXP", "", 16f, num, 328f, 32f, (Action)delegate { UIConfig.ShowXPBar = !UIConfig.ShowXPBar; UIConfig.Save(); Refresh(); }, 11f, (Color?)new Color(0.12f, 0.1f, 0.16f, 0.85f), (Color?)CanvasService.TEXT_PRIMARY, (Color?)null, applyNocturneFont: true); _lblXPBar = GetBtnLabel(btn2, "BtnXP"); num += 40f; GameObject btn3 = CanvasService.CreateButton(_root.transform, "BtnSt", "", 16f, num, 328f, 32f, (Action)delegate { UIConfig.ShowClassHUD = !UIConfig.ShowClassHUD; UIConfig.Save(); Refresh(); }, 11f, (Color?)new Color(0.12f, 0.1f, 0.16f, 0.85f), (Color?)CanvasService.TEXT_PRIMARY, (Color?)null, applyNocturneFont: true); _lblStacks = GetBtnLabel(btn3, "BtnSt"); num += 40f; GameObject btn4 = CanvasService.CreateButton(_root.transform, "BtnFH", "", 16f, num, 328f, 32f, (Action)delegate { UIConfig.ShowFamiliarStatus = !UIConfig.ShowFamiliarStatus; UIConfig.Save(); Refresh(); }, 11f, (Color?)new Color(0.12f, 0.1f, 0.16f, 0.85f), (Color?)CanvasService.TEXT_PRIMARY, (Color?)null, applyNocturneFont: true); _lblFamHP = GetBtnLabel(btn4, "BtnFH"); num += 40f; GameObject btn5 = CanvasService.CreateButton(_root.transform, "BtnNt", "", 16f, num, 328f, 32f, (Action)delegate { UIConfig.ShowNotifications = !UIConfig.ShowNotifications; UIConfig.Save(); Refresh(); }, 11f, (Color?)new Color(0.12f, 0.1f, 0.16f, 0.85f), (Color?)CanvasService.TEXT_PRIMARY, (Color?)null, applyNocturneFont: true); _lblNotify = GetBtnLabel(btn5, "BtnNt"); num += 40f; GameObject btn6 = CanvasService.CreateButton(_root.transform, "BtnEv", "", 16f, num, 328f, 32f, (Action)delegate { UIConfig.ShowEventHUD = !UIConfig.ShowEventHUD; UIConfig.Save(); Refresh(); }, 11f, (Color?)new Color(0.12f, 0.1f, 0.16f, 0.85f), (Color?)CanvasService.TEXT_PRIMARY, (Color?)null, applyNocturneFont: true); _lblEventHUD = GetBtnLabel(btn6, "BtnEv"); num += 40f; GameObject btn7 = CanvasService.CreateButton(_root.transform, "BtnQh", "", 16f, num, 328f, 32f, (Action)delegate { UIConfig.ShowQuestTracker = !UIConfig.ShowQuestTracker; UIConfig.Save(); Refresh(); }, 11f, (Color?)new Color(0.12f, 0.1f, 0.16f, 0.85f), (Color?)CanvasService.TEXT_PRIMARY, (Color?)null, applyNocturneFont: true); _lblQuestHUD = GetBtnLabel(btn7, "BtnQh"); num += 40f; GameObject btn8 = CanvasService.CreateButton(_root.transform, "BtnSf", "", 16f, num, 328f, 32f, (Action)delegate { UIConfig.ShowSystemFeed = !UIConfig.ShowSystemFeed; SystemFeedPanel.RefreshVisibility(); UIConfig.Save(); Refresh(); }, 11f, (Color?)new Color(0.12f, 0.1f, 0.16f, 0.85f), (Color?)CanvasService.TEXT_PRIMARY, (Color?)null, applyNocturneFont: true); _lblSystemFeed = GetBtnLabel(btn8, "BtnSf"); num += 40f; CanvasService.CreateDivider(_root.transform, "DBot", 0f, 496f, 360f); CanvasService.CreateButton(_root.transform, "BtnBack", "◀ Back", 16f, 504f, 80f, 26f, (Action)delegate { Hide(); _onBack?.Invoke(); }, 11f, (Color?)new Color(0.12f, 0.1f, 0.14f, 0.85f), (Color?)CanvasService.TEXT_SECONDARY, (Color?)null, applyNocturneFont: true); HUDPositionService.ApplySaved(_root, "UISettingsPanel"); _root.SetActive(false); } } private TextMeshProUGUI GetBtnLabel(GameObject btn, string id) { if ((Object)(object)btn == (Object)null) { return null; } Transform val = btn.transform.Find("Text_" + id + "_Label"); if (!((Object)(object)val != (Object)null)) { return null; } return ((Component)val).GetComponent(); } } internal class VFXPanel { private GameObject _root; private bool _visible; private readonly Action _onBack; public bool IsVisible => _visible; public VFXPanel(Action onBack = null) { _onBack = onBack; } public void Show() { if ((Object)(object)_root == (Object)null) { Create(); } _visible = true; _root.SetActive(true); } public void Hide() { if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } _visible = false; } public void Dispose() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; } private void Create() { //IL_004f: 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_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) CanvasService canvasService = OrdainUI.Core.Core.CanvasService; if (canvasService != null) { _root = canvasService.CreateRootWindow("VFXPanel", 320f, 200f, 204); GameObject val = CanvasService.CreatePanel(_root.transform, "Header", 0f, 0f, 320f, 44f, CanvasService.BG_HEADER); CanvasService.CreateText(val.transform, "Title", "VFX COLLECTION", 16f, 12f, 260f, 24f, 16f, CanvasService.ACCENT_GOLD, (TextAlignmentOptions)4097); CanvasService.CreateCloseButton(_root.transform, 320f, delegate { Hide(); }); CanvasService.MakeDraggable(_root, val.transform); CanvasService.CreateDivider(_root.transform, "D0", 0f, 44f, 320f); CanvasService.CreateText(_root.transform, "Placeholder", "To be added later.", 0f, 80f, 320f, 40f, 16f, CanvasService.TEXT_SECONDARY, (TextAlignmentOptions)514); CanvasService.CreateButton(_root.transform, "Back", "◀ Back", 16f, 164f, 80f, 26f, (Action)delegate { Hide(); _onBack?.Invoke(); }, 11f, (Color?)new Color(0.12f, 0.1f, 0.14f, 0.85f), (Color?)CanvasService.TEXT_SECONDARY, (Color?)null, applyNocturneFont: true); _root.SetActive(false); } } } } namespace OrdainUI.Core { internal static class Core { private static World _client; private static Entity _localCharacter = Entity.Null; private static Entity _localUser = Entity.Null; private static MonoBehaviour _monoBehaviour; public static bool Initialized { get; private set; } = false; public static World World => _client; public static EntityManager EntityManager => _client.EntityManager; public static ManualLogSource Log => Plugin.Logger; public static CanvasService CanvasService { get; private set; } public static MessageService MessageService { get; private set; } public static Entity LocalCharacter { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (_localCharacter != Entity.Null) { EntityManager entityManager = EntityManager; if (((EntityManager)(ref entityManager)).Exists(_localCharacter)) { return _localCharacter; } } if (ConsoleShared.TryGetLocalCharacterInCurrentWorld(ref _localCharacter, _client)) { return _localCharacter; } return Entity.Null; } } public static Entity LocalUser { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (_localUser != Entity.Null) { EntityManager entityManager = EntityManager; if (((EntityManager)(ref entityManager)).Exists(_localUser)) { return _localUser; } } if (ConsoleShared.TryGetLocalUserInCurrentWorld(ref _localUser, _client)) { return _localUser; } return Entity.Null; } } public static void Initialize(GameDataManager gameDataManager) { if (!Initialized) { _client = ((ComponentSystemBase)gameDataManager).World; MessageService = new MessageService(); Initialized = true; Plugin.Verbose("[OrdainUI] Core initialized."); } } public static void SetCanvas(UICanvasBase canvas) { CanvasService = new CanvasService(canvas); Plugin.Verbose("[OrdainUI] Canvas captured, UI services ready."); } public static void Reset() { //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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) CanvasService = null; MessageService = null; _client = null; _localCharacter = Entity.Null; _localUser = Entity.Null; Initialized = false; Plugin.Verbose("[OrdainUI] Core reset."); } public static Coroutine StartCoroutine(IEnumerator routine) { //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_0027: Expected O, but got Unknown if ((Object)(object)_monoBehaviour == (Object)null) { GameObject val = new GameObject("OrdainUI_CoroutineHost"); _monoBehaviour = (MonoBehaviour)(object)val.AddComponent(); Object.DontDestroyOnLoad((Object)val); } return _monoBehaviour.StartCoroutine(CollectionExtensions.WrapToIl2Cpp(routine)); } } }