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 LudsPortals v1.2.0
LudsPortals.dll
Decompiled a day 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.ComponentModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using Groups; using Guilds; using HarmonyLib; using JetBrains.Annotations; using Microsoft.CodeAnalysis; using ServerSync; using Splatform; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; [assembly: AssemblyConfiguration("")] [assembly: AssemblyDescription("https://valheim.thunderstore.io/package/Smoothbrain/TargetPortal")] [assembly: AssemblyProduct("TargetPortal")] [assembly: AssemblyCompany("")] [assembly: AssemblyTitle("TargetPortal")] [assembly: CompilationRelaxations(8)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: IgnoresAccessChecksTo("assembly_utils")] [assembly: IgnoresAccessChecksTo("assembly_guiutils")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: IgnoresAccessChecksTo("assembly_valheim")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCopyright("Copyright © 2022")] [assembly: Guid("150BFDAF-FF35-4302-B7CC-BEDCE69118D5")] [assembly: ComVisible(false)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: <8553158a-8f72-4ea0-bd59-8a85820cbb72>RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [<8c5729ce-4888-4ed6-af85-86876667bfd0>Embedded] internal sealed class <8c5729ce-4888-4ed6-af85-86876667bfd0>EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [<8c5729ce-4888-4ed6-af85-86876667bfd0>Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class <dbb9d2de-775e-4a96-9873-3e5066032ce0>NullableAttribute : Attribute { public readonly byte[] NullableFlags; public <dbb9d2de-775e-4a96-9873-3e5066032ce0>NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public <dbb9d2de-775e-4a96-9873-3e5066032ce0>NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [<8c5729ce-4888-4ed6-af85-86876667bfd0>Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class <209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContextAttribute : Attribute { public readonly byte Flag; public <209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContextAttribute(byte P_0) { Flag = P_0; } } [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] [CompilerGenerated] [<8c5729ce-4888-4ed6-af85-86876667bfd0>Embedded] internal sealed class <8553158a-8f72-4ea0-bd59-8a85820cbb72>RefSafetyRulesAttribute : Attribute { public readonly int Version; public <8553158a-8f72-4ea0-bd59-8a85820cbb72>RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace TargetPortal { public class CloseMap : MonoBehaviour { [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] private void OnTriggerExit(Collider other) { if (Map.Teleporting && (Object)(object)((Component)other).GetComponent<Player>() == (Object)(object)Player.m_localPlayer) { Minimap.instance.m_dragView = false; Minimap.instance.SetMapMode((MapMode)1); Map.CancelTeleport(); } } } [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(0)] [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] public static class Helper { private static byte[] ReadEmbeddedFileBytes(string name) { using MemoryStream memoryStream = new MemoryStream(); Assembly.GetExecutingAssembly().GetManifestResourceStream("TargetPortal." + name)?.CopyTo(memoryStream); return memoryStream.ToArray(); } private static Texture2D loadTexture(string name) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown Texture2D val = new Texture2D(0, 0); typeof(ImageConversion).GetMethod("LoadImage", new Type[2] { typeof(Texture2D), typeof(byte[]) }).Invoke(null, new object[2] { val, ReadEmbeddedFileBytes(name) }); return val; } public static Sprite loadSprite(string name, int width, int height) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) return Sprite.Create(loadTexture(name), new Rect(0f, 0f, (float)width, (float)height), Vector2.zero); } } [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(0)] [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] public static class LastUsedPortals { private const string Key = "TargetPortal LastUsed"; [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(new byte[] { 2, 1, 1 })] private static Dictionary<string, string> cache; private static float cacheTime = -10f; private static Dictionary<string, ZDO> byPosition = new Dictionary<string, ZDO>(); private static string Id(ZDO zdo) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return ((object)zdo.GetPosition()/*cast due to .constrained prefix*/).ToString(); } private static Dictionary<string, string> Load() { Dictionary<string, string> dictionary = new Dictionary<string, string>(); if ((Object)(object)Player.m_localPlayer != (Object)null && Player.m_localPlayer.m_customData.TryGetValue("TargetPortal LastUsed", out var value)) { string[] array = value.Split(new char[1] { '|' }); for (int i = 0; i < array.Length; i++) { string[] array2 = array[i].Split(new char[1] { '>' }); if (array2.Length == 2) { dictionary[array2[0]] = array2[1]; } } } return dictionary; } [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(2)] public static ZDO FindSource(Vector3 position) { //IL_0007: 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) return (from z in TargetPortal.knownPortals where Vector3.Distance(z.GetPosition(), position) < 6f orderby Vector3.Distance(z.GetPosition(), position) select z).FirstOrDefault(); } public static void Record(Vector3 sourcePosition, ZDO destination) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) ZDO val = FindSource(sourcePosition); if (val != null && !((Object)(object)Player.m_localPlayer == (Object)null)) { Debug.Log((object)string.Format("TargetPortal: last used {0} -> {1}, picture available: {2}", val.GetString("tag", ""), destination.GetString("tag", ""), !string.IsNullOrEmpty(destination.GetString("pv_id", "")))); Dictionary<string, string> dictionary = Load(); dictionary[Id(val)] = Id(destination); dictionary[Id(destination)] = Id(val); Player.m_localPlayer.m_customData["TargetPortal LastUsed"] = string.Join("|", dictionary.Select([<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(0)] (KeyValuePair<string, string> p) => p.Key + ">" + p.Value)); } } public static void ApplyLinks() { //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Player.m_localPlayer == (Object)null) { return; } Dictionary<string, string> dictionary = Load(); if (dictionary.Count == 0) { return; } Dictionary<string, ZDO> dictionary2 = TargetPortal.knownPortals.GroupBy(Id).ToDictionary([<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(0)] (IGrouping<string, ZDO> g) => g.Key, [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(0)] (IGrouping<string, ZDO> g) => g.First()); foreach (ZDO knownPortal in TargetPortal.knownPortals) { if (dictionary.TryGetValue(Id(knownPortal), out var value) && dictionary2.TryGetValue(value, out var value2) && knownPortal.GetConnectionZDOID((ConnectionType)1) != value2.m_uid) { knownPortal.SetConnection((ConnectionType)1, value2.m_uid); } } } [return: <dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(2)] public static ZDO GetTarget(ZDO source) { if ((Object)(object)Player.m_localPlayer == (Object)null) { return null; } if (cache == null || Time.realtimeSinceStartup - cacheTime > 0.5f) { cache = Load(); byPosition = TargetPortal.knownPortals.GroupBy(Id).ToDictionary([<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(0)] (IGrouping<string, ZDO> g) => g.Key, [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(0)] (IGrouping<string, ZDO> g) => g.First()); cacheTime = Time.realtimeSinceStartup; } if (!cache.TryGetValue(Id(source), out var value) || !byPosition.TryGetValue(value, out var value2)) { return null; } return value2; } } [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(0)] internal static class LudsTheme { public const float DefaultScale = 0.576f; public const float DefaultOpacity = 0.96f; public const float PanelMaxBrightness = 0.4f; public static readonly string[] PresetNames = new string[6] { "Gold", "Ember", "Emerald", "Frost", "Crimson", "Amethyst" }; private static readonly string[] PresetAccent = new string[6] { "FFB83B", "FF7A2E", "4FD18B", "6EC6FF", "FF5A5A", "B58CFF" }; private static readonly string[] PresetPanel = new string[6] { "050403", "0A0403", "030805", "03060A", "0A0304", "06030A" }; public static string AccentHex = PresetAccent[0]; public static string PanelHex = PresetPanel[0]; public static float Opacity = 0.96f; public static float Scale = 0.576f; public static int Align = 1; public static int AlignY = 1; private static Color accent = Color.white; private static Color panelBase = Color.black; private static string modName = ""; private static Func<bool> useShared = () => true; private static string loadedPath = ""; private static DateTime loadedStamp; private static float nextCheck; private static float nextApply; private static bool unsaved; private static bool rebuildOnCommit; private static bool hold; private static float heldScale; private static bool pending; public static bool Hold { get { return hold; } set { if (value && !hold) { heldScale = Scale; } hold = value; } } public static float LayoutScale => Scale; public static Vector2 LayoutAnchor => new Vector2((float)Align * 0.5f, 1f - (float)AlignY * 0.5f); public static Vector2 LayoutPosition => new Vector2((float)(1 - Align) * 40f, (float)(AlignY - 1) * 40f); public static int Version { get; private set; } public static Color Accent => accent; public static Color Panel => Rgb(panelBase, Opacity); public static Color Field => Rgb(panelBase * 5.7f, Mathf.Max(0.99f * Opacity, 0.85f)); public static Color ButtonFill => Rgb(panelBase * 1.5f, Mathf.Max(0.92f * Opacity, 0.65f)); public static Color ButtonHover => Rgb(accent * 0.3f, 0.94f); public static Color Border => Rgb(accent * 0.85f, 0.8f); public static Color Divider => Rgb(accent * 0.85f, 0.85f); public static Color Row => new Color(0f, 0f, 0f, 0.5f * Opacity); public static Color ListBg => new Color(0f, 0f, 0f, Mathf.Max(0.4f * Opacity, ScrimAlpha)); public static Color PanelSolid => Rgb(panelBase, 1f); public static float ScrimAlpha => 0.55f * (1f - Mathf.Clamp01(Opacity / 0.6f)); public static Color Scrim => new Color(0f, 0f, 0f, ScrimAlpha); private static string CurrentPath => Path.Combine(Paths.ConfigPath, useShared() ? "luds.theme.ini" : ("luds." + modName + ".theme.ini")); private static Color Rgb(Color c, float a) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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) return new Color(Mathf.Clamp01(c.r), Mathf.Clamp01(c.g), Mathf.Clamp01(c.b), Mathf.Clamp01(a)); } public static void Init(string mod, Func<bool> shared) { modName = mod; useShared = shared; Load(); } public static bool Tick() { if (pending && !hold && Time.unscaledTime >= nextApply) { pending = false; nextApply = Time.unscaledTime + 0.08f; return true; } if (Time.unscaledTime < nextCheck) { return false; } nextCheck = Time.unscaledTime + 0.25f; string currentPath = CurrentPath; DateTime dateTime = (File.Exists(currentPath) ? File.GetLastWriteTimeUtc(currentPath) : DateTime.MinValue); if (currentPath != loadedPath || dateTime != loadedStamp) { Load(); if (hold) { pending = true; return false; } return true; } return false; } public static void Mutate(Action change, bool save = true, bool rebuild = true) { change(); Clamp(); if (save) { Save(); } else { unsaved = true; } if (rebuild) { pending = true; } else { rebuildOnCommit = true; } } public static void SaveNow() { if (unsaved) { Save(); } if (rebuildOnCommit) { rebuildOnCommit = false; pending = true; } } public static void ApplyPreset(int index) { index = (index % PresetNames.Length + PresetNames.Length) % PresetNames.Length; Mutate(delegate { AccentHex = PresetAccent[index]; PanelHex = PresetPanel[index]; }); } public static int PresetIndex() { for (int i = 0; i < PresetNames.Length; i++) { if (string.Equals(AccentHex, PresetAccent[i], StringComparison.OrdinalIgnoreCase) && string.Equals(PanelHex, PresetPanel[i], StringComparison.OrdinalIgnoreCase)) { return i; } } return -1; } public static void Reset() { Mutate(SetDefaults); } public static bool TryHex(string text, out string hex) { hex = text.Trim().TrimStart(new char[1] { '#' }).ToUpperInvariant(); int result; if (hex.Length == 6) { return int.TryParse(hex, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out result); } return false; } private static string LimitBrightness(string hex) { //IL_0001: 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) float num = default(float); float num2 = default(float); float num3 = default(float); Color.RGBToHSV(FromHex(hex), ref num, ref num2, ref num3); if (!(num3 <= 0.4f)) { return ColorUtility.ToHtmlStringRGB(Color.HSVToRGB(num, num2, 0.4f)); } return hex; } private static Color FromHex(string hex) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) int num = int.Parse(hex, NumberStyles.HexNumber, CultureInfo.InvariantCulture); return new Color((float)((num >> 16) & 0xFF) / 255f, (float)((num >> 8) & 0xFF) / 255f, (float)(num & 0xFF) / 255f); } private static void SetDefaults() { AccentHex = PresetAccent[0]; PanelHex = PresetPanel[0]; Opacity = 0.96f; Scale = 0.576f; Align = 1; AlignY = 1; } private static void Clamp() { //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_005c: 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_006e: 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_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) if (!TryHex(AccentHex, out AccentHex)) { AccentHex = PresetAccent[0]; } if (!TryHex(PanelHex, out PanelHex)) { PanelHex = PresetPanel[0]; } PanelHex = LimitBrightness(PanelHex); Color val = FromHex(AccentHex); if (Mathf.Max(new float[3] { val.r, val.g, val.b }) < 0.35f) { AccentHex = PresetAccent[0]; } Opacity = Mathf.Clamp(Mathf.Round(Opacity * 100f) / 100f, 0f, 1f); Scale = Mathf.Clamp(Scale, 0.3456f, 0.80639994f); Align = Mathf.Clamp(Align, 0, 2); AlignY = Mathf.Clamp(AlignY, 0, 2); accent = FromHex(AccentHex); panelBase = FromHex(PanelHex); Version++; } private static void Load() { SetDefaults(); string text = (loadedPath = CurrentPath); try { if (File.Exists(text)) { string[] array = File.ReadAllLines(text); foreach (string text2 in array) { int num = text2.IndexOf('='); if (num <= 0) { continue; } string text3 = text2.Substring(0, num).Trim(); string text4 = text2.Substring(num + 1).Trim(); float result; bool flag = float.TryParse(text4, NumberStyles.Float, CultureInfo.InvariantCulture, out result); switch (text3) { case "Accent": AccentHex = text4; break; case "Panel": PanelHex = text4; break; case "Opacity": if (flag) { Opacity = result; } break; case "Scale": if (flag) { Scale = result; } break; case "Align": if (flag) { Align = (int)result; } break; case "AlignY": if (flag) { AlignY = (int)result; } break; } } } loadedStamp = (File.Exists(text) ? File.GetLastWriteTimeUtc(text) : DateTime.MinValue); } catch (Exception ex) { Debug.LogWarning((object)("Luds theme: could not read " + text + ": " + ex.Message)); } Clamp(); } private static void Save() { string currentPath = CurrentPath; try { string contents = string.Join(Environment.NewLine, "Accent=" + AccentHex, "Panel=" + PanelHex, "Opacity=" + Opacity.ToString("0.##", CultureInfo.InvariantCulture), "Scale=" + Scale.ToString("0.####", CultureInfo.InvariantCulture), "Align=" + Align, "AlignY=" + AlignY) + Environment.NewLine; File.WriteAllText(currentPath, contents); loadedPath = currentPath; loadedStamp = File.GetLastWriteTimeUtc(currentPath); unsaved = false; } catch (Exception ex) { Debug.LogWarning((object)("Luds theme: could not write " + currentPath + ": " + ex.Message)); } } } internal static class LudsColorExtensions { public static Color A(this Color c, float alpha) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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) return new Color(c.r, c.g, c.b, alpha); } } [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(0)] internal sealed class ThemeHost { public Func<Transform, string, Color, bool, Image> Image; public Func<Transform, string, string, bool, float, Color, TextAlignmentOptions, TextMeshProUGUI> Text; public Func<Transform, string, Action, RectTransform> Button; public Func<Transform, Color, List<Image>> Border; public Func<Image, string, TMP_InputField> Input; public Func<bool> GetSync; public Action<bool> SetSync; [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(new byte[] { 1, 2 })] public Func<RectTransform> Anchor; [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(2)] public Action ApplyLayout; public Func<bool> HostOpen; public string Title = ""; public Color Cream; public Color Dim; public float Width; public bool HorizontalPosition; } [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(0)] [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] internal static class LudsThemeUI { [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(0)] private class GearButton : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler, IPointerClickHandler { [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(1)] private Image icon; private Color rest; private float hover; private bool over; private int seenVersion = -1; [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] public void Init(Image icon, Color rest) { //IL_0008: 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) this.icon = icon; this.rest = rest; } private void OnEnable() { hover = 0f; over = false; } private void Update() { //IL_0078: 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_008d: 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_00b4: Unknown result type (might be due to invalid IL or missing references) float num = (over ? 1f : 0f); if (hover != num || seenVersion != LudsTheme.Version) { seenVersion = LudsTheme.Version; hover = Mathf.MoveTowards(hover, num, Time.unscaledDeltaTime * 9f); float num2 = 1f - Mathf.Pow(1f - hover, 3f); ((Graphic)icon).color = Color.Lerp(rest.A(0.8f), LudsTheme.Accent, num2); ((Transform)((Graphic)icon).rectTransform).localScale = Vector3.one * (1f + 0.1f * num2); } } [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] public void OnPointerEnter(PointerEventData eventData) { over = true; } [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] public void OnPointerExit(PointerEventData eventData) { over = false; } [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] public void OnPointerClick(PointerEventData eventData) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if ((int)eventData.button == 0) { Toggle(); } } } [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(0)] private class ColorBinding : MonoBehaviour { private Graphic graphic; private Func<Color> color; public void Init(Graphic graphic, Func<Color> color) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) this.graphic = graphic; this.color = color; graphic.color = color(); } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) graphic.color = color(); } } [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(0)] private class TextBinding : MonoBehaviour { private TextMeshProUGUI text; private Func<string> value; public void Init(TextMeshProUGUI text, Func<string> value) { this.text = text; this.value = value; } private void Update() { string text = value(); if (((TMP_Text)this.text).text != text) { ((TMP_Text)this.text).text = text; } } } [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(0)] private class FieldFollower : MonoBehaviour { private TMP_InputField field; private Func<string> value; public void Init(TMP_InputField field, Func<string> value) { this.field = field; this.value = value; } private void Update() { if (!field.isFocused) { string text = value(); if (field.text != text) { field.SetTextWithoutNotify(text); } } } } [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(0)] private class Clickable : MonoBehaviour, IPointerClickHandler, IEventSystemHandler { [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(1)] private Action onClick; [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] public void Init(Action onClick) { this.onClick = onClick; } [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] public void OnPointerClick(PointerEventData eventData) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if ((int)eventData.button == 0) { onClick(); } } } [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(0)] private class PageFollower : MonoBehaviour { [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(1)] private readonly Vector3[] corners = (Vector3[])(object)new Vector3[4]; private void LateUpdate() { //IL_00a9: 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_00be: 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) RectTransform val = ((host != null && host.HostOpen()) ? host.Anchor() : null); if ((Object)(object)val == (Object)null || (Object)(object)pageRect == (Object)null) { Hide(); return; } host.ApplyLayout?.Invoke(); val.GetWorldCorners(corners); float num = Mathf.Exp(0.5f * Mathf.Log((float)Screen.width / 1920f) + 0.5f * Mathf.Log((float)Screen.height / 1080f)); ((Transform)pageRect).position = corners[0]; ((Transform)pageRect).localScale = Vector3.one * (((Transform)val).lossyScale.x / num); for (int i = 0; i < ((Transform)val).childCount; i++) { GameObject gameObject = ((Component)((Transform)val).GetChild(i)).gameObject; if (gameObject.activeSelf) { gameObject.SetActive(false); hidden.Add(gameObject); } } } } [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(0)] private class ColourWheel : MonoBehaviour, IPointerDownHandler, IEventSystemHandler, IDragHandler, IPointerUpHandler { private RectTransform wheel; private RectTransform marker; private int seenStamp = -1; public void Init(RectTransform wheel, RectTransform marker) { this.wheel = wheel; this.marker = marker; } private void Update() { //IL_00e3: 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_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012c: 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) int num = LudsTheme.Version * 2 + (editAccent ? 1 : 0); if (!picking && num != seenStamp && !string.Equals(HexFromState(), TargetHex, StringComparison.OrdinalIgnoreCase) && LudsTheme.TryHex(TargetHex, out var hex)) { float hue = default(float); float num2 = default(float); float num3 = default(float); Color.RGBToHSV(new Color((float)int.Parse(hex.Substring(0, 2), NumberStyles.HexNumber) / 255f, (float)int.Parse(hex.Substring(2, 2), NumberStyles.HexNumber) / 255f, (float)int.Parse(hex.Substring(4, 2), NumberStyles.HexNumber) / 255f), ref hue, ref num2, ref num3); if (num2 > 0.001f && num3 > 0.001f) { LudsThemeUI.hue = hue; } saturation = num2; brightness = num3; } if (!picking) { seenStamp = num; } Rect rect = wheel.rect; float num4 = ((Rect)(ref rect)).width * 0.5f; float num5 = LudsThemeUI.hue * 2f * (float)Math.PI; marker.anchoredPosition = new Vector2(Mathf.Cos(num5), Mathf.Sin(num5)) * saturation * num4; } private void Pick(PointerEventData eventData) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_0044: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); if (RectTransformUtility.ScreenPointToLocalPointInRectangle(wheel, eventData.position, eventData.pressEventCamera, ref val)) { Rect rect = wheel.rect; float num = ((Rect)(ref rect)).width * 0.5f; Vector2 val2 = val; rect = wheel.rect; val = val2 - ((Rect)(ref rect)).center; hue = Mathf.Repeat(Mathf.Atan2(val.y, val.x) / ((float)Math.PI * 2f), 1f); saturation = Mathf.Clamp01(((Vector2)(ref val)).magnitude / num); brightness = (editAccent ? 1f : 0.4f); CommitColour(); } } public void OnPointerDown(PointerEventData eventData) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if ((int)eventData.button == 0) { picking = true; Pick(eventData); } } public void OnDrag(PointerEventData eventData) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if ((int)eventData.button == 0) { Pick(eventData); } } public void OnPointerUp(PointerEventData eventData) { picking = false; LudsTheme.SaveNow(); } } [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(0)] private class ThemeSlider : MonoBehaviour, IPointerDownHandler, IEventSystemHandler, IDragHandler, IPointerUpHandler { private RectTransform track; private RectTransform fill; private RectTransform handle; private float min; private float max; private Func<float> get; private Action<float> set; private float startX; private float startValue; private float pixelsPerUnit; public void Init(RectTransform track, RectTransform fill, RectTransform handle, float min, float max, Func<float> get, Action<float> set) { this.track = track; this.fill = fill; this.handle = handle; this.min = min; this.max = max; this.get = get; this.set = set; } private void Update() { //IL_0029: 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_0059: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.InverseLerp(min, max, get()); fill.anchorMax = new Vector2(num, 1f); RectTransform obj = handle; Rect rect = track.rect; obj.anchoredPosition = new Vector2(10f + num * ((Rect)(ref rect)).width, 0f); } private void Begin(PointerEventData eventData) { //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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[4]; track.GetWorldCorners(array); float num = Mathf.Max(1f, RectTransformUtility.WorldToScreenPoint(eventData.pressEventCamera, array[3]).x - RectTransformUtility.WorldToScreenPoint(eventData.pressEventCamera, array[0]).x); pixelsPerUnit = num / (max - min); Vector2 val = default(Vector2); if (RectTransformUtility.ScreenPointToLocalPointInRectangle(track, eventData.position, eventData.pressEventCamera, ref val)) { Rect rect = track.rect; float xMin = ((Rect)(ref rect)).xMin; rect = track.rect; float num2 = Mathf.InverseLerp(xMin, ((Rect)(ref rect)).xMax, val.x); startValue = Mathf.Round(Mathf.Lerp(min, max, num2)); set(startValue); } else { startValue = get(); } startX = eventData.position.x; } private void Drag(PointerEventData eventData) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) set(Mathf.Clamp(Mathf.Round(startValue + (eventData.position.x - startX) / pixelsPerUnit), min, max)); } public void OnPointerDown(PointerEventData eventData) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if ((int)eventData.button == 0) { Begin(eventData); } } public void OnDrag(PointerEventData eventData) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if ((int)eventData.button == 0) { Drag(eventData); } } public void OnPointerUp(PointerEventData eventData) { LudsTheme.SaveNow(); } } public static bool Active; [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(2)] private static ThemeHost host; [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(2)] private static GameObject canvasObject; [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(2)] private static RectTransform pageRect; private static Vector2 builtSize; private static readonly List<TMP_InputField> fields = new List<TMP_InputField>(); private static readonly List<GameObject> hidden = new List<GameObject>(); [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(2)] private static Sprite gearSprite; [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(2)] private static Sprite wheelSprite; [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(2)] private static Sprite markerSprite; private static bool editAccent = true; private static float hue; private static float saturation; private static float brightness = 1f; private static bool picking; public static bool IsTyping { get { if (!Active) { return false; } foreach (TMP_InputField field in fields) { if ((Object)(object)field != (Object)null && field.isFocused) { return true; } } return false; } } private static string TargetHex { get { if (!editAccent) { return LudsTheme.PanelHex; } return LudsTheme.AccentHex; } } public static void Register(ThemeHost h) { host = h; } public static void Toggle() { if (Active) { Hide(); } else { Show(); } } public static void Show() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) RectTransform val = ((host != null) ? host.Anchor() : null); if (host == null || (Object)(object)val == (Object)null) { return; } Rect rect; if (!((Object)(object)canvasObject == (Object)null)) { Vector2 val2 = builtSize; rect = val.rect; if (!(val2 != ((Rect)(ref rect)).size)) { goto IL_0081; } } if ((Object)(object)canvasObject != (Object)null) { Object.Destroy((Object)(object)canvasObject); } ThemeHost h = host; rect = val.rect; BuildPage(h, ((Rect)(ref rect)).size); goto IL_0081; IL_0081: Active = true; LudsTheme.Hold = true; canvasObject.SetActive(true); } public static void Hide() { Active = false; LudsTheme.Hold = false; if ((Object)(object)canvasObject != (Object)null) { canvasObject.SetActive(false); } foreach (GameObject item in hidden) { if ((Object)(object)item != (Object)null) { item.SetActive(true); } } hidden.Clear(); foreach (TMP_InputField field in fields) { if ((Object)(object)field != (Object)null) { field.DeactivateInputField(false); } } } public static void AddGear(Transform panel, ThemeHost h) { //IL_0026: 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_0093: 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_00bd: 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_00ee: Unknown result type (might be due to invalid IL or missing references) Register(h); Image val = h.Image(panel, "SettingsButton", new Color(0f, 0f, 0f, 0f), arg4: true); Place(((Graphic)val).rectTransform, h.Width - 30f - 52f, 24f, 52f, 52f); Image val2 = h.Image(((Component)val).transform, "Icon", Color.white, arg4: false); val2.sprite = GearSprite(); val2.preserveAspect = true; ((Graphic)val2).rectTransform.anchorMin = Vector2.zero; ((Graphic)val2).rectTransform.anchorMax = Vector2.one; ((Graphic)val2).rectTransform.offsetMin = new Vector2(6f, 6f); ((Graphic)val2).rectTransform.offsetMax = new Vector2(-6f, -6f); ((Component)val).gameObject.AddComponent<GearButton>().Init(val2, h.Cream); } private static Sprite GearSprite() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)gearSprite != (Object)null) { return gearSprite; } Texture2D val = new Texture2D(64, 64, (TextureFormat)4, false) { filterMode = (FilterMode)1 }; Color[] array = (Color[])(object)new Color[4096]; for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { int num = 0; for (int k = 0; k < 9; k++) { float num2 = (float)j + ((float)(k % 3) + 0.5f) / 3f - 32f; float num3 = (float)i + ((float)(k / 3) + 0.5f) / 3f - 32f; float num4 = Mathf.Sqrt(num2 * num2 + num3 * num3); float num5 = Mathf.Atan2(num3, num2); float num6 = 21f + 7f * Mathf.Clamp01(Mathf.Cos(num5 * 8f) * 2.2f + 0.4f); if (num4 <= num6 && num4 >= 9f) { num++; } } array[i * 64 + j] = new Color(1f, 1f, 1f, (float)num / 9f); } } val.SetPixels(array); val.Apply(); gearSprite = Sprite.Create(val, new Rect(0f, 0f, 64f, 64f), new Vector2(0.5f, 0.5f), 100f); return gearSprite; } private static Sprite WheelSprite() { //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_002c: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_00db: 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) if ((Object)(object)wheelSprite != (Object)null) { return wheelSprite; } Texture2D val = new Texture2D(192, 192, (TextureFormat)4, false) { filterMode = (FilterMode)1 }; Color[] array = (Color[])(object)new Color[36864]; float num = 95f; for (int i = 0; i < 192; i++) { for (int j = 0; j < 192; j++) { float num2 = (float)j + 0.5f - 96f; float num3 = (float)i + 0.5f - 96f; float num4 = Mathf.Sqrt(num2 * num2 + num3 * num3); float num5 = Mathf.Atan2(num3, num2) / ((float)Math.PI * 2f); Color val2 = Color.HSVToRGB((num5 < 0f) ? (num5 + 1f) : num5, Mathf.Clamp01(num4 / num), 1f); val2.a = Mathf.Clamp01(num - num4 + 0.5f); array[i * 192 + j] = val2; } } val.SetPixels(array); val.Apply(); wheelSprite = Sprite.Create(val, new Rect(0f, 0f, 192f, 192f), new Vector2(0.5f, 0.5f), 100f); return wheelSprite; } private static Sprite MarkerSprite() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)markerSprite != (Object)null) { return markerSprite; } Texture2D val = new Texture2D(32, 32, (TextureFormat)4, false) { filterMode = (FilterMode)1 }; Color[] array = (Color[])(object)new Color[1024]; for (int i = 0; i < 32; i++) { for (int j = 0; j < 32; j++) { float num = Mathf.Sqrt(((float)j + 0.5f - 16f) * ((float)j + 0.5f - 16f) + ((float)i + 0.5f - 16f) * ((float)i + 0.5f - 16f)); float num2 = Mathf.Clamp01(Mathf.Min(num - 8.5f, 12.5f - num) + 0.5f); float num3 = Mathf.Clamp01(Mathf.Min(num - 7f, 14f - num) + 0.5f); array[i * 32 + j] = ((num2 > 0f) ? new Color(1f, 1f, 1f, num2) : new Color(0f, 0f, 0f, num3 * 0.8f)); } } val.SetPixels(array); val.Apply(); markerSprite = Sprite.Create(val, new Rect(0f, 0f, 32f, 32f), new Vector2(0.5f, 0.5f), 100f); return markerSprite; } private static void BuildPage(ThemeHost h, Vector2 size) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown //IL_0097: 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_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_0117: 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_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_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0177: 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_0454: Unknown result type (might be due to invalid IL or missing references) //IL_04ae: Unknown result type (might be due to invalid IL or missing references) fields.Clear(); builtSize = size; float x = size.x; canvasObject = new GameObject("Luds Theme UI " + h.Title, new Type[1] { typeof(RectTransform) }); Object.DontDestroyOnLoad((Object)(object)canvasObject); Canvas obj = canvasObject.AddComponent<Canvas>(); obj.renderMode = (RenderMode)0; obj.sortingOrder = 600; CanvasScaler obj2 = canvasObject.AddComponent<CanvasScaler>(); obj2.uiScaleMode = (ScaleMode)1; obj2.referenceResolution = new Vector2(1920f, 1080f); obj2.screenMatchMode = (ScreenMatchMode)0; obj2.matchWidthOrHeight = 0.5f; canvasObject.AddComponent<GraphicRaycaster>(); Image val = h.Image(canvasObject.transform, "Page", new Color(0f, 0f, 0f, 0f), arg4: true); pageRect = ((Graphic)val).rectTransform; RectTransform obj3 = pageRect; RectTransform obj4 = pageRect; Vector2 val2 = (pageRect.pivot = Vector2.zero); Vector2 anchorMin = (obj4.anchorMax = val2); obj3.anchorMin = anchorMin; pageRect.sizeDelta = size; ((Component)val).gameObject.AddComponent<PageFollower>(); TextMeshProUGUI obj5 = h.Text(((Component)val).transform, "Title", h.Title + " Settings", arg4: true, 48f, LudsTheme.Accent, (TextAlignmentOptions)514); ((TMP_Text)obj5).enableAutoSizing = true; ((TMP_Text)obj5).fontSizeMin = 24f; ((TMP_Text)obj5).fontSizeMax = 48f; Place(((TMP_Text)obj5).rectTransform, 40f, 16f, x - 80f, 64f); Bind((Graphic)(object)obj5, () => LudsTheme.Accent); Image obj6 = h.Image(((Component)val).transform, "Divider", LudsTheme.Divider, arg4: false); Place(((Graphic)obj6).rectTransform, 90f, 86f, x - 180f, 2f); Bind((Graphic)(object)obj6, () => LudsTheme.Divider); float num = 340f; float num2 = x - 40f - num; float num3 = 104f; PresetRow(h, ((Component)val).transform, x, num3, num2, num); num3 += 54f; ColourBlock(h, ((Component)val).transform, num3, x); num3 += 214f; SliderRow(h, ((Component)val).transform, x, "Opacity", num3, num2, num, 0f, 100f, () => LudsTheme.Opacity * 100f, delegate(float v) { LudsTheme.Mutate(delegate { LudsTheme.Opacity = v / 100f; }, save: false, rebuild: false); }, (float v) => Mathf.RoundToInt(v) + "%"); num3 += 50f; SliderRow(h, ((Component)val).transform, x, "Size", num3, num2, num, 60f, 140f, () => LudsTheme.Scale / 0.576f * 100f, delegate(float v) { LudsTheme.Mutate(delegate { LudsTheme.Scale = v / 100f * 0.576f; }, save: false, rebuild: false); }, (float v) => Mathf.RoundToInt(v) + "%"); num3 += 50f; MoveRow(h, ((Component)val).transform, x, num3, num2, num); num3 += 114f; if (Chainloader.PluginInfos.Values.Count([<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(0)] (PluginInfo p) => p.Metadata.Name.StartsWith("Luds")) >= 2) { Strip(h, ((Component)val).transform, x, num3, 56f); Place(((TMP_Text)h.Text(((Component)val).transform, "SyncLabel", "Sync look", arg4: false, 26f, h.Cream, (TextAlignmentOptions)4097)).rectTransform, 40f, num3 - 2f, num2 - 50f, 30f); Place(((TMP_Text)h.Text(((Component)val).transform, "SyncNote", "With other Luds mods", arg4: false, 18f, h.Dim, (TextAlignmentOptions)4097)).rectTransform, 40f, num3 + 24f, num2 - 50f, 24f); RectTransform obj7 = h.Button(((Component)val).transform, h.GetSync() ? "On" : "Off", delegate { h.SetSync(!h.GetSync()); }); Place(obj7, x - 40f - 150f, num3 + 2f, 150f, 44f); Follow(((Component)obj7).GetComponentInChildren<TextMeshProUGUI>(), () => (!h.GetSync()) ? "Off" : "On"); num3 += 56f; } num3 += 18f; Place(h.Button(((Component)val).transform, "Reset", LudsTheme.Reset), x * 0.5f - 208f, num3, 200f, 52f); Place(h.Button(((Component)val).transform, "Done", Hide), x * 0.5f + 8f, num3, 200f, 52f); } private static void MoveRow(ThemeHost h, Transform parent, float width, float y, float left, float controlWidth) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) Strip(h, parent, width, y, 108f); Place(((TMP_Text)h.Text(parent, "MoveLabel", "Menu position", arg4: false, 26f, h.Cream, (TextAlignmentOptions)4097)).rectTransform, 40f, y + 20f, left - 50f, 30f); Place(((TMP_Text)h.Text(parent, "MoveNote", "Snap to the screen", arg4: false, 18f, h.Dim, (TextAlignmentOptions)4097)).rectTransform, 40f, y + 48f, left - 50f, 24f); int num = ((!h.HorizontalPosition) ? 1 : 3); float num2 = (float)num * 50f + (float)(num - 1) * 8f; float num3 = left + controlWidth - num2; for (int i = 0; i < 3; i++) { for (int j = 0; j < num; j++) { int cx = (h.HorizontalPosition ? j : LudsTheme.Align); int cy = i; Image val = h.Image(parent, "Cell" + cx + cy, LudsTheme.Accent, arg4: true); Bind((Graphic)(object)val, () => (LudsTheme.Align != cx || LudsTheme.AlignY != cy) ? LudsTheme.Accent.A(0.22f) : LudsTheme.Accent); h.Border(((Component)val).transform, new Color(0f, 0f, 0f, 0.7f)); Place(((Graphic)val).rectTransform, num3 + (float)j * 58f, y + 3f + (float)i * 34f, 50f, 26f); ((Component)val).gameObject.AddComponent<Clickable>().Init(delegate { LudsTheme.Mutate(delegate { if (h.HorizontalPosition) { LudsTheme.Align = cx; } LudsTheme.AlignY = cy; }); }); } } } private static void PresetRow(ThemeHost h, Transform parent, float width, float y, float left, float controlWidth) { //IL_0066: Unknown result type (might be due to invalid IL or missing references) Label(h, parent, "Preset", y); Place(h.Button(parent, "-", delegate { LudsTheme.ApplyPreset(LudsTheme.PresetIndex() - 1); }), left, y, 60f, 44f); TextMeshProUGUI obj = h.Text(parent, "PresetValue", "", arg4: false, 26f, LudsTheme.Accent, (TextAlignmentOptions)514); Place(((TMP_Text)obj).rectTransform, left + 64f, y, controlWidth - 128f, 44f); Bind((Graphic)(object)obj, () => LudsTheme.Accent); Follow(obj, () => (LudsTheme.PresetIndex() >= 0) ? LudsTheme.PresetNames[LudsTheme.PresetIndex()] : "Custom"); Place(h.Button(parent, "+", delegate { LudsTheme.ApplyPreset(LudsTheme.PresetIndex() + 1); }), left + controlWidth - 60f, y, 60f, 44f); } private static void Strip(ThemeHost h, Transform parent, float width, float y, float height) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) Place(((Graphic)h.Image(parent, "Strip", new Color(0f, 0f, 0f, 0.35f), arg4: false)).rectTransform, 24f, y - 4f, width - 48f, height); } private static void Label(ThemeHost h, Transform parent, string text, float y) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) Strip(h, parent, builtSize.x, y, 48f); Place(((TMP_Text)h.Text(parent, text + "Label", text, arg4: false, 26f, h.Cream, (TextAlignmentOptions)4097)).rectTransform, 40f, y, 200f, 44f); } private static string HexFromState() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) return ColorUtility.ToHtmlStringRGB(Color.HSVToRGB(hue, saturation, brightness)); } private static void CommitColour() { if (!editAccent) { brightness = Mathf.Min(brightness, 0.4f); } string hex = HexFromState(); if (editAccent) { LudsTheme.Mutate(delegate { LudsTheme.AccentHex = hex; }, save: false, rebuild: false); } else { LudsTheme.Mutate(delegate { LudsTheme.PanelHex = hex; }, save: false, rebuild: false); } } private static void ColourBlock(ThemeHost h, Transform parent, float y, float width) { //IL_0026: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: 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_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) Place(((Graphic)h.Image(parent, "ColourStrip", new Color(0f, 0f, 0f, 0.35f), arg4: false)).rectTransform, 24f, y - 4f, width - 48f, 210f); Image val = h.Image(parent, "Wheel", Color.white, arg4: true); val.sprite = WheelSprite(); float num = width - 40f - 190f; Place(((Graphic)val).rectTransform, num, y + 2f, 190f, 190f); Image val2 = h.Image(((Component)val).transform, "Marker", Color.white, arg4: false); val2.sprite = MarkerSprite(); RectTransform rectTransform = ((Graphic)val2).rectTransform; RectTransform rectTransform2 = ((Graphic)val2).rectTransform; Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(0.5f, 0.5f); rectTransform2.anchorMax = val3; rectTransform.anchorMin = val3; ((Graphic)val2).rectTransform.sizeDelta = new Vector2(26f, 26f); ((Component)val).gameObject.AddComponent<ColourWheel>().Init(((Graphic)val).rectTransform, ((Graphic)val2).rectTransform); float num2 = 40f; float num3 = num - 24f - num2; float num4 = (num3 - 10f) / 2f; Tile(h, parent, "Accent", accentTile: true, num2, y + 44f, num4); Tile(h, parent, "Panel", accentTile: false, num2 + num4 + 10f, y + 44f, num4); Image val4 = h.Image(parent, "HexInput", new Color(0f, 0f, 0f, 0.6f), arg4: true); h.Border(((Component)val4).transform, new Color(0f, 0f, 0f, 0.85f)); Place(((Graphic)val4).rectTransform, num2, y + 106f, num3, 44f); TMP_InputField field = h.Input(val4, "RRGGBB"); field.characterLimit = 7; field.SetTextWithoutNotify("#" + TargetHex); ((UnityEvent<string>)(object)field.onEndEdit).AddListener((UnityAction<string>)([<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(0)] (string entered) => { if (LudsTheme.TryHex(entered, out var hex)) { if (editAccent) { LudsTheme.Mutate(delegate { LudsTheme.AccentHex = hex; }); } else { LudsTheme.Mutate(delegate { LudsTheme.PanelHex = hex; }); } } field.SetTextWithoutNotify("#" + TargetHex); })); fields.Add(field); ((Component)field).gameObject.AddComponent<FieldFollower>().Init(field, () => "#" + TargetHex); } private static void Tile(ThemeHost h, Transform parent, string name, bool accentTile, float x, float y, float width) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: 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_0107: 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_0122: 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_012a: Unknown result type (might be due to invalid IL or missing references) Func<Color> colour = () => (!accentTile) ? LudsTheme.PanelSolid : LudsTheme.Accent; Image val = h.Image(parent, name + "Tile", colour(), arg4: true); Bind((Graphic)(object)val, colour); Place(((Graphic)val).rectTransform, x, y, width, 46f); foreach (Image item in h.Border(((Component)val).transform, Color.white)) { Bind((Graphic)(object)item, () => (Color)((editAccent != accentTile) ? LudsTheme.Border : new Color(0.95f, 0.9f, 0.8f, 1f))); } TextMeshProUGUI val2 = h.Text(((Component)val).transform, "Label", name, arg4: false, 24f, Color.white, (TextAlignmentOptions)514); ((TMP_Text)val2).rectTransform.anchorMin = Vector2.zero; ((TMP_Text)val2).rectTransform.anchorMax = Vector2.one; RectTransform rectTransform = ((TMP_Text)val2).rectTransform; Vector2 offsetMin = (((TMP_Text)val2).rectTransform.offsetMax = Vector2.zero); rectTransform.offsetMin = offsetMin; Bind((Graphic)(object)val2, delegate { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_005d: 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) Color val3 = colour(); return (!(val3.r * 0.3f + val3.g * 0.59f + val3.b * 0.11f > 0.5f)) ? new Color(0.97f, 0.93f, 0.85f) : new Color(0.05f, 0.04f, 0.03f); }); ((Component)val).gameObject.AddComponent<Clickable>().Init(delegate { editAccent = accentTile; }); } private static void SliderRow(ThemeHost h, Transform parent, float width, string text, float y, float left, float controlWidth, float min, float max, Func<float> get, Action<float> set, Func<float, string> format) { Label(h, parent, text, y); Slider(h, parent, left, y, controlWidth - 90f, min, max, get, set, format, 86f); } private static void Slider(ThemeHost h, Transform parent, float x, float y, float trackWidth, float min, float max, Func<float> get, Action<float> set, Func<float, string> format, float valueWidth) { //IL_0036: 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_0097: 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_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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_0162: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019f: 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_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) Image val = h.Image(parent, "Slider", new Color(0f, 0f, 0f, 0f), arg4: true); Place(((Graphic)val).rectTransform, x, y, trackWidth, 44f); Image val2 = h.Image(((Component)val).transform, "Track", new Color(0f, 0f, 0f, 0.6f), arg4: false); ((Graphic)val2).rectTransform.anchorMin = new Vector2(0f, 0.5f); ((Graphic)val2).rectTransform.anchorMax = new Vector2(1f, 0.5f); ((Graphic)val2).rectTransform.offsetMin = new Vector2(10f, -5f); ((Graphic)val2).rectTransform.offsetMax = new Vector2(-10f, 5f); h.Border(((Component)val2).transform, new Color(0f, 0f, 0f, 0.85f)); Image val3 = h.Image(((Component)val2).transform, "Fill", LudsTheme.Accent, arg4: false); Bind((Graphic)(object)val3, () => LudsTheme.Accent.A(0.85f)); ((Graphic)val3).rectTransform.anchorMin = Vector2.zero; ((Graphic)val3).rectTransform.anchorMax = new Vector2(0f, 1f); Vector2 val4 = (((Graphic)val3).rectTransform.offsetMin = (((Graphic)val3).rectTransform.offsetMax = Vector2.zero)); Image val6 = h.Image(((Component)val).transform, "Handle", LudsTheme.Accent, arg4: false); Bind((Graphic)(object)val6, () => LudsTheme.Accent); RectTransform rectTransform = ((Graphic)val6).rectTransform; RectTransform rectTransform2 = ((Graphic)val6).rectTransform; ((Vector2)(ref val4))..ctor(0f, 0.5f); rectTransform2.anchorMax = val4; rectTransform.anchorMin = val4; ((Graphic)val6).rectTransform.sizeDelta = new Vector2(16f, 32f); h.Border(((Component)val6).transform, new Color(0f, 0f, 0f, 0.7f)); ((Component)val).gameObject.AddComponent<ThemeSlider>().Init(((Graphic)val2).rectTransform, ((Graphic)val3).rectTransform, ((Graphic)val6).rectTransform, min, max, get, set); TextMeshProUGUI obj = h.Text(parent, "SliderValue", "", arg4: false, 26f, LudsTheme.Accent, (TextAlignmentOptions)4100); Place(((TMP_Text)obj).rectTransform, x + trackWidth + 4f, y, valueWidth, 44f); Bind((Graphic)(object)obj, () => LudsTheme.Accent); Follow(obj, () => format(get())); } private static void Bind(Graphic graphic, Func<Color> color) { ((Component)graphic).gameObject.AddComponent<ColorBinding>().Init(graphic, color); } public static void Live(Graphic graphic, Func<Color> color) { Bind(graphic, color); } private static void Follow([<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(2)] TextMeshProUGUI text, Func<string> value) { if ((Object)(object)text != (Object)null) { ((Component)text).gameObject.AddComponent<TextBinding>().Init(text, value); } } private static void Place(RectTransform rt, float left, float top, float width, float height) { //IL_0014: 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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: 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_003a: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0f, 1f); rt.pivot = val; Vector2 anchorMin = (rt.anchorMax = val); rt.anchorMin = anchorMin; rt.anchoredPosition = new Vector2(left, 0f - top); rt.sizeDelta = new Vector2(width, height); } public static void StyleScrollbar(Scrollbar bar) { Image component = ((Component)bar).GetComponent<Image>(); if ((Object)(object)component != (Object)null) { component.sprite = null; component.type = (Type)0; Live((Graphic)(object)component, () => new Color(0f, 0f, 0f, 0.35f * LudsTheme.Opacity)); } Image val = (((Object)(object)bar.handleRect != (Object)null) ? ((Component)bar.handleRect).GetComponent<Image>() : null); if ((Object)(object)val != (Object)null) { val.sprite = null; val.type = (Type)0; Live((Graphic)(object)val, () => LudsTheme.Accent.A(0.85f)); } ((Selectable)bar).transition = (Transition)0; } } public static class Map { [HarmonyPatch(typeof(TeleportWorldTrigger), "OnTriggerEnter")] private class OpenMapOnPortalEnter { [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] private static bool Prefix(TeleportWorldTrigger __instance, Collider colliderIn) { //IL_0095: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((Component)colliderIn).GetComponent<Player>() != (Object)(object)Player.m_localPlayer) { return false; } if (TargetPortal.limitToVanillaPortals.Value == TargetPortal.Toggle.On) { string prefabName = Utils.GetPrefabName(((Component)((Component)__instance).transform.parent).gameObject); if (!(prefabName == "portal_wood") && !(prefabName == "portal_stone")) { return true; } } if (PortalMenu.IsOpen || Teleporting) { return false; } PortalAllowsAllItems = __instance.m_teleportWorld.m_allowAllItems; PortalMenu.SourceWorld = __instance.m_teleportWorld; if (InventoryGui.IsVisible()) { InventoryGui.instance.Hide(); } PortalMenu.Open(((Component)__instance).transform.position); return false; } } private delegate bool GetPortal(out PinData closestPin, out ZDO portalZDO); [HarmonyPatch(typeof(Minimap), "SetMapMode")] public class LeavePortalModeOnMapClose { private static void Postfix(MapMode mode) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 if ((int)mode != 2) { CancelTeleport(); } } } [HarmonyPatch(typeof(Minimap), "Start")] public class AddMinimapPortalIcon { public static int pinType; [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] private static void Postfix(Minimap __instance) { //IL_003a: 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_0058: Unknown result type (might be due to invalid IL or missing references) pinType = __instance.m_visibleIconTypes.Length; bool[] array = new bool[pinType + 1]; Array.Copy(__instance.m_visibleIconTypes, array, pinType); __instance.m_visibleIconTypes = array; __instance.m_icons.Add(new SpriteData { m_name = (PinType)pinType, m_icon = TargetPortal.portalIcon }); } } [HarmonyPatch(typeof(Minimap), "OnMapLeftClick")] private class MapLeftClick { private static bool Prefix() { if (!Teleporting) { return true; } if (PortalMenu.OverBackButton) { return false; } return HandlePortalClick(GetClosestPortal); } } [HarmonyPatch(typeof(Minimap), "RemovePinUnderPointer")] private class MapRightClick { private static void Prefix() { if (GetClosestPortal(out var _, out var portalZDO)) { ToggleFavoritePortal(portalZDO); } } } [HarmonyPatch] private class MapAlternativeClick { [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] private static IEnumerable<MethodInfo> TargetMethods() { return new MethodInfo[3] { AccessTools.DeclaredMethod(typeof(Minimap), "OnMapDblClick", (Type[])null, (Type[])null), AccessTools.DeclaredMethod(typeof(Minimap), "RemovePinUnderPointer", (Type[])null, (Type[])null), AccessTools.DeclaredMethod(typeof(Minimap), "OnMapMiddleClick", (Type[])null, (Type[])null) }; } private static bool Prefix() { return !Teleporting; } } [HarmonyPatch(typeof(Minimap), "Start")] private static class RefereshPortalPins { [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] private static void Postfix(Minimap __instance) { ((MonoBehaviour)__instance).StartCoroutine(Update()); [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] static IEnumerator Update() { yield return null; while (true) { if (shouldPortalsBeVisible && !Teleporting) { AddPortalPins(); } yield return (object)new WaitForSeconds(1f); } } } } [HarmonyPatch(typeof(Minimap), "Awake")] private static class AddFavoritePins { [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] private static void Postfix(Minimap __instance) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_003a: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("TargetPortal Favorites"); val.transform.parent = __instance.m_largeRoot.transform; favoriteList = val; RectTransform obj = favoriteList.AddComponent<RectTransform>(); obj.anchorMin = new Vector2(0f, 0.5f); obj.anchorMax = new Vector2(0f, 0.5f); obj.anchoredPosition = new Vector2(15f, 0f); obj.sizeDelta = new Vector2(200f, 500f); obj.pivot = new Vector2(0f, 0.5f); ((HorizontalOrVerticalLayoutGroup)favoriteList.AddComponent<VerticalLayoutGroup>()).childForceExpandHeight = false; } } private class FavoriteClicked : MonoBehaviour, IPointerClickHandler, IEventSystemHandler { [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(1)] public PinData Pin; [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] public void OnPointerClick(PointerEventData pointerEventData) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Invalid comparison between Unknown and I4 ZDO value; if ((int)pointerEventData.button == 0) { HandlePortalClick([<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(2)] (out PinData pin, out ZDO zdo) => { pin = Pin; return activePins.TryGetValue(pin, out zdo); }); } else if ((int)pointerEventData.button == 1 && activePins.TryGetValue(Pin, out value)) { ToggleFavoritePortal(value); } } } [HarmonyPatch(typeof(Minimap), "Update")] private static class TogglePortalIcons { [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] private static void Prefix(Minimap __instance) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Invalid comparison between Unknown and I4 //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 //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) if ((TargetPortal.allowIconToggleWithoutMap.Value == TargetPortal.Toggle.On) ? ((int)Minimap.instance.m_mode > 0) : ((int)Minimap.instance.m_mode == 2)) { KeyboardShortcut value = TargetPortal.mapPortalIconKey.Value; if (((KeyboardShortcut)(ref value)).IsDown() && ((Component)Player.m_localPlayer).GetComponent<PlayerController>().TakeInput(false)) { if (!Teleporting) { if (shouldPortalsBeVisible) { RemovePortalPins(); } else { AddPortalPins(); } } shouldPortalsBeVisible = !shouldPortalsBeVisible; } } if (Teleporting && TargetPortal.showPlayersDuringPortal.Value == TargetPortal.Toggle.On) { __instance.UpdatePlayerPins(Time.deltaTime); } } } public static bool Teleporting; private static bool PortalAllowsAllItems; [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(1)] private static readonly Dictionary<PinData, ZDO> activePins = new Dictionary<PinData, ZDO>(); private static bool shouldPortalsBeVisible = false; [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(2)] private static bool[] visibleIconTypes; [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(1)] private static GameObject favoriteList = null; public static void OpenMapFromMenu(Vector3 portalPosition) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) bool noMap = Game.m_noMap; Game.m_noMap = false; Teleporting = true; Minimap.instance.ShowPointOnMap(portalPosition); Game.m_noMap = noMap; if (!shouldPortalsBeVisible) { AddPortalPins(); } if (TargetPortal.hidePinsDuringPortal.Value == TargetPortal.Toggle.On && visibleIconTypes == null) { visibleIconTypes = new bool[Minimap.instance.m_visibleIconTypes.Length]; Array.Copy(Minimap.instance.m_visibleIconTypes, visibleIconTypes, Minimap.instance.m_visibleIconTypes.Length); ToggleIconFilters(force: true); } } [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] private unsafe static bool IsPortalAccessible(ZDO zdo) { //IL_00a6: Unknown result type (might be due to invalid IL or missing references) TargetPortal.PortalMode portalMode = (TargetPortal.PortalMode)zdo.GetInt("TargetPortal PortalMode", 0); string ownerString = zdo.GetString("TargetPortal PortalOwnerId", ""); string text = ((object)Unsafe.As<PlatformUserID, PlatformUserID>(ref UserInfo.GetLocalUser().UserId)/*cast due to .constrained prefix*/).ToString(); if (TargetPortal.allowNonPublicPortals.Value != TargetPortal.Toggle.Off && portalMode != TargetPortal.PortalMode.Public && (portalMode != TargetPortal.PortalMode.Admin || !TargetPortal.configSync.IsAdmin) && !(ownerString == text.Replace("Steam_", "")) && (portalMode != TargetPortal.PortalMode.Group || !Groups.API.GroupPlayers().Contains(Groups.PlayerReference.fromPlayerInfo(((IEnumerable<PlayerInfo>)ZNet.instance.m_players).FirstOrDefault((Func<PlayerInfo, bool>)((PlayerInfo p) => ((object)(*(PlatformUserID*)(&p.m_userInfo.m_id))/*cast due to .constrained prefix*/).ToString().Replace("Steam_", "") == ownerString)))))) { if (portalMode == TargetPortal.PortalMode.Guild) { Guild ownGuild = Guilds.API.GetOwnGuild(); if (ownGuild != null) { return ownGuild.Members.ContainsKey(new Guilds.PlayerReference { id = ((!Enumerable.Contains(ownerString, '_')) ? ("Steam_" + ownerString) : ownerString), name = zdo.GetString("TargetPortal PortalOwnerName", "") }); } } return false; } return true; } [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] public static List<ZDO> GetAccessiblePortals() { return TargetPortal.knownPortals.Where(IsPortalAccessible).ToList(); } [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] public static bool IsFavorite(ZDO zdo) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (Player.m_localPlayer.m_customData.TryGetValue("TargetPortal Favorites", out var value)) { return value.Split(new char[1] { '|' }).Contains<string>(((object)zdo.GetPosition()/*cast due to .constrained prefix*/).ToString()); } return false; } [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] public static void ToggleFavorite(ZDO zdo) { ToggleFavoritePortal(zdo); } [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] public static void RenamePortal(ZDO zdo, string text) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) text = text.Trim(); if (text.Length > TargetPortal.portalNameLength.Value) { text = text.Substring(0, TargetPortal.portalNameLength.Value); } if (!(text == zdo.GetString("tag", ""))) { zdo.SetOwner(ZDOMan.GetSessionID()); zdo.Set(ZDOVars.s_tag, text); ZDOMan.instance.ForceSendZDO(zdo.m_uid); } } [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] public static bool TeleportToPortal(ZDO portalZDO) { if (TargetPortal.ignoreItemsTeleport.Value != TargetPortal.IgnoreItems.Always && (TargetPortal.ignoreItemsTeleport.Value == TargetPortal.IgnoreItems.Never || !PortalAllowsAllItems) && !((Humanoid)Player.m_localPlayer).IsTeleportable(false)) { ((Character)Player.m_localPlayer).Message((MessageType)2, "$msg_noteleport", 0, (Sprite)null, false); return false; } StartTeleport(portalZDO); return true; } [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] private static void StartTeleport(ZDO destination) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) LastUsedPortals.Record(PortalMenu.EntryPosition, destination); Player localPlayer = Player.m_localPlayer; TeleportWorld sourceWorld = PortalMenu.SourceWorld; if ((Object)(object)sourceWorld != (Object)null && (Object)(object)sourceWorld.m_nview != (Object)null && sourceWorld.m_nview.IsValid() && sourceWorld.m_nview.GetZDO() != null) { sourceWorld.m_nview.GetZDO().SetConnection((ConnectionType)1, destination.m_uid); if (((Humanoid)localPlayer).IsTeleportable(sourceWorld.m_allowAllItems) && sourceWorld.TargetFound()) { sourceWorld.Teleport(localPlayer); if (((Character)localPlayer).IsTeleporting()) { return; } } } Quaternion rotation = destination.GetRotation(); ((Character)localPlayer).TeleportTo(destination.GetPosition() + rotation * Vector3.forward + Vector3.up, rotation, true); } private static void ToggleIconFilters(bool force = false) { if (visibleIconTypes == null) { return; } HashSet<Sprite> locationSprites = new HashSet<Sprite>(Minimap.instance.m_locationIcons.Select((LocationSpriteData l) => l.m_icon)); HashSet<int> hashSet = new HashSet<int>(from p in Minimap.instance.m_pins where locationSprites.Contains(p.m_icon) select (int)p.m_type) { AddMinimapPortalIcon.pinType }; if (TargetPortal.showPlayersDuringPortal.Value == TargetPortal.Toggle.On) { hashSet.Add(10); } for (int num = 0; num < visibleIconTypes.Length; num++) { if (!hashSet.Contains(num) && visibleIconTypes[num] && (!Minimap.instance.m_visibleIconTypes[num] || force)) { Minimap.instance.ToggleIconFilter((PinType)num); } } } public static void CancelTeleport() { Teleporting = false; PortalMenu.ReleasePause(); if (!shouldPortalsBeVisible) { RemovePortalPins(); } if (TargetPortal.hidePinsDuringPortal.Value == TargetPortal.Toggle.On) { ToggleIconFilters(); visibleIconTypes = null; } } [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] private static bool HandlePortalClick(GetPortal getPortal) { if (!Teleporting) { return true; } if (TargetPortal.ignoreItemsTeleport.Value != TargetPortal.IgnoreItems.Always && (TargetPortal.ignoreItemsTeleport.Value == TargetPortal.IgnoreItems.Never || !PortalAllowsAllItems) && !((Humanoid)Player.m_localPlayer).IsTeleportable(false)) { ((Character)Player.m_localPlayer).Message((MessageType)2, "$msg_noteleport", 0, (Sprite)null, false); return false; } if (!getPortal(out var _, out var portalZDO)) { return false; } Minimap.instance.SetMapMode((MapMode)1); CancelTeleport(); StartTeleport(portalZDO); return false; } [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(2)] private static bool GetClosestPortal(out PinData closestPin, out ZDO portalZDO) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) foreach (PinData key in activePins.Keys) { key.m_save = true; } Minimap instance = Minimap.instance; closestPin = instance.GetClosestPin(instance.ScreenToWorldPoint(Input.mousePosition), instance.m_removeRadius * (instance.m_largeZoom * 2f), true); foreach (PinData key2 in activePins.Keys) { key2.m_save = false; } if (closestPin == null) { portalZDO = null; return false; } return activePins.TryGetValue(closestPin, out portalZDO); } [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] private static void ToggleFavoritePortal(ZDO portalZDO) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) string text = ((object)portalZDO.GetPosition()/*cast due to .constrained prefix*/).ToString(); if (Player.m_localPlayer.m_customData.TryGetValue("TargetPortal Favorites", out var value)) { List<string> list = value.Split(new char[1] { '|' }).ToList(); if (!list.Remove(text)) { list.Add(text); } Player.m_localPlayer.m_customData["TargetPortal Favorites"] = string.Join("|", list); } else { Player.m_localPlayer.m_customData.Add("TargetPortal Favorites", text); } FillFavorites(); } private static void ClearFavorites() { for (int i = 0; i < favoriteList.transform.childCount; i++) { Object.Destroy((Object)(object)((Component)favoriteList.transform.GetChild(i)).gameObject); } } private static void FillFavorites() { ClearFavorites(); } private unsafe static void AddPortalPins() { //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: 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_010a: Unknown result type (might be due to invalid IL or missing references) bool flag = false; HashSet<Vector3> existingPins = new HashSet<Vector3>(activePins.Keys.Select((PinData p) => p.m_pos)); string text = ((object)Unsafe.As<PlatformUserID, PlatformUserID>(ref UserInfo.GetLocalUser().UserId)/*cast due to .constrained prefix*/).ToString(); foreach (ZDO knownPortal in TargetPortal.knownPortals) { TargetPortal.PortalMode portalMode = (TargetPortal.PortalMode)knownPortal.GetInt("TargetPortal PortalMode", 0); string ownerString = knownPortal.GetString("TargetPortal PortalOwnerId", ""); if (TargetPortal.allowNonPublicPortals.Value != TargetPortal.Toggle.Off && portalMode != TargetPortal.PortalMode.Public && (portalMode != TargetPortal.PortalMode.Admin || !TargetPortal.configSync.IsAdmin) && !(ownerString == text.Replace("Steam_", "")) && (portalMode != TargetPortal.PortalMode.Group || !Groups.API.GroupPlayers().Contains(Groups.PlayerReference.fromPlayerInfo(((IEnumerable<PlayerInfo>)ZNet.instance.m_players).FirstOrDefault((Func<PlayerInfo, bool>)((PlayerInfo p) => ((object)(*(PlatformUserID*)(&p.m_userInfo.m_id))/*cast due to .constrained prefix*/).ToString().Replace("Steam_", "") == ownerString)))))) { if (portalMode != TargetPortal.PortalMode.Guild) { continue; } Guild ownGuild = Guilds.API.GetOwnGuild(); if (ownGuild == null || !ownGuild.Members.ContainsKey(new Guilds.PlayerReference { id = ((!Enumerable.Contains(ownerString, '_')) ? ("Steam_" + ownerString) : ownerString), name = knownPortal.GetString("TargetPortal PortalOwnerName", "") })) { continue; } } if (existingPins.Contains(knownPortal.m_position)) { existingPins.Remove(knownPortal.m_position); continue; } activePins.Add(Minimap.instance.AddPin(knownPortal.m_position, (PinType)AddMinimapPortalIcon.pinType, knownPortal.GetString("tag", ""), false, false, 0L, default(PlatformUserID)), knownPortal); flag = true; } foreach (PinData item in activePins.Keys.Where((PinData p) => existingPins.Contains(p.m_pos)).ToList()) { Minimap.instance.RemovePin(item); activePins.Remove(item); flag = true; } if (flag) { FillFavorites(); } } private static void RemovePortalPins() { foreach (PinData key in activePins.Keys) { Minimap.instance.RemovePin(key); } activePins.Clear(); ClearFavorites(); } } [<209a9d03-c1c6-42ae-bb18-be2d982e8981>NullableContext(1)] [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(0)] public class PortalMenu : MonoBehaviour { [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(0)] private class ButtonView : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler, IPointerDownHandler, IPointerUpHandler, IPointerClickHandler { private RectTransform visual; private Image fill; private List<Image> borders; private TextMeshProUGUI label; private Action onClick; private float hover; private float press; private bool over; private bool down; public void Init(RectTransform visual, Image fill, List<Image> borders, TextMeshProUGUI label, Action onClick) { this.visual = visual; this.fill = fill; this.borders = borders; this.label = label; this.onClick = onClick; } private void OnEnable() { hover = (press = 0f); over = (down = false); } private void Update() { //IL_0070: 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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) float unscaledDeltaTime = Time.unscaledDeltaTime; hover = Mathf.MoveTowards(hover, over ? 1f : 0f, unscaledDeltaTime * 9f); press = Mathf.MoveTowards(press, down ? 1f : 0f, unscaledDeltaTime * 14f); float num = Ease(hover); ((Graphic)fill).color = Color.Lerp(LudsTheme.ButtonFill, LudsTheme.ButtonHover, num); Color color = Color.Lerp(LudsTheme.Border, LudsTheme.Accent, num); foreach (Image border in borders) { ((Graphic)border).color = color; } ((Graphic)label).color = Color.Lerp(Cream, Gold, num); ((Transform)visual).localScale = Vector3.one * (1f + 0.05f * num - 0.06f * press); } public void OnPointerEnter(PointerEventData eventData) { over = true; } public void OnPointerExit(PointerEventData eventData) { over = (down = false); } public void OnPointerDown(PointerEventData eventData) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 down = (int)eventData.button == 0; } public void OnPointerUp(PointerEventData eventData) { down = false; } public void OnPointerClick(PointerEventData eventData) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if ((int)eventData.button == 0) { onClick(); } } } [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(0)] private class RowView : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler, IPointerClickHandler { private ZDO zdo; private bool here; private Image bg; private Image highlight; private Image accent; private float hover; private bool over; private RectTransform nameRect; private TextMeshProUGUI nameText; private TextMeshProUGUI distanceText; private Image star; private StarClick starClick; private PencilButton pencil; [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(2)] private Image renameBg; [<dbb9d2de-775e-4a96-9873-3e5066032ce0>Nullable(2)] private TMP_InputField renameInput; private bool renaming; public int Index; public bool Focused; private float created = Time.unscaledTime; public Image StarImage => star; public ZDO Zdo => zdo; public bool Here => here; public void Configure(ZDO zdo, bool favorite, bool here) { //IL_000b: 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_0030: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: 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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0143: 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_0181: Unknown result type (might be due to invalid IL or missing references) ((Transform)((Graphic)star).rectTransform).localScale = Vector3.one; ((Transform)((Graphic)star).rectTransform).localEulerAngles = Vector3.zero; ((Graphic)star).color = Color.white; renaming = false; ((Component)nameText).gameObject.SetActive(true); Image obj = renameBg; if (obj != null) { ((Component)obj).gameObject.SetActive(false); } pencil.SetRowHover(0f); this.zdo = zdo; Focused = false; this.here = here; created = Time.unscaledTime; over = false; hover = 0f; ((Graphic)highlight).color = LudsTheme.Accent.A(0f); ((Graphic)accent).color = LudsTheme.Accent.A(0f); ((TMP_Text)nameText).text = PortalName(zdo); ((Graphic)nameText).color = (here ? Dim : Cream); ((Graphic)distanceText).color = (Color)(here ? Dim : new Color(0.88f, 0.82f, 0.7f)); nameRect.offsetMin = new Vector2(62f, 0f); star.sprite = (favorite ? starSprite : starEmptySprite); starClick.Zdo = zdo; UpdateDistance(((Object)(object)Player.m_localPlayer != (Object)null) ? ((Component)Player.m_localPlayer).transform.position : Vector3.zero); } public static RowView Create(Transform parent) { //IL_0007: 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_0077: 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_00c2: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_018a: 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_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0289: 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_02f5: Unknown result type (might be due to invalid IL or missing references) Image val = MakeImage(parent, "Row", null, LudsTheme.Row, raycast: true); LudsThemeUI.Live((Graphic)(object)val, () => LudsTheme.Row); ((Component)val).gameObject.AddComponent<LayoutElement>().preferredHeight = 52f; RowView rowView = ((Component)val).gameObject.AddComponent<RowView>(); rowView.bg = val; rowView.highlight = MakeImage(((Component)val).transform, "Highlight", null, LudsTheme.Accent.A(0f)); Stretch(((Graphic)rowView.highlight).rectTransform, 0f, 0f, 0f, 0f); rowView.accent = MakeImage(((Component)val).transform, "Accent", null, LudsTheme.Accent.A(0f)); ((Graphic)rowView.accent).rectTransform.anchorMin = Vector2.zero; ((Graphic)rowView.accent).rectTransform.anchorMax = new Vector2(0f, 1f); ((Graphic)rowView.accent).rectTransform.pivot = new Vector2(0f, 0.5f); ((Graphic)rowView.accent).rectTransform.sizeDelta = new Vector2(4f, 0f); Image val2 = (rowView.star = MakeImage(((Component)val).transform, "Star", starEmptySprite, Color.white, raycast: true)); RectTransform rectTransform = ((Graphic)val2).rectTransform; RectTransform rectTransform2 = ((Graphic)val2).rectTransform; RectTransform rectTransform3 = ((Graphic)val2).rectTransform; Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(0f, 0.5f); rectTransform3.pivot = val3; Vector2 anchorMin = (rectTransform2.anchorMax = val3); rectTransform.anchorMin = anchorMin; ((Graphic)val2).rectTransform.anchoredPosition = new Vector2(13f, 0f); ((Graphic)val2).rectTransform.sizeDelta = new Vector2(33f, 33f); rowView.starClick = ((Component)val2).gameObject.AddComponent<StarClick>(); rowView.starClick.Row = rowView; rowView.pencil = PencilButton.Create(((Component)val).transform, rowView); rowView.nameText = MakeText(((Component)val).transform, "Name", "", heading: false, 28f, Cream, (TextAlignmentOptions)4097); Stretch(((TMP_Text)rowView.nameText).rectTransform, 62f, 0f, 262f, 0f); rowView.nameRect = ((TMP_Text)rowView.nameText).rectTransform; rowView.distanceText = MakeText(((Component)val).transform, "Distance", "", heading: false, 26f, new Color(0.88f, 0.82f, 0.7f), (TextAlignmentOptions)4100); Stretch(((TMP_Text)rowView.distanceText).rectTransform, 0f, 0f, 14f, 0f); ((TMP_Text)rowView.distanceText).rectTransform.anchorMin = new Vector2(1f, 0f); ((TMP_Text)rowView.distanceText).rectTransform.offsetMin = new Vector2(-190f, 0f); return rowView; } public void UpdateDistance(Vector3 playerPos) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) ((TMP_Text)distanceText).text = (here ? "You are here" : FormatDistance(Vector3.Distance(zdo.GetPosition(), playerPos))); } private void Update() { //IL_006f: 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_008b: 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_00b0: 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_00b5: 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_00da: 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_00e5: 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) float num = (((over || Focused) && !here) ? 1f : 0f); if (!Mathf.Approximately(hover, num)) { hover = Mathf.MoveTowards(hover, num, Time.unscaledDeltaTime * 8f); float num2 = Ease(hover); pencil.SetRowHover(num2); ((Graphic)highlight).color = LudsTheme.Accent.A(0.2f * num2); ((Graphic)accent).color = LudsTheme.Accent.A(num2); ((Graphic)nameText).color = Color.Lerp(here ? Dim : Cream, Color.white, num2); ((Graphic)distanceText).color = Color.Lerp(new Color(0.88f, 0.82f, 0.7f), Gold, num2); nameRect.offsetMin = new Vector2(62f + 8f * num2, 0f); } } public void OnPointerEnter(PointerEventData eventData) { //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) int num; if (!(Time.unscaledTime - created > 0.25f)) { Vector2 delta = eventData.delta; num = ((((Vector2)(ref delta)).sqrMagnitude > 0f) ? 1 : 0); } else { num = 1; } over = (byte)num != 0; if (over && !here) { SetFocus(Index, scroll: false); } } public void OnPointerExit(PointerEventData eventData) { over = false; } public void Activate() { if (!here && (Object)(object)renamingRow == (Object)null && Map.TeleportToPortal(zdo)) { Close(); } } public void BeginRename() { if ((Object)(object)renamingRow != (Object)null && (Object)(object)renamingRow != (Object)(object)this) { renamingRow.EndRename(commit: true); } EnsureRenameInput(); renamingRow = this; renaming = true; ((Componen