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.Xml.Linq; using BepInEx; using EntityStates; using EntityStates.Commando.CommandoWeapon; using HG.Reflection; using HarmonyLib; using IL.RoR2.UI; using Microsoft.CodeAnalysis; using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod.Cil; using On.EntityStates.Commando.CommandoWeapon; using On.RoR2; using On.RoR2.Skills; using R2API.AddressReferencedAssets; using Rewired; using RoR2; using RoR2.Skills; using RoR2.UI; using SkillUpgradesTree.Test; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Sprites; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("SkillUpgradesTree")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("SkillUpgradesTree")] [assembly: AssemblyTitle("SkillUpgradesTree")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] [module: UnverifiableCode] 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 SkillUpgradesTree { public class BezierPath { public int SegmentsPerCurve = 10; public float MINIMUM_SQR_DISTANCE = 0.01f; public float DIVISION_THRESHOLD = -0.99f; private List controlPoints; private int curveCount; public BezierPath() { controlPoints = new List(); } public void SetControlPoints(List newControlPoints) { controlPoints.Clear(); controlPoints.AddRange(newControlPoints); curveCount = (controlPoints.Count - 1) / 3; } public void SetControlPoints(Vector2[] newControlPoints) { controlPoints.Clear(); controlPoints.AddRange(newControlPoints); curveCount = (controlPoints.Count - 1) / 3; } public List GetControlPoints() { return controlPoints; } public void Interpolate(List segmentPoints, float scale) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: 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_0160: 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_016d: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0189: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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) controlPoints.Clear(); if (segmentPoints.Count < 2) { return; } for (int i = 0; i < segmentPoints.Count; i++) { if (i == 0) { Vector2 val = segmentPoints[i]; Vector2 val2 = segmentPoints[i + 1]; Vector2 val3 = val2 - val; Vector2 item = val + scale * val3; controlPoints.Add(val); controlPoints.Add(item); continue; } if (i == segmentPoints.Count - 1) { Vector2 val4 = segmentPoints[i - 1]; Vector2 val5 = segmentPoints[i]; Vector2 val6 = val5 - val4; Vector2 item2 = val5 - scale * val6; controlPoints.Add(item2); controlPoints.Add(val5); continue; } Vector2 val7 = segmentPoints[i - 1]; Vector2 val8 = segmentPoints[i]; Vector2 val9 = segmentPoints[i + 1]; Vector2 val10 = val9 - val7; Vector2 normalized = ((Vector2)(ref val10)).normalized; Vector2 val11 = scale * normalized; val10 = val8 - val7; Vector2 item3 = val8 - val11 * ((Vector2)(ref val10)).magnitude; Vector2 val12 = scale * normalized; val10 = val9 - val8; Vector2 item4 = val8 + val12 * ((Vector2)(ref val10)).magnitude; controlPoints.Add(item3); controlPoints.Add(val8); controlPoints.Add(item4); } curveCount = (controlPoints.Count - 1) / 3; } public void SamplePoints(List sourcePoints, float minSqrDistance, float maxSqrDistance, float scale) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_008a: 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) if (sourcePoints.Count < 2) { return; } Stack stack = new Stack(); stack.Push(sourcePoints[0]); Vector2 val = sourcePoints[1]; int num = 2; Vector2 val2; for (num = 2; num < sourcePoints.Count; num++) { val2 = val - sourcePoints[num]; if (((Vector2)(ref val2)).sqrMagnitude > minSqrDistance) { val2 = stack.Peek() - sourcePoints[num]; if (((Vector2)(ref val2)).sqrMagnitude > maxSqrDistance) { stack.Push(val); } } val = sourcePoints[num]; } Vector2 val3 = stack.Pop(); Vector2 val4 = stack.Peek(); val2 = val4 - val; Vector2 normalized = ((Vector2)(ref val2)).normalized; val2 = val - val3; float magnitude = ((Vector2)(ref val2)).magnitude; val2 = val3 - val4; float magnitude2 = ((Vector2)(ref val2)).magnitude; val3 += normalized * ((magnitude2 - magnitude) / 2f); stack.Push(val3); stack.Push(val); Interpolate(new List(stack), scale); } public Vector2 CalculateBezierPoint(int curveIndex, float t) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_0047: 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_0050: Unknown result type (might be due to invalid IL or missing references) int num = curveIndex * 3; Vector2 p = controlPoints[num]; Vector2 p2 = controlPoints[num + 1]; Vector2 p3 = controlPoints[num + 2]; Vector2 p4 = controlPoints[num + 3]; return CalculateBezierPoint(t, p, p2, p3, p4); } public List GetDrawingPoints0() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) List list = new List(); for (int i = 0; i < curveCount; i++) { if (i == 0) { list.Add(CalculateBezierPoint(i, 0f)); } for (int j = 1; j <= SegmentsPerCurve; j++) { float t = (float)j / (float)SegmentsPerCurve; list.Add(CalculateBezierPoint(i, t)); } } return list; } public List GetDrawingPoints1() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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) List list = new List(); for (int i = 0; i < controlPoints.Count - 3; i += 3) { Vector2 p = controlPoints[i]; Vector2 p2 = controlPoints[i + 1]; Vector2 p3 = controlPoints[i + 2]; Vector2 p4 = controlPoints[i + 3]; if (i == 0) { list.Add(CalculateBezierPoint(0f, p, p2, p3, p4)); } for (int j = 1; j <= SegmentsPerCurve; j++) { float t = (float)j / (float)SegmentsPerCurve; list.Add(CalculateBezierPoint(t, p, p2, p3, p4)); } } return list; } public List GetDrawingPoints2() { List list = new List(); for (int i = 0; i < curveCount; i++) { List list2 = FindDrawingPoints(i); if (i != 0) { list2.RemoveAt(0); } list.AddRange(list2); } return list; } private List FindDrawingPoints(int curveIndex) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) List list = new List(); Vector2 item = CalculateBezierPoint(curveIndex, 0f); Vector2 item2 = CalculateBezierPoint(curveIndex, 1f); list.Add(item); list.Add(item2); FindDrawingPoints(curveIndex, 0f, 1f, list, 1); return list; } private int FindDrawingPoints(int curveIndex, float t0, float t1, List pointList, int insertionIndex) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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_004d: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) Vector2 val = CalculateBezierPoint(curveIndex, t0); Vector2 val2 = CalculateBezierPoint(curveIndex, t1); Vector2 val3 = val - val2; if (((Vector2)(ref val3)).sqrMagnitude < MINIMUM_SQR_DISTANCE) { return 0; } float num = (t0 + t1) / 2f; Vector2 val4 = CalculateBezierPoint(curveIndex, num); val3 = val - val4; Vector2 normalized = ((Vector2)(ref val3)).normalized; val3 = val2 - val4; Vector2 normalized2 = ((Vector2)(ref val3)).normalized; if (Vector2.Dot(normalized, normalized2) > DIVISION_THRESHOLD || Mathf.Abs(num - 0.5f) < 0.0001f) { int num2 = 0; num2 += FindDrawingPoints(curveIndex, t0, num, pointList, insertionIndex); pointList.Insert(insertionIndex + num2, val4); num2++; return num2 + FindDrawingPoints(curveIndex, num, t1, pointList, insertionIndex + num2); } return 0; } private Vector2 CalculateBezierPoint(float t, Vector2 p0, Vector2 p1, Vector2 p2, Vector2 p3) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_0068: 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) float num = 1f - t; float num2 = t * t; float num3 = num * num; float num4 = num3 * num; float num5 = num2 * t; Vector2 val = num4 * p0; val += 3f * num3 * t * p1; val += 3f * num * num2 * p2; return val + num5 * p3; } } [Serializable] public class CableCurve { [SerializeField] private Vector2 m_start; [SerializeField] private Vector2 m_end; [SerializeField] private float m_slack; [SerializeField] private int m_steps; [SerializeField] private bool m_regen; private static Vector2[] emptyCurve = (Vector2[])(object)new Vector2[2] { new Vector2(0f, 0f), new Vector2(0f, 0f) }; [SerializeField] private Vector2[] points; public bool regenPoints { get { return m_regen; } set { m_regen = value; } } public Vector2 start { get { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) return m_start; } set { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) if (value != m_start) { m_regen = true; } m_start = value; } } public Vector2 end { get { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) return m_end; } set { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) if (value != m_end) { m_regen = true; } m_end = value; } } public float slack { get { return m_slack; } set { if (value != m_slack) { m_regen = true; } m_slack = Mathf.Max(0f, value); } } public int steps { get { return m_steps; } set { if (value != m_steps) { m_regen = true; } m_steps = Mathf.Max(2, value); } } public Vector2 midPoint { get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) Vector2 result = Vector2.zero; if (m_steps == 2) { return (points[0] + points[1]) * 0.5f; } if (m_steps > 2) { int num = m_steps / 2; result = ((m_steps % 2 != 0) ? points[num] : ((points[num] + points[num + 1]) * 0.5f)); } return result; } } public CableCurve() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) points = emptyCurve; m_start = Vector2.up; m_end = Vector2.up + Vector2.right; m_slack = 0.5f; m_steps = 20; m_regen = true; } public CableCurve(Vector2[] inputPoints) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) points = inputPoints; m_start = inputPoints[0]; m_end = inputPoints[1]; m_slack = 0.5f; m_steps = 20; m_regen = true; } public CableCurve(List inputPoints) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) points = inputPoints.ToArray(); m_start = inputPoints[0]; m_end = inputPoints[1]; m_slack = 0.5f; m_steps = 20; m_regen = true; } public CableCurve(CableCurve v) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) points = v.Points(); m_start = v.start; m_end = v.end; m_slack = v.slack; m_steps = v.steps; m_regen = v.regenPoints; } public Vector2[] Points() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0250: 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_0260: 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_029e: Unknown result type (might be due to invalid IL or missing references) if (!m_regen) { return points; } if (m_steps < 2) { return emptyCurve; } float num = Vector2.Distance(m_end, m_start); float num2 = Vector2.Distance(new Vector2(m_end.x, m_start.y), m_start); float num3 = num + Mathf.Max(0.0001f, m_slack); float num4 = 0f; float y = m_start.y; float num5 = num2; float y2 = end.y; if (num5 - num4 == 0f) { return emptyCurve; } float num6 = Mathf.Sqrt(Mathf.Pow(num3, 2f) - Mathf.Pow(y2 - y, 2f)) / (num5 - num4); int num7 = 30; int num8 = 0; int num9 = num7 * 10; bool flag = false; float num10 = 0f; float num11 = 0f; float num12 = 100f; float num13 = 0f; for (int i = 0; i < num7; i++) { for (int j = 0; j < 10; j++) { num8++; num11 = num10 + num12; num13 = (float)Math.Sinh(num11) / num11; if (!float.IsInfinity(num13)) { if (num13 == num6) { flag = true; num10 = num11; break; } if (num13 > num6) { break; } num10 = num11; if (num8 > num9) { flag = true; break; } } } if (flag) { break; } num12 *= 0.1f; } float num14 = (num5 - num4) / 2f / num10; float num15 = (num4 + num5 - num14 * Mathf.Log((num3 + y2 - y) / (num3 - y2 + y))) / 2f; float num16 = (y2 + y - num3 * (float)Math.Cosh(num10) / (float)Math.Sinh(num10)) / 2f; points = (Vector2[])(object)new Vector2[m_steps]; float num17 = m_steps - 1; for (int k = 0; k < m_steps; k++) { float num18 = (float)k / num17; Vector2 zero = Vector2.zero; zero.x = Mathf.Lerp(start.x, end.x, num18); zero.y = num14 * (float)Math.Cosh((num18 * num2 - num15) / num14) + num16; points[k] = zero; } m_regen = false; return points; } } [Serializable] [BepInPlugin("com.brynzananas.skillupgradestree", "Skill Upgrades Tree", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class SkillUpgardesTreePlugin : BaseUnityPlugin { public const string ModGuid = "com.brynzananas.skillupgradestree"; public const string ModName = "Skill Upgrades Tree"; public const string ModVer = "1.0.0"; private static SkillUpgardesTreePlugin _instance; public static SkillUpgardesTreePlugin instance => _instance; public void Awake() { _instance = this; SkillUpgradesTreeApi.Init(); } public void OnDestroy() { SkillUpgradesTreeApi.UnsetHooks(); TestClass.UnsetHooks(); } } [Serializable] public class SkillUpgrade { [Serializable] public struct RequiredUpgrade { public string requiredSkillId; public RequiredUpgradeCondition condition; } public enum RequiredUpgradeCondition { Required, Selective } public string id; public string nameToken; public string descriptionToken; public string loreToken; public Sprite icon; internal SkillUpgradeIndex _skillUpgradeIndex; public List requiredUpgrades = new List(); public int selectiveUpgradesRequired = 1; public List mutuallyExclusiveWith = new List(); [HideInInspector] public bool isSelected; public SkillUpgradeIndex skillUpgradeIndex => _skillUpgradeIndex; public SkillUpgrade Clone() { return new SkillUpgrade { id = id, nameToken = nameToken, descriptionToken = descriptionToken, loreToken = loreToken, icon = icon, requiredUpgrades = requiredUpgrades, mutuallyExclusiveWith = mutuallyExclusiveWith.ToList(), _skillUpgradeIndex = skillUpgradeIndex, isSelected = false }; } } public class SkillUpgradeButton : MonoBehaviour { public HGButton button; public Image iconImage; public Image borderImage; public Color lockedColor = Color.gray; public Color availableColor = Color.white; public Color unlockedColor = Color.green; private SkillUpgrade _skillUpgrade; private SkillUpgradesTreeController controller; private SkillUpgradesTreeUIViewer viewer; private bool pressed; public SkillUpgrade skillUpgrade => _skillUpgrade; public RectTransform RectTransform => ((Component)this).GetComponent(); public void Setup(SkillUpgrade data, SkillUpgradesTreeController treeController, SkillUpgradesTreeUIViewer uiViewer) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown _skillUpgrade = data; controller = treeController; viewer = uiViewer; if ((Object)(object)iconImage != (Object)null && (Object)(object)data.icon != (Object)null) { iconImage.sprite = data.icon; } ((UnityEvent)((Button)button).onClick).AddListener(new UnityAction(OnNodeClicked)); ((MPButton)button).onSelect.AddListener(new UnityAction(OnPointerEnter)); ((MPButton)button).onDeselect.AddListener(new UnityAction(OnPointerExit)); UpdateVisuals(); } public void FixedUpdate() { if (pressed) { pressed = false; } } public void UpdateVisuals() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (_skillUpgrade.isSelected) { ((Graphic)borderImage).color = unlockedColor; } else if (controller.CanUnlockSkill(_skillUpgrade.id)) { ((Graphic)borderImage).color = availableColor; } else { ((Graphic)borderImage).color = lockedColor; } } private void OnNodeClicked() { if (!pressed) { pressed = true; if (controller.TryUnlockSkill(_skillUpgrade.id)) { _skillUpgrade.isSelected = controller.FindRuntimeSkill(_skillUpgrade.id).isSelected; viewer.RefreshAllNodes(); } } } public void OnPointerEnter() { viewer.ShowNodeDetails(_skillUpgrade); } public void OnPointerExit() { viewer.ClearNodeDetails(); } } public enum SkillUpgradeIndex { None = -1 } public static class SkillUpgradesTreeApi { public class Row_AddButtonEvents { public LoadoutPanelController loadoutPanelController; public UserProfile userProfile; public SkillDef skillDef; public BodyIndex bodyIndex; public HGButton hGButton; public void OnClick() { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)loadoutPanelController.GetSkillUpgradesTree())) { GameObject skillUpgradesTree = loadoutPanelController.GetSkillUpgradesTree(); Object.Destroy((Object)(object)skillUpgradesTree); } if (skillDefToSkillUpgradesTreeDef.TryGetValue(skillDef, out var value)) { GameObject val = Object.Instantiate(SkillUpgradesTreePrefab, ((Component)loadoutPanelController).transform); val.transform.localPosition = new Vector3(717.1114f, 40.3184f, -47.6533f); SkillUpgradesTreeController component = val.GetComponent(); component.skillTreeAsset = value; component.userProfile = userProfile; component.targetSkillDef = skillDef; component.bodyIndex = bodyIndex; component.Init(); SkillUpgradesTreeUIViewer component2 = val.GetComponent(); component2.skillButton = (Button)(object)hGButton; component2.Init(); loadoutPanelController.SetSkillUpgradesTree(val); } } } [CompilerGenerated] private static class <>O { public static hook_SetSkillDefs <0>__SkillCatalog_SetSkillDefs; public static hook_Clone <1>__BodyLoadout_Clone; public static hook_Serialize <2>__BodyLoadout_Serialize; public static hook_Deserialize <3>__BodyLoadout_Deserialize; public static hook_ToXml <4>__BodyLoadout_ToXml; public static hook_FromXml <5>__BodyLoadout_FromXml; public static hook_ApplyLoadoutServer <6>__SkillLocator_ApplyLoadoutServer; public static Manipulator <7>__Row_FromSkillSlot; public static Manipulator <8>__Row_AddButton; public static Action <9>__AddLanguageTokens; public static Action <10>__AddButtonDelegate; } public static AssetBundle assetBundle; public static GameObject SkillUpgradesTreePrefab; public static GameObject SkillUpgradeButton; public static SkillUpgradesTreeDef TestDef; public static Material BlurMaterial; public static Sprite BorderSprite; public static Sprite PanelSprite; private static bool initialized; internal static List skillUpgradesTreeDefs = new List(); private static SkillUpgrade[] _skillUpgrades = Array.Empty(); private static int _skillUpgradesCount; private static Dictionary skillDefToSkillUpgradesTreeDef = new Dictionary(); private static Dictionary> tempDict1 = new Dictionary>(); private static Dictionary idToIndex = new Dictionary(); private static bool _hooksSet; public static Action onSkillUpgradesRegistered; private static SkillDef WhyAddButtonJustDoesntPutSkillDefAsAnArgument; private static UserProfile ThisIsSoBad; private static BodyIndex IWantToCrackRockerSurvivorSoMuch; public static int skillUpgradesCount => _skillUpgradesCount; public static void Init() { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) SetHooks(); if (!initialized) { assetBundle = AssetBundle.LoadFromFileAsync(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)SkillUpgardesTreePlugin.instance).Info.Location), "assetbundles", "skillupgradestreeassets")).assetBundle; SkillUpgradesTreePrefab = assetBundle.LoadAsset("Assets/SkillUpgradesTree/SkillUpgradesTreePrefab.prefab"); SkillUpgradeButton = assetBundle.LoadAsset("Assets/SkillUpgradesTree/SkillUpgradeButton.prefab"); TestDef = assetBundle.LoadAsset("Assets/SkillUpgradesTree/TestTree.asset"); BlurMaterial = Addressables.LoadAssetAsync((object)"TranslucentImage/Default-Translucent.mat").WaitForCompletion(); BorderSprite = Addressables.LoadAssetAsync((object)"RoR2/Base/UI/texUIHighlightHeader.png").WaitForCompletion(); PanelSprite = Addressables.LoadAssetAsync((object)"RoR2/Base/UI/texUICleanPanel.png").WaitForCompletion(); initialized = true; } } public static void SetHooks() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0040: 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_004b: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_0082: 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_008d: Expected O, but got Unknown //IL_00a3: 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_00ae: Expected O, but got Unknown //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown //IL_00e5: 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_00f0: Expected O, but got Unknown //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Expected O, but got Unknown //IL_0127: 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_0132: Expected O, but got Unknown if (!_hooksSet) { object obj = <>O.<0>__SkillCatalog_SetSkillDefs; if (obj == null) { hook_SetSkillDefs val = SkillCatalog_SetSkillDefs; <>O.<0>__SkillCatalog_SetSkillDefs = val; obj = (object)val; } SkillCatalog.SetSkillDefs += (hook_SetSkillDefs)obj; object obj2 = <>O.<1>__BodyLoadout_Clone; if (obj2 == null) { hook_Clone val2 = BodyLoadout_Clone; <>O.<1>__BodyLoadout_Clone = val2; obj2 = (object)val2; } BodyLoadout.Clone += (hook_Clone)obj2; object obj3 = <>O.<2>__BodyLoadout_Serialize; if (obj3 == null) { hook_Serialize val3 = BodyLoadout_Serialize; <>O.<2>__BodyLoadout_Serialize = val3; obj3 = (object)val3; } BodyLoadout.Serialize += (hook_Serialize)obj3; object obj4 = <>O.<3>__BodyLoadout_Deserialize; if (obj4 == null) { hook_Deserialize val4 = BodyLoadout_Deserialize; <>O.<3>__BodyLoadout_Deserialize = val4; obj4 = (object)val4; } BodyLoadout.Deserialize += (hook_Deserialize)obj4; object obj5 = <>O.<4>__BodyLoadout_ToXml; if (obj5 == null) { hook_ToXml val5 = BodyLoadout_ToXml; <>O.<4>__BodyLoadout_ToXml = val5; obj5 = (object)val5; } BodyLoadout.ToXml += (hook_ToXml)obj5; object obj6 = <>O.<5>__BodyLoadout_FromXml; if (obj6 == null) { hook_FromXml val6 = BodyLoadout_FromXml; <>O.<5>__BodyLoadout_FromXml = val6; obj6 = (object)val6; } BodyLoadout.FromXml += (hook_FromXml)obj6; object obj7 = <>O.<6>__SkillLocator_ApplyLoadoutServer; if (obj7 == null) { hook_ApplyLoadoutServer val7 = SkillLocator_ApplyLoadoutServer; <>O.<6>__SkillLocator_ApplyLoadoutServer = val7; obj7 = (object)val7; } SkillLocator.ApplyLoadoutServer += (hook_ApplyLoadoutServer)obj7; object obj8 = <>O.<7>__Row_FromSkillSlot; if (obj8 == null) { Manipulator val8 = Row_FromSkillSlot; <>O.<7>__Row_FromSkillSlot = val8; obj8 = (object)val8; } Row.FromSkillSlot += (Manipulator)obj8; object obj9 = <>O.<8>__Row_AddButton; if (obj9 == null) { Manipulator val9 = Row_AddButton; <>O.<8>__Row_AddButton = val9; obj9 = (object)val9; } Row.AddButton += (Manipulator)obj9; RoR2Application.onLoadFinished = (Action)Delegate.Combine(RoR2Application.onLoadFinished, new Action(TestClass.AddLanguageTokens)); _hooksSet = true; } } private static bool BodyLoadout_FromXml(orig_FromXml orig, BodyLoadout self, XElement element) { bool flag = orig.Invoke(self, element); if (!flag) { return flag; } bool[] array = new bool[skillUpgradesCount]; foreach (XElement item in element.Elements("SkillUpgrade")) { string value = item.Value; if (value == null) { continue; } SkillUpgradeIndex skillUpgradeIndex = GetSkillUpgradeIndex(value); if (skillUpgradeIndex != SkillUpgradeIndex.None) { int num = (int)skillUpgradeIndex; if (num >= 0 && num < array.Length) { array[num] = true; } } } self.SetSkillUpgrades(array); return flag; } private static XElement BodyLoadout_ToXml(orig_ToXml orig, BodyLoadout self, string elementName) { XElement xElement = orig.Invoke(self, elementName); bool[] skillUpgrades = self.GetSkillUpgrades(); if (skillUpgrades == null) { return xElement; } for (int i = 0; i < skillUpgrades.Length; i++) { if (skillUpgrades[i]) { XElement content = new XElement("SkillUpgrade", GetSkillUpgrade(i).id); xElement.Add(content); } } return xElement; } public static void UnsetHooks() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Expected O, but got Unknown //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Expected O, but got Unknown //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Expected O, but got Unknown if (_hooksSet) { object obj = <>O.<0>__SkillCatalog_SetSkillDefs; if (obj == null) { hook_SetSkillDefs val = SkillCatalog_SetSkillDefs; <>O.<0>__SkillCatalog_SetSkillDefs = val; obj = (object)val; } SkillCatalog.SetSkillDefs -= (hook_SetSkillDefs)obj; object obj2 = <>O.<1>__BodyLoadout_Clone; if (obj2 == null) { hook_Clone val2 = BodyLoadout_Clone; <>O.<1>__BodyLoadout_Clone = val2; obj2 = (object)val2; } BodyLoadout.Clone -= (hook_Clone)obj2; object obj3 = <>O.<2>__BodyLoadout_Serialize; if (obj3 == null) { hook_Serialize val3 = BodyLoadout_Serialize; <>O.<2>__BodyLoadout_Serialize = val3; obj3 = (object)val3; } BodyLoadout.Serialize -= (hook_Serialize)obj3; object obj4 = <>O.<3>__BodyLoadout_Deserialize; if (obj4 == null) { hook_Deserialize val4 = BodyLoadout_Deserialize; <>O.<3>__BodyLoadout_Deserialize = val4; obj4 = (object)val4; } BodyLoadout.Deserialize -= (hook_Deserialize)obj4; object obj5 = <>O.<4>__BodyLoadout_ToXml; if (obj5 == null) { hook_ToXml val5 = BodyLoadout_ToXml; <>O.<4>__BodyLoadout_ToXml = val5; obj5 = (object)val5; } BodyLoadout.ToXml -= (hook_ToXml)obj5; object obj6 = <>O.<5>__BodyLoadout_FromXml; if (obj6 == null) { hook_FromXml val6 = BodyLoadout_FromXml; <>O.<5>__BodyLoadout_FromXml = val6; obj6 = (object)val6; } BodyLoadout.FromXml -= (hook_FromXml)obj6; object obj7 = <>O.<6>__SkillLocator_ApplyLoadoutServer; if (obj7 == null) { hook_ApplyLoadoutServer val7 = SkillLocator_ApplyLoadoutServer; <>O.<6>__SkillLocator_ApplyLoadoutServer = val7; obj7 = (object)val7; } SkillLocator.ApplyLoadoutServer -= (hook_ApplyLoadoutServer)obj7; object obj8 = <>O.<7>__Row_FromSkillSlot; if (obj8 == null) { Manipulator val8 = Row_FromSkillSlot; <>O.<7>__Row_FromSkillSlot = val8; obj8 = (object)val8; } Row.FromSkillSlot -= (Manipulator)obj8; object obj9 = <>O.<8>__Row_AddButton; if (obj9 == null) { Manipulator val9 = Row_AddButton; <>O.<8>__Row_AddButton = val9; obj9 = (object)val9; } Row.AddButton -= (Manipulator)obj9; RoR2Application.onLoadFinished = (Action)Delegate.Remove(RoR2Application.onLoadFinished, new Action(TestClass.AddLanguageTokens)); _hooksSet = false; } } private static void SkillLocator_ApplyLoadoutServer(orig_ApplyLoadoutServer orig, SkillLocator self, Loadout loadout, BodyIndex bodyIndex) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, loadout, bodyIndex); bool[] skillUpgrades = loadout.bodyLoadoutManager.GetReadOnlyBodyLoadout(bodyIndex).GetSkillUpgrades(); self.SetSkillUpgrades(skillUpgrades); } private static void BodyLoadout_Deserialize(orig_Deserialize orig, BodyLoadout self, NetworkReader reader) { orig.Invoke(self, reader); if (reader.ReadBoolean()) { bool[] array = new bool[skillUpgradesCount]; for (int i = 0; i < skillUpgradesCount; i++) { array[i] = reader.ReadBoolean(); } self.SetSkillUpgrades(array); } } private static void BodyLoadout_Serialize(orig_Serialize orig, BodyLoadout self, NetworkWriter writer) { orig.Invoke(self, writer); bool[] skillUpgrades = self.GetSkillUpgrades(); if (skillUpgrades == null) { writer.Write(false); return; } writer.Write(true); for (int i = 0; i < skillUpgradesCount; i++) { writer.Write(skillUpgrades[i]); } } private static BodyLoadout BodyLoadout_Clone(orig_Clone orig, BodyLoadout self) { BodyLoadout val = orig.Invoke(self); val.SetSkillUpgrades(self.GetSkillUpgrades()); return val; } private static void Row_FromSkillSlot(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0009: 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_0069: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.Emit(OpCodes.Ldarg_1); val.Emit(OpCodes.Stsfld, AccessTools.Field(typeof(SkillUpgradesTreeApi), "IWantToCrackRockerSurvivorSoMuch")); if (val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchNewobj(x, typeof(Row)) })) { val.Emit(OpCodes.Dup); val.Emit(OpCodes.Ldfld, AccessTools.Field(typeof(Row), "userProfile")); val.Emit(OpCodes.Stsfld, AccessTools.Field(typeof(SkillUpgradesTreeApi), "ThisIsSoBad")); } else { Log(((MemberReference)il.Method).Name + " IL Hook 1 failed!"); } val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(Variant), "skillDef") })) { val.Emit(OpCodes.Dup); val.Emit(OpCodes.Stsfld, AccessTools.Field(typeof(SkillUpgradesTreeApi), "WhyAddButtonJustDoesntPutSkillDefAsAnArgument")); } else { Log(((MemberReference)il.Method).Name + " IL Hook 2 failed!"); } } private static void SkillCatalog_SetSkillDefs(orig_SetSkillDefs orig, SkillDef[] newSkillDefs) { orig.Invoke(newSkillDefs); int num = 0; List list = new List(); if (skillUpgradesTreeDefs.Count == 0) { TestClass.Init(); } foreach (SkillUpgradesTreeDef skillUpgradesTreeDef2 in skillUpgradesTreeDefs) { foreach (SkillUpgrade skill in skillUpgradesTreeDef2.skills) { if (!list.Contains(skill)) { skill._skillUpgradeIndex = (SkillUpgradeIndex)num; list.Add(skill); idToIndex.Add(skill.id, skill.skillUpgradeIndex); num++; } } foreach (AddressReferencedAsset item in skillUpgradesTreeDef2.skillsToApply) { SkillDef asset = item.Asset; if (tempDict1.ContainsKey(asset)) { tempDict1[asset].AddRange(skillUpgradesTreeDef2.skills); continue; } List list2 = new List(); list2.AddRange(skillUpgradesTreeDef2.skills); tempDict1.Add(asset, list2); } } _skillUpgrades = list.ToArray(); _skillUpgradesCount = num; foreach (KeyValuePair> item2 in tempDict1) { SkillUpgradesTreeDef skillUpgradesTreeDef = ScriptableObject.CreateInstance(); ((Object)skillUpgradesTreeDef).name = ((Object)item2.Key).name + "UpgradesTree"; skillUpgradesTreeDef.skills = item2.Value; BesameRequiredSkills(skillUpgradesTreeDef.skills); skillDefToSkillUpgradesTreeDef.Add(item2.Key, skillUpgradesTreeDef); } onSkillUpgradesRegistered?.Invoke(); } private static void BesameRequiredSkills(List skillUpgrades) { if (skillUpgrades == null || skillUpgrades.Count == 0) { return; } Dictionary> dictionary = new Dictionary>(StringComparer.Ordinal); foreach (SkillUpgrade skillUpgrade in skillUpgrades) { if (Utility.IsNullOrWhiteSpace(skillUpgrade.id)) { continue; } if (!dictionary.TryGetValue(skillUpgrade.id, out var value)) { value = new Dictionary(StringComparer.Ordinal); dictionary[skillUpgrade.id] = value; } if (skillUpgrade.mutuallyExclusiveWith == null) { continue; } foreach (string item in skillUpgrade.mutuallyExclusiveWith) { if (!Utility.IsNullOrWhiteSpace(item)) { value[item] = item; } } } foreach (KeyValuePair> item2 in dictionary) { string key = item2.Key; Dictionary value2 = item2.Value; foreach (KeyValuePair item3 in value2) { string key2 = item3.Key; string value3 = item3.Value; if (dictionary.TryGetValue(key2, out var value4) && !value4.ContainsKey(key)) { value4[key] = key; } } } foreach (SkillUpgrade skillUpgrade2 in skillUpgrades) { if (!Utility.IsNullOrWhiteSpace(skillUpgrade2.id) && dictionary.TryGetValue(skillUpgrade2.id, out var value5)) { skillUpgrade2.mutuallyExclusiveWith.AddRange(value5.Values); } } } private static void Row_AddButton(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); ILLabel val2 = null; int locid = 0; int num = default(int); if (val.TryGotoNext((MoveType)2, new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref locid), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "hoverToken") })) { val.Emit(OpCodes.Ldloc, locid); val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Action)AddButtonDelegate); } else { Log(((MemberReference)il.Method).Name + " IL Hook 1 failed!"); } } private static void AddButtonDelegate(HGButton hGButton, LoadoutPanelController loadoutPanelController) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown Row_AddButtonEvents row_AddButtonEvents = new Row_AddButtonEvents(); row_AddButtonEvents.loadoutPanelController = loadoutPanelController; row_AddButtonEvents.skillDef = WhyAddButtonJustDoesntPutSkillDefAsAnArgument; row_AddButtonEvents.userProfile = ThisIsSoBad; row_AddButtonEvents.bodyIndex = IWantToCrackRockerSurvivorSoMuch; row_AddButtonEvents.hGButton = hGButton; ((UnityEvent)((Button)hGButton).onClick).AddListener(new UnityAction(row_AddButtonEvents.OnClick)); } public static void Log(object logMessage) { ((BaseUnityPlugin)SkillUpgardesTreePlugin.instance).Logger.LogMessage(logMessage); } public static bool GetSkillUpgradeSelected(this BodyLoadout bodyLoadout, string upgradeId) { return bodyLoadout.GetSkillUpgradeSelected(GetSkillUpgradeIndex(upgradeId)); } public static bool GetSkillUpgradeSelected(this BodyLoadout bodyLoadout, SkillUpgradeIndex skillUpgradeIndex) { if (bodyLoadout.GetSkillUpgrades() == null) { return false; } return bodyLoadout.GetSkillUpgrades()[(int)skillUpgradeIndex]; } public static void SetSkillUpgradeSelected(this BodyLoadout bodyLoadout, SkillUpgradeIndex skillUpgradeIndex, bool selected) { bool[] array = bodyLoadout.GetSkillUpgrades(); if (array == null) { array = new bool[skillUpgradesCount]; } array[(int)skillUpgradeIndex] = selected; bodyLoadout.SetSkillUpgrades(array); } public static bool GetSkillUpgradeSelected(this BodyLoadoutManager bodyLoadoutManager, BodyIndex bodyIndex, string upgradeId) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return bodyLoadoutManager.GetSkillUpgradeSelected(bodyIndex, GetSkillUpgradeIndex(upgradeId)); } public static bool GetSkillUpgradeSelected(this BodyLoadoutManager bodyLoadoutManager, BodyIndex bodyIndex, SkillUpgradeIndex skillUpgradeIndex) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return bodyLoadoutManager.GetReadOnlyBodyLoadout(bodyIndex).GetSkillUpgradeSelected(skillUpgradeIndex); } public static void SetSkillUpgradeSelected(this BodyLoadoutManager bodyLoadoutManager, BodyIndex bodyIndex, SkillUpgradeIndex skillUpgradeIndex, bool selected) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected I4, but got Unknown //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected I4, but got Unknown if ((int)bodyIndex >= BodyCatalog.bodyCount) { throw new ArgumentOutOfRangeException("bodyIndex", (int)bodyIndex, $"Value provided for 'bodyIndex' is outside range [0, {(int)bodyIndex}]"); } BodyLoadout orCreateModifiedBodyLoadout = bodyLoadoutManager.GetOrCreateModifiedBodyLoadout(bodyIndex); orCreateModifiedBodyLoadout.SetSkillUpgradeSelected(skillUpgradeIndex, selected); bodyLoadoutManager.RemoveBodyLoadoutIfDefault(orCreateModifiedBodyLoadout); } public static bool GetSkillUpgradeSelected(this SkillLocator skillLocator, SkillUpgradeIndex skillUpgradeIndex) { if (skillLocator.GetSkillUpgrades() == null) { return false; } return skillLocator.GetSkillUpgrades()[(int)skillUpgradeIndex]; } public static bool GetSkillUpgradeSelected(this SkillLocator skillLocator, string upgradeId) { return skillLocator.GetSkillUpgradeSelected(GetSkillUpgradeIndex(upgradeId)); } public static void SetSkillUpgradeSelected(this SkillLocator skillLocator, SkillUpgradeIndex skillUpgradeIndex, bool selected) { bool[] array = skillLocator.GetSkillUpgrades(); if (array == null) { array = new bool[skillUpgradesCount]; } array[(int)skillUpgradeIndex] = selected; skillLocator.SetSkillUpgrades(array); } public static SkillUpgradeIndex GetSkillUpgradeIndex(string upgradeId) { SkillUpgradeIndex value; return idToIndex.TryGetValue(upgradeId, out value) ? value : SkillUpgradeIndex.None; } public static SkillUpgrade GetSkillUpgrade(SkillUpgradeIndex skillUpgradeIndex) { return GetSkillUpgrade((int)skillUpgradeIndex); } public static SkillUpgrade GetSkillUpgrade(int skillUpgradeIndex) { return _skillUpgrades[skillUpgradeIndex]; } private static bool[] GetSkillUpgrades(this ref BodyInfo bodyInfo) { return SkillUpgradesTreeInterop.GetSkillUpgrades(ref bodyInfo); } private static void SetSkillUpgrades(this ref BodyInfo bodyInfo, bool[] bools) { SkillUpgradesTreeInterop.SetSkillUpgrades(ref bodyInfo, bools); } private static bool[] GetSkillUpgrades(this BodyLoadout bodyLoadout) { return SkillUpgradesTreeInterop.GetSkillUpgrades(bodyLoadout); } private static void SetSkillUpgrades(this BodyLoadout bodyLoadout, bool[] bools) { SkillUpgradesTreeInterop.SetSkillUpgrades(bodyLoadout, bools); } private static bool[] GetSkillUpgrades(this SkillLocator skillLocator) { return SkillUpgradesTreeInterop.GetSkillUpgrades(skillLocator); } private static void SetSkillUpgrades(this SkillLocator skillLocator, bool[] bools) { SkillUpgradesTreeInterop.SetSkillUpgrades(skillLocator, bools); } private static GameObject GetSkillUpgradesTree(this LoadoutPanelController loadoutPanelController) { return SkillUpgradesTreeInterop.GetSkillUpgradesTree(loadoutPanelController); } private static void SetSkillUpgradesTree(this LoadoutPanelController loadoutPanelController, GameObject gameObject) { SkillUpgradesTreeInterop.SetSkillUpgradesTree(loadoutPanelController, gameObject); } } public class SkillUpgradesTreeController : MonoBehaviour { public SkillUpgradesTreeDef skillTreeAsset; public List runtimeSkills = new List(); public UserProfile userProfile; public SkillDef targetSkillDef; public BodyIndex bodyIndex; private bool initialized; public void Init() { if (!initialized) { InitializeTree(); initialized = true; } } private void InitializeTree() { if (!Object.op_Implicit((Object)(object)skillTreeAsset)) { return; } runtimeSkills.Clear(); foreach (SkillUpgrade skill in skillTreeAsset.skills) { runtimeSkills.Add(skill.Clone()); } } public bool CanUnlockSkill(string skillId) { SkillUpgrade skillUpgrade = FindRuntimeSkill(skillId); if (skillUpgrade == null) { return false; } if (skillUpgrade.isSelected) { foreach (SkillUpgrade runtimeSkill in runtimeSkills) { foreach (SkillUpgrade.RequiredUpgrade requiredUpgrade in runtimeSkill.requiredUpgrades) { if (Utility.IsNullOrWhiteSpace(requiredUpgrade.requiredSkillId) || requiredUpgrade.requiredSkillId != skillUpgrade.id || !runtimeSkill.isSelected) { continue; } return false; } } } if (!CheckParent(skillUpgrade)) { return false; } foreach (string item in skillUpgrade.mutuallyExclusiveWith) { SkillUpgrade skillUpgrade2 = FindRuntimeSkill(item); if (skillUpgrade2 != null && skillUpgrade2.isSelected) { return false; } } return true; } public bool TryUnlockSkill(string skillId) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (CanUnlockSkill(skillId)) { SkillUpgrade skillUpgrade = FindRuntimeSkill(skillId); skillUpgrade.isSelected = !skillUpgrade.isSelected; SkillUpgradesTreeApi.Log((skillUpgrade.isSelected ? "Selected" : "Deselected") + " skill: " + skillId); userProfile.loadout.bodyLoadoutManager.SetSkillUpgradeSelected(bodyIndex, skillUpgrade.skillUpgradeIndex, skillUpgrade.isSelected); userProfile.OnLoadoutChanged(); return true; } return false; } public List GetActiveAndValidSkillsAsList() { List list = new List(); foreach (SkillUpgrade runtimeSkill in runtimeSkills) { if (!runtimeSkill.isSelected || !CheckParent(runtimeSkill)) { continue; } bool flag = false; foreach (string item in runtimeSkill.mutuallyExclusiveWith) { SkillUpgrade skillUpgrade = FindRuntimeSkill(item); if (skillUpgrade != null && skillUpgrade.isSelected) { flag = true; break; } } if (!flag) { list.Add(runtimeSkill); } } return list; } public bool[] GetActiveAndValidSkills() { bool[] array = new bool[SkillUpgradesTreeApi.skillUpgradesCount]; foreach (SkillUpgrade runtimeSkill in runtimeSkills) { if (!runtimeSkill.isSelected || !CheckParent(runtimeSkill)) { continue; } bool flag = false; foreach (string item in runtimeSkill.mutuallyExclusiveWith) { SkillUpgrade skillUpgrade = FindRuntimeSkill(item); if (skillUpgrade != null && skillUpgrade.isSelected) { flag = true; break; } } if (!flag) { array[(int)runtimeSkill.skillUpgradeIndex] = true; } } return array; } private bool CheckParent(SkillUpgrade skillUpgrade) { bool flag = false; int num = 0; bool flag2 = false; foreach (SkillUpgrade.RequiredUpgrade requiredUpgrade in skillUpgrade.requiredUpgrades) { if (Utility.IsNullOrWhiteSpace(requiredUpgrade.requiredSkillId)) { continue; } SkillUpgrade skillUpgrade2 = FindRuntimeSkill(requiredUpgrade.requiredSkillId); if (skillUpgrade2 == null || !skillUpgrade2.isSelected) { switch (requiredUpgrade.condition) { case SkillUpgrade.RequiredUpgradeCondition.Required: flag = true; flag2 = true; break; case SkillUpgrade.RequiredUpgradeCondition.Selective: num++; flag2 = true; break; } } } if (flag2) { if (flag) { return false; } if (num < skillUpgrade.selectiveUpgradesRequired) { return false; } } return true; } public SkillUpgrade FindRuntimeSkill(string id) { return runtimeSkills.Find((SkillUpgrade s) => s.id == id); } } [CreateAssetMenu(menuName = "SkillUpgradesTree/SkillUpgradesTreeDef")] public class SkillUpgradesTreeDef : ScriptableObject { public List> skillsToApply; public List skills = new List(); public SkillUpgrade FindSkill(string upgradeId) { return skills.Find((SkillUpgrade s) => s.id == upgradeId); } public void Register() { SkillUpgradesTreeApi.skillUpgradesTreeDefs.Add(this); } public SkillUpgradeIndex GetSkillUpgradeIndex(string upgradeId) { return skills.Find((SkillUpgrade s) => s.id == upgradeId).skillUpgradeIndex; } } public class SkillUpgradesTreeUIViewer : MonoBehaviour { private class CreateConnectingLinesForIncompatibleUpgradesDisplayClass { public SkillUpgradeButton skillUpgradeButton; public SkillUpgradesTreeUIViewer skillUpgradesTreeUIViewer; private List incompatibleLines = new List(); public void CreateConnectingLinesForIncompatibleUpgrades() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) foreach (string item in this.skillUpgradeButton.skillUpgrade.mutuallyExclusiveWith) { if (!Utility.IsNullOrWhiteSpace(item)) { SkillUpgradeButton skillUpgradeButton = skillUpgradesTreeUIViewer.FindSkillButton(item); if (Object.op_Implicit((Object)(object)skillUpgradeButton)) { incompatibleLines.Add(skillUpgradesTreeUIViewer.CreateConnectingLine(skillUpgradeButton.RectTransform, this.skillUpgradeButton.RectTransform, Color.red, 8f, skillUpgradesTreeUIViewer.verticalSpacing / 2f)); } } } } public void DestroyConnectingLinesForIncompatibleUpgrades() { int count = incompatibleLines.Count; for (int i = 0; i < count; i++) { Object.Destroy((Object)(object)incompatibleLines[i]); } incompatibleLines.Clear(); } } public SkillUpgradesTreeController controller; public ScrollRect scrollRect; public RectTransform mapContentContainer; public float scrollSpeed = 250f; public float horizontalSpacing = 150f; public float verticalSpacing = -150f; public float startYPosition = 400f; public float maxDirectionalAngle = 55f; public GameObject skillNodePrefab; public UILineRenderer linePrefab; public TextMeshProUGUI skillNameText; public TextMeshProUGUI skillDescriptionText; public TextMeshProUGUI skillLoreText; public Button btnUp; public Button btnDown; public Button btnLeft; public Button btnRight; [HideInInspector] public Button skillButton; private MPEventSystemLocator mPEventSystemLocator; private List spawnedNodes = new List(); private Vector2 scrollVelocity; private Dictionary autoCalculatedPositions = new Dictionary(); private bool inittialized; public static SkillUpgradesTreeUIViewer instance { get; private set; } public void Awake() { instance = this; mPEventSystemLocator = ((Component)this).GetComponent(); } public void Init() { if (!inittialized) { SetMaterials(); ClearNodeDetails(); GenerateTreeUI(); SetupNavigationButtons(); SelectFirstButton(); inittialized = true; } } private void SelectFirstButton() { SkillUpgradeButton skillUpgradeButton = spawnedNodes.First(); if (Object.op_Implicit((Object)(object)skillUpgradeButton)) { HGButton button = skillUpgradeButton.button; if (button != null) { ((Selectable)button).Select(); } } } private void SetMaterials() { ((Graphic)((Component)((Component)this).transform.Find("blur")).GetComponent()).material = SkillUpgradesTreeApi.BlurMaterial; ((Component)((Component)this).transform.Find("border")).GetComponent().sprite = SkillUpgradesTreeApi.BorderSprite; ((Component)((Component)this).transform.Find("rightpanel")).GetComponent().sprite = SkillUpgradesTreeApi.PanelSprite; } private void Update() { if (inittialized) { HandleNavigationScroll(); } } private void GenerateTreeUI() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Expected O, but got Unknown //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Expected O, but got Unknown //IL_029f: 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_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: 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) Transform val = null; foreach (Transform item in (Transform)mapContentContainer) { Transform val2 = item; if (((Object)((Component)val2).gameObject).name == "core") { val = val2; Image component = ((Component)val).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.sprite = controller.targetSkillDef.icon; } } else { Object.Destroy((Object)(object)((Component)val2).gameObject); } } spawnedNodes.Clear(); autoCalculatedPositions.Clear(); CalculateProceduralLayouts(); foreach (SkillUpgrade runtimeSkill in controller.runtimeSkills) { GameObject val3 = Object.Instantiate(skillNodePrefab, (Transform)(object)mapContentContainer); RectTransform component2 = val3.GetComponent(); if (autoCalculatedPositions.ContainsKey(runtimeSkill.id)) { component2.anchoredPosition = autoCalculatedPositions[runtimeSkill.id]; } SkillUpgradeButton component3 = val3.GetComponent(); component3.Setup(runtimeSkill, controller, this); if (controller.userProfile.loadout.bodyLoadoutManager.GetSkillUpgradeSelected(controller.bodyIndex, runtimeSkill.skillUpgradeIndex)) { runtimeSkill.isSelected = true; } component3.UpdateVisuals(); CreateConnectingLinesForIncompatibleUpgradesDisplayClass createConnectingLinesForIncompatibleUpgradesDisplayClass = new CreateConnectingLinesForIncompatibleUpgradesDisplayClass(); createConnectingLinesForIncompatibleUpgradesDisplayClass.skillUpgradeButton = component3; createConnectingLinesForIncompatibleUpgradesDisplayClass.skillUpgradesTreeUIViewer = this; ((MPButton)component3.button).onSelect.AddListener(new UnityAction(createConnectingLinesForIncompatibleUpgradesDisplayClass.CreateConnectingLinesForIncompatibleUpgrades)); ((MPButton)component3.button).onDeselect.AddListener(new UnityAction(createConnectingLinesForIncompatibleUpgradesDisplayClass.DestroyConnectingLinesForIncompatibleUpgrades)); spawnedNodes.Add(component3); } foreach (SkillUpgradeButton spawnedNode in spawnedNodes) { SkillUpgrade skillUpgrade = spawnedNode.skillUpgrade; int num = 0; foreach (SkillUpgrade.RequiredUpgrade requiredUpgrade in skillUpgrade.requiredUpgrades) { if (Utility.IsNullOrWhiteSpace(requiredUpgrade.requiredSkillId)) { continue; } SkillUpgradeButton skillUpgradeButton = spawnedNodes.Find((SkillUpgradeButton n) => n.skillUpgrade.id == requiredUpgrade.requiredSkillId); if (!((Object)(object)skillUpgradeButton == (Object)null)) { num++; Color color = Color.white; SkillUpgrade.RequiredUpgradeCondition condition = requiredUpgrade.condition; SkillUpgrade.RequiredUpgradeCondition requiredUpgradeCondition = condition; if (requiredUpgradeCondition == SkillUpgrade.RequiredUpgradeCondition.Selective) { color = Color.gray; } CreateConnectingLine(skillUpgradeButton.RectTransform, spawnedNode.RectTransform, color, 4f, 0f); } } if (num == 0 && Object.op_Implicit((Object)(object)val)) { CreateConnectingLine((RectTransform)(object)((val is RectTransform) ? val : null), spawnedNode.RectTransform, Color.white, 4f, 0f); } } ConfigureExplicitNavigation(); } private void ConfigureExplicitNavigation() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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) foreach (SkillUpgradeButton spawnedNode in spawnedNodes) { Button component = ((Component)spawnedNode).GetComponent