Decompiled source of GK2Plus v2.0.0
BepInEx\plugins\GK2Plus\GK2Plus.dll
Decompiled 2 months ago
The result has been truncated due to the large size, download it to view full contents!
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.Text; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using GK2Plus.Core; using GK2Plus.Features.Cheats; using GK2Plus.Features.Crafting; using GK2Plus.Features.Farming; using GK2Plus.Features.General; using GK2Plus.Features.Inventory; using GK2Plus.Features.Movement; using GK2Plus.Features.Tracking; using GK2Plus.Framework; using GK2Plus.Framework.Crafting; using GK2Plus.Framework.Diagnostics; using GK2Plus.Framework.Events; using GK2Plus.Framework.Farming; using GK2Plus.Framework.Inventory; using GK2Plus.Framework.Localization; using GK2Plus.Framework.Quests; using GK2Plus.Framework.Saves; using GK2Plus.Framework.UI; using GK2Plus.Framework.World; using GK2Plus.Framework.Zombies; using HarmonyLib; using LazyBearTechnology; using Microsoft.CodeAnalysis; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("duhhbzz")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("2.0.0.0")] [assembly: AssemblyInformationalVersion("2.0.0+9a91408055a9a966a5c149e46f3027b6dc99d944")] [assembly: AssemblyProduct("GK2Plus")] [assembly: AssemblyTitle("GK2Plus")] [assembly: AssemblyVersion("2.0.0.0")] [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 GK2Plus { [BepInPlugin("com.duhhbzz.gk2plus", "GK2+", "2.0.0")] public sealed class Plugin : BaseUnityPlugin { private Harmony _harmony; private FeatureRegistry _featureRegistry; private CompatibilityManager _compatibilityManager; private GK2Services _services; internal static ConfigEntry<bool> MasterEnabled { get; private set; } private void Awake() { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Expected O, but got Unknown ((BaseUnityPlugin)this).Logger.LogInfo((object)"----------------------------------------"); ((BaseUnityPlugin)this).Logger.LogInfo((object)"GK2+ v2.0.0"); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Graveyard Keeper Plus"); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Tested game version: v1.008"); ((BaseUnityPlugin)this).Logger.LogInfo((object)"----------------------------------------"); GameCompatibility.LogStatus(((BaseUnityPlugin)this).Logger); MasterEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", true, "Master switch for GK2+ gameplay features. For normal use, configure GK2+ from its in-game menu. Advanced users may edit com.duhhbzz.gk2plus.cfg directly or through a compatible mod-manager config editor. External config edits should be treated as next-launch changes."); GK2MenuInputSettings.Bind(((BaseUnityPlugin)this).Config); _harmony = new Harmony("com.duhhbzz.gk2plus"); _compatibilityManager = new CompatibilityManager(((BaseUnityPlugin)this).Logger); _compatibilityManager.Scan(); _services = new GK2Services(((BaseUnityPlugin)this).Logger); _services.Initialize(); GK2MenuInputSettings.RegisterControls(_services.UI); FrameworkDiagnostics.LogReady(((BaseUnityPlugin)this).Logger); ((MonoBehaviour)this).StartCoroutine(MainMenuBadgeController.Run(((BaseUnityPlugin)this).Logger)); _featureRegistry = new FeatureRegistry(); RegisterFeatures(_featureRegistry); if (MasterEnabled.Value) { _featureRegistry.InitializeAll(((BaseUnityPlugin)this).Config, ((BaseUnityPlugin)this).Logger, _harmony); } else { ((BaseUnityPlugin)this).Logger.LogWarning((object)"GK2+ master switch is disabled. Gameplay features will not initialize."); } ((BaseUnityPlugin)this).Logger.LogInfo((object)"GK2+ v2.0.0 loaded successfully."); } private void RegisterFeatures(FeatureRegistry registry) { registry.Register(new ManualSaveFeature(_services.Saves)); registry.Register(new BasicCheatsFeature(_services.Saves, _services.UI, ((BaseUnityPlugin)this).Config)); registry.Register(new BackwardsCompatibleExtensionsFeature(((BaseUnityPlugin)this).Config, _services.UI)); registry.Register(new UnifiedTrackerFeature(((BaseUnityPlugin)this).Config, _services.UI, _services.Saves)); registry.Register(new QuestJournalFeature(((BaseUnityPlugin)this).Config, _services.UI)); registry.Register(new ContinuousPlantingFeature(((BaseUnityPlugin)this).Config, _services.UI)); registry.Register(new SprintingFeature(((BaseUnityPlugin)this).Config, _services.UI)); registry.Register(new StackSizesFeature(((BaseUnityPlugin)this).Config, _services.UI)); registry.Register(new SharedChestsFeature(((BaseUnityPlugin)this).Config, _services.UI)); } private void OnDestroy() { _services?.Shutdown(); Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } } } namespace GK2Plus.Framework { internal abstract class GK2ServiceBase : IGK2Service { protected ManualLogSource Logger { get; } public abstract string Name { get; } protected GK2ServiceBase(ManualLogSource logger) { Logger = logger; } public virtual void Initialize() { Logger.LogDebug((object)("Initializing framework service: " + Name)); } public virtual void Shutdown() { Logger.LogDebug((object)("Shutting down framework service: " + Name)); } } internal sealed class GK2Services { private readonly ManualLogSource _logger; private readonly List<IGK2Service> _services; public GK2EventService Events { get; } public GK2SaveService Saves { get; } public GK2WorldService World { get; } public GK2InventoryService Inventory { get; } public GK2CraftingService Crafting { get; } public GK2FarmingService Farming { get; } public GK2ZombieService Zombies { get; } public GK2QuestService Quests { get; } public GK2LocalizationService Localization { get; } public GK2UIService UI { get; } public GK2Services(ManualLogSource logger) { _logger = logger ?? throw new ArgumentNullException("logger"); Events = new GK2EventService(logger); Saves = new GK2SaveService(logger); World = new GK2WorldService(logger); Inventory = new GK2InventoryService(logger); Crafting = new GK2CraftingService(logger); Farming = new GK2FarmingService(logger); Zombies = new GK2ZombieService(logger); Quests = new GK2QuestService(logger); Localization = new GK2LocalizationService(logger); UI = new GK2UIService(logger); _services = new List<IGK2Service> { Events, Saves, World, Inventory, Crafting, Farming, Zombies, Quests, Localization, UI }; } public void Initialize() { _logger.LogInfo((object)$"Initializing {_services.Count} GK2+ framework service(s)..."); foreach (IGK2Service service in _services) { service.Initialize(); } } public void Shutdown() { for (int num = _services.Count - 1; num >= 0; num--) { try { _services[num].Shutdown(); } catch (Exception arg) { _logger.LogError((object)$"Failed to shut down framework service '{_services[num].Name}': {arg}"); } } } } internal interface IGK2Service { string Name { get; } void Initialize(); void Shutdown(); } } namespace GK2Plus.Framework.Zombies { internal sealed class GK2ZombieService : GK2ServiceBase { public override string Name => "Zombies"; public GK2ZombieService(ManualLogSource logger) : base(logger) { } } } namespace GK2Plus.Framework.World { internal sealed class GK2WorldService : GK2ServiceBase { public override string Name => "World"; public GK2WorldService(ManualLogSource logger) : base(logger) { } } } namespace GK2Plus.Framework.UI { internal sealed class GK2FeatureOption { public string Value { get; } public string Label { get; } public GK2FeatureOption(string value, string label) { Value = value ?? string.Empty; Label = (string.IsNullOrWhiteSpace(label) ? Value : label); } } internal sealed class GK2FeatureOptionControl { public string Id { get; } public string Tab { get; } public string Label { get; } public Func<string> ValueProvider { get; } public Func<IReadOnlyList<GK2FeatureOption>> OptionsProvider { get; } public Action<string> ValueChanged { get; } public string ParentFeatureId { get; } public int Order { get; } public Func<bool> EnabledProvider { get; } public bool AllowInGameEditing { get; } public bool Searchable { get; } public GK2FeatureOptionControl(string id, string tab, string label, Func<string> valueProvider, Func<IReadOnlyList<GK2FeatureOption>> optionsProvider, Action<string> valueChanged, string parentFeatureId = null, int order = 0, Func<bool> enabledProvider = null, bool allowInGameEditing = false, bool searchable = false) { if (string.IsNullOrWhiteSpace(id)) { throw new ArgumentException("A feature option id is required.", "id"); } Id = id; Tab = (string.IsNullOrWhiteSpace(tab) ? "General" : tab); Label = (string.IsNullOrWhiteSpace(label) ? id : label); ValueProvider = valueProvider ?? throw new ArgumentNullException("valueProvider"); OptionsProvider = optionsProvider ?? throw new ArgumentNullException("optionsProvider"); ValueChanged = valueChanged ?? throw new ArgumentNullException("valueChanged"); ParentFeatureId = parentFeatureId ?? string.Empty; Order = order; EnabledProvider = enabledProvider ?? ((Func<bool>)(() => true)); AllowInGameEditing = allowInGameEditing; Searchable = searchable; } } internal sealed class GK2FeatureToggleControl { public string Id { get; } public string Tab { get; } public string Label { get; } public Func<bool> EnabledProvider { get; } public Func<string> StatusProvider { get; } public Action<bool> EnabledChanged { get; } public int Order { get; } public GK2FeatureToggleControl(string id, string tab, string label, Func<bool> enabledProvider, Func<string> statusProvider, Action<bool> enabledChanged, int order = 0) { if (string.IsNullOrWhiteSpace(id)) { throw new ArgumentException("A feature toggle id is required.", "id"); } Id = id; Tab = (string.IsNullOrWhiteSpace(tab) ? "General" : tab); Label = (string.IsNullOrWhiteSpace(label) ? id : label); EnabledProvider = enabledProvider ?? throw new ArgumentNullException("enabledProvider"); StatusProvider = statusProvider ?? throw new ArgumentNullException("statusProvider"); EnabledChanged = enabledChanged ?? throw new ArgumentNullException("enabledChanged"); Order = order; } } internal sealed class GK2MenuAction { public string Id { get; } public string Tab { get; } public string Label { get; } public Action Execute { get; } public Func<bool> IsAvailable { get; } public GK2MenuAction(string id, string tab, string label, Action execute, Func<bool> isAvailable = null) { Id = id ?? throw new ArgumentNullException("id"); Tab = tab ?? throw new ArgumentNullException("tab"); Label = label ?? throw new ArgumentNullException("label"); Execute = execute ?? throw new ArgumentNullException("execute"); IsAvailable = isAvailable; } public bool CanExecute() { if (IsAvailable != null) { return IsAvailable(); } return true; } } internal static class GK2MenuInputSettings { private const float ControllerChordHoldSeconds = 0.45f; private static ConfigFile _config; private static GK2UIService _uiService; internal static ConfigEntry<KeyCode> MenuHotkey { get; private set; } internal static ConfigEntry<bool> ControllerShortcutEnabled { get; private set; } internal static float ControllerHoldSeconds => 0.45f; internal static KeyCode CurrentHotkey => (KeyCode)(((??)MenuHotkey?.Value) ?? 283); internal static bool IsControllerShortcutEnabled => ControllerShortcutEnabled?.Value ?? true; internal static void Bind(ConfigFile config) { _config = config ?? throw new ArgumentNullException("config"); MenuHotkey = config.Bind<KeyCode>("General", "MenuHotkey", (KeyCode)283, "Keyboard key used to open/close the GK2+ menu. This setting is live-safe and can be changed from the GK2+ General tab."); ControllerShortcutEnabled = config.Bind<bool>("General", "ControllerMenuShortcut", true, "Enable the controller / Steam Deck GK2+ menu shortcut. Hold L3 + R3 together briefly to open/close the menu; B closes an open GK2+ menu."); } internal static void RegisterControls(GK2UIService uiService) { if (uiService != null && MenuHotkey != null && ControllerShortcutEnabled != null) { _uiService = uiService; uiService.RegisterFeatureOptionControl(new GK2FeatureOptionControl("menu.hotkey", "General", "Menu Hotkey", () => ((object)CurrentHotkey/*cast due to .constrained prefix*/).ToString(), GetHotkeyOptions, SetHotkey, null, -1000, null, allowInGameEditing: true)); uiService.RegisterFeatureOptionControl(new GK2FeatureOptionControl("menu.controller-shortcut", "General", "Controller / Steam Deck Shortcut", () => (!IsControllerShortcutEnabled) ? "Off" : "On", GetOnOffOptions, SetControllerShortcut, null, -990, null, allowInGameEditing: true)); } } internal static string GetToggleHint() { //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) string text = ((object)CurrentHotkey/*cast due to .constrained prefix*/).ToString(); if (!IsControllerShortcutEnabled) { return text + " Toggle"; } return text + " / L3+R3"; } internal static string GetCloseHint() { if (!IsControllerShortcutEnabled) { return "ESC Close"; } return "ESC / B Close"; } private static IReadOnlyList<GK2FeatureOption> GetHotkeyOptions() { return new GK2FeatureOption[15] { new GK2FeatureOption("F1", "F1"), new GK2FeatureOption("F2", "F2"), new GK2FeatureOption("F3", "F3"), new GK2FeatureOption("F4", "F4"), new GK2FeatureOption("F5", "F5"), new GK2FeatureOption("F6", "F6"), new GK2FeatureOption("F7", "F7"), new GK2FeatureOption("F8", "F8"), new GK2FeatureOption("F9", "F9"), new GK2FeatureOption("F10", "F10"), new GK2FeatureOption("F11", "F11"), new GK2FeatureOption("F12", "F12"), new GK2FeatureOption("Home", "Home"), new GK2FeatureOption("Insert", "Insert"), new GK2FeatureOption("BackQuote", "Back Quote (`)") }; } private static IReadOnlyList<GK2FeatureOption> GetOnOffOptions() { return new GK2FeatureOption[2] { new GK2FeatureOption("Off", "Off"), new GK2FeatureOption("On", "On") }; } private static void SetHotkey(string value) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (MenuHotkey != null && Enum.TryParse<KeyCode>(value, ignoreCase: true, out KeyCode result)) { MenuHotkey.Value = result; SaveAndRefresh(); } } private static void SetControllerShortcut(string value) { if (ControllerShortcutEnabled != null) { ControllerShortcutEnabled.Value = string.Equals(value, "On", StringComparison.OrdinalIgnoreCase) || string.Equals(value, "True", StringComparison.OrdinalIgnoreCase); SaveAndRefresh(); } } private static void SaveAndRefresh() { ConfigFile config = _config; if (config != null) { config.Save(); } _uiService?.RefreshMenu(); } } internal sealed class GK2QuestJournalController { private enum JournalFilter { Active, Completed } private sealed class QuestRowView { public GameObject Root; public RectTransform Rect; public Image Background; public Image Icon; public TextMeshProUGUI Title; public TextMeshProUGUI Description; public TextMeshProUGUI Status; public GK2UiProgressBarView Progress; public Button SelectButton; public Button PinButton; public Image PinIcon; public QuestData Quest; } private sealed class QuestGroupView { public GameObject Root; public RectTransform Rect; public Image Background; public Image HeaderBackground; public Image Portrait; public TextMeshProUGUI Title; public TextMeshProUGUI Count; public TextMeshProUGUI Chevron; public Button ToggleButton; public string GroupKey; } private readonly ManualLogSource _logger; private QuestTreePageWidget _host; private LazyScrollRect _nativeScrollRect; private GK2UiTheme _theme; private GameObject _root; private RectTransform _rootRect; private Button _activeFilterButton; private Button _completedFilterButton; private TextMeshProUGUI _activeFilterLabel; private TextMeshProUGUI _completedFilterLabel; private ScrollRect _questScroll; private RectTransform _questListContent; private GK2UiPool<QuestGroupView> _questGroupPool; private GK2UiPool<QuestRowView> _questRowPool; private readonly HashSet<string> _expandedQuestGroups = new HashSet<string>(StringComparer.OrdinalIgnoreCase); private ScrollRect _detailScroll; private RectTransform _detailContent; private TextMeshProUGUI _detailTitle; private TextMeshProUGUI _detailStatus; private TextMeshProUGUI _detailDescription; private TextMeshProUGUI _detailPaneHeaderTitle; private GameObject _detailSummaryPanel; private RectTransform _detailSummaryRect; private RectTransform _detailPortraitRect; private RectTransform _descriptionHeaderRect; private RectTransform _objectivesHeaderRect; private Image _detailIcon; private Button _trackButton; private TextMeshProUGUI _trackButtonLabel; private Button _unpinAllButton; private GK2UiPool<GK2UiItemRequirementView> _objectivePool; private JournalFilter _filter; private string _selectedQuestId = string.Empty; internal GK2QuestJournalController(ManualLogSource logger) { _logger = logger; } internal bool TryShow(QuestTreePageWidget host, string focusOnQuest) { if (!((Object)(object)host == (Object)null)) { MainGame instance = MainGame.Instance; if (((instance == null) ? null : instance.GameSave?.questSystemData?.questCollection) != null) { try { _host = host; _theme = GK2UiTheme.Resolve(_logger); if (_theme == null || (Object)(object)_theme.BodyTextTemplate == (Object)null || (Object)(object)_theme.TitleTextTemplate == (Object)null) { return false; } ResolveNativeScrollRect(host); if ((Object)(object)_nativeScrollRect != (Object)null) { ((Component)_nativeScrollRect).gameObject.SetActive(false); } EnsureUi(host); if ((Object)(object)_root == (Object)null) { return false; } _root.SetActive(true); _root.transform.SetAsLastSibling(); if (!string.IsNullOrWhiteSpace(focusOnQuest)) { _selectedQuestId = focusOnQuest; } Refresh(); EnsureControllerFocus(); return true; } catch (Exception arg) { ManualLogSource logger = _logger; if (logger != null) { logger.LogError((object)$"Quest Journal failed to open: {arg}"); } RestoreNativeTree(); return false; } } } return false; } private void EnsureControllerFocus() { if (!((Object)(object)EventSystem.current == (Object)null) && !((Object)(object)_root == (Object)null) && !((Object)(object)_activeFilterButton == (Object)null)) { GameObject currentSelectedGameObject = EventSystem.current.currentSelectedGameObject; if (!((Object)(object)currentSelectedGameObject != (Object)null) || !currentSelectedGameObject.transform.IsChildOf(_root.transform)) { EventSystem.current.SetSelectedGameObject(((Component)_activeFilterButton).gameObject); } } } internal void Hide() { if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } } internal void RestoreNativeTree() { Hide(); if ((Object)(object)_nativeScrollRect != (Object)null) { ((Component)_nativeScrollRect).gameObject.SetActive(true); } } internal void RefreshIfVisible() { if ((Object)(object)_root != (Object)null && _root.activeInHierarchy) { Refresh(); } } private void ResolveNativeScrollRect(QuestTreePageWidget host) { if (!((Object)(object)_nativeScrollRect != (Object)null)) { _nativeScrollRect = Traverse.Create((object)host).Field("scrollRect").GetValue<LazyScrollRect>(); } } private void EnsureUi(QuestTreePageWidget host) { //IL_0073: 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_0087: 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_0091: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: 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) if (!((Object)(object)_root != (Object)null) || !((Object)(object)_root.transform.parent == (Object)(object)((Component)host).transform)) { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = GK2UiFactory.CreateImage(((Component)host).transform, "GK2PlusQuestJournal", _theme.ContentStoneSprite, (Type)(((Object)(object)_theme.ContentStoneSprite != (Object)null) ? 2 : 0), Vector2.zero, Vector2.one, new Vector2(0.5f, 0.5f), Vector2.zero, Vector2.zero, ((Object)(object)_theme.ContentStoneSprite != (Object)null) ? Color.white : _theme.ContentBackground, raycastTarget: true); _rootRect = _root.GetComponent<RectTransform>(); _rootRect.offsetMin = Vector2.zero; _rootRect.offsetMax = Vector2.zero; BuildHeader(); BuildQuestList(); BuildDetails(); ManualLogSource logger = _logger; if (logger != null) { logger.LogInfo((object)"GK2+ Quest Journal mounted into native Quests tab."); } } } private void BuildHeader() { } private void BuildQuestList() { //IL_0048: 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_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_0070: 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_008e: 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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0159: 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_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018f: 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_01ad: 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_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Expected O, but got Unknown //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Expected O, but got Unknown //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_0347: 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_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) float num = 8f; float num2 = 282f; GameObject val = GK2UiFactory.CreateImage(_root.transform, "QuestListPane", _theme.ContentCellSprite, (Type)(((Object)(object)_theme.ContentCellSprite != (Object)null) ? 1 : 0), new Vector2(0f, 0f), new Vector2(0f, 1f), new Vector2(0f, 1f), Vector2.zero, Vector2.zero, ((Object)(object)_theme.ContentCellSprite != (Object)null) ? Color.white : _theme.RowBackground); RectTransform component = val.GetComponent<RectTransform>(); component.offsetMin = new Vector2(num, 8f); component.offsetMax = new Vector2(num + num2, -8f); GK2UiSectionHeaderView gK2UiSectionHeaderView = GK2UiSectionHeaderBuilder.Create(val.transform, _theme, "QuestJournalHeader", "Quest Journal", 26f); gK2UiSectionHeaderView.Rect.offsetMin = new Vector2(0f, -26f); gK2UiSectionHeaderView.Rect.offsetMax = Vector2.zero; float num3 = 29f; float num4 = num2 - 10f; GameObject val2 = GK2UiFactory.CreateImage(val.transform, "QuestFilterStrip", _theme.MainWindowHeaderSprite, (Type)(((Object)(object)_theme.MainWindowHeaderSprite != (Object)null) ? 1 : 0), new Vector2(0f, 1f), new Vector2(0f, 1f), new Vector2(0f, 1f), new Vector2(5f, 0f - num3), new Vector2(num4, 26f), ((Object)(object)_theme.MainWindowHeaderSprite != (Object)null) ? Color.white : _theme.HeaderBackground); float num5 = -1f; float num6 = (num4 - num5) / 2f; _activeFilterButton = GK2UiFactory.CreateNativeWindowTab(val2.transform, "ActiveFilter", _theme, "Active", new Vector2((0f - (num6 + num5)) / 2f, 0f), new Vector2(num6, 26f), selected: true, (UnityAction)delegate { _filter = JournalFilter.Active; _selectedQuestId = string.Empty; Refresh(); }); _activeFilterLabel = ((Component)_activeFilterButton).GetComponentInChildren<TextMeshProUGUI>(true); _completedFilterButton = GK2UiFactory.CreateNativeWindowTab(val2.transform, "CompletedFilter", _theme, "Completed", new Vector2((num6 + num5) / 2f, 0f), new Vector2(num6, 26f), selected: false, (UnityAction)delegate { _filter = JournalFilter.Completed; _selectedQuestId = string.Empty; Refresh(); }); _completedFilterLabel = ((Component)_completedFilterButton).GetComponentInChildren<TextMeshProUGUI>(true); GameObject obj = GK2UiFactory.CreateRect(val.transform, "QuestViewport", Vector2.zero, Vector2.one, new Vector2(0.5f, 0.5f), Vector2.zero, Vector2.zero); RectTransform component2 = obj.GetComponent<RectTransform>(); float num7 = num3 + 26f + 4f; component2.offsetMin = new Vector2(5f, 5f); component2.offsetMax = new Vector2(-5f, 0f - num7); obj.AddComponent<RectMask2D>(); GameObject val3 = GK2UiFactory.CreateRect(obj.transform, "QuestListContent", new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0.5f, 1f), Vector2.zero, Vector2.zero); _questListContent = val3.GetComponent<RectTransform>(); _questListContent.offsetMin = Vector2.zero; _questListContent.offsetMax = Vector2.zero; _questScroll = val.AddComponent<ScrollRect>(); _questScroll.viewport = component2; _questScroll.content = _questListContent; _questScroll.horizontal = false; _questScroll.vertical = true; _questScroll.movementType = (MovementType)2; _questScroll.inertia = false; _questScroll.scrollSensitivity = 28f; _questGroupPool = new GK2UiPool<QuestGroupView>(CreateQuestGroup, delegate(QuestGroupView view, bool active) { if ((Object)(object)view?.Root != (Object)null) { view.Root.SetActive(active); } }); _questRowPool = new GK2UiPool<QuestRowView>(CreateQuestRow, delegate(QuestRowView view, bool active) { if ((Object)(object)view?.Root != (Object)null) { view.Root.SetActive(active); } }); } private QuestGroupView CreateQuestGroup() { //IL_0037: 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_0055: 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_0069: 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_0087: 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_0119: 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_012d: 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_016c: 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_0195: 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_01b3: 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_01c3: 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_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: 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_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_0334: 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_034f: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: 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_03df: Unknown result type (might be due to invalid IL or missing references) //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Unknown result type (might be due to invalid IL or missing references) //IL_0476: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_0494: Unknown result type (might be due to invalid IL or missing references) //IL_04a2: Unknown result type (might be due to invalid IL or missing references) GameObject val = GK2UiFactory.CreateImage((Transform)(object)_questListContent, "QuestGroup", _theme.ContentCellSprite, (Type)(((Object)(object)_theme.ContentCellSprite != (Object)null) ? 1 : 0), new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0.5f, 1f), Vector2.zero, new Vector2(0f, 52f), ((Object)(object)_theme.ContentCellSprite != (Object)null) ? Color.white : _theme.RowBackground); RectTransform component = val.GetComponent<RectTransform>(); Image component2 = val.GetComponent<Image>(); ((Graphic)component2).raycastTarget = false; float num = 52f; Image component3 = GK2UiFactory.CreateImage(val.transform, "GroupHeader", _theme.SectionHeaderInactiveSprite ?? _theme.SectionHeaderSprite, (Type)(((Object)(object)(_theme.SectionHeaderInactiveSprite ?? _theme.SectionHeaderSprite) != (Object)null) ? 1 : 0), new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0.5f, 1f), Vector2.zero, new Vector2(0f, num), ((Object)(object)(_theme.SectionHeaderInactiveSprite ?? _theme.SectionHeaderSprite) != (Object)null) ? Color.white : _theme.HeaderBackground).GetComponent<Image>(); GameObject val2 = GK2UiFactory.CreateImage(val.transform, "GroupToggle", null, (Type)0, new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0.5f, 1f), Vector2.zero, new Vector2(0f, num), new Color(1f, 1f, 1f, 0.001f), raycastTarget: true); Button val3 = val2.AddComponent<Button>(); ((Selectable)val3).targetGraphic = (Graphic)(object)val2.GetComponent<Image>(); ((Selectable)val3).transition = (Transition)1; ColorBlock colors = ((Selectable)val3).colors; ((ColorBlock)(ref colors)).normalColor = Color.white; ((ColorBlock)(ref colors)).highlightedColor = new Color(1f, 0.9f, 0.72f, 1f); ((ColorBlock)(ref colors)).pressedColor = new Color(1f, 0.78f, 0.45f, 1f); ((ColorBlock)(ref colors)).selectedColor = Color.white; ((ColorBlock)(ref colors)).fadeDuration = 0.05f; ((Selectable)val3).colors = colors; float num2 = 4f; float num3 = 42f; Image portrait = GK2UiPortraitBuilder.CreateStonePortrait(val.transform, _theme, "NpcPortrait", new Vector2(num2, -5f), num3, 1.45f).Portrait; float num4 = num2 + num3 + 8f; TextMeshProUGUI val4 = GK2UiFactory.CreateNativeTemplateText(val.transform, "GroupTitle", _theme.MainWindowTabTextTemplate ?? _theme.TitleTextTemplate ?? _theme.BodyTextTemplate, string.Empty, 12.5f, (TextAlignmentOptions)4097, new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0f, 1f), new Vector2(num4, -7f), new Vector2(-86f, 22f)); ((Graphic)val4).color = Color.white; ((TMP_Text)val4).textWrappingMode = (TextWrappingModes)0; ((TMP_Text)val4).overflowMode = (TextOverflowModes)1; TextMeshProUGUI val5 = GK2UiFactory.CreateText(val.transform, "GroupCount", _theme.BodyTextTemplate, string.Empty, 8.5f, (TextAlignmentOptions)4097, new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0f, 1f), new Vector2(num4, -29f), new Vector2(-86f, 15f)); ((Graphic)val5).color = new Color(0.72f, 0.68f, 0.61f, 1f); TextMeshProUGUI val6 = GK2UiFactory.CreateNativeTemplateText(val.transform, "Chevron", _theme.MainWindowTabTextTemplate ?? _theme.TitleTextTemplate ?? _theme.BodyTextTemplate, "-", 14f, (TextAlignmentOptions)514, new Vector2(1f, 1f), new Vector2(1f, 1f), new Vector2(1f, 1f), new Vector2(-10f, -15f), new Vector2(20f, 20f)); ((Graphic)val6).color = Color.white; return new QuestGroupView { Root = val, Rect = component, Background = component2, HeaderBackground = component3, Portrait = portrait, Title = val4, Count = val5, Chevron = val6, ToggleButton = val3 }; } private QuestRowView CreateQuestRow() { //IL_0017: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_00ea: 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_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: 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_01c2: 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_0219: 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_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_0323: 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_0368: 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_0383: 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_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Unknown result type (might be due to invalid IL or missing references) //IL_0404: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Unknown result type (might be due to invalid IL or missing references) //IL_043e: Unknown result type (might be due to invalid IL or missing references) //IL_049a: Unknown result type (might be due to invalid IL or missing references) //IL_04a9: Unknown result type (might be due to invalid IL or missing references) //IL_04b8: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04cc: 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) GameObject val = GK2UiFactory.CreateImage((Transform)(object)_questListContent, "QuestRow", null, (Type)0, new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0.5f, 1f), Vector2.zero, new Vector2(0f, 64f), Color.clear, raycastTarget: true); RectTransform component = val.GetComponent<RectTransform>(); Image component2 = val.GetComponent<Image>(); Button val2 = val.AddComponent<Button>(); ((Selectable)val2).targetGraphic = (Graphic)(object)component2; ((Selectable)val2).transition = (Transition)1; ColorBlock colors = ((Selectable)val2).colors; ((ColorBlock)(ref colors)).normalColor = Color.white; ((ColorBlock)(ref colors)).highlightedColor = new Color(1f, 0.92f, 0.76f, 1f); ((ColorBlock)(ref colors)).pressedColor = new Color(1f, 0.82f, 0.55f, 1f); ((ColorBlock)(ref colors)).selectedColor = Color.white; ((ColorBlock)(ref colors)).fadeDuration = 0.05f; ((Selectable)val2).colors = colors; float num = 6f; float num2 = 38f; Image portrait = GK2UiPortraitBuilder.CreateStonePortrait(val.transform, _theme, "QuestPortrait", new Vector2(num, -6f), num2, 1.15f).Portrait; float num3 = num + num2 + 7f; TextMeshProUGUI val3 = GK2UiFactory.CreateNativeTemplateText(val.transform, "QuestTitle", _theme.MainWindowTabTextTemplate ?? _theme.TitleTextTemplate ?? _theme.BodyTextTemplate, string.Empty, 10.75f, (TextAlignmentOptions)4097, new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0f, 1f), new Vector2(num3, -4f), new Vector2(-112f, 18f)); ((TMP_Text)val3).textWrappingMode = (TextWrappingModes)0; ((TMP_Text)val3).overflowMode = (TextOverflowModes)1; ((Graphic)val3).color = Color.white; TextMeshProUGUI val4 = GK2UiFactory.CreateText(val.transform, "QuestStatus", _theme.BodyTextTemplate, string.Empty, 7.75f, (TextAlignmentOptions)516, new Vector2(1f, 1f), new Vector2(1f, 1f), new Vector2(1f, 1f), new Vector2(-29f, -4f), new Vector2(76f, 16f)); ((Graphic)val4).color = new Color(0.72f, 0.68f, 0.62f, 1f); GameObject obj = GK2UiFactory.CreateImage(val.transform, "PinButton", UnifiedTrackerFeature.GetTrackerPinSpriteForExternalUi(), (Type)0, new Vector2(1f, 1f), new Vector2(1f, 1f), new Vector2(1f, 1f), new Vector2(-6f, -4f), new Vector2(18f, 18f), Color.white, raycastTarget: true); Image component3 = obj.GetComponent<Image>(); component3.preserveAspect = true; Button val5 = obj.AddComponent<Button>(); ((Selectable)val5).targetGraphic = (Graphic)(object)component3; ((Selectable)val5).transition = (Transition)1; Navigation navigation = ((Selectable)val5).navigation; ((Navigation)(ref navigation)).mode = (Mode)0; ((Selectable)val5).navigation = navigation; TextMeshProUGUI val6 = GK2UiFactory.CreateText(val.transform, "QuestDescription", _theme.BodyTextTemplate, string.Empty, 8.25f, (TextAlignmentOptions)257, new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0f, 1f), new Vector2(num3, -24f), new Vector2(0f - (num3 + 7f), 25f)); ((TMP_Text)val6).textWrappingMode = (TextWrappingModes)1; ((TMP_Text)val6).overflowMode = (TextOverflowModes)3; ((TMP_Text)val6).maxVisibleLines = 2; ((Graphic)val6).color = new Color(0.76f, 0.72f, 0.66f, 1f); GK2UiProgressBarView gK2UiProgressBarView = GK2UiFactory.CreateNativeProgressBar(val.transform, "QuestProgress", _theme, new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(0.5f, 0f), new Vector2((num3 - 7f) / 2f, 4f), new Vector2(0f - (num3 + 7f), 12f), 0f, 1f, string.Empty); gK2UiProgressBarView.Root.SetActive(false); if ((Object)(object)_theme.DividerSprite != (Object)null) { GK2UiFactory.CreateImage(val.transform, "RowDivider", _theme.DividerSprite, (Type)1, new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(0.5f, 0f), Vector2.zero, new Vector2(-12f, 4f), Color.white); } return new QuestRowView { Root = val, Rect = component, Background = component2, Icon = portrait, Title = val3, Description = val6, Status = val4, Progress = gK2UiProgressBarView, SelectButton = val2, PinButton = val5, PinIcon = component3 }; } private void BuildDetails() { //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_004c: 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_0056: 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_0074: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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_012d: 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_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: 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_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0279: 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_028d: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: 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_037d: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: 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_041a: Unknown result type (might be due to invalid IL or missing references) //IL_0429: Unknown result type (might be due to invalid IL or missing references) //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_0480: Unknown result type (might be due to invalid IL or missing references) //IL_04a6: Unknown result type (might be due to invalid IL or missing references) //IL_04ba: 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) //IL_04d0: Expected O, but got Unknown //IL_04eb: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_0515: Unknown result type (might be due to invalid IL or missing references) //IL_0529: Unknown result type (might be due to invalid IL or missing references) //IL_0561: 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_0581: Unknown result type (might be due to invalid IL or missing references) //IL_058b: Expected O, but got Unknown //IL_05a6: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: Unknown result type (might be due to invalid IL or missing references) //IL_05d0: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Unknown result type (might be due to invalid IL or missing references) //IL_064d: Unknown result type (might be due to invalid IL or missing references) //IL_065c: Unknown result type (might be due to invalid IL or missing references) //IL_066b: Unknown result type (might be due to invalid IL or missing references) //IL_0670: Unknown result type (might be due to invalid IL or missing references) //IL_067f: Unknown result type (might be due to invalid IL or missing references) //IL_06b4: Unknown result type (might be due to invalid IL or missing references) float num = 298f; GameObject val = GK2UiFactory.CreateImage(_root.transform, "QuestDetailsPane", _theme.ContentCellSprite, (Type)(((Object)(object)_theme.ContentCellSprite != (Object)null) ? 1 : 0), Vector2.zero, Vector2.one, new Vector2(0.5f, 0.5f), Vector2.zero, Vector2.zero, ((Object)(object)_theme.ContentCellSprite != (Object)null) ? Color.white : _theme.RowBackground); RectTransform component = val.GetComponent<RectTransform>(); component.offsetMin = new Vector2(num, 8f); component.offsetMax = new Vector2(-8f, -8f); GK2UiSectionHeaderView gK2UiSectionHeaderView = GK2UiSectionHeaderBuilder.Create(val.transform, _theme, "QuestDetailsHeader", "Quest Details", 26f); gK2UiSectionHeaderView.Rect.offsetMin = new Vector2(0f, -26f); gK2UiSectionHeaderView.Rect.offsetMax = Vector2.zero; _detailPaneHeaderTitle = gK2UiSectionHeaderView.Title; GameObject obj = GK2UiFactory.CreateRect(val.transform, "DetailsViewport", Vector2.zero, Vector2.one, new Vector2(0.5f, 0.5f), Vector2.zero, Vector2.zero); RectTransform component2 = obj.GetComponent<RectTransform>(); component2.offsetMin = new Vector2(8f, 8f); component2.offsetMax = new Vector2(-8f, -34f); obj.AddComponent<RectMask2D>(); GameObject val2 = GK2UiFactory.CreateRect(obj.transform, "DetailsContent", new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0.5f, 1f), Vector2.zero, Vector2.zero); _detailContent = val2.GetComponent<RectTransform>(); _detailScroll = val.AddComponent<ScrollRect>(); _detailScroll.viewport = component2; _detailScroll.content = _detailContent; _detailScroll.horizontal = false; _detailScroll.vertical = true; _detailScroll.movementType = (MovementType)2; _detailScroll.inertia = false; _detailScroll.scrollSensitivity = 28f; _detailSummaryPanel = GK2UiFactory.CreateImage((Transform)(object)_detailContent, "QuestSummary", _theme.ContentCellSprite, (Type)(((Object)(object)_theme.ContentCellSprite != (Object)null) ? 1 : 0), new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0.5f, 1f), Vector2.zero, new Vector2(0f, 82f), ((Object)(object)_theme.ContentCellSprite != (Object)null) ? Color.white : _theme.RowBackground); _detailSummaryRect = _detailSummaryPanel.GetComponent<RectTransform>(); GK2UiPortraitView gK2UiPortraitView = GK2UiPortraitBuilder.CreateStonePortrait(_detailSummaryPanel.transform, _theme, "DetailQuestPortrait", new Vector2(8f, -8f), 58f, 1.25f); _detailIcon = gK2UiPortraitView.Portrait; _detailPortraitRect = gK2UiPortraitView.Rect; float num2 = 74f; _detailTitle = GK2UiFactory.CreateNativeTemplateText(_detailSummaryPanel.transform, "DetailTitle", _theme.MainWindowTabTextTemplate ?? _theme.TitleTextTemplate, string.Empty, 15f, (TextAlignmentOptions)257, new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0f, 1f), new Vector2(num2, -8f), new Vector2(0f - (num2 + 112f), 36f)); ((Graphic)_detailTitle).color = Color.white; ((TMP_Text)_detailTitle).textWrappingMode = (TextWrappingModes)1; _detailStatus = GK2UiFactory.CreateText(_detailSummaryPanel.transform, "DetailStatus", _theme.BodyTextTemplate, string.Empty, 9f, (TextAlignmentOptions)257, new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0f, 1f), new Vector2(num2, -46f), new Vector2(0f - (num2 + 112f), 18f)); ((Graphic)_detailStatus).color = new Color(0.72f, 0.68f, 0.61f, 1f); _trackButton = GK2UiFactory.CreateNativeRedButton(_detailSummaryPanel.transform, "TrackQuestButton", _theme, "Track Quest", Vector2.zero, new Vector2(104f, GK2UiMetrics.Native.RedButtonSize.y), (UnityAction)delegate { QuestData val3 = ResolveSelectedQuest(); if (val3 != null) { UnifiedTrackerFeature.ToggleQuestFromExternalUi(val3); Refresh(); } }); RectTransform component3 = ((Component)_trackButton).GetComponent<RectTransform>(); component3.anchorMin = new Vector2(1f, 0f); component3.anchorMax = new Vector2(1f, 0f); component3.pivot = new Vector2(1f, 0f); component3.anchoredPosition = new Vector2(-8f, 8f); _trackButtonLabel = ((Component)_trackButton).GetComponentInChildren<TextMeshProUGUI>(true); _unpinAllButton = GK2UiFactory.CreateNativeRedButton(_detailSummaryPanel.transform, "UnpinAllQuestsButton", _theme, "Unpin All", Vector2.zero, new Vector2(94f, GK2UiMetrics.Native.RedButtonSize.y), (UnityAction)delegate { UnifiedTrackerFeature.UnpinAllQuestsFromExternalUi(); Refresh(); }); RectTransform component4 = ((Component)_unpinAllButton).GetComponent<RectTransform>(); component4.anchorMin = new Vector2(1f, 0f); component4.anchorMax = new Vector2(1f, 0f); component4.pivot = new Vector2(1f, 0f); component4.anchoredPosition = new Vector2(-120f, 8f); GK2UiSectionHeaderView gK2UiSectionHeaderView2 = GK2UiSectionHeaderBuilder.Create((Transform)(object)_detailContent, _theme, "DescriptionHeader", "Description", 20f); _descriptionHeaderRect = gK2UiSectionHeaderView2.Rect; _detailDescription = GK2UiFactory.CreateText((Transform)(object)_detailContent, "DetailDescription", _theme.BodyTextTemplate, string.Empty, 10f, (TextAlignmentOptions)257, new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0f, 1f), Vector2.zero, new Vector2(0f, 80f)); ((TMP_Text)_detailDescription).textWrappingMode = (TextWrappingModes)1; ((Graphic)_detailDescription).color = new Color(0.82f, 0.78f, 0.71f, 1f); GK2UiSectionHeaderView gK2UiSectionHeaderView3 = GK2UiSectionHeaderBuilder.Create((Transform)(object)_detailContent, _theme, "ObjectivesHeader", "Objectives", 20f); _objectivesHeaderRect = gK2UiSectionHeaderView3.Rect; _objectivePool = new GK2UiPool<GK2UiItemRequirementView>(() => GK2UiItemRequirementBuilder.Create((Transform)(object)_detailContent, _theme, 44f), delegate(GK2UiItemRequirementView view, bool active) { if ((Object)(object)view?.Root != (Object)null) { view.Root.SetActive(active); } }); } private void Refresh() { //IL_0376: Unknown result type (might be due to invalid IL or missing references) List<QuestData> visibleQuests = GetVisibleQuests(); int num = visibleQuests.Count((QuestData quest) => quest.IsActiveQuest); int num2 = visibleQuests.Count((QuestData quest) => (int)quest.status == 3); if ((Object)(object)_activeFilterLabel != (Object)null) { ((TMP_Text)_activeFilterLabel).text = $"Active ({num})"; } if ((Object)(object)_completedFilterLabel != (Object)null) { ((TMP_Text)_completedFilterLabel).text = $"Completed ({num2})"; } ApplyFilterStyle(_activeFilterButton, _filter == JournalFilter.Active); ApplyFilterStyle(_completedFilterButton, _filter == JournalFilter.Completed); List<QuestData> list = visibleQuests.Where((QuestData quest) => (_filter != JournalFilter.Active) ? ((int)quest.status == 3) : quest.IsActiveQuest).OrderBy(GetQuestGroupDisplayName).ThenBy((QuestData quest) => ((ObjectLinkedToDefinition<QuestDef>)(object)quest).Definition?.phase ?? 0) .ThenBy(GetQuestTitle) .ToList(); if (list.Count == 0) { _selectedQuestId = string.Empty; } else if (!list.Any((QuestData quest) => string.Equals(((ObjectLinkedToDefinition<QuestDef>)(object)quest).id, _selectedQuestId, StringComparison.OrdinalIgnoreCase))) { _selectedQuestId = ((ObjectLinkedToDefinition<QuestDef>)(object)list[0]).id; } List<IGrouping<string, QuestData>> list2 = (from @group in list.GroupBy<QuestData, string>(GetQuestGroupKey, StringComparer.OrdinalIgnoreCase) orderby GetQuestGroupDisplayName(@group.FirstOrDefault()) select @group).ToList(); if (list2.Count > 0 && _expandedQuestGroups.Count == 0) { string questGroupKey = GetQuestGroupKey(((IEnumerable<QuestData>)list).FirstOrDefault((Func<QuestData, bool>)((QuestData quest) => string.Equals(((ObjectLinkedToDefinition<QuestDef>)(object)quest).id, _selectedQuestId, StringComparison.OrdinalIgnoreCase))) ?? list2[0].First()); _expandedQuestGroups.Add(questGroupKey); } _questGroupPool.Begin(); _questRowPool.Begin(); float num3 = 0f; foreach (IGrouping<string, QuestData> item in list2) { List<QuestData> list3 = item.ToList(); bool flag = _expandedQuestGroups.Contains(item.Key); float num4 = 52f; if (flag) { num4 += (float)list3.Count * 67f; } QuestGroupView questGroupView = _questGroupPool.Rent(); ConfigureQuestGroup(questGroupView, item.Key, list3, flag, num3, num4); if (flag) { float num5 = 52f; foreach (QuestData item2 in list3) { QuestRowView row = _questRowPool.Rent(); ConfigureQuestRow(row, questGroupView.Root.transform, item2, num5); num5 += 67f; } } num3 += num4 + 3f; } _questGroupPool.End(); _questRowPool.End(); _questListContent.sizeDelta = new Vector2(0f, Mathf.Max(0f, num3 - 3f)); RenderSelectedQuest(); Canvas.ForceUpdateCanvases(); } private List<QuestData> GetVisibleQuests() { MainGame instance = MainGame.Instance; List<QuestData> list = ((instance == null) ? null : instance.GameSave?.questSystemData?.questCollection?.quests); if (list == null) { return new List<QuestData>(); } return list.Where((QuestData quest) => quest != null && !quest.isHidden && !quest.isUnknown && (int)quest.status != 4).ToList(); } private void ApplyFilterStyle(Button button, bool selected) { if (!((Object)(object)button == (Object)null)) { GK2UiFactory.SetNativeWindowTabSelected(((Component)button).gameObject, selected); } } private void ConfigureQuestGroup(QuestGroupView view, string groupKey, List<QuestData> quests, bool expanded, float y, float groupHeight) { //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Expected O, but got Unknown //IL_006a: 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_009e: 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_00cd: 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_017c: 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_0157: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0215: 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_0302: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) if (view == null || quests == null || quests.Count == 0) { return; } QuestData val = quests[0]; view.Root.SetActive(true); view.Root.transform.SetParent((Transform)(object)_questListContent, false); view.GroupKey = groupKey; view.Rect.anchorMin = new Vector2(0f, 1f); view.Rect.anchorMax = new Vector2(1f, 1f); view.Rect.pivot = new Vector2(0.5f, 1f); view.Rect.anchoredPosition = new Vector2(0f, 0f - y); view.Rect.sizeDelta = new Vector2(0f, groupHeight); bool flag = quests.All((QuestData quest) => (int)quest.status == 3); view.Background.sprite = _theme.ContentCellSprite; view.Background.type = (Type)(((Object)(object)_theme.ContentCellSprite != (Object)null) ? 1 : 0); ((Graphic)view.Background).color = (Color)((!((Object)(object)_theme.ContentCellSprite != (Object)null)) ? (flag ? new Color(0.15f, 0.17f, 0.15f, 0.96f) : _theme.RowBackground) : (flag ? new Color(0.92f, 0.95f, 0.9f, 1f) : Color.white)); Sprite val2 = (expanded ? (_theme.SectionHeaderSprite ?? _theme.SectionHeaderInactiveSprite) : (_theme.SectionHeaderInactiveSprite ?? _theme.SectionHeaderSprite)); view.HeaderBackground.sprite = val2; view.HeaderBackground.type = (Type)(((Object)(object)val2 != (Object)null) ? 1 : 0); ((Graphic)view.HeaderBackground).color = (((Object)(object)val2 != (Object)null) ? Color.white : _theme.HeaderBackground); ((TMP_Text)view.Title).text = GetQuestGroupDisplayName(val); ((TMP_Text)view.Count).text = ((quests.Count == 1) ? "1 quest" : $"{quests.Count} quests"); ((TMP_Text)view.Chevron).text = (expanded ? "-" : "+"); try { QuestDef definition = ((ObjectLinkedToDefinition<QuestDef>)(object)val).Definition; object obj = ((definition != null) ? definition.Portrait : null); if (obj == null) { QuestDef definition2 = ((ObjectLinkedToDefinition<QuestDef>)(object)val).Definition; obj = ((definition2 != null) ? definition2.Icon : null); } Sprite val3 = (Sprite)obj; view.Portrait.sprite = val3; ((Component)view.Portrait).gameObject.SetActive((Object)(object)val3 != (Object)null); ((Graphic)view.Portrait).color = Color.white; if ((Object)(object)val3 != (Object)null) { ImageExtensions.BlueColorReplace(view.Portrait, _theme?.ItemIconTint ?? Color.white); } } catch { view.Portrait.sprite = null; ((Component)view.Portrait).gameObject.SetActive(false); } ((UnityEventBase)view.ToggleButton.onClick).RemoveAllListeners(); ((UnityEvent)view.ToggleButton.onClick).AddListener((UnityAction)delegate { if (_expandedQuestGroups.Contains(groupKey)) { _expandedQuestGroups.Remove(groupKey); } else { _expandedQuestGroups.Add(groupKey); } Refresh(); }); } private void ConfigureQuestRow(QuestRowView row, Transform parent, QuestData quest, float y) { //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Expected O, but got Unknown //IL_0069: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_0111: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: 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_018d: Invalid comparison between Unknown and I4 //IL_0416: Unknown result type (might be due to invalid IL or missing references) //IL_0420: Expected O, but got Unknown //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_0203: 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_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) if (row == null || (Object)(object)parent == (Object)null || quest == null) { return; } row.Root.SetActive(true); row.Root.transform.SetParent(parent, false); row.Quest = quest; float num = 8f; row.Rect.anchorMin = new Vector2(0f, 1f); row.Rect.anchorMax = new Vector2(1f, 1f); row.Rect.pivot = new Vector2(0.5f, 1f); row.Rect.anchoredPosition = new Vector2(num / 2f, 0f - y); row.Rect.sizeDelta = new Vector2(0f - num, 64f); bool flag = string.Equals(((ObjectLinkedToDefinition<QuestDef>)(object)quest).id, _selectedQuestId, StringComparison.OrdinalIgnoreCase); row.Background.sprite = null; row.Background.type = (Type)0; ((Graphic)row.Background).color = (Color)(flag ? new Color(0.78f, 0.58f, 0.26f, 0.16f) : Color.clear); ((TMP_Text)row.Title).text = GetQuestTitle(quest); ((TMP_Text)row.Description).text = quest.Description ?? string.Empty; ((TMP_Text)row.Status).text = GetQuestStatusText(quest); if ((int)quest.status == 3) { ((Graphic)row.Title).color = new Color(0.78f, 0.82f, 0.72f, 1f); ((Graphic)row.Description).color = new Color(0.62f, 0.66f, 0.58f, 1f); } else { ((Graphic)row.Title).color = Color.white; ((Graphic)row.Description).color = new Color(0.76f, 0.72f, 0.66f, 1f); } GetQuestProgress(GetItemRequirements(quest), out var current, out var target, out var progress); bool flag2 = target > 0; row.Progress.Root.SetActive(flag2); if (flag2) { row.Progress.SetProgress(progress, 1f, $"{current}/{target}"); } else { row.Progress.SetProgress(0f, 1f, string.Empty); } try { Image icon = row.Icon; QuestDef definition = ((ObjectLinkedToDefinition<QuestDef>)(object)quest).Definition; object obj = ((definition != null) ? definition.Portrait : null); if (obj == null) { QuestDef definition2 = ((ObjectLinkedToDefinition<QuestDef>)(object)quest).Definition; obj = ((definition2 != null) ? definition2.Icon : null); } icon.sprite = (Sprite)obj; ((Component)row.Icon).gameObject.SetActive((Object)(object)row.Icon.sprite != (Object)null); ((Graphic)row.Icon).color = Color.white; if ((Object)(object)row.Icon.sprite != (Object)null) { ImageExtensions.BlueColorReplace(row.Icon, _theme?.ItemIconTint ?? Color.white); } } catch { row.Icon.sprite = null; ((Component)row.Icon).gameObject.SetActive(false); } ((UnityEventBase)row.SelectButton.onClick).RemoveAllListeners(); ((UnityEvent)row.SelectButton.onClick).AddListener((UnityAction)delegate { _selectedQuestId = ((ObjectLinkedToDefinition<QuestDef>)(object)quest).id; Refresh(); }); bool flag3 = quest.IsActiveQuest && UnifiedTrackerFeature.CanTrackQuestFromExternalUi(); ((Component)row.PinButton).gameObject.SetActive(flag3); if (flag3) { bool flag4 = UnifiedTrackerFeature.IsQuestTrackedFromExternalUi(((ObjectLinkedToDefinition<QuestDef>)(object)quest).id); row.PinIcon.sprite = UnifiedTrackerFeature.GetTrackerPinSpriteForExternalUi(); ((Graphic)row.PinIcon).color = (Color)(flag4 ? Color.white : new Color(1f, 1f, 1f, 0.42f)); ((UnityEventBase)row.PinButton.onClick).RemoveAllListeners(); ((UnityEvent)row.PinButton.onClick).AddListener((UnityAction)delegate { UnifiedTrackerFeature.ToggleQuestFromExternalUi(quest); Refresh(); }); } } private void RenderSelectedQuest() { //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: 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_01a3: 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_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0224: 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_0118: 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_0370: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_037c: 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_03b9: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03df: Invalid comparison between Unknown and I4 //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_059d: Unknown result type (might be due to invalid IL or missing references) //IL_0422: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_0495: 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_04c9: Unknown result type (might be due to invalid IL or missing references) //IL_04f5: Unknown result type (might be due to invalid IL or missing references) QuestData val = ResolveSelectedQuest(); ((TMP_Text)_detailPaneHeaderTitle).text = "Quest Details"; _detailSummaryPanel.SetActive(true); if (val == null) { ((TMP_Text)_detailTitle).text = ((_filter == JournalFilter.Active) ? "No Active Quests" : "No Completed Quests"); ((TMP_Text)_detailStatus).text = ((_filter == JournalFilter.Active) ? "New active quests will appear here." : "Completed quests will appear here."); ((Component)_detailPortraitRect).gameObject.SetActive(false); ((Component)_trackButton).gameObject.SetActive(false); bool flag = UnifiedTrackerFeature.HasTrackedQuestsForExternalUi(); ((Component)_unpinAllButton).gameObject.SetActive(flag); ((Selectable)_unpinAllButton).interactable = flag; ((Component)_descriptionHeaderRect).gameObject.SetActive(false); ((Component)_objectivesHeaderRect).gameObject.SetActive(false); ((Component)_detailDescription).gameObject.SetActive(false); _objectivePool.Begin(); _objectivePool.End(); _detailSummaryRect.anchoredPosition = Vector2.zero; _detailSummaryRect.sizeDelta = new Vector2(0f, 82f); _detailContent.sizeDelta = new Vector2(0f, 94f); return; } ((Component)_detailPortraitRect).gameObject.SetActive(true); ((Component)_detailDescription).gameObject.SetActive(true); Rect rect = _detailScroll.viewport.rect; float num = Mathf.Max(240f, ((Rect)(ref rect)).width); _detailSummaryRect.anchoredPosition = Vector2.zero; _detailSummaryRect.sizeDelta = new Vector2(0f, 82f); ((TMP_Text)_detailTitle).text = GetQuestTitle(val); ((TMP_Text)_detailStatus).text = GetQuestStatusText(val); try { QuestDef definition = ((ObjectLinkedToDefinition<QuestDef>)(object)val).Definition; object obj = ((definition != null) ? definition.Portrait : null); if (obj == null) { QuestDef definition2 = ((ObjectLinkedToDefinition<QuestDef>)(object)val).Definition; obj = ((definition2 != null) ? definition2.Icon : null); } Sprite val2 = (Sprite)obj; _detailIcon.sprite = val2; ((Component)_detailIcon).gameObject.SetActive((Object)(object)val2 != (Object)null); ((Graphic)_detailIcon).color = Color.white; if ((Object)(object)val2 != (Object)null) { ImageExtensions.BlueColorReplace(_detailIcon, _theme?.ItemIconTint ?? Color.white); } } catch { _detailIcon.sprite = null; ((Component)_detailIcon).gameObject.SetActive(false); } bool flag2 = val.IsActiveQuest && UnifiedTrackerFeature.CanTrackQuestFromExternalUi(); ((Component)_trackButton).gameObject.SetActive(flag2); bool flag3 = UnifiedTrackerFeature.HasTrackedQuestsForExternalUi(); ((Component)_unpinAllButton).gameObject.SetActive(flag3); ((Selectable)_unpinAllButton).interactable = flag3; if (flag2) { bool flag4 = UnifiedTrackerFeature.IsQuestTrackedFromExternalUi(((ObjectLinkedToDefinition<QuestDef>)(object)val).id); ((TMP_Text)_trackButtonLabel).text = (flag4 ? "Tracked" : "Track Quest"); } float num2 = 90f; ((Component)_descriptionHeaderRect).gameObject.SetActive(true); _descriptionHeaderRect.anchoredPosition = new Vector2(0f, 0f - num2); _descriptionHeaderRect.sizeDelta = new Vector2(0f, 20f); num2 += 25f; ((TMP_Text)_detailDescription).text = val.Description ?? string.Empty; Vector2 preferredValues = ((TMP_Text)_detailDescription).GetPreferredValues(((TMP_Text)_detailDescription).text, num, 0f); float num3 = Mathf.Max(36f, preferredValues.y); ((TMP_Text)_detailDescription).rectTransform.anchoredPosition = new Vector2(0f, 0f - num2); ((TMP_Text)_detailDescription).rectTransform.sizeDelta = new Vector2(0f, num3); num2 += num3 + 10f; List<QuestPhraseRequirement> itemRequirements = GetItemRequirements(val); bool flag5 = (int)val.status != 3 && itemRequirements.Count > 0; ((Component)_objectivesHeaderRect).gameObject.SetActive(flag5); _objectivePool.Begin(); if (flag5) { _objectivesHeaderRect.anchoredPosition = new Vector2(0f, 0f - num2); _objectivesHeaderRect.sizeDelta = new Vector2(0f, 20f); num2 += 25f; int num4 = Mathf.Max(1, 4); for (int i = 0; i < itemRequirements.Count; i++) { QuestPhraseRequirement val3 = itemRequirements[i]; GK2UiItemRequirementView gK2UiItemRequirementView = _objectivePool.Rent(); int num5 = i / num4; int num6 = i % num4; gK2UiItemRequirementView.Rect.anchorMin = new Vector2(0f, 1f); gK2UiItemRequirementView.Rect.anchorMax = new Vector2(0f, 1f); gK2UiItemRequirementView.Rect.pivot = new Vector2(0f, 1f); gK2UiItemRequirementView.Rect.anchoredPosition = new Vector2(4f + (float)num6 * 50f, 0f - (num2 + (float)num5 * 50f)); GK2UiItemRequirementBuilder.Bind(current: GetInventoryCount(val3.itemCount.itemId), view: gK2UiItemRequirementView, theme: _theme, itemId: val3.itemCount.itemId, target: val3.itemCount.count); } int num7 = Mathf.CeilToInt((float)itemRequirements.Count / (float)num4); num2 += (float)num7 * 44f + (float)Mathf.Max(0, num7 - 1) * 6f; } _objectivePool.End(); _detailContent.sizeDelta = new Vector2(0f, num2 + 16f); } private static List<QuestPhraseRequirement> GetItemRequirements(QuestData quest) { return ((ObjectLinkedToDefinition<QuestDef>)(object)quest)?.Definition?.finishCheck?.phraseReqs?.Where((QuestPhraseRequirement requirement) => requirement != null && (int)requirement.entity == 0 && requirement.itemCount != null && !string.IsNullOrWhiteSpace(requirement.itemCount.itemId)).ToList() ?? new List<QuestPhraseRequirement>(); } private static int GetInventoryCount(string itemId) { if (string.IsNullOrWhiteSpace(itemId)) { return 0; } PlayerData playerData = MainGame.PlayerData; int? obj; if (playerData == null) { obj = null; } else { Inventory inventory = playerData.Inventory; if (inventory == null) { obj = null; } else { Item data = inventory.Data; obj = ((data != null) ? new int?(data.GetTotalCountInInventory(itemId, (Item)null, false)) : ((int?)null)); } } int? num = obj; return num.GetValueOrDefault(); } private static void GetQuestProgress(List<QuestPhraseRequirement> requirements, out int current, out int target, out float progress01) { current = 0; target = 0; if (requirements != null) { foreach (QuestPhraseRequirement requirement in requirements) { if (requirement?.itemCount != null) { int num = Mathf.Max(1, requirement.itemCount.count); int inventoryCount = GetInventoryCount(requirement.itemCount.itemId); target += num; current += Mathf.Min(inventoryCount, num); } } } progress01 = ((target <= 0) ? 0f : Mathf.Clamp01((float)current / (float)target)); } private QuestData ResolveSelectedQuest() { if (string.IsNullOrWhiteSpace(_selectedQuestId)) { return null; } MainGame instance = MainGame.Instance; QuestCollectionData val = ((instance == null) ? null : instance.GameSave?.questSystemData?.questCollection); if (val?.questsCache == null || !val.questsCache.TryGetValue(_selectedQuestId, out var value)) { return null; } return value; } private static string GetQuestGroupKey(QuestData quest) { string text = NormalizeIdentityId(GetIdentityString(TryGetQuestCharacterIdentity(quest))); if (!string.IsNullOrWhiteSpace(text)) { return "npc:" + text; } try { object obj; if (quest == null) { obj = null; } else { QuestDef definition = ((ObjectLinkedToDefinition<QuestDef>)(object)quest).Definition; obj = ((definition != null) ? definition.Portrait : null); } Sprite val = (Sprite)obj; if ((Object)(object)val != (Object)null && !string.IsNullOrWhiteSpace(((Object)val).name)) { return "portrait:" + ((Object)val).name; } } catch { } return "other"; } private static string GetQuestGroupDisplayName(QuestData quest) { string text = NormalizeIdentityId(GetIdentityString(TryGetQuestCharacterIdentity(quest))); if (!string.IsNullOrWhiteSpace(text)) { string text2 = LLBase.L(text); if (!string.IsNullOrWhiteSpace(text2) && !string.Equals(text2, text, StringComparison.OrdinalIgnoreCase)) { return text2; } return HumanizeIdentifier(text); } try { object obj; if (quest == null) { obj = null; } else { QuestDef definition = ((ObjectLinkedToDefinition<QuestDef>)(object)quest).Definition; if (definition == null) { obj = null; } else { Sprite portrait = definition.Portrait; obj = ((portrait != null) ? ((Object)portrait).name : null); } } string value = (string)obj; if (!string.IsNullOrWhiteSpace(value)) { return HumanizeIdentifier(value); } } catch { } return "Other"; } private static object TryGetQuestCharacterIdentity(QuestData quest) { object obj = ((ObjectLinkedToDefinition<QuestDef>)(object)quest)?.Definition; if (obj == null) { return null; } string[] obj2 = new string[15] { "character", "Character", "npc", "Npc", "NPC", "giver", "Giver", "owner", "Owner", "characterId", "CharacterId", "npcId", "NpcId", "giverId", "GiverId" }; Type type = obj.GetType(); string[] array = obj2; foreach (string name in array) { try { PropertyInfo property = type.GetProperty(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property != null) { object value = property.GetValue(obj, null); if (value != null) { return value; } } FieldInfo field = type.GetField(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { object value2 = field.GetValue(obj); if (value2 != null) { return value2; } } } catch { } } return null; } private static string GetIdentityString(object identity) { if (identity == null) { return string.Empty; } if (identity is string result) { return result; } Type type = identity.GetType(); string[] array = new string[5] { "id", "Id", "ID", "name", "Name" }; foreach (string name in array) { try { PropertyInfo property = type.GetProperty(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property != null) { object value = property.GetValue(identity, null); if (value != null) { return value.ToString(); } } FieldInfo field = type.GetField(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { object value2 = field.GetValue(identity); if (value2 != null) { return value2.ToString(); } } } catch { } } return identity.ToString(); } private static string NormalizeIdentityId(string value) { if (string.IsNullOrWhiteSpace(value)) { return string.Empty; } string text = value.Trim(); int num = text.IndexOf("(clone)", StringComparison.OrdinalIgnoreCase); if (num >= 0) { text = text.Remove(num, "(clone)".Length).Trim(); } return text; } private static string HumanizeIdentifier(string value) { if (string.IsNullOrWhiteSpace(value)) { return "Other"; } string text = NormalizeIdentityId(value).Replace("_portrait", string.Empty).Replace("_icon", string.Empty).Replace("portrait_", string.Empty) .Replace("icon_", string.Empty) .Replace("_", " ") .Replace("-", " ") .Trim(); if (text.Length == 0) { return "Other"; } string[] array = text.Split(new char[1] { ' ' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < array.Length; i++) { string text2 = array[i]; if (text2.Length != 0) { array[i] = char.ToUpperInvariant(text2[0]) + ((text2.Length > 1) ? text2.Substring(1).ToLowerInvariant() : string.Empty); } } return string.Join(" ", array); } private static string GetQuestTitle(QuestData quest) { if (quest == null) { return string.Empty; } string text = LLBase.L(((ObjectLinkedToDefinition<QuestDef>)(object)quest).id); if (!string.IsNullOrWhiteSpace(text)) { return text; } return ((ObjectLinkedToDefinition<QuestDef>)(object)quest).id; } private static string GetQuestStatusText(QuestData quest) { //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_0010: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected I4, but got Unknown if (quest == null) { return string.Empty; } QuestStatus status = quest.status; return (int)status switch { 0 => "Available", 1 => "Awaiting", 2 => "In Progress", 3 => "Completed", 4 => "Canceled", _ => ((object)Unsafe.As<QuestStatus, QuestStatus>(ref quest.status)/*cast due to .constrained prefix*/).ToString(), }; } } internal sealed class GK2ItemOption { public string Id { get; } public string DisplayName { get; } public GK2ItemOption(string id, string displayName) { Id = id ?? string.Empty; DisplayName = (string.IsNullOrWhiteSpace(displayName) ? Id : displayName); } } internal sealed class GK2SpawnItemControl { public string Tab { get; } public Func<IReadOnlyList<GK2ItemOption>> ItemOptionsProvider { get; } public Func<string> SelectedItemIdProvider { get; } public Func<int> QuantityProvider { get; } public Action<string> ItemSelected { get; } public Action<int> QuantityChanged { get; } public Action Spawn { get; } public Func<bool> CanSpawn { get; } public GK2SpawnItemControl(string tab, Func<IReadOnlyList<GK2ItemOption>> itemOptionsProvider, Func<string> selectedItemIdProvider, Func<int> quantityProvider, Action<string> itemSelected, Action<int> quantityChanged, Action spawn, Func<bool> canSpawn) { Tab = (string.IsNullOrWhiteSpace(tab) ? "Cheats" : tab); ItemOptionsProvider = itemOptionsProvider ?? throw new ArgumentNullException("itemOptionsProvider"); SelectedItemIdProvider = selectedItemIdProvider ?? throw new ArgumentNullException("selectedItemIdProvider"); QuantityProvider = quantityProvider ?? throw new ArgumentNullException("quantityProvider"); ItemSelected = itemSelected ?? throw new ArgumentNullException("itemSelected"); QuantityChanged = quantityChanged ?? throw new ArgumentNullException("quantityChanged"); Spawn = spawn ?? throw new ArgumentNullException("spawn"); CanSpawn = canSpawn ?? ((Func<bool>)(() => true)); } } internal sealed class GK2TrackerHudController : MonoBehaviour { private sealed class HudIngredientView { public GameObject Root; public RectTransform Rect; public Image Slot; public Image Icon; public TextMeshProUGUI Count; public TextMeshProUGUI Label; public string ItemId; public bool? EnoughState; } private sealed class HudMaterialData { public string ItemId; public int Current; public int Target; } private sealed class HudCraftEntryData { public string Title; public readonly List<HudMaterialData> Materials = new List<HudMaterialData>(); } private sealed class HudCraftEntryView { public GameObject Root; public RectTransform Rect; public TextMeshProUGUI Title; public GK2UiPool<HudIngredientView> IngredientPool; } private sealed class HudQuestEntryData { public string Title; public string Description; public readonly List<HudMaterialData> Materials = new List<HudMaterialData>(); } private sealed class HudQuestEntryView { public GameObject Root; public RectTransform Rect; public TextMeshProUGUI Title; public TextMeshProUGUI Description; public GK2UiPool<HudIngredientView> IngredientPool; } private sealed class HudPanel { public GameObject Root; public RectTransform Rect; public TextMeshProUGUI Title; public TextMeshProUGUI Body; public GK2UiPool<HudIngredientView> IngredientPool; public GK2UiPool<HudCraftEntryView> CraftEntryPool; public GK2UiPool<HudQuestEntryView> QuestEntryPool; } private const string HudRootName = "GK2PlusNativeTrackerHud"; private ManualLogSource _logger; private Func<bool> _visibleProvider; private Func<string> _textProvider; private GameObject _hudRoot; private RectTransform _rootRect; private GK2UiTheme _theme; private TextMeshProUGUI _titleTemplate; private TextMeshProUGUI _bodyTemplate; private readonly Dictionary<string, HudPanel> _panels = new Dictionary<string, HudPanel>(StringComparer.OrdinalIgnoreCase); private string _cachedText = string.Empty; private string _renderedText = string.Empty; private float _nextRefreshAt; public static GK2TrackerHudController Create(ManualLogSource logger, Func<bool> visibleProvider, Func<string> textProvider) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown GameObject val = GameObject.Find("GK2PlusTrackerHudController"); if ((Object)(object)val == (Object)null) { val = new GameObject("GK2PlusTrackerHudController"); Object.DontDestroyOnLoad((Object)(object)val); } GK2TrackerHudController gK2TrackerHudController = val.GetComponent<GK2TrackerHudController>(); if ((Object)(object)gK2TrackerHudController == (Object)null) { gK2TrackerHudController = val.AddComponent<GK2TrackerHudController>(); } gK2TrackerHudController._logger = logger; gK2TrackerHudController._visibleProvider = visibleProvider; gK2TrackerHudController._textProvider = textProvider; gK2TrackerHudController._nextRefreshAt = 0f; return gK2TrackerHudController; } private void Update() { if (Time.unscaledTime < _nextRefreshAt) { return; } _nextRefreshAt = Time.unscaledTime + 0.25f; Func<bool> visibleProvider = _visibleProvider; if (visibleProvider == null || !visibleProvider()) { HideAll(); return; } try { _cachedText = _textProvider?.Invoke() ?? string.Empty; } catch (Exception arg) { _cachedText = string.Empty; ManualLogSource logger = _logger; if (logger != null) { logger.LogError((object)$"GK2+ tracker HUD refresh failed: {arg}"); } } if (string.IsNullOrWhiteSpace(_cachedText) || !EnsureHud()) { HideAll(); } else if (!string.Equals(_cachedText, _renderedText, StringComparison.Ordinal)) { Dictionary<string, string> groups = ParseGroups(_cachedText); LayoutGroups(groups); _renderedText = _cachedText; } } private bool EnsureHud() { //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Expected O, but got Unknown //IL_0148: 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_0168: 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_019c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_hudRoot != (Object)null && (Object)(object)_rootRect != (Object)null && (Object)(object)_titleTemplate != (Object)null && (Object)(object)_bodyTemplate != (Object)null) { return true; } GUIElements instance = GUIElements.Instance; if ((Object)(object)instance == (Object)null || (Object)(object)instance.Root == (Object)null) { return false; } _theme = GK2UiTheme.Resolve(_logger); _titleTemplate = _theme?.TitleTextTemplate; _bodyTemplate = _theme?.BodyTextTemplate; if (_theme == null || (Object)(object)_titleTemplate == (Object)null || (Object)(object)_bodyTemplate == (Object)null) { return false; } Transform val = ((Transform)instance.Root).Find("GK2PlusNativeTrackerHud"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)((Component)val).gameObject); } _hudRoot = new GameObject("GK2PlusNativeTrackerHud", new Type[1] { typeof(RectTransform) }); _hudRoot.transform.SetParent((Transform)(object)instance.Root, false); _hudRoot.transform.SetAsLastSibling(); _rootRect = _hudRoot.GetComponent<RectTransform>(); _rootRect.anchorMin = Vector2.one; _rootRect.anchorMax = Vector2.one; _rootRect.pivot = Vector2.one; _rootRect.anchoredPosition = new Vector2(-20f, -56f); _rootRect.sizeDelta = new Vector2(152f, 600f); ManualLogSource logger = _logger; if (logger != null) { logger.LogInfo((object)"GK2+ compact grouped tracker HUD initialized."); } return true; } private void LayoutGroups(IReadOnlyDictionary<string, string> groups) { //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) string[] obj = new string[3] { "QUESTS", "CRAFTS", "ITEMS" }; float num = 0f; string[] array = obj; foreach (string text in array) { if (!groups.TryGetValue(text, out var value) || string.IsNullOrWhiteSpace(value)) { if (_panels.TryGetValue(text, out var value2)) { value2.Root.SetActive(false); } continue; } HudPanel orCreatePanel = GetOrCreatePanel(text); orCreatePanel.Root.SetActive(true); ((TMP_Text)orCreatePanel.Title).text = FormatTitle(text); float num2 = Mathf.Max(34f, RenderPanelBody(orCreatePanel, text, value.Trim())); float num3 = 25f + num2; orCreatePanel.Rect.anchoredPosition = new Vector2(0f, 0f - num); orCreatePanel.Rect.sizeDelta = new Vector2(152f, num3); num += num3 + 8f; } } private float RenderPanelBody(HudPanel panel, string groupName, string body) { if (string.Equals(groupName, "CRAFTS", StringComparison.OrdinalIgnoreCase)) { return RenderCraftPanel(panel, body); } if (string.Equals(groupName, "QUESTS", StringComparison.OrdinalIgnoreCase)) { return RenderQuestPanel(panel, body); } ((Component)panel.Body).gameObject.SetActive(true); panel.CraftEntryPool?.Begin(); panel.CraftEntryPool?.End(); panel.QuestEntryPool?.Begin(); panel.QuestEntryPool?.End(); panel.IngredientPool?.Begin(); string[] array = (body ?? string.Empty).Replace("\r", string.Empty).Split('\n'); List<string> list = new List<string>(); int num = 0; int lineIndex = -1; for (int i = 0; i < array.Length; i++) { if (TryParseHudItemToken(array[i].Trim(), out var itemId, out var current, out var target, out var label, out var customItem)) { if (customItem) { num = 0; lineIndex = -1; int count = list.Count; list.Add(" "); list.Add(string.Empty); list.Add(string.Empty); HudIngredientView view = panel.IngredientPool?.Rent(); ConfigureIngredientView(view, count, 0, itemId, current, target, label, customItem: true); continue; } if (num == 0) { lineIndex = list.Count; list.Add(" "); list.Add(string.Empty); list.Add(string.Empty); } HudIngredientView view2 = panel.IngredientPool?.Rent(); ConfigureIngredientView(view2, lineIndex, num, itemId, current, target, string.Empty, customItem: false); num++; if (num >= 3) { num = 0; lineIndex = -1; } } else { num = 0; lineIndex = -1; list.Add(array[i]); } } ((TMP_Text)panel.Body).text = string.Join("\n", list); panel.IngredientPool?.End(); return 12f + (float)Math.Max(1, list.Count) * 13.5f; } private float RenderCraftPanel(HudPanel panel, string body) { ((TMP_Text)panel.Body).text = string.Empty; ((Component)panel.Body).gameObject.SetActive(false); panel.IngredientPool?.Begin(); panel.IngredientPool?.End(); panel.QuestEntryPool?.Begin(); panel.QuestEntryPool?.End(); List<HudCraftEntryData> list = ParseCraftEntries(body); panel.CraftEntryPool?.Begin(); float num = 6f; for (int i = 0; i < list.Count; i++) { HudCraftEntryView hudCraftEntryView = panel.CraftEntryPool?.Rent(); if (hudCraftEntryView != null) { float num2 = ConfigureCraftEntry(hudCraftEntryView, list[i], num); num += num2 + 5f; } } panel.CraftEntryPool?.End(); if (list.Count > 0) { num -= 5f; } return num + 6f; } private float RenderQuestPanel(HudPanel panel, string body) { ((TMP_Text)panel.Body).text = string.Empty; ((Component)panel.Body).gameObject.SetActive(false); panel.IngredientPool?.Begin(); panel.IngredientPool?.End(); panel.CraftEntryPool?.Begin(); panel.CraftEntryPool?.End(); List<HudQuestEntryData> list = ParseQuestEntries(body); panel.QuestEntryPool?.Begin(); float num = 6f; for (int i = 0; i < list.Count; i++) { HudQuestEntryView hudQuestEntryView = panel.QuestEntryPool?.Rent(); if (hudQuestEntryView != null) { float num2 = ConfigureQuestEntry(hudQuestEntryView, list[i], num); num += num2 + 6f; } } panel.QuestEntryPool?.End(); if (list.Count > 0) { num -= 6f; } return num + 6f; } private static List<HudQuestEntryData> ParseQuestEntries(string body) { List<HudQuestEntryData> list = new List<HudQuestEntryData>(); HudQuestEntryData hudQuestEntryData = null; string[] array = (body ?? string.Empty).Replace("\r", string.Empty).Split('\n'); for (int i = 0; i < array.Length; i++) { string text = array[i].Trim(); if (!string.IsNullOrWhiteSpace(text)) { string itemId; int current; int target; string label; bool customItem; if (TryParseQuestToken(text, out var title, out var description)) { hudQuestEntryData = new HudQuestEntryData { Title = title, Description = description }; list.Add(hudQuestEntryData); } else if (TryParseHudItemToken(text, out itemId, out current, out target, out label, out customItem) && !customItem) { hudQuestEntryData?.Materials.Add(new HudMaterialData { ItemId = itemId, Current = current, Target = target }); } } } return list; } private static bool TryParseQuestToken(string line, out string title, out string description) { title = string.Empty; description = string.Empty; if (string.IsNullOrWhiteSpace(line) || !line.StartsWith("[[QUEST|", StringComparison.OrdinalIgnoreCase) || !line.EndsWith("]]", StringComparison.Ordinal)) { return false; } string[] array = line.Substring(2, line.Length - 4).Split('|'); if (array.Length < 3 || !string.Equals(array[0], "QUEST", StringComparison.OrdinalIgnoreCase)) { return false; } try { title = Uri.UnescapeDataString(array[1] ?? string.Empty); description = Uri.UnescapeDataString(array[2] ?? string.Empty); } catch { title = string.Empty; description = string.Empty; return false; } return !string.IsNullOrWhiteSpace(title); } private float ConfigureQuestEntry(HudQuestEntryView view, HudQuestEntryData data, float cursorY) { //IL_0031: 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_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_00a9: 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_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) if (view == null || data == null) { return 0f; } float num = 136f; view.Root.SetActive(true); view.Rect.anchoredPosition = new Vector2(8f, 0f - (25f + cursorY)); ((TMP_Text)view.Title).text = data.Title ?? string.Empty; Vector2 preferredValues = ((TMP_Text)view.Title).GetPreferredValues(((TMP_Text)view.Title).text, num, 0f); float num2 = Mathf.Max(13.5f, preferredValues.y); ((TMP_Text)view.Title).rectTransform.anchoredPosition = Vector2.zero; ((TMP_Text)view.Title).rectTransform.sizeDelta = new Vector2(0