using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.Json; using BepInEx; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using Esper.SkillWeb; using Esper.SkillWeb.Graph; using Esper.SkillWeb.UI; using Esper.SkillWeb.UI.UGUI; using HarmonyLib; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSystem; using Il2CppSystem.Collections.Generic; using Notifications; using Progress.Shop.Skill.UI; using Research; using SaveSystem; using Store; using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")] [assembly: AssemblyCompany("UpgradeLib")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("UpgradeLib")] [assembly: AssemblyTitle("UpgradeLib")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace UpgradeLib; [BepInPlugin("com.upgradelib.roadsideresearch", "UpgradeLib", "1.0.2")] public class Plugin : BasePlugin { public const string GUID = "com.upgradelib.roadsideresearch"; public const string Name = "UpgradeLib"; public const string Version = "1.0.2"; internal static ManualLogSource Log; public override void Load() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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_0045: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) Log = ((BasePlugin)this).Log; Harmony val = new Harmony("com.upgradelib.roadsideresearch"); val.PatchAll(typeof(CreateUIPatch)); val.PatchAll(typeof(CreateUIPostfixPatch)); val.PatchAll(typeof(SkillNodeUpgradePatch)); val.PatchAll(typeof(GameLoadPatch)); val.PatchAll(typeof(WebUnloadPatch)); val.PatchAll(typeof(SkillButtonPatch)); val.PatchAll(typeof(SkillIconPatch)); val.PatchAll(typeof(SkillCostLabelPatch)); val.PatchAll(typeof(SkillNameLabelPatch)); val.PatchAll(typeof(SkillDescriptionLabelPatch)); val.PatchAll(typeof(SkillUnlockPopulatorPatch)); val.PatchAll(typeof(SkillEnablerPatch)); val.PatchAll(typeof(SkillNodeLevelTextPatch)); val.PatchAll(typeof(SkillNodeUpdateStatePatch)); ((BasePlugin)this).AddComponent(); Log.LogInfo((object)"UpgradeLib v2 loaded! Tree-based upgrades will appear in skill webs."); } } [HarmonyPatch] internal static class CreateUIPatch { [HarmonyPatch(typeof(WebViewUGUI), "CreateUI")] [HarmonyPrefix] public static void BeforeCreateUI(WebViewUGUI __instance) { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown bool flag = default(bool); try { if (((RuntimeWebViewer)__instance).web == null) { return; } string webName = ((RuntimeWebViewer)__instance).webName; ManualLogSource log = Plugin.Log; if (log != null) { BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(38, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("UpgradeLib: CreateUI called for web '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(webName); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("'"); } log.LogInfo(val); } CostType? costTypeFromWebName = GetCostTypeFromWebName(webName); if (costTypeFromWebName.HasValue) { UpgradePanelComponent.SaveCostType(__instance, costTypeFromWebName.Value); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(36, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("UpgradeLib: CreateUI prefix failed: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex); } log.LogError(val2); } } } private static CostType? GetCostTypeFromWebName(string webName) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Expected O, but got Unknown if (string.IsNullOrEmpty(webName)) { return null; } string text = webName.ToLowerInvariant(); if (text.Contains("economy") || text.Contains("shop") || text.Contains("store") || text.Contains("econ")) { return CostType.Money; } if (text.Contains("research") || text.Contains("alien") || text.Contains("tech")) { return CostType.Research; } ManualLogSource log = Plugin.Log; if (log != null) { bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(51, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("UpgradeLib: Unknown web name '"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(webName); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("', skipping injection"); } log.LogInfo(val); } return null; } } [HarmonyPatch] internal static class CreateUIPostfixPatch { [HarmonyPatch(typeof(WebViewUGUI), "CreateUI")] [HarmonyPostfix] public static void AfterCreateUI(WebViewUGUI __instance) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown try { UpgradePanelComponent.CreateCustomNodeUI(__instance); } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(37, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("UpgradeLib: CreateUI postfix failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex); } log.LogError(val); } } } } [HarmonyPatch] internal static class SkillNodeUpgradePatch { [HarmonyPatch(typeof(SkillNode), "TryUpgrade")] [HarmonyPrefix] public static bool CustomUpgrade(SkillNode __instance, ref bool __result) { //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Expected O, but got Unknown //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Expected O, but got Unknown //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Expected O, but got Unknown if (((Node)__instance).id < 10000) { return true; } if (UpgradePanelComponent.IsDragging) { __result = false; return false; } bool flag = default(bool); try { UpgradeDefinition byNodeId = UpgradeAPI.GetByNodeId(((Node)__instance).id); if (byNodeId == null) { return true; } if (UpgradeAPI.IsPurchased(byNodeId.Id)) { NotificationsManager.QueueNotification("Already purchased!", false, 3f); __result = false; return false; } if (!UpgradeAPI.CanPurchase(byNodeId.Id)) { string parentId = UpgradeAPI.GetParentId(byNodeId.Id); string text = ((parentId != null) ? UpgradeAPI.GetById(parentId) : null)?.Name ?? "prerequisite"; NotificationsManager.QueueNotification("Requires: " + text, false, 3f); __result = false; return false; } float cost = byNodeId.Cost; if (byNodeId.CostType == CostType.Money) { float currentCurrency = CurrencyManager.CurrentCurrency; if (currentCurrency < cost) { NotificationsManager.QueueNotification($"Need ${cost:F0} — you have ${currentCurrency:F0}", false, 3f); __result = false; return false; } CurrencyManager.ChangeCurrency(0f - cost); } else { float currentResearch = ResearchManager.CurrentResearch; if (currentResearch < cost) { NotificationsManager.QueueNotification($"Need {cost:F0} research — you have {currentResearch:F0}", false, 3f); __result = false; return false; } ResearchManager.AddResearch(0f - cost); } UpgradeState.SetPurchased(byNodeId.Id); __instance.SetLevel(1, false); __instance.state = (State)3; SkillNodeUGUI val = default(SkillNodeUGUI); if ((Object)(object)WebViewUGUI.Active != (Object)null && WebViewUGUI.Active.loadedSkillNodes.TryGetValue(((Node)__instance).id, ref val)) { val.ReloadUI(); } if (byNodeId.Children != null) { SkillNodeUGUI val2 = default(SkillNodeUGUI); foreach (UpgradeDefinition child in byNodeId.Children) { int nodeIdForUpgrade = UpgradeAPI.GetNodeIdForUpgrade(child.Id); if (nodeIdForUpgrade < 0) { continue; } Web web = __instance.web; if (web != null && web.skillNodes.ContainsKey(nodeIdForUpgrade)) { web.skillNodes[nodeIdForUpgrade].state = (State)1; if ((Object)(object)WebViewUGUI.Active != (Object)null && WebViewUGUI.Active.loadedSkillNodes.TryGetValue(nodeIdForUpgrade, ref val2)) { val2.ReloadUI(); } } } } UpgradePersistence.Save(); ManualLogSource log; try { byNodeId.OnPurchased?.Invoke(); } catch (Exception ex) { log = Plugin.Log; if (log != null) { BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(40, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("UpgradeLib: OnPurchased callback error: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex.Message); } log.LogWarning(val3); } } string text2 = ((byNodeId.CostType == CostType.Money) ? $"${cost:F0}" : $"{cost:F0} research"); NotificationsManager.QueueNotification(byNodeId.Name + " purchased! (-" + text2 + ")", false, 4f); log = Plugin.Log; if (log != null) { BepInExInfoLogInterpolatedStringHandler val4 = new BepInExInfoLogInterpolatedStringHandler(29, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("UpgradeLib: Purchased '"); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted(byNodeId.Id); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("' for "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted(text2); } log.LogInfo(val4); } __result = true; return false; } catch (Exception ex2) { ManualLogSource log = Plugin.Log; if (log != null) { BepInExErrorLogInterpolatedStringHandler val5 = new BepInExErrorLogInterpolatedStringHandler(29, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val5).AppendLiteral("UpgradeLib: Purchase failed: "); ((BepInExLogInterpolatedStringHandler)val5).AppendFormatted(ex2); } log.LogError(val5); } __result = false; return false; } } } [HarmonyPatch] internal static class GameLoadPatch { [HarmonyPatch(typeof(CurrencyManager), "Spawned")] [HarmonyPostfix] public static void OnCurrencyManagerSpawned() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown try { ManualLogSource log = Plugin.Log; if (log != null) { log.LogInfo((object)"UpgradeLib: CurrencyManager spawned, loading saved upgrades..."); } UpgradePersistence.Load(); } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; if (log2 != null) { bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(37, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("UpgradeLib: Failed to load on spawn: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex); } log2.LogError(val); } } } } [HarmonyPatch] internal static class WebUnloadPatch { [HarmonyPatch(typeof(WebViewUGUI), "Unload")] [HarmonyPrefix] public static void BeforeUnload(WebViewUGUI __instance) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown try { UpgradePanelComponent.OnWebUnloaded(__instance); } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(34, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("UpgradeLib: Unload cleanup error: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogWarning(val); } } } } [HarmonyPatch] internal static class SkillButtonPatch { [HarmonyPatch(typeof(SkillButton), "HandleNewData")] [HarmonyPrefix] public static bool Prefix(SkillNode newData) { if (newData == null || ((Node)newData).id < 10000) { return true; } return false; } } [HarmonyPatch] internal static class SkillIconPatch { [HarmonyPatch(typeof(SkillIcon), "HandleNewData")] [HarmonyPrefix] public static bool Prefix(SkillIcon __instance, SkillNode newData) { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) if (newData == null || ((Node)newData).id < 10000) { return true; } try { Skill skill = newData.skill; if ((Object)(object)skill != (Object)null) { SkillIcon icon = skill.GetIcon(newData.state, true); Image val = ((Component)__instance).GetComponent(); if ((Object)(object)val == (Object)null) { val = ((Component)__instance).GetComponentInChildren(); } if ((Object)(object)val != (Object)null) { if ((Object)(object)icon.icon != (Object)null) { val.sprite = icon.icon; } ((Graphic)val).color = icon.color; } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(35, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("UpgradeLib: SkillIcon patch error: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogWarning(val2); } } return false; } } [HarmonyPatch] internal static class SkillCostLabelPatch { [HarmonyPatch(typeof(SkillCostLabel), "HandleNewData")] [HarmonyPrefix] public static bool Prefix(SkillCostLabel __instance, SkillNode newData) { //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown if (newData == null || ((Node)newData).id < 10000) { return true; } try { UpgradeDefinition byNodeId = UpgradeAPI.GetByNodeId(((Node)newData).id); if (byNodeId == null) { return false; } string text = ((!UpgradeAPI.IsPurchased(byNodeId.Id)) ? ((byNodeId.CostType == CostType.Money) ? $"${byNodeId.Cost:F0}" : $"{byNodeId.Cost:F0} research") : "Owned"); TMP_Text val = ((Component)__instance).GetComponent(); if ((Object)(object)val == (Object)null) { val = ((Component)__instance).GetComponentInChildren(); } if ((Object)(object)val != (Object)null) { val.text = text; } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(40, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("UpgradeLib: SkillCostLabel patch error: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogWarning(val2); } } return false; } } [HarmonyPatch] internal static class SkillNameLabelPatch { [HarmonyPatch(typeof(SkillNameLabel), "HandleNewData")] [HarmonyPrefix] public static bool Prefix(SkillNameLabel __instance, SkillNode newData) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown if (newData == null || ((Node)newData).id < 10000) { return true; } try { UpgradeDefinition byNodeId = UpgradeAPI.GetByNodeId(((Node)newData).id); if (byNodeId == null) { return false; } TMP_Text val = ((Component)__instance).GetComponent(); if ((Object)(object)val == (Object)null) { val = ((Component)__instance).GetComponentInChildren(); } if ((Object)(object)val != (Object)null) { val.text = byNodeId.Name; } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(40, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("UpgradeLib: SkillNameLabel patch error: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogWarning(val2); } } return false; } } [HarmonyPatch] internal static class SkillDescriptionLabelPatch { [HarmonyPatch(typeof(SkillDescriptionLabel), "HandleNewData")] [HarmonyPrefix] public static bool Prefix(SkillDescriptionLabel __instance, SkillNode newData) { //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Expected O, but got Unknown if (newData == null || ((Node)newData).id < 10000) { return true; } try { UpgradeDefinition byNodeId = UpgradeAPI.GetByNodeId(((Node)newData).id); if (byNodeId == null) { return false; } string text; if (UpgradeAPI.IsPurchased(byNodeId.Id)) { text = byNodeId.Description + "\n\nPurchased"; } else if (!UpgradeAPI.CanPurchase(byNodeId.Id)) { string parentId = UpgradeAPI.GetParentId(byNodeId.Id); text = string.Concat(str2: ((parentId != null) ? UpgradeAPI.GetById(parentId) : null)?.Name ?? "prerequisite", str0: byNodeId.Description, str1: "\n\nRequires: "); } else { text = byNodeId.Description; } TMP_Text val = ((Component)__instance).GetComponent(); if ((Object)(object)val == (Object)null) { val = ((Component)__instance).GetComponentInChildren(); } if ((Object)(object)val != (Object)null) { val.text = text; } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(47, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("UpgradeLib: SkillDescriptionLabel patch error: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log.LogWarning(val2); } } return false; } } [HarmonyPatch] internal static class SkillUnlockPopulatorPatch { [HarmonyPatch(typeof(SkillUnlockPopulator), "HandleNewData")] [HarmonyPrefix] public static bool Prefix(SkillUnlockPopulator __instance, SkillNode newData) { if (newData == null || ((Node)newData).id < 10000) { return true; } try { Traverse.Create((object)__instance).Method("ClearList", Array.Empty()).GetValue(); } catch { } return false; } } [HarmonyPatch] internal static class SkillEnablerPatch { [HarmonyPatch(typeof(SkillEnabler), "HandleNewData")] [HarmonyPrefix] public static bool Prefix(SkillEnabler __instance, SkillNode newData) { if (newData == null || ((Node)newData).id < 10000) { return true; } try { GameObject value = Traverse.Create((object)__instance).Field("_target").GetValue(); if ((Object)(object)value != (Object)null) { value.SetActive(false); } } catch { } return false; } } [HarmonyPatch] internal static class SkillNodeUpdateStatePatch { [HarmonyPatch(typeof(SkillNode), "UpdateState", new Type[] { })] [HarmonyPrefix] public static bool SkipUpdateState(SkillNode __instance) { if (((Node)__instance).id >= 10000) { return false; } return true; } [HarmonyPatch(typeof(SkillNode), "UpdateState", new Type[] { typeof(bool) })] [HarmonyPrefix] public static bool SkipUpdateStateBool(SkillNode __instance) { if (((Node)__instance).id >= 10000) { return false; } return true; } } [HarmonyPatch] internal static class SkillNodeLevelTextPatch { [HarmonyPatch(typeof(SkillNodeUGUI), "Refresh")] [HarmonyPostfix] public static void AfterRefresh(SkillNodeUGUI __instance) { FixCustomNode(__instance); } [HarmonyPatch(typeof(SkillNodeUGUI), "ReloadUI")] [HarmonyPostfix] public static void AfterReloadUI(SkillNodeUGUI __instance) { FixCustomNode(__instance); } private static void FixCustomNode(SkillNodeUGUI instance) { //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Invalid comparison between Unknown and I4 //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Invalid comparison between Unknown and I4 //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015b: 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_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_00ca: Unknown result type (might be due to invalid IL or missing references) SkillNode skillNode = instance.skillNode; if (skillNode == null || ((Node)skillNode).id < 10000) { return; } UpgradeDefinition byNodeId = UpgradeAPI.GetByNodeId(((Node)skillNode).id); if (byNodeId == null) { return; } if (UpgradeState.IsPurchased(byNodeId.Id)) { skillNode.state = (State)3; } else if (UpgradeAPI.CanPurchase(byNodeId.Id)) { skillNode.state = (State)1; } else { skillNode.state = (State)0; } Skill skill = skillNode.skill; if ((Object)(object)skill != (Object)null && (Object)(object)instance.iconImage != (Object)null) { SkillIcon icon = skill.GetIcon(skillNode.state, true); if ((Object)(object)icon.icon != (Object)null) { instance.iconImage.sprite = icon.icon; } ((Graphic)instance.iconImage).color = icon.color; if ((int)skillNode.state == 1) { ((Graphic)instance.iconImage).CrossFadeColor(Color.black, 0f, true, true); } } State state = skillNode.state; Color val = (Color)(((int)state == 0) ? Color.black : (((int)state != 1) ? new Color(1f, 0.55f, 0f, 1f) : Color.white)); Color val2 = val; Button componentInChildren = ((Component)instance).GetComponentInChildren