Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of StatsPlus v2.0.4
StatsMod.dll
Decompiled 5 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Drawing; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Logging; using IL.RoR2; using LeTai.Asset.TranslucentImage; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using Newtonsoft.Json; using On.RoR2; using On.RoR2.UI; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using RoR2; using RoR2.Stats; using RoR2.UI; using StatsMod.CustomStats; using TMPro; using Unity.Mathematics; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("StatsMod")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+94359d6bf957b49f508f30315c806ec771c42642")] [assembly: AssemblyProduct("StatsMod")] [assembly: AssemblyTitle("StatsMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.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 StatsMod { public static class Assets { public static AssetBundle mainAssetBundle = null; internal static string assetBundleName = "statsmodassets"; internal static string assemblyDir => Path.GetDirectoryName(StatsMod.pluginInfo.Location); public static void PopulateAssets() { mainAssetBundle = AssetBundle.LoadFromFile(Path.Combine(assemblyDir, assetBundleName)); } } public class GraphHandler : MonoBehaviour { public enum MouseActionType { Move, SelectAreaToZoom, SelectPoints } public enum RectangleType { Free, PreserveAspectRatio, OriginalAspectRatio } public enum RectangleSelectionType { SelectAll, SelectUnselect } public enum RectangleSelectionPhase { Moving, Release } public enum PointSelectionType { Select, FixZoomPoint } [Flags] public enum UpdateMethod { UpdatePositionAndScale = 1, UpdateOutlines = 2, UpdatePointVisuals = 4, UpdateContent = 8, MouseZoom = 0x10, MouseAction = 0x20, UpdateGridLines = 0x40, All = 0x80 } public bool updateGraph = true; private GraphSettings GS; [SerializeField] private Canvas canvas; private RectTransform graph; private RectTransform graphContent; private Vector2 contentScale = Vector2.zero; private List<Vector2> values; private List<float> trueYvalues; private List<int> sortedIndices; private Vector2Int xAxisRange = new Vector2Int(-1, -1); private Vector2Int prevXAxisRange = new Vector2Int(-1, -1); public int activePointIndex = -1; private Vector2 activePointValue = Vector2.zero; private bool pointIsActive = false; private List<GameObject> points; private List<Image> pointImages; private List<RectTransform> pointRects; private List<GameObject> pointOutlines; private List<RectTransform> pointOutlineRects; private List<Image> pointOutlineImages; private List<GameObject> lines; private List<RectTransform> lineRects; private List<Image> lineImages; private List<RectTransform> xGridRects; private List<Image> xGridImages; private List<TextMeshProUGUI> xAxisTexts; private List<RectTransform> xAxisTextRects; private List<RectTransform> yGridRects; private List<Image> yGridImages; private List<TextMeshProUGUI> yAxisTexts; private List<RectTransform> yAxisTextRects; private RectTransform zoomSelectionRectTransform; private Image zoomSelectionImage; private List<RectTransform> zoomSelectionOutlines; private List<Image> zoomSelectionOutlineImages; private RectTransform pointSelectionRectTransform; private Image pointSelectionImage; private List<RectTransform> pointSelectionOutlines; private List<Image> pointSelectionOutlineImages; private RectTransform maskObj; private Image backgroundImage; private RectTransform backgroundRect; private GameObject pointParent; private GameObject lineParent; private GameObject gridParent; private GameObject outlineParent; private List<RectTransform> outlines; private List<Image> outlineImages; private List<int> lockedHoveredPoints; private List<int> lockedPoints; private List<int> fixedHoveredPoints; public int fixedPointIndex = -1; private Vector2 contentOffset = Vector2.zero; private Vector2 bottomLeft; private Vector2 topRight; private Vector2 center; public MouseActionType mouseActionType; public RectangleType rectangleType; public RectangleSelectionType rectangleSelectionType; public RectangleSelectionPhase rectangleSelectionPhase; public PointSelectionType pointSelectionType; private List<int> initialLockedPoints; private List<int> recentlyLockedPoints; private bool mouseInsideBounds = false; private Vector2 mousePos; private Vector2 previousMousePos; private Vector2 initialMousePos = Vector2.zero; private bool initialMouseInsideBounds = false; private Vector2 _zoomPoint = Vector2.zero; private Vector2 _absoluteZoomPoint = Vector2.zero; private Vector2 _targetZoom = new Vector2(1f, 1f); private Vector2 zoom = new Vector2(1f, 1f); private Vector2 moveOffset; public Vector2 _targetMoveOffset; private Vector2 initialMoveOffset = Vector2.zero; private float timeToUpdateMouse = 0f; private float timeToUpdateTouch = 0f; private float timeToUpdateScroll = 0f; private bool error; private bool currentPlotIsLog = false; public readonly int logBase = 2; private bool rightBorderReached; private bool topBorderReached; private bool bottomBorderReached; private bool leftBorderReached; public List<Vector2> Values => values; public Vector2Int XAxisRange => xAxisRange; public Vector2 ActivePointValue => activePointValue; public Vector2 BottomLeft => bottomLeft; public Vector2 TopRight => topRight; public Vector2 Center => center; private Vector2 zoomPoint { 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 _zoomPoint; } set { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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) if (IsWithinBounds(zoom, absoluteZoomPoint, value, moveOffset)) { _zoomPoint = value; } } } private Vector2 absoluteZoomPoint { 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 _absoluteZoomPoint; } set { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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) if (IsWithinBounds(zoom, value, zoomPoint, moveOffset)) { _absoluteZoomPoint = value; } } } public Vector2 targetZoom { 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 _targetZoom; } set { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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) if (IsWithinBounds(value, absoluteZoomPoint, zoomPoint, moveOffset)) { _targetZoom = value; } } } public Vector2 targetMoveOffset { 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 _targetMoveOffset; } set { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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) if (IsWithinBounds(zoom, absoluteZoomPoint, zoomPoint, value)) { _targetMoveOffset = value; } } } public void CreatePoint(Vector2 newValue, bool shouldCreateLine = true) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) CreatePointInternal(newValue, shouldCreateLine); } public void ChangePoint(int indexToChange, Vector2 newValue) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) ChangePointInternal(indexToChange, newValue); } public void SetCornerValues(Vector2 newBottomLeft, Vector2 newTopRight) { //IL_0002: 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) SetCornerValuesInternal(newBottomLeft, newTopRight); } public void UpdateGraph() { UpdateGraphInternal(UpdateMethod.All); } public void PlotStat(string statName, int index, bool isLog = false) { //IL_0065: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: 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_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) ResetGraph(); UpdateGraph(); UpdateContent(); float num = -5f; float num2 = 5f; currentPlotIsLog = isLog; StatsScreen.ChangePlotTitle(statName); List<object> statSeries = RecordHandler.independentDatabase[0].GetStatSeries("timestamps"); if (index >= 0) { Color lineColor = GraphSettings.Rainbow((float)index / (float)RecordHandler.independentDatabase.Count); GS.LineColor = lineColor; List<object> statSeries2 = RecordHandler.independentDatabase[index].GetStatSeries(statName); for (int i = 0; i < statSeries.Count; i++) { float num3 = Convert.ToSingle(statSeries[i]); float num4 = Convert.ToSingle(PlayerStatsDatabase.Numberise(statSeries2[i])); trueYvalues.Add(num4); if (num4.ToString() == "Infinity") { num4 = -1f; } if (currentPlotIsLog && num4 != 0f) { num4 = (float)Math.Log(Math.Abs(num4), logBase); } CreatePoint(new Vector2(num3, num4)); if (num4 < num) { num = num4; } else if (num4 > num2) { num2 = num4; } } } else if (index == -1) { int num5 = 0; foreach (IndependentEntry item in RecordHandler.independentDatabase) { Color lineColor2 = GraphSettings.Rainbow((float)num5 / (float)RecordHandler.independentDatabase.Count); GS.LineColor = lineColor2; List<object> statSeries3 = item.GetStatSeries(statName); for (int j = 0; j < statSeries.Count; j++) { float num6 = Convert.ToSingle(statSeries[j]); float num7 = Convert.ToSingle(PlayerStatsDatabase.Numberise(statSeries3[j])); trueYvalues.Add(num7); if (num7.ToString() == "Infinity") { num7 = -1f; } if (currentPlotIsLog && num7 != 0f) { num7 = (float)Math.Log(Math.Abs(num7), logBase); } if (j == 0) { GS.LineColor = Color.clear; } CreatePoint(new Vector2(num6, num7)); GS.LineColor = lineColor2; if (num7 < num) { num = num7; } else if (num7 > num2) { num2 = num7; } } num5++; } } float num8 = Convert.ToSingle(statSeries[statSeries.Count - 1]) * 0.05f; float num9 = math.max(math.abs(num), math.abs(num2)) * 0.05f; SetCornerValues(new Vector2(0f - num8, num - num9), new Vector2(Convert.ToSingle(statSeries[statSeries.Count - 1]) + num8, num2 + num9)); absoluteZoomPoint = Vector2.zero; UpdateGraph(); SetCornerValues(new Vector2(0f - num8, num - num9), new Vector2(Convert.ToSingle(statSeries[statSeries.Count - 1]) + num8, num2 + num9)); UpdateGraph(); } private void ResetGraph() { Object.Destroy((Object)(object)((Component)maskObj).gameObject); Object.Destroy((Object)(object)outlineParent.gameObject); AwakeWOHook(); Start(); } private void Awake() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ResolutionConVar.SetString += new hook_SetString(ResizeGraph); AwakeWOHook(); } private void AwakeWOHook() { values = new List<Vector2>(); trueYvalues = new List<float>(); sortedIndices = new List<int>(); points = new List<GameObject>(); pointRects = new List<RectTransform>(); pointImages = new List<Image>(); pointOutlines = new List<GameObject>(); pointOutlineRects = new List<RectTransform>(); pointOutlineImages = new List<Image>(); lines = new List<GameObject>(); lineRects = new List<RectTransform>(); lineImages = new List<Image>(); xGridRects = new List<RectTransform>(); xGridImages = new List<Image>(); yGridRects = new List<RectTransform>(); yGridImages = new List<Image>(); xAxisTexts = new List<TextMeshProUGUI>(); yAxisTexts = new List<TextMeshProUGUI>(); xAxisTextRects = new List<RectTransform>(); yAxisTextRects = new List<RectTransform>(); zoomSelectionOutlines = new List<RectTransform>(); zoomSelectionOutlineImages = new List<Image>(); pointSelectionOutlines = new List<RectTransform>(); pointSelectionOutlineImages = new List<Image>(); outlines = new List<RectTransform>(); outlineImages = new List<Image>(); lockedHoveredPoints = new List<int>(); lockedPoints = new List<int>(); initialLockedPoints = new List<int>(); recentlyLockedPoints = new List<int>(); fixedHoveredPoints = new List<int>(); } private void ResizeGraph(orig_SetString orig, ResolutionConVar self, string newValue) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, newValue); if ((Object)(object)graph != (Object)null) { string[] array = newValue.Split('x'); int num = int.Parse(array[0]); int num2 = int.Parse(array[1]); GS.GraphSize = new Vector2(0.5208f * (float)num, 0.7037f * (float)num2); ((Transform)graph).localPosition = Vector2.op_Implicit(new Vector2(0.1302f * (float)num, 0.0212f * (float)num2)); UpdateOutlines(); } } private bool IsWithinBounds(Vector2 zoom, Vector2 absoluteZoomPoint, Vector2 zoomPoint, Vector2 moveOffset) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //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_0028: 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) //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_0035: 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_0042: 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_005b: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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_00be: Unknown result type (might be due to invalid IL or missing references) Vector2 val = GS.GraphScale * zoom; Vector2 val2 = absoluteZoomPoint - zoomPoint * val - moveOffset; Vector2 val3 = -val2 / val; Vector2 val4 = val3 + GS.GraphSize / val; rightBorderReached = val4.x > float.MaxValue || float.IsNaN(val4.x); topBorderReached = val4.y > float.MaxValue || float.IsNaN(val4.y); bottomBorderReached = val3.x < float.MinValue || float.IsNaN(val3.x); leftBorderReached = val3.y < float.MinValue || float.IsNaN(val3.y); if (rightBorderReached || topBorderReached || bottomBorderReached || leftBorderReached) { return false; } return true; } private bool IsSizeableDif() { //IL_0007: 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_0017: 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_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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_0048: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) Vector2 val = GS.GraphScale * targetZoom; Vector2 val2 = absoluteZoomPoint - zoomPoint * val - targetMoveOffset; Vector2 val3 = -val2 / val; Vector2 val4 = val3 + GS.GraphSize / val; Vector2 val5 = TopRight - val4; if (!(((Vector2)(ref val5)).magnitude > 1E+11f)) { val5 = BottomLeft - val3; if (!(((Vector2)(ref val5)).magnitude > 1E+11f)) { return false; } } return true; } private void OnDestroy() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ResolutionConVar.SetString -= new hook_SetString(ResizeGraph); } private void Start() { if (!CheckForErrors()) { GS = ((Component)this).GetComponent<GraphSettings>(); PrepareGraph(); } } private void Update() { //IL_009a: 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_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) //IL_00c2: 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_00de: 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_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_0103: 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) if (Input.GetKey((KeyCode)304)) { mouseActionType = MouseActionType.SelectAreaToZoom; } else if (Input.GetKey((KeyCode)306)) { mouseActionType = MouseActionType.SelectPoints; } else { mouseActionType = MouseActionType.Move; } if (!error) { CheckIfUpdateGraph(); if (updateGraph) { UpdateGraphInternal(UpdateMethod.All); } if (lockedHoveredPoints.Count > 0) { UpdatePoints(); } if (fixedHoveredPoints.Count > 0) { UpdatePointOutlines(); } zoom = Vector2.Lerp(zoom, targetZoom, GS.SmoothZoomSpeed * Time.deltaTime); moveOffset = Vector2.Lerp(moveOffset, targetMoveOffset, GS.SmoothMoveSpeed * Time.deltaTime); if (IsSizeableDif()) { zoom = targetZoom; moveOffset = targetMoveOffset; } } } private void PrepareGraph() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_00f2: 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_00fa: 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_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)canvas == (Object)null) { canvas = new GameObject("GraphCanvas").AddComponent<Canvas>(); ((Component)canvas).gameObject.SetActive(false); canvas.renderMode = (RenderMode)0; ((Component)canvas).gameObject.AddComponent<GraphicRaycaster>(); } if ((Object)(object)((Component)this).GetComponent<RectTransform>() == (Object)null) { ((Component)this).gameObject.AddComponent<RectTransform>(); } graph = ((Component)this).gameObject.GetComponent<RectTransform>(); ((Transform)graph).SetParent(((Component)canvas).transform); graph.anchoredPosition = Vector2.zero; graph.sizeDelta = GS.GraphSize; RectTransform obj = graph; Vector3 localPosition = (((Transform)graph).localPosition = Vector2.op_Implicit(new Vector2(0.1302f * (float)Screen.width, 0.0212f * (float)Screen.height))); ((Transform)obj).localPosition = localPosition; maskObj = new GameObject("MaskObj").AddComponent<RectTransform>(); ((Transform)maskObj).SetParent((Transform)(object)graph); maskObj.anchoredPosition = Vector2.zero; ((Component)maskObj).gameObject.AddComponent<Image>(); Mask val2 = ((Component)maskObj).gameObject.AddComponent<Mask>(); val2.showMaskGraphic = false; backgroundRect = new GameObject("Background").AddComponent<RectTransform>(); ((Transform)backgroundRect).SetParent((Transform)(object)maskObj); backgroundRect.anchoredPosition = Vector2.zero; backgroundImage = ((Component)backgroundRect).gameObject.AddComponent<Image>(); graphContent = new GameObject("GraphContent").AddComponent<RectTransform>(); ((Transform)graphContent).SetParent(((Component)backgroundRect).transform); graphContent.sizeDelta = Vector2.zero; gridParent = CreateParent("GridParent"); lineParent = CreateParent("LineParent"); pointParent = CreateParent("PointParent"); outlineParent = CreateParent("OutlineParent"); CreateOutlines(); outlineParent.transform.SetParent((Transform)(object)graph); fixedPointIndex = -1; CreateselectionTypes(); UpdateGraphInternal(UpdateMethod.All); } private GameObject CreateParent(string name) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_004b: 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) GameObject val = new GameObject(name); val.transform.SetParent((Transform)(object)((name == "OutlineParent") ? graph : graphContent)); Image val2 = val.AddComponent<Image>(); ((Graphic)val2).color = new Color(0f, 0f, 0f, 0f); ((Graphic)val2).raycastTarget = false; val.GetComponent<RectTransform>().anchoredPosition = Vector2.zero; return val; } private void CreateOutlines() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 4; i++) { Image val = new GameObject("Outline").AddComponent<Image>(); RectTransform component = ((Component)val).GetComponent<RectTransform>(); ((Transform)component).SetParent(outlineParent.transform); ((Graphic)val).color = GS.OutlineColor; ((Graphic)val).raycastTarget = false; outlines.Add(component); outlineImages.Add(val); } } private void CreatePointInternal(Vector2 value, bool shouldCreateLine = true) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_005a: 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_00a3: 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_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Expected O, but got Unknown //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Expected O, but got Unknown //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) int i = points.Count; GameObject val = CreatePointOutline(i); GameObject val2 = new GameObject("Point" + i); points.Add(val2); values.Add(value); val2.transform.SetParent(val.transform); Image val3 = val2.AddComponent<Image>(); ((Graphic)val3).color = GS.PointColor; pointImages.Add(val3); RectTransform component = val2.GetComponent<RectTransform>(); component.sizeDelta = Vector2.one * GS.PointRadius; pointRects.Add(component); val3.sprite = GS.PointSprite; EventTrigger val4 = val2.AddComponent<EventTrigger>(); var array = new[] { new { Type = (EventTriggerType)0, Callback = (Action)delegate { MouseTrigger(i, enter: true); } }, new { Type = (EventTriggerType)1, Callback = (Action)delegate { MouseTrigger(i, enter: false); } }, new { Type = (EventTriggerType)4, Callback = (Action)delegate { PointClicked(i); } } }; var array2 = array; foreach (var eventType in array2) { Entry val5 = new Entry { eventID = eventType.Type }; ((UnityEvent<BaseEventData>)(object)val5.callback).AddListener((UnityAction<BaseEventData>)delegate { eventType.Callback(); }); val4.triggers.Add(val5); } if (points.Count > 1 && shouldCreateLine) { GameObject val6 = new GameObject("Line"); val6.transform.SetParent(lineParent.transform); lineImages.Add(val6.AddComponent<Image>()); ((Graphic)val6.GetComponent<Image>()).color = GS.LineColor; lineRects.Add(val6.GetComponent<RectTransform>()); lines.Add(val6); if (value.x < bottomLeft.x || value.x > topRight.x) { val6.SetActive(false); } } lockedHoveredPoints.Add(i); SortIndices(); if (value.x < bottomLeft.x || value.x > topRight.x) { val.SetActive(false); } } private void ChangePointInternal(int index, Vector2 newValue) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) values[index] = newValue; SortIndices(); } private void SortIndices() { sortedIndices = (from item in values.Select((Vector2 vector, int index) => new { vector, index }) orderby item.vector.x, item.vector.y select item.index).ToList(); } private GameObject CreatePointOutline(int i) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("PointOutline" + i); pointOutlines.Add(val); if ((Object)(object)pointParent != (Object)null) { val.transform.SetParent(pointParent.transform); } Image val2 = val.AddComponent<Image>(); ((Graphic)val2).color = GS.PointColor; pointOutlineImages.Add(val2); RectTransform component = val.GetComponent<RectTransform>(); component.sizeDelta = new Vector2(GS.PointRadius, GS.PointRadius); pointOutlineRects.Add(component); Sprite pointSprite = GS.PointSprite; val2.sprite = pointSprite; return val; } private void CreateGridLines(bool createX) { //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Expected O, but got Unknown //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_028c: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) if (createX) { GameObject val = new GameObject("xGrid" + xGridRects.Count); val.transform.SetParent(gridParent.transform); Image val2 = val.AddComponent<Image>(); ((Graphic)val2).raycastTarget = false; xGridRects.Add(val.GetComponent<RectTransform>()); xGridImages.Add(val2); if (xGridRects.Count > 1) { TextMeshProUGUI val3 = new GameObject("xText" + xGridRects.Count).AddComponent<TextMeshProUGUI>(); RectTransform component = ((Component)val3).gameObject.GetComponent<RectTransform>(); ((Transform)component).SetParent((Transform)(object)val.GetComponent<RectTransform>()); ((TMP_Text)val3).font = GS.GridTextFont; ((TMP_Text)val3).fontStyle = (FontStyles)1; ((TMP_Text)val3).alignment = (TextAlignmentOptions)514; ((TMP_Text)val3).verticalAlignment = (VerticalAlignmentOptions)512; ((Graphic)val3).color = GS.XAxisTextColor; ((TMP_Text)val3).enableAutoSizing = true; component.sizeDelta = Vector2.one * GS.XAxisTextSize; ((Graphic)val3).raycastTarget = false; xAxisTexts.Add(val3); xAxisTextRects.Add(component); } } else { GameObject val4 = new GameObject("yGrid" + yGridRects.Count); val4.transform.SetParent(gridParent.transform); Image val5 = val4.AddComponent<Image>(); ((Graphic)val5).raycastTarget = false; yGridRects.Add(val4.GetComponent<RectTransform>()); yGridImages.Add(val5); if (yGridRects.Count > 1) { TextMeshProUGUI val6 = new GameObject("yText" + yGridRects.Count).AddComponent<TextMeshProUGUI>(); RectTransform component2 = ((Component)val6).gameObject.GetComponent<RectTransform>(); ((Transform)component2).SetParent((Transform)(object)val4.GetComponent<RectTransform>()); ((TMP_Text)val6).font = GS.GridTextFont; ((TMP_Text)val6).fontStyle = (FontStyles)1; ((TMP_Text)val6).alignment = (TextAlignmentOptions)514; ((TMP_Text)val6).verticalAlignment = (VerticalAlignmentOptions)512; ((Graphic)val6).color = GS.YAxisTextColor; ((TMP_Text)val6).enableAutoSizing = true; component2.sizeDelta = Vector2.one * GS.YAxisTextSize; ((Graphic)val6).raycastTarget = false; yAxisTexts.Add(val6); yAxisTextRects.Add(component2); } } } private void CreateselectionTypes() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_002e: 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_007b: 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_0118: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("SelectionParent"); val.transform.SetParent((Transform)(object)graphContent); val.AddComponent<RectTransform>().anchoredPosition = new Vector2(0f, 0f); zoomSelectionImage = new GameObject("ZoomSelection").AddComponent<Image>(); zoomSelectionRectTransform = ((Component)zoomSelectionImage).GetComponent<RectTransform>(); ((Transform)zoomSelectionRectTransform).SetParent(val.transform); for (int i = 0; i < 4; i++) { Image val2 = new GameObject("Outline").AddComponent<Image>(); RectTransform component = ((Component)val2).GetComponent<RectTransform>(); ((Transform)component).SetParent((Transform)(object)zoomSelectionRectTransform); zoomSelectionOutlineImages.Add(val2); zoomSelectionOutlines.Add(component); } ((Component)zoomSelectionRectTransform).gameObject.SetActive(false); pointSelectionImage = new GameObject("PointSelection").AddComponent<Image>(); pointSelectionRectTransform = ((Component)pointSelectionImage).GetComponent<RectTransform>(); ((Transform)pointSelectionRectTransform).SetParent(val.transform); for (int j = 0; j < 4; j++) { Image val3 = new GameObject("Outline").AddComponent<Image>(); RectTransform component2 = ((Component)val3).GetComponent<RectTransform>(); ((Transform)component2).SetParent((Transform)(object)pointSelectionRectTransform); pointSelectionOutlineImages.Add(val3); pointSelectionOutlines.Add(component2); } ((Component)pointSelectionRectTransform).gameObject.SetActive(false); } private void CheckIfUpdateGraph() { //IL_0064: Unknown result type (might be due to invalid IL or missing references) CalculateMousePosition(); if (mouseInsideBounds) { if (Input.GetMouseButtonDown(0) || Input.GetMouseButton(0) || Input.GetMouseButtonUp(0)) { timeToUpdateMouse = GS.updatePeriod; } if (Input.touchCount > 0) { timeToUpdateTouch = GS.updatePeriod; } if (Input.mouseScrollDelta.y != 0f) { timeToUpdateScroll = GS.updatePeriod; } } if (timeToUpdateMouse > 0f) { UpdateGraphInternal(UpdateMethod.UpdatePositionAndScale | UpdateMethod.UpdatePointVisuals | UpdateMethod.UpdateContent | UpdateMethod.MouseAction | UpdateMethod.UpdateGridLines); } if (timeToUpdateTouch > 0f) { UpdateGraphInternal(UpdateMethod.UpdatePositionAndScale | UpdateMethod.UpdatePointVisuals | UpdateMethod.UpdateContent | UpdateMethod.MouseZoom | UpdateMethod.MouseAction | UpdateMethod.UpdateGridLines); } if (timeToUpdateScroll > 0f) { UpdateGraphInternal(UpdateMethod.UpdatePositionAndScale | UpdateMethod.UpdatePointVisuals | UpdateMethod.UpdateContent | UpdateMethod.MouseZoom | UpdateMethod.UpdateGridLines); } timeToUpdateMouse -= Time.deltaTime; timeToUpdateTouch -= Time.deltaTime; timeToUpdateScroll -= Time.deltaTime; } public void UpdateGraphInternal(UpdateMethod methodsToUpdate) { if (methodsToUpdate.HasFlag(UpdateMethod.UpdatePositionAndScale) || methodsToUpdate.HasFlag(UpdateMethod.All)) { UpdatePositionAndScale(); } CalculateCornerValues(); if (methodsToUpdate.HasFlag(UpdateMethod.UpdateOutlines) || methodsToUpdate.HasFlag(UpdateMethod.All)) { UpdateOutlines(); } if (methodsToUpdate.HasFlag(UpdateMethod.UpdateContent) || methodsToUpdate.HasFlag(UpdateMethod.All)) { HandleActiveObjects(); } if (methodsToUpdate.HasFlag(UpdateMethod.UpdatePointVisuals) || methodsToUpdate.HasFlag(UpdateMethod.All)) { UpdatePointVisuals(); } if (methodsToUpdate.HasFlag(UpdateMethod.UpdateContent) || methodsToUpdate.HasFlag(UpdateMethod.All)) { UpdateContent(); } CalculateMousePosition(); if (methodsToUpdate.HasFlag(UpdateMethod.MouseZoom) || methodsToUpdate.HasFlag(UpdateMethod.All)) { MouseZoom(); } if (methodsToUpdate.HasFlag(UpdateMethod.MouseAction) || methodsToUpdate.HasFlag(UpdateMethod.All)) { MouseAction(); } if (methodsToUpdate.HasFlag(UpdateMethod.UpdateGridLines) || methodsToUpdate.HasFlag(UpdateMethod.All)) { UpdateGridLines(); } } private void UpdatePositionAndScale() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_0042: 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_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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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_00b5: 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) contentScale = GS.GraphScale * zoom; maskObj.sizeDelta = GS.GraphSize; contentOffset = absoluteZoomPoint - zoomPoint * contentScale - moveOffset; graphContent.anchoredPosition = -GS.GraphSize / 2f + contentOffset; graph.sizeDelta = GS.GraphSize; backgroundRect.sizeDelta = GS.GraphSize; ((Graphic)backgroundImage).color = GS.BackgroundColor; } private void UpdateOutlines() { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_010d: 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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < outlines.Count; i++) { if (i % 2 == 0) { outlines[i].sizeDelta = new Vector2(GS.OutlineWidth, GS.GraphSize.y + GS.OutlineWidth * 2f); outlines[i].anchoredPosition = new Vector2((float)((i != 0) ? 1 : (-1)) * (GS.GraphSize.x + GS.OutlineWidth) / 2f, 0f); } else { outlines[i].sizeDelta = new Vector2(GS.GraphSize.x + GS.OutlineWidth * 2f, GS.OutlineWidth); outlines[i].anchoredPosition = new Vector2(0f, (float)((i != 1) ? 1 : (-1)) * (GS.GraphSize.y + GS.OutlineWidth) / 2f); } } } private void CalculateCornerValues() { //IL_0042: 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_004e: 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_0059: 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_0063: 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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_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) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) topRight = new Vector2(Mathf.Clamp(topRight.x, bottomLeft.x, float.PositiveInfinity), Mathf.Clamp(topRight.y, bottomLeft.y, float.PositiveInfinity)); bottomLeft = -contentOffset / contentScale; topRight = bottomLeft + GS.GraphSize / contentScale; center = (topRight - bottomLeft) / 2f + bottomLeft; } private void UpdateContent() { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: 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_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0120: 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_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) if (((Vector2Int)(ref xAxisRange)).x == -1 || ((Vector2Int)(ref xAxisRange)).y == -1) { return; } Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(bottomLeft.y, topRight.y); for (int i = ((Vector2Int)(ref xAxisRange)).x - 1; i <= ((Vector2Int)(ref xAxisRange)).y + 1; i++) { if (i < 0 || i > sortedIndices.Count - 1) { continue; } int num = sortedIndices[i]; float y = values[num].y; float y2 = values[Mathf.Clamp(num - 1, 0, values.Count - 1)].y; float y3 = values[Mathf.Clamp(num + 1, 0, values.Count - 1)].y; if ((!(y < val.x) || !(y2 < val.x) || !(y3 < val.x)) && (!(y > val.y) || !(y2 > val.y) || !(y3 > val.y))) { UpdateAnchoredPosition(pointOutlineRects[i], CalculatePosition(i)); if (lines.Count > 0 && num < lines.Count) { Vector2 val2 = CalculatePosition(num); Vector2 val3 = CalculatePosition(num + 1); float num2 = Vector2.Distance(val2, val3); UpdateAnchoredPosition(lineRects[num], (val3 + val2) / 2f); UpdateSizeDelta(lineRects[num], new Vector2(num2, GS.LineWidth)); Vector2 val4 = val3 - val2; float num3 = Mathf.Atan2(val4.y, val4.x) * 57.29578f; ((Transform)lineRects[num]).rotation = Quaternion.AngleAxis(num3, Vector3.forward); } } } } private void HandleActiveObjects() { //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) try { if (((Vector2Int)(ref prevXAxisRange)).x < ((Vector2Int)(ref xAxisRange)).x) { for (int i = ((Vector2Int)(ref prevXAxisRange)).x - 1; i < ((Vector2Int)(ref xAxisRange)).x - 1; i++) { if (i >= 0) { pointOutlines[sortedIndices[i]].SetActive(false); if (i < lines.Count) { lines[sortedIndices[i]].SetActive(false); } } } } else if (((Vector2Int)(ref prevXAxisRange)).x > ((Vector2Int)(ref xAxisRange)).x && ((Vector2Int)(ref xAxisRange)).x >= 0) { for (int j = ((Vector2Int)(ref xAxisRange)).x - 1; j < ((Vector2Int)(ref prevXAxisRange)).x; j++) { if (j >= 0) { pointOutlines[sortedIndices[j]].SetActive(true); if (j < lines.Count) { lines[sortedIndices[j]].SetActive(true); } } } } if (((Vector2Int)(ref prevXAxisRange)).y > ((Vector2Int)(ref xAxisRange)).y) { for (int k = ((Vector2Int)(ref xAxisRange)).y + 2; k <= ((Vector2Int)(ref prevXAxisRange)).y + 2; k++) { if (k <= pointOutlines.Count - 1 && k >= 0) { pointOutlines[sortedIndices[k]].SetActive(false); if (k < lines.Count) { lines[sortedIndices[k]].SetActive(false); } } } } else if (((Vector2Int)(ref xAxisRange)).y > ((Vector2Int)(ref prevXAxisRange)).y) { for (int l = ((Vector2Int)(ref prevXAxisRange)).y + 2; l <= ((Vector2Int)(ref xAxisRange)).y + 1; l++) { if (l <= pointOutlines.Count - 1 && l >= 0) { pointOutlines[sortedIndices[l]].SetActive(true); if (l < lines.Count) { lines[sortedIndices[l]].SetActive(true); } } } } } catch (ArgumentOutOfRangeException) { } prevXAxisRange = xAxisRange; xAxisRange = new Vector2Int(MinMaxBinarySearch(findLeft: true), MinMaxBinarySearch(findLeft: false)); } private Vector2 CalculatePosition(int i) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) return values[i] * contentScale; } private void MouseTrigger(int pointIndex, bool enter) { //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_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Expected O, but got Unknown //IL_0160: 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_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) fixedHoveredPoints.Add(pointIndex); fixedHoveredPoints = fixedHoveredPoints.Distinct().ToList(); if (enter) { activePointIndex = pointIndex; activePointValue = values[pointIndex]; pointIsActive = enter; if (pointSelectionType == PointSelectionType.Select) { lockedHoveredPoints.Add(pointIndex); lockedHoveredPoints = lockedHoveredPoints.Distinct().ToList(); } } else { if ((lockedPoints.Contains(activePointIndex) && pointSelectionType == PointSelectionType.Select) || (fixedPointIndex == activePointIndex && pointSelectionType == PointSelectionType.FixZoomPoint)) { return; } activePointIndex = pointIndex; activePointValue = values[pointIndex]; pointIsActive = enter; } if (points[pointIndex].transform.childCount > 0) { Object.Destroy((Object)(object)((Component)points[pointIndex].transform.GetChild(0)).gameObject); return; } GameObject val = new GameObject("coordinateDisplay"); val.transform.SetParent(points[pointIndex].transform, false); RectTransform val2 = val.AddComponent<RectTransform>(); val2.anchorMin = Vector2.zero; val2.anchorMax = Vector2.one; val2.offsetMin = Vector2.zero; val2.offsetMax = Vector2.zero; ((Transform)val2).localPosition = ((Transform)val2).localPosition + new Vector3(0f, 25f, 0f); TextMeshProUGUI val3 = val.gameObject.AddComponent<TextMeshProUGUI>(); if (currentPlotIsLog) { ((TMP_Text)val3).text = $"{Math.Round(values[pointIndex].x, 0)}, {trueYvalues[pointIndex]}"; } else { ((TMP_Text)val3).text = $"{Math.Round(values[pointIndex].x, 0)}, {trueYvalues[pointIndex]}"; } ((Graphic)val3).color = Color.white; ((TMP_Text)val3).fontSize = 30f; ((TMP_Text)val3).alignment = (TextAlignmentOptions)514; ((TMP_Text)val3).enableWordWrapping = false; ((Graphic)val3).raycastTarget = false; } private void PointClicked(int pointIndex) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) if (pointSelectionType == PointSelectionType.FixZoomPoint) { if (fixedPointIndex != -1) { ChangeZoomPoint(values[pointIndex]); fixedHoveredPoints.Add(fixedPointIndex); } fixedHoveredPoints = fixedHoveredPoints.Distinct().ToList(); fixedPointIndex = ((fixedPointIndex == pointIndex) ? (-1) : pointIndex); ChangeZoomPoint((fixedPointIndex == -1) ? center : values[pointIndex]); } else if (lockedPoints.Contains(pointIndex)) { lockedPoints.Remove(pointIndex); } else { lockedPoints.Add(pointIndex); } } private void UpdatePointVisuals() { if (((Vector2Int)(ref xAxisRange)).x == -1 || ((Vector2Int)(ref xAxisRange)).y == -1) { return; } for (int i = ((Vector2Int)(ref xAxisRange)).x; i <= ((Vector2Int)(ref xAxisRange)).y; i++) { if (activePointIndex != sortedIndices[i]) { lockedHoveredPoints.Add(sortedIndices[i]); fixedHoveredPoints.Add(sortedIndices[i]); } } } private void UpdatePoints() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_0103: 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_0110: 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_0131: 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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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_00a9: 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_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < lockedHoveredPoints.Count; i++) { int num = lockedHoveredPoints[i]; bool flag = activePointIndex == num && pointIsActive; Vector2 val; Color val2; float num2; if (lockedPoints.Contains(num)) { val = Vector2.one * GS.PointLockedRadius; val2 = GS.PointLockedColor; num2 = GS.PointLockedSpeed; } else if (flag && pointSelectionType == PointSelectionType.Select) { val = Vector2.one * GS.PointHoverRadius; val2 = GS.PointHoverColor; num2 = GS.PointHoverSpeed; } else { val = Vector2.one * GS.PointRadius; val2 = GS.PointColor; num2 = GS.PointHoverSpeed; } pointRects[num].sizeDelta = Vector2.Lerp(pointRects[num].sizeDelta, val, Time.deltaTime * num2); if (!flag && Vector2.Distance(pointRects[num].sizeDelta, val) < 0.5f && Vector4.Distance(Color.op_Implicit(((Graphic)pointImages[num]).color), Color.op_Implicit(val2)) < 0.5f) { ((Graphic)pointImages[num]).color = val2; pointRects[num].sizeDelta = val; lockedHoveredPoints.RemoveAt(i); } else if (!fixedHoveredPoints.Contains(num) && num != fixedPointIndex) { pointOutlineRects[num].sizeDelta = pointRects[num].sizeDelta + Vector2.one * GS.UnfixedPointOutlineWidth; } } UpdatePointOutlines(); } private void UpdatePointOutlines() { //IL_0060: 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_00fe: 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_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); for (int i = 0; i < fixedHoveredPoints.Count; i++) { int num = fixedHoveredPoints[i]; bool flag = activePointIndex == num && pointIsActive; float num2; Color val2; if (fixedPointIndex == num) { ((Vector2)(ref val))..ctor(GS.FixedPointOutlineWidth, GS.FixedPointOutlineWidth); val2 = GS.FixedPointOutlineColor; num2 = GS.FixedPointOutlineSpeed; } else if (flag && pointSelectionType == PointSelectionType.FixZoomPoint) { ((Vector2)(ref val))..ctor(GS.UnfixedPointOutlineHoverWidth, GS.UnfixedPointOutlineHoverWidth); val2 = GS.UnfixedPointOutlineHoverColor; num2 = GS.UnfixedPointOutlineHoverSpeed; } else { ((Vector2)(ref val))..ctor(GS.UnfixedPointOutlineWidth, GS.UnfixedPointOutlineWidth); val2 = GS.UnfixedPointOutlineColor; num2 = GS.UnfixedPointOutlineHoverSpeed; } val += pointRects[num].sizeDelta; RectTransform val3 = pointOutlineRects[num]; if (pointSelectionType == PointSelectionType.FixZoomPoint) { val3.sizeDelta = Vector2.Lerp(val3.sizeDelta, val, Time.deltaTime * num2); } else { val3.sizeDelta = val; } Image val4 = pointOutlineImages[num]; val2 = Color.Lerp(((Graphic)val4).color, val2, Time.deltaTime * num2); ((Graphic)val4).color = val2; if (!flag && Vector2.Distance(val3.sizeDelta, val) < 0.5f) { fixedHoveredPoints.RemoveAt(i); } } } private void UpdateGridLines() { //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_0013: 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_0031: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_058c: Unknown result type (might be due to invalid IL or missing references) //IL_05a7: Unknown result type (might be due to invalid IL or missing references) //IL_05ba: Unknown result type (might be due to invalid IL or missing references) //IL_05c5: Unknown result type (might be due to invalid IL or missing references) //IL_05ce: Unknown result type (might be due to invalid IL or missing references) //IL_05d5: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Unknown result type (might be due to invalid IL or missing references) //IL_0547: Unknown result type (might be due to invalid IL or missing references) //IL_0571: Unknown result type (might be due to invalid IL or missing references) //IL_0621: Unknown result type (might be due to invalid IL or missing references) //IL_062a: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_0645: Unknown result type (might be due to invalid IL or missing references) //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_0683: Unknown result type (might be due to invalid IL or missing references) //IL_06c7: Unknown result type (might be due to invalid IL or missing references) //IL_06e6: Unknown result type (might be due to invalid IL or missing references) //IL_072d: Unknown result type (might be due to invalid IL or missing references) //IL_0742: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_06f9: Unknown result type (might be due to invalid IL or missing references) //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0715: Unknown result type (might be due to invalid IL or missing references) Vector2 val = CalculateGridSpacing(); Vector2 val2 = new Vector2(Mathf.Ceil(bottomLeft.x * val.x) / val.x, Mathf.Ceil(bottomLeft.y * val.y) / val.y) * contentScale; Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(-1f, -1f); int num = Mathf.CeilToInt((topRight.y - bottomLeft.y) * val.y) + 1; int num2 = Mathf.CeilToInt((topRight.x - bottomLeft.x) * val.x) + 1; if (num2 < 0) { num2 = 7; } if (num < 0) { num = 7; } while (xGridRects.Count <= num2) { CreateGridLines(createX: true); } while (yGridRects.Count <= num) { CreateGridLines(createX: false); } for (int i = 0; i < num2; i++) { RectTransform val4 = xGridRects[i]; Image val5 = xGridImages[i]; if (!((Component)val4).gameObject.activeSelf) { ((Component)val4).gameObject.SetActive(true); } if (i == 0) { UpdateSizeDelta(val4, new Vector2(GS.XAxisWidth, GS.GraphSize.y * 2f)); ((Graphic)val5).color = GS.XAxisColor; UpdateAnchoredPosition(val4, new Vector2(0f, center.y * contentScale.y)); continue; } UpdateSizeDelta(val4, new Vector2(GS.XGridWidth, GS.GraphSize.y * 2f)); ((Graphic)val5).color = GS.XGridColor; if (Mathf.Round(val2.x + ((float)i + val3.x) / val.x * contentScale.x) == 0f) { val3.x = 0f; } UpdateAnchoredPosition(val4, new Vector2(val2.x + ((float)i + val3.x) / val.x * contentScale.x, center.y * contentScale.y)); UpdateSizeDelta(xAxisTextRects[i - 1], new Vector2(1f / val.x * contentScale.x, GS.XAxisTextSize)); UpdateAnchoredPosition(xAxisTextRects[i - 1], new Vector2(0f, (0f - center.y) * contentScale.y + GS.XAxisTextOffset)); ((TMP_Text)xAxisTexts[i - 1]).text = ((Mathf.Floor(1f / val.x) > 0f) ? Mathf.Round(val2.x / contentScale.x + ((float)i + val3.x) / val.x).ToString() : (val2.x / contentScale.x + ((float)i + val3.x) / val.x).ToString("R")); if (((TMP_Text)xAxisTexts[i - 1]).text[0] == '-') { ((TMP_Text)xAxisTexts[i - 1]).text = ""; } } if (xAxisTexts.Count >= 2) { for (int j = 1; j < xAxisTexts.Count; j++) { if (((TMP_Text)xAxisTexts[j - 1]).text == "" && ((TMP_Text)xAxisTexts[j]).text != "") { ((TMP_Text)xAxisTexts[j - 1]).text = "seconds"; break; } } } for (int k = 0; k < num; k++) { RectTransform val6 = yGridRects[k]; Image val7 = yGridImages[k]; if (!((Component)val6).gameObject.activeSelf) { ((Component)val6).gameObject.SetActive(true); } if (k == 0) { UpdateSizeDelta(val6, new Vector2(GS.GraphSize.x * 2f, GS.YAxisWidth)); ((Graphic)val7).color = GS.YAxisColor; UpdateAnchoredPosition(val6, new Vector2(center.x * contentScale.x, 0f)); continue; } UpdateSizeDelta(val6, new Vector2(GS.GraphSize.x * 2f, GS.YGridWidth)); ((Graphic)val7).color = GS.YGridColor; if (Mathf.Round(val2.y + ((float)k + val3.y) / val.y * contentScale.y) == 0f) { val3.y = 0f; } UpdateAnchoredPosition(val6, new Vector2(center.x * contentScale.x, val2.y + ((float)k + val3.y) / val.y * contentScale.y)); UpdateSizeDelta(yAxisTextRects[k - 1], new Vector2(1f / val.x * contentScale.x, GS.XAxisTextSize)); UpdateAnchoredPosition(yAxisTextRects[k - 1], new Vector2((0f - center.x) * contentScale.x + GS.YAxisTextOffset, 0f)); ((TMP_Text)yAxisTexts[k - 1]).text = ((Mathf.Floor(1f / val.y) > 0f) ? Mathf.Round(val2.y / contentScale.y + ((float)k + val3.y) / val.y).ToString() : (val2.y / contentScale.y + ((float)k + val3.y) / val.y).ToString("R")); if (currentPlotIsLog) { ((TMP_Text)yAxisTexts[k - 1]).text = $"{logBase}<sup>{((TMP_Text)yAxisTexts[k - 1]).text}</sup>"; } } for (int l = num2; l < xGridRects.Count; l++) { if (((Component)xGridRects[l]).gameObject.activeSelf) { ((Component)xGridRects[l]).gameObject.SetActive(false); } } for (int m = num; m < yGridRects.Count; m++) { if (((Component)yGridRects[m]).gameObject.activeSelf) { ((Component)yGridRects[m]).gameObject.SetActive(false); } } } private Vector2 CalculateGridSpacing() { //IL_0053: 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_0063: 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) int num = Mathf.FloorToInt(Mathf.Log(zoom.x, 2f)); int num2 = Mathf.FloorToInt(Mathf.Log(zoom.y, 2f)); float num3 = Mathf.Pow(2f, (float)num); float num4 = Mathf.Pow(2f, (float)num2); return new Vector2(num3, num4) * GS.GridSpacing; } private void SetCornerValuesInternal(Vector2 newBottomLeft, Vector2 newTopRight) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_005b: 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_0088: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f9: 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_0112: 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_011c: 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_011e: 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) if (newBottomLeft.x < -2.5E+38f || float.IsNaN(newBottomLeft.x)) { newBottomLeft.x = -2.5E+38f; } if (newBottomLeft.y < -2.5E+38f || float.IsNaN(newBottomLeft.y)) { newBottomLeft.y = -2.5E+38f; } if (newTopRight.x > 2.5E+38f || float.IsNaN(newTopRight.x)) { newTopRight.x = 2.5E+38f; } if (newTopRight.y > 2.5E+38f || float.IsNaN(newTopRight.y)) { newTopRight.y = 2.5E+38f; } Vector2 val = (newTopRight - newBottomLeft) / 2f + newBottomLeft; targetMoveOffset = (val - center) * contentScale + moveOffset; ChangeZoomPoint(val); targetZoom = GS.GraphSize / GS.GraphScale / (newTopRight - newBottomLeft); } private void CalculateMousePosition() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_011a: Unknown result type (might be due to invalid IL or missing references) mousePos = (new Vector2(Input.mousePosition.x, Input.mousePosition.y) - new Vector2(((Component)graphContent).transform.position.x, ((Component)graphContent).transform.position.y)) / contentScale; mouseInsideBounds = mousePos.x > bottomLeft.x && mousePos.y > bottomLeft.y && mousePos.x < topRight.x && mousePos.y < topRight.y; mousePos = new Vector2(Mathf.Clamp(mousePos.x, bottomLeft.x, topRight.x), Mathf.Clamp(mousePos.y, bottomLeft.y, topRight.y)); } private void MouseZoom() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0068: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) if (mouseInsideBounds && Input.mouseScrollDelta.y != 0f) { if (fixedPointIndex == -1) { ChangeZoomPoint(mousePos); } targetZoom = zoom + Input.mouseScrollDelta.y * zoom * GS.ZoomSpeed / 100f; } } private void ChangeZoomPoint(Vector2 newZoomPoint) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_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_0020: 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_002c: 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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) if (IsWithinBounds(zoom, (newZoomPoint - zoomPoint) * contentScale + absoluteZoomPoint, newZoomPoint, moveOffset)) { absoluteZoomPoint = (newZoomPoint - zoomPoint) * contentScale + absoluteZoomPoint; zoomPoint = newZoomPoint; } } private void MouseAction() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0106: 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_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_0120: 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_013d: 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_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Invalid comparison between Unknown and I4 //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Invalid comparison between Unknown and I4 //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_04b7: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Invalid comparison between Unknown and I4 //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Unknown result type (might be due to invalid IL or missing references) if (Input.GetMouseButtonDown(0)) { initialMouseInsideBounds = mouseInsideBounds; if (!mouseInsideBounds) { return; } initialMousePos = Vector2.op_Implicit(Input.mousePosition); if (mouseActionType == MouseActionType.Move) { initialMoveOffset = moveOffset; } else if (mouseActionType == MouseActionType.SelectPoints) { initialLockedPoints.Clear(); for (int i = 0; i < lockedPoints.Count; i++) { initialLockedPoints.Add(lockedPoints[i]); } } return; } if (Input.GetMouseButton(0) && initialMouseInsideBounds) { if (Input.GetMouseButtonDown(1)) { initialMouseInsideBounds = false; ((Component)zoomSelectionRectTransform).gameObject.SetActive(false); ((Component)pointSelectionRectTransform).gameObject.SetActive(false); } if (previousMousePos != mousePos) { Vector2 val = Vector2.op_Implicit(Input.mousePosition); if (mouseActionType == MouseActionType.Move) { targetMoveOffset = initialMousePos - val + initialMoveOffset; } else if (mouseActionType == MouseActionType.SelectAreaToZoom) { if (!((Component)zoomSelectionRectTransform).gameObject.activeSelf) { ((Component)zoomSelectionRectTransform).gameObject.SetActive(true); } SelectAreaToZoom(release: false); } else if (mouseActionType == MouseActionType.SelectPoints) { if (!((Component)pointSelectionRectTransform).gameObject.activeSelf) { ((Component)pointSelectionRectTransform).gameObject.SetActive(true); } SelectPoints(release: false); } } previousMousePos = mousePos; } else if (Input.GetMouseButtonUp(0) && initialMouseInsideBounds) { if (mouseActionType == MouseActionType.SelectAreaToZoom) { SelectAreaToZoom(release: true); } else if (mouseActionType == MouseActionType.SelectPoints) { SelectPoints(release: true); } recentlyLockedPoints.Clear(); } if (Input.touchCount != 1) { return; } Touch touch = Input.GetTouch(0); if ((int)((Touch)(ref touch)).phase == 0) { initialMousePos = ((Touch)(ref touch)).position; mousePos = (new Vector2(((Touch)(ref touch)).position.x, ((Touch)(ref touch)).position.y) - new Vector2(((Component)graphContent).transform.position.x, ((Component)graphContent).transform.position.y)) / contentScale; initialMouseInsideBounds = mousePos.x > bottomLeft.x && mousePos.y > bottomLeft.y && mousePos.x < topRight.x && mousePos.y < topRight.y; if (mouseActionType == MouseActionType.Move) { initialMoveOffset = moveOffset; } else if (mouseActionType == MouseActionType.SelectPoints) { initialLockedPoints.Clear(); for (int j = 0; j < lockedPoints.Count; j++) { initialLockedPoints.Add(lockedPoints[j]); } } } else if ((int)((Touch)(ref touch)).phase == 1 && initialMouseInsideBounds) { if (mouseActionType == MouseActionType.Move) { Vector2 position = ((Touch)(ref touch)).position; targetMoveOffset = initialMousePos - position + initialMoveOffset; } else if (mouseActionType == MouseActionType.SelectAreaToZoom) { if (!((Component)zoomSelectionRectTransform).gameObject.activeSelf) { ((Component)zoomSelectionRectTransform).gameObject.SetActive(true); } SelectAreaToZoom(release: false); } else if (mouseActionType == MouseActionType.SelectPoints) { if (!((Component)pointSelectionRectTransform).gameObject.activeSelf) { ((Component)pointSelectionRectTransform).gameObject.SetActive(true); } SelectPoints(release: false); } } else if ((int)((Touch)(ref touch)).phase == 3 && initialMouseInsideBounds) { if (mouseActionType == MouseActionType.SelectAreaToZoom) { SelectAreaToZoom(release: true); } else if (mouseActionType == MouseActionType.SelectPoints) { SelectPoints(release: true); } recentlyLockedPoints.Clear(); } } private void SelectAreaToZoom(bool release) { //IL_0017: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_007a: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0136: 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_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) Vector2 val = (new Vector2(initialMousePos.x, initialMousePos.y) - new Vector2(((Component)graphContent).transform.position.x, ((Component)graphContent).transform.position.y)) / contentScale; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(mousePos.x, val.y + (mousePos.x - val.x) / GS.GraphSize.x * GS.GraphSize.y * contentScale.x / contentScale.y); Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(mousePos.x, val.y + (mousePos.x - val.x)); Vector2 val4 = ((rectangleType == RectangleType.Free) ? mousePos : ((rectangleType == RectangleType.PreserveAspectRatio) ? val2 : val3)); if (!release) { zoomSelectionRectTransform.anchoredPosition = (val + (val4 - val) / 2f) * contentScale; Vector2 val5 = new Vector2(Mathf.Abs(val4.x - val.x), Mathf.Abs(val4.y - val.y)) * contentScale; zoomSelectionRectTransform.sizeDelta = val5; ((Graphic)zoomSelectionImage).color = GS.ZoomSelectionColor; for (int i = 0; i < zoomSelectionOutlines.Count; i++) { if (i % 2 == 0) { zoomSelectionOutlines[i].sizeDelta = new Vector2(GS.ZoomSelectionOutlineWidth, val5.y + GS.ZoomSelectionOutlineWidth * 2f); zoomSelectionOutlines[i].anchoredPosition = new Vector2((float)((i != 0) ? 1 : (-1)) * (val5.x + GS.ZoomSelectionOutlineWidth) / 2f, 0f); } else { zoomSelectionOutlines[i].sizeDelta = new Vector2(val5.x + GS.ZoomSelectionOutlineWidth * 2f, GS.ZoomSelectionOutlineWidth); zoomSelectionOutlines[i].anchoredPosition = new Vector2(0f, (float)((i != 1) ? 1 : (-1)) * (val5.y + GS.ZoomSelectionOutlineWidth) / 2f); } ((Graphic)zoomSelectionOutlineImages[i]).color = GS.ZoomSelectionOutlineColor; } } else { ((Component)zoomSelectionRectTransform).gameObject.SetActive(false); Vector2 val6 = default(Vector2); ((Vector2)(ref val6))..ctor(Mathf.Min(val.x, val4.x), Mathf.Min(val.y, val4.y)); Vector2 val7 = default(Vector2); ((Vector2)(ref val7))..ctor(Mathf.Max(val.x, val4.x), Mathf.Max(val.y, val4.y)); Vector2 val8 = val7 - val6; float magnitude = ((Vector2)(ref val8)).magnitude; val8 = topRight - bottomLeft; if (magnitude > ((Vector2)(ref val8)).magnitude / 16f) { SetCornerValues(val6, val7); } } } private void SelectPoints(bool release) { //IL_0017: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to inva