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 SkillsPreview v0.4.2
SkillsPreview.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using SkillsPreview.App.Data; using SkillsPreview.App.Locale; using SkillsPreview.App.Logging; using SkillsPreview.App.Store; using SkillsPreview.App.UI.CharacterStatsPanel; using SkillsPreview.App.UI.FavoriteSkillsHud; using SkillsPreview.App.UI.SettingsPanel; using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyCompany("SkillsPreview")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("0.4.2.0")] [assembly: AssemblyInformationalVersion("0.4.2+466677ba6673f25673ffe840bd8f1f08b9218e36")] [assembly: AssemblyProduct("SkillsPreview")] [assembly: AssemblyTitle("SkillsPreview")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.4.2.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace SkillsPreview.App { [BepInPlugin("godzki.skills_preview", "Skills Preview", "0.4.2")] public class Plugin : BaseUnityPlugin { internal static Plugin Instance; internal static ManualLogSource Log; private readonly Harmony _harmony = new Harmony("godzki.skills_preview"); internal static void SaveConfig() { ((BaseUnityPlugin)Instance).Config.Save(); FavoriteSkillsStore.NotifyConfigChanged(); } private void Awake() { Instance = this; Log = ((BaseUnityPlugin)this).Logger; Config.Bind((BaseUnityPlugin)(object)this); _harmony.PatchAll(); Log.LogInfo((object)"Skills Preview 0.4.2 loaded."); } private void OnDestroy() { _harmony.UnpatchSelf(); } } } namespace SkillsPreview.App.UI { internal static class SpriteUtils { internal static Sprite RoundedRect(int radius) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) int num = radius * 2 + 2; Texture2D val = new Texture2D(num, num, (TextureFormat)5, false); ((Texture)val).filterMode = (FilterMode)1; ((Texture)val).wrapMode = (TextureWrapMode)1; Color32[] array = (Color32[])(object)new Color32[num * num]; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { array[i * num + j] = SampleRoundedRectPixel(j, i, num, num, radius); } } val.SetPixels32(array); val.Apply(false); Vector4 val2 = default(Vector4); ((Vector4)(ref val2))..ctor((float)radius, (float)radius, (float)radius, (float)radius); return Sprite.Create(val, new Rect(0f, 0f, (float)num, (float)num), new Vector2(0.5f, 0.5f), 100f, 0u, (SpriteMeshType)0, val2); } internal static Sprite ResetIcon(int size = 24) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016f: 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_017c: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(size, size, (TextureFormat)5, false); ((Texture)val).filterMode = (FilterMode)1; ((Texture)val).wrapMode = (TextureWrapMode)1; Color32[] array = (Color32[])(object)new Color32[size * size]; for (int i = 0; i < array.Length; i++) { array[i] = new Color32((byte)0, (byte)0, (byte)0, (byte)0); } Color32 val2 = default(Color32); ((Color32)(ref val2))..ctor((byte)160, (byte)115, (byte)55, byte.MaxValue); float num = (float)(size - 1) * 0.5f; float num2 = (float)(size - 1) * 0.5f; float num3 = (float)size * 0.44f; float num4 = (float)size * 0.27f; float num5 = (num3 + num4) * 0.5f; float num6 = (num3 - num4) * 0.5f; for (int j = 0; j < size; j++) { for (int k = 0; k < size; k++) { float num7 = (float)k - num; float num8 = (float)j - num2; float num9 = Mathf.Sqrt(num7 * num7 + num8 * num8); if (!(num9 < num4 - 1f) && !(num9 > num3 + 1f)) { float num10 = Mathf.Atan2(num8, num7) * 57.29578f; if (num10 < 0f) { num10 += 360f; } if (!(num10 >= 60f) || !(num10 <= 105f)) { float num11 = Mathf.Min(num9 - num4, num3 - num9); byte b = (byte)((num11 >= 1f) ? byte.MaxValue : ((num11 > 0f) ? ((byte)(255f * num11)) : 0)); array[j * size + k] = new Color32(val2.r, val2.g, val2.b, b); } } } } float num12 = (float)Math.PI / 3f; float num13 = num + num5 * Mathf.Cos(num12); float num14 = num2 + num5 * Mathf.Sin(num12); float num15 = Mathf.Sin(num12); float num16 = 0f - Mathf.Cos(num12); float num17 = Mathf.Cos(num12); float num18 = Mathf.Sin(num12); float num19 = num6 * 2.8f; float num20 = num6 * 1.5f; Vector2 a = default(Vector2); ((Vector2)(ref a))..ctor(num13 + num15 * num19, num14 + num16 * num19); Vector2 b2 = default(Vector2); ((Vector2)(ref b2))..ctor(num13 + num17 * num20, num14 + num18 * num20); Vector2 c = default(Vector2); ((Vector2)(ref c))..ctor(num13 - num17 * num20, num14 - num18 * num20); FillTriangle(array, size, a, b2, c, val2); val.SetPixels32(array); val.Apply(false); return Sprite.Create(val, new Rect(0f, 0f, (float)size, (float)size), new Vector2(0.5f, 0.5f), 100f); } private static void FillTriangle(Color32[] pixels, int size, Vector2 a, Vector2 b, Vector2 c, Color32 color) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_0032: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_008b: 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) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_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_00cd: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.Max(0, Mathf.FloorToInt(Mathf.Min(a.x, Mathf.Min(b.x, c.x)))); int num2 = Mathf.Min(size - 1, Mathf.CeilToInt(Mathf.Max(a.x, Mathf.Max(b.x, c.x)))); int num3 = Mathf.Max(0, Mathf.FloorToInt(Mathf.Min(a.y, Mathf.Min(b.y, c.y)))); int num4 = Mathf.Min(size - 1, Mathf.CeilToInt(Mathf.Max(a.y, Mathf.Max(b.y, c.y)))); for (int i = num3; i <= num4; i++) { for (int j = num; j <= num2; j++) { if (PointInTriangle(new Vector2((float)j, (float)i), a, b, c)) { pixels[i * size + j] = color; } } } } private static bool PointInTriangle(Vector2 p, Vector2 a, Vector2 b, Vector2 c) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) float num = Cross(p - a, b - a); float num2 = Cross(p - b, c - b); float num3 = Cross(p - c, a - c); if (!(num >= 0f) || !(num2 >= 0f) || !(num3 >= 0f)) { if (num <= 0f && num2 <= 0f) { return num3 <= 0f; } return false; } return true; } private static float Cross(Vector2 v1, Vector2 v2) { //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_000d: 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 v1.x * v2.y - v1.y * v2.x; } internal static Sprite RoundedRectFrame(int radius, int frameWidth) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.Max(radius * 2 + 2, frameWidth * 2 + 3); int r = Mathf.Max(0, radius - frameWidth); int num2 = num - frameWidth * 2; Texture2D val = new Texture2D(num, num, (TextureFormat)5, false); ((Texture)val).filterMode = (FilterMode)1; ((Texture)val).wrapMode = (TextureWrapMode)1; Color32[] array = (Color32[])(object)new Color32[num * num]; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { byte a = SampleRoundedRectPixel(j, i, num, num, radius).a; int num3 = j - frameWidth; int num4 = i - frameWidth; byte b = (byte)((num3 >= 0 && num4 >= 0 && num3 < num2 && num4 < num2) ? SampleRoundedRectPixel(num3, num4, num2, num2, r).a : 0); array[i * num + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(a * (255 - b) / 255)); } } val.SetPixels32(array); val.Apply(false); Vector4 val2 = default(Vector4); ((Vector4)(ref val2))..ctor((float)radius, (float)radius, (float)radius, (float)radius); return Sprite.Create(val, new Rect(0f, 0f, (float)num, (float)num), new Vector2(0.5f, 0.5f), 100f, 0u, (SpriteMeshType)0, val2); } private static Color32 SampleRoundedRectPixel(int x, int y, int w, int h, int r) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Clamp(x, r, w - r - 1); float num2 = Mathf.Clamp(y, r, h - r - 1); float num3 = Mathf.Sqrt(((float)x - num) * ((float)x - num) + ((float)y - num2) * ((float)y - num2)); if (num3 <= (float)r - 1f) { return new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue); } if (num3 >= (float)r + 0.5f) { return new Color32((byte)0, (byte)0, (byte)0, (byte)0); } byte b = (byte)(255f * Mathf.Clamp01((float)r + 0.5f - num3)); return new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, b); } } } namespace SkillsPreview.App.UI.SettingsPanel { internal class SettingsPanel { private static Log.Scoped Logger { get; } = Log.For("SettingsPanel"); public GameObject Root { get; private set; } internal bool IsAlive => (Object)(object)Root != (Object)null; internal bool IsVisible { get { if ((Object)(object)Root != (Object)null) { return Root.activeSelf; } return false; } } private SettingsPanel(GameObject root) { Root = root; } internal void Show() { if ((Object)(object)Root != (Object)null) { Root.SetActive(true); } } internal void Hide() { if ((Object)(object)Root != (Object)null) { Root.SetActive(false); } } internal static SettingsPanel Create(Transform skillsFrame) { Font builtinResource = Resources.GetBuiltinResource<Font>("Arial.ttf"); GameObject val = SettingsPanelLayout.BuildRoot(skillsFrame); SettingsPanelLayout.BuildBackground(val, skillsFrame); ILabels current = L.Current; Transform content = SettingsPanelLayout.AddScrollView(val.transform); List<Action> resets = new List<Action>(); SettingsPanelLayout.AddTitle(val.transform, skillsFrame, current.SectionSkillsPanel); SettingsPanelRows.Populate(content, builtinResource, resets, skillsFrame, current); SettingsPanelLayout.AddResetAllButton(val.transform, current.ResetAll, resets, skillsFrame); SettingsPanelLayout.AddCloseButton(val.transform, val, skillsFrame); Logger.Debug("Settings panel created."); return new SettingsPanel(val); } } internal static class SettingsPanelLayout { private const float PanelWidth = 500f; private const float PanelHeight = 620f; private const int SectionFontSize = 12; private static readonly Color PanelBgColor = new Color(0.08f, 0.06f, 0.04f, 0.97f); private static readonly Color SectionColor = new Color(0.65f, 0.52f, 0.28f); internal static GameObject BuildRoot(Transform skillsFrame) { //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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_008c: 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_00a1: Expected O, but got Unknown GameObject val = new GameObject("godzki_SettingsPanel", new Type[1] { typeof(RectTransform) }); val.SetActive(false); val.transform.SetParent(skillsFrame, false); val.transform.SetAsLastSibling(); RectTransform component = val.GetComponent<RectTransform>(); component.anchorMin = new Vector2(0.5f, 0.5f); component.anchorMax = new Vector2(0.5f, 0.5f); component.pivot = new Vector2(0.5f, 0.5f); component.sizeDelta = new Vector2(500f, 620f); component.anchoredPosition = Vector2.zero; return val; } internal static void BuildBackground(GameObject root, Transform skillsFrame) { //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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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) Transform obj = skillsFrame.Find("bkg"); Image val = ((obj != null) ? ((Component)obj).GetComponent<Image>() : null); if ((Object)(object)val != (Object)null) { GameObject obj2 = Object.Instantiate<GameObject>(((Component)val).gameObject, root.transform); ((Object)obj2).name = "bkg"; RectTransform component = obj2.GetComponent<RectTransform>(); component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; Vector2 offsetMin = (component.offsetMax = Vector2.zero); component.offsetMin = offsetMin; } else { GameObject val2 = new GameObject("bkg", new Type[3] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Image) }); val2.transform.SetParent(root.transform, false); SettingsPanelWidgets.Stretch(val2.GetComponent<RectTransform>()); ((Graphic)val2.GetComponent<Image>()).color = PanelBgColor; } } internal static void AddTitle(Transform parent, Transform skillsFrame, string label) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) Transform obj = skillsFrame.Find("topic"); if ((Object)(object)obj == (Object)null) { throw new InvalidOperationException("topic not found in SkillsFrame"); } GameObject obj2 = Object.Instantiate<GameObject>(((Component)obj).gameObject, parent); ((Object)obj2).name = "Topic"; RectTransform component = obj2.GetComponent<RectTransform>(); component.anchorMin = new Vector2(0.5f, 1f); component.anchorMax = new Vector2(0.5f, 1f); component.pivot = new Vector2(0.5f, 1f); component.anchoredPosition = new Vector2(0f, -10f); obj2.GetComponentInChildren<TMP_Text>().text = label; } internal static Transform AddScrollView(Transform parent) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_003f: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown //IL_00fb: 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_0148: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Expected O, but got Unknown //IL_01e7: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("ScrollView", new Type[2] { typeof(RectTransform), typeof(ScrollRect) }); val.transform.SetParent(parent, false); RectTransform component = val.GetComponent<RectTransform>(); component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.offsetMin = new Vector2(8f, 90f); component.offsetMax = new Vector2(-8f, -62f); GameObject val2 = new GameObject("Viewport", new Type[4] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Image), typeof(Mask) }); val2.transform.SetParent(val.transform, false); RectTransform component2 = val2.GetComponent<RectTransform>(); SettingsPanelWidgets.Stretch(component2); ((Graphic)val2.GetComponent<Image>()).color = new Color(0f, 0f, 0f, 0.01f); val2.GetComponent<Mask>().showMaskGraphic = false; GameObject val3 = new GameObject("Content", new Type[3] { typeof(RectTransform), typeof(VerticalLayoutGroup), typeof(ContentSizeFitter) }); val3.transform.SetParent(val2.transform, false); RectTransform component3 = val3.GetComponent<RectTransform>(); component3.anchorMin = new Vector2(0f, 1f); component3.anchorMax = new Vector2(1f, 1f); component3.pivot = new Vector2(0.5f, 1f); component3.anchoredPosition = Vector2.zero; component3.sizeDelta = Vector2.zero; VerticalLayoutGroup component4 = val3.GetComponent<VerticalLayoutGroup>(); ((HorizontalOrVerticalLayoutGroup)component4).spacing = 2f; ((LayoutGroup)component4).padding = new RectOffset(24, 24, 24, 24); ((HorizontalOrVerticalLayoutGroup)component4).childForceExpandWidth = true; ((HorizontalOrVerticalLayoutGroup)component4).childForceExpandHeight = false; val3.GetComponent<ContentSizeFitter>().verticalFit = (FitMode)2; ScrollRect component5 = val.GetComponent<ScrollRect>(); component5.content = component3; component5.viewport = component2; component5.horizontal = false; component5.vertical = true; component5.scrollSensitivity = 30f; component5.movementType = (MovementType)2; component5.inertia = false; return val3.transform; } internal static void AddSection(Transform parent, Font font, string label) { //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_0057: 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) GameObject val = new GameObject("Section_" + label, new Type[4] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Text), typeof(LayoutElement) }); val.transform.SetParent(parent, false); LayoutElement component = val.GetComponent<LayoutElement>(); float preferredHeight = (component.minHeight = 22f); component.preferredHeight = preferredHeight; Text component2 = val.GetComponent<Text>(); component2.font = font; component2.fontSize = 12; component2.fontStyle = (FontStyle)1; component2.alignment = (TextAnchor)6; ((Graphic)component2).color = SectionColor; component2.text = "— " + label; ((Graphic)component2).raycastTarget = false; } internal static void AddResetAllButton(Transform parent, string label, List<Action> resets, Transform skillsFrame) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown List<Action> resets2 = resets; Transform obj = skillsFrame.Find("Closebutton"); if ((Object)(object)obj == (Object)null) { throw new InvalidOperationException("Closebutton not found in SkillsFrame"); } GameObject obj2 = Object.Instantiate<GameObject>(((Component)obj).gameObject, parent); ((Object)obj2).name = "ResetBtn"; RectTransform component = obj2.GetComponent<RectTransform>(); component.anchorMin = new Vector2(0f, 0f); component.anchorMax = new Vector2(0f, 0f); component.pivot = new Vector2(0f, 0f); component.sizeDelta = new Vector2(130f, 40f); component.anchoredPosition = new Vector2(15f, 30f); obj2.GetComponentInChildren<TMP_Text>().text = label; Button component2 = obj2.GetComponent<Button>(); component2.onClick = new ButtonClickedEvent(); ((UnityEvent)component2.onClick).AddListener((UnityAction)delegate { foreach (Action item in resets2) { item(); } }); } internal static void AddCloseButton(Transform parent, GameObject panelRoot, Transform skillsFrame) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_007d: 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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown GameObject panelRoot2 = panelRoot; Transform obj = skillsFrame.Find("Closebutton"); if ((Object)(object)obj == (Object)null) { throw new InvalidOperationException("Closebutton not found in SkillsFrame"); } GameObject obj2 = Object.Instantiate<GameObject>(((Component)obj).gameObject, parent); ((Object)obj2).name = "CloseBtn"; RectTransform component = obj2.GetComponent<RectTransform>(); component.anchorMin = new Vector2(0.5f, 0f); component.anchorMax = new Vector2(0.5f, 0f); component.pivot = new Vector2(0.5f, 0f); component.anchoredPosition = new Vector2(0f, 25f); Button component2 = obj2.GetComponent<Button>(); component2.onClick = new ButtonClickedEvent(); ((UnityEvent)component2.onClick).AddListener((UnityAction)delegate { panelRoot2.SetActive(false); }); } } internal static class ColorPickerPopup { private const float SwatchSize = 22f; private const float SwatchSpacing = 0f; private const int GridColumns = 12; private const int GridRows = 8; private const float AlphaBarWidth = 18f; private const float PopupPadding = 8f; private const float GridToBarGap = 14f; private static readonly Color PopupBgColor = new Color(0.08f, 0.06f, 0.04f, 0.97f); private static GameObject? CurrentlyOpenOverlay; private static Sprite? CachedGradient; private static Sprite AlphaGradientSprite => CachedGradient ?? (CachedGradient = BuildAlphaGradientSprite()); internal static (GameObject overlay, Action<Color> syncAlpha) Build(Transform panelRoot, Func<Color> getColor, Action<Color> applyColor) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Expected O, but got Unknown Func<Color> getColor2 = getColor; Action<Color> applyColor2 = applyColor; GameObject overlayGo = BuildOverlay(panelRoot); GameObject val = BuildPopupPanel(overlayGo.transform); float gridWidth = 264f; float gridHeight = 176f; GameObject obj = BuildGrid(val.transform, gridWidth, gridHeight); GameObject sliderGo = BuildAlphaSlider(val.transform, gridWidth, gridHeight); Slider slider = sliderGo.GetComponent<Slider>(); slider.value = getColor2().a; AddSwatches(obj.transform, slider, applyColor2); ((UnityEvent<float>)(object)slider.onValueChanged).AddListener((UnityAction<float>)delegate(float alpha) { //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_0012: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) Color val2 = getColor2(); applyColor2(new Color(val2.r, val2.g, val2.b, alpha)); UpdateSliderTint(sliderGo, val2); }); ((UnityEvent)overlayGo.GetComponent<Button>().onClick).AddListener((UnityAction)delegate { CloseOverlay(overlayGo); }); return (overlayGo, SyncAlpha); void SyncAlpha(Color c) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) slider.value = c.a; UpdateSliderTint(sliderGo, c); } } internal static void OpenOverlay(GameObject overlay, Color currentColor, Action<Color> syncAlpha) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)CurrentlyOpenOverlay != (Object)null && (Object)(object)CurrentlyOpenOverlay != (Object)(object)overlay) { CurrentlyOpenOverlay.SetActive(false); } CurrentlyOpenOverlay = overlay; overlay.SetActive(true); syncAlpha(currentColor); } private static void CloseOverlay(GameObject overlay) { overlay.SetActive(false); if ((Object)(object)CurrentlyOpenOverlay == (Object)(object)overlay) { CurrentlyOpenOverlay = null; } } private static GameObject BuildOverlay(Transform panelRoot) { //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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_0081: 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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown GameObject val = new GameObject("ColorPickerOverlay", new Type[4] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Image), typeof(Button) }); val.transform.SetParent(panelRoot, false); val.SetActive(false); RectTransform component = val.GetComponent<RectTransform>(); component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; Vector2 offsetMin = (component.offsetMax = Vector2.zero); component.offsetMin = offsetMin; ((Graphic)val.GetComponent<Image>()).color = new Color(0f, 0f, 0f, 0f); return val; } private static GameObject BuildPopupPanel(Transform overlayTransform) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_00ab: 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_00cd: 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_00e1: 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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Expected O, but got Unknown float num = 264f; float num2 = 176f; float num3 = 8f + num + 14f + 18f + 8f; float num4 = 8f + num2 + 8f; GameObject val = new GameObject("ColorPickerPopup", new Type[4] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Image), typeof(Button) }); val.transform.SetParent(overlayTransform, false); RectTransform component = val.GetComponent<RectTransform>(); component.anchorMin = new Vector2(0.5f, 0.5f); component.anchorMax = new Vector2(0.5f, 0.5f); component.pivot = new Vector2(0.5f, 0.5f); component.sizeDelta = new Vector2(num3, num4); component.anchoredPosition = Vector2.zero; Image component2 = val.GetComponent<Image>(); ((Graphic)component2).color = PopupBgColor; ((Selectable)val.GetComponent<Button>()).targetGraphic = (Graphic)(object)component2; return val; } private static GameObject BuildGrid(Transform popupTransform, float gridWidth, float gridHeight) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Expected O, but got Unknown GameObject val = new GameObject("ColorGrid", new Type[2] { typeof(RectTransform), typeof(GridLayoutGroup) }); val.transform.SetParent(popupTransform, false); RectTransform component = val.GetComponent<RectTransform>(); component.anchorMin = new Vector2(0f, 0f); component.anchorMax = new Vector2(0f, 0f); component.pivot = new Vector2(0f, 0f); component.anchoredPosition = new Vector2(8f, 8f); component.sizeDelta = new Vector2(gridWidth, gridHeight); GridLayoutGroup component2 = val.GetComponent<GridLayoutGroup>(); component2.cellSize = new Vector2(22f, 22f); component2.spacing = new Vector2(0f, 0f); component2.startCorner = (Corner)0; component2.startAxis = (Axis)0; component2.constraint = (Constraint)1; component2.constraintCount = 12; ((LayoutGroup)component2).childAlignment = (TextAnchor)0; return val; } private static void AddSwatches(Transform gridTransform, Slider alphaSlider, Action<Color> applyColor) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_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_0095: 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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown Slider alphaSlider2 = alphaSlider; Action<Color> applyColor2 = applyColor; for (int i = 0; i < ColorPicker.Palette.Length; i++) { Color swatchColor = ColorPicker.Palette[i]; GameObject val = new GameObject($"Swatch_{i}", new Type[4] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Image), typeof(Button) }); val.transform.SetParent(gridTransform, false); Image component = val.GetComponent<Image>(); ((Graphic)component).color = swatchColor; Button component2 = val.GetComponent<Button>(); ((Selectable)component2).targetGraphic = (Graphic)(object)component; ((UnityEvent)component2.onClick).AddListener((UnityAction)delegate { //IL_0043: Unknown result type (might be due to invalid IL or missing references) Color obj = default(Color); ((Color)(ref obj))..ctor(swatchColor.r, swatchColor.g, swatchColor.b, alphaSlider2.value); applyColor2(obj); }); } } private static GameObject BuildAlphaSlider(Transform popupTransform, float gridWidth, float gridHeight) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: 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_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Expected O, but got Unknown //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Expected O, but got Unknown //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Expected O, but got Unknown //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("AlphaSlider", new Type[2] { typeof(RectTransform), typeof(Slider) }); val.transform.SetParent(popupTransform, false); RectTransform component = val.GetComponent<RectTransform>(); component.anchorMin = new Vector2(0f, 0f); component.anchorMax = new Vector2(0f, 0f); component.pivot = new Vector2(0f, 0f); component.anchoredPosition = new Vector2(8f + gridWidth + 14f, 8f); component.sizeDelta = new Vector2(18f, gridHeight); GameObject val2 = new GameObject("Background", new Type[3] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Image) }); val2.transform.SetParent(val.transform, false); SettingsPanelWidgets.Stretch(val2.GetComponent<RectTransform>()); Image component2 = val2.GetComponent<Image>(); component2.sprite = AlphaGradientSprite; component2.type = (Type)0; component2.preserveAspect = false; ((Graphic)component2).color = Color.white; GameObject val3 = new GameObject("Fill Area", new Type[1] { typeof(RectTransform) }); val3.transform.SetParent(val.transform, false); RectTransform component3 = val3.GetComponent<RectTransform>(); component3.anchorMin = Vector2.zero; component3.anchorMax = Vector2.one; Vector2 offsetMin = (component3.offsetMax = Vector2.zero); component3.offsetMin = offsetMin; GameObject val4 = new GameObject("Fill", new Type[3] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Image) }); val4.transform.SetParent(val3.transform, false); RectTransform component4 = val4.GetComponent<RectTransform>(); component4.anchorMin = Vector2.zero; component4.anchorMax = new Vector2(1f, 0f); component4.sizeDelta = Vector2.zero; ((Graphic)val4.GetComponent<Image>()).color = new Color(0f, 0f, 0f, 0f); GameObject val5 = new GameObject("Handle Slide Area", new Type[1] { typeof(RectTransform) }); val5.transform.SetParent(val.transform, false); RectTransform component5 = val5.GetComponent<RectTransform>(); component5.anchorMin = Vector2.zero; component5.anchorMax = Vector2.one; component5.offsetMin = new Vector2(0f, 8f); component5.offsetMax = new Vector2(0f, -8f); GameObject val6 = new GameObject("Handle", new Type[3] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Image) }); val6.transform.SetParent(val5.transform, false); val6.GetComponent<RectTransform>().sizeDelta = new Vector2(24f, 7f); Image component6 = val6.GetComponent<Image>(); ((Graphic)component6).color = Color.white; SettingsPanelWidgets.ApplyRoundedSprite(component6); Slider component7 = val.GetComponent<Slider>(); component7.direction = (Direction)2; component7.minValue = 0f; component7.maxValue = 1f; component7.value = 1f; component7.wholeNumbers = false; component7.fillRect = val4.GetComponent<RectTransform>(); component7.handleRect = val6.GetComponent<RectTransform>(); ((Selectable)component7).targetGraphic = (Graphic)(object)component6; return val; } private static void UpdateSliderTint(GameObject sliderGo, Color color) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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) Transform obj = sliderGo.transform.Find("Background"); Image val = ((obj != null) ? ((Component)obj).GetComponent<Image>() : null); if ((Object)(object)val != (Object)null) { ((Graphic)val).color = new Color(color.r, color.g, color.b, 1f); } } private static Sprite BuildAlphaGradientSprite() { //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_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_0037: 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_0074: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(1, 64, (TextureFormat)4, false) { filterMode = (FilterMode)1, wrapMode = (TextureWrapMode)1 }; for (int i = 0; i < 64; i++) { val.SetPixel(0, i, new Color(1f, 1f, 1f, (float)i / 63f)); } val.Apply(); return Sprite.Create(val, new Rect(0f, 0f, 1f, 64f), new Vector2(0.5f, 0.5f)); } } internal static class SettingsPanelRows { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func<bool> <>9__3_0; public static Action<bool> <>9__3_1; public static Func<bool> <>9__3_2; public static Func<bool> <>9__3_3; public static Action<bool> <>9__3_4; public static Func<bool> <>9__3_5; public static Func<Color> <>9__3_6; public static Action<Color> <>9__3_7; public static Func<Color> <>9__3_8; public static Func<Color> <>9__3_9; public static Action<Color> <>9__3_10; public static Func<Color> <>9__3_11; public static Func<float> <>9__3_12; public static Action<float> <>9__3_13; public static Func<float> <>9__3_14; public static Func<float> <>9__3_15; public static Action<float> <>9__3_16; public static Func<float> <>9__3_17; public static Func<float> <>9__3_18; public static Action<float> <>9__3_19; public static Func<float> <>9__3_20; public static Func<float> <>9__3_21; public static Action<float> <>9__3_22; public static Func<float> <>9__3_23; public static Func<float> <>9__3_24; public static Action<float> <>9__3_25; public static Func<float> <>9__3_26; public static Func<float> <>9__3_27; public static Action<float> <>9__3_28; public static Func<float> <>9__3_29; public static Func<int> <>9__3_30; public static Action<int> <>9__3_31; public static Func<int> <>9__3_32; public static Func<int> <>9__3_33; public static Action<int> <>9__3_34; public static Func<int> <>9__3_35; public static Func<float> <>9__3_36; public static Action<float> <>9__3_37; public static Func<float> <>9__3_38; public static Func<float> <>9__3_39; public static Action<float> <>9__3_40; public static Func<float> <>9__3_41; public static Func<int> <>9__3_42; public static Action<int> <>9__3_43; public static Func<int> <>9__3_44; public static Func<float> <>9__3_45; public static Action<float> <>9__3_46; public static Func<float> <>9__3_47; public static Func<Color> <>9__3_48; public static Action<Color> <>9__3_49; public static Func<Color> <>9__3_50; public static Func<Color> <>9__3_51; public static Action<Color> <>9__3_52; public static Func<Color> <>9__3_53; public static Func<Color> <>9__3_54; public static Action<Color> <>9__3_55; public static Func<Color> <>9__3_56; public static Func<Color> <>9__3_57; public static Action<Color> <>9__3_58; public static Func<Color> <>9__3_59; public static Func<Color> <>9__3_60; public static Action<Color> <>9__3_61; public static Func<Color> <>9__3_62; public static Func<Color> <>9__3_63; public static Action<Color> <>9__3_64; public static Func<Color> <>9__3_65; public static OnValidateInput <>9__5_0; internal bool <Populate>b__3_0() { return Config.DebugMode.Value; } internal void <Populate>b__3_1(bool v) { Config.DebugMode.Value = v; } internal bool <Populate>b__3_2() { return (bool)((ConfigEntryBase)Config.DebugMode).DefaultValue; } internal bool <Populate>b__3_3() { return Config.HudWidgetsVisible.Value; } internal void <Populate>b__3_4(bool v) { Config.HudWidgetsVisible.Value = v; } internal bool <Populate>b__3_5() { return (bool)((ConfigEntryBase)Config.HudWidgetsVisible).DefaultValue; } internal Color <Populate>b__3_6() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return Config.FavoriteStarColor.Value; } internal void <Populate>b__3_7(Color v) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) Config.FavoriteStarColor.Value = v; } internal Color <Populate>b__3_8() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) return (Color)((ConfigEntryBase)Config.FavoriteStarColor).DefaultValue; } internal Color <Populate>b__3_9() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return Config.UnfavoriteStarColor.Value; } internal void <Populate>b__3_10(Color v) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) Config.UnfavoriteStarColor.Value = v; } internal Color <Populate>b__3_11() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) return (Color)((ConfigEntryBase)Config.UnfavoriteStarColor).DefaultValue; } internal float <Populate>b__3_12() { return Config.HudPositionX.Value; } internal void <Populate>b__3_13(float v) { Config.HudPositionX.Value = v; } internal float <Populate>b__3_14() { return (float)((ConfigEntryBase)Config.HudPositionX).DefaultValue; } internal float <Populate>b__3_15() { return Config.HudPositionY.Value; } internal void <Populate>b__3_16(float v) { Config.HudPositionY.Value = v; } internal float <Populate>b__3_17() { return (float)((ConfigEntryBase)Config.HudPositionY).DefaultValue; } internal float <Populate>b__3_18() { return Config.HudScale.Value; } internal void <Populate>b__3_19(float v) { Config.HudScale.Value = v; } internal float <Populate>b__3_20() { return (float)((ConfigEntryBase)Config.HudScale).DefaultValue; } internal float <Populate>b__3_21() { return Config.WidgetWidth.Value; } internal void <Populate>b__3_22(float v) { Config.WidgetWidth.Value = v; } internal float <Populate>b__3_23() { return (float)((ConfigEntryBase)Config.WidgetWidth).DefaultValue; } internal float <Populate>b__3_24() { return Config.WidgetHeight.Value; } internal void <Populate>b__3_25(float v) { Config.WidgetHeight.Value = v; } internal float <Populate>b__3_26() { return (float)((ConfigEntryBase)Config.WidgetHeight).DefaultValue; } internal float <Populate>b__3_27() { return Config.WidgetIconSize.Value; } internal void <Populate>b__3_28(float v) { Config.WidgetIconSize.Value = v; } internal float <Populate>b__3_29() { return (float)((ConfigEntryBase)Config.WidgetIconSize).DefaultValue; } internal int <Populate>b__3_30() { return Config.WidgetFontSizeLevel.Value; } internal void <Populate>b__3_31(int v) { Config.WidgetFontSizeLevel.Value = v; } internal int <Populate>b__3_32() { return (int)((ConfigEntryBase)Config.WidgetFontSizeLevel).DefaultValue; } internal int <Populate>b__3_33() { return Config.WidgetFontSizeProgress.Value; } internal void <Populate>b__3_34(int v) { Config.WidgetFontSizeProgress.Value = v; } internal int <Populate>b__3_35() { return (int)((ConfigEntryBase)Config.WidgetFontSizeProgress).DefaultValue; } internal float <Populate>b__3_36() { return Config.WidgetSpacing.Value; } internal void <Populate>b__3_37(float v) { Config.WidgetSpacing.Value = v; } internal float <Populate>b__3_38() { return (float)((ConfigEntryBase)Config.WidgetSpacing).DefaultValue; } internal float <Populate>b__3_39() { return Config.WidgetBorderSize.Value; } internal void <Populate>b__3_40(float v) { Config.WidgetBorderSize.Value = v; } internal float <Populate>b__3_41() { return (float)((ConfigEntryBase)Config.WidgetBorderSize).DefaultValue; } internal int <Populate>b__3_42() { return Config.WidgetCornerRadius.Value; } internal void <Populate>b__3_43(int v) { Config.WidgetCornerRadius.Value = v; } internal int <Populate>b__3_44() { return (int)((ConfigEntryBase)Config.WidgetCornerRadius).DefaultValue; } internal float <Populate>b__3_45() { return Config.WidgetLevelUpDuration.Value; } internal void <Populate>b__3_46(float v) { Config.WidgetLevelUpDuration.Value = v; } internal float <Populate>b__3_47() { return (float)((ConfigEntryBase)Config.WidgetLevelUpDuration).DefaultValue; } internal Color <Populate>b__3_48() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return Config.WidgetBorderColor.Value; } internal void <Populate>b__3_49(Color v) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) Config.WidgetBorderColor.Value = v; } internal Color <Populate>b__3_50() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) return (Color)((ConfigEntryBase)Config.WidgetBorderColor).DefaultValue; } internal Color <Populate>b__3_51() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return Config.WidgetBgColor.Value; } internal void <Populate>b__3_52(Color v) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) Config.WidgetBgColor.Value = v; } internal Color <Populate>b__3_53() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) return (Color)((ConfigEntryBase)Config.WidgetBgColor).DefaultValue; } internal Color <Populate>b__3_54() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return Config.WidgetLevelColor.Value; } internal void <Populate>b__3_55(Color v) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) Config.WidgetLevelColor.Value = v; } internal Color <Populate>b__3_56() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) return (Color)((ConfigEntryBase)Config.WidgetLevelColor).DefaultValue; } internal Color <Populate>b__3_57() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return Config.WidgetProgressColor.Value; } internal void <Populate>b__3_58(Color v) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) Config.WidgetProgressColor.Value = v; } internal Color <Populate>b__3_59() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) return (Color)((ConfigEntryBase)Config.WidgetProgressColor).DefaultValue; } internal Color <Populate>b__3_60() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return Config.WidgetProgressMaxColor.Value; } internal void <Populate>b__3_61(Color v) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) Config.WidgetProgressMaxColor.Value = v; } internal Color <Populate>b__3_62() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) return (Color)((ConfigEntryBase)Config.WidgetProgressMaxColor).DefaultValue; } internal Color <Populate>b__3_63() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return Config.WidgetLevelUpColor.Value; } internal void <Populate>b__3_64(Color v) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) Config.WidgetLevelUpColor.Value = v; } internal Color <Populate>b__3_65() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) return (Color)((ConfigEntryBase)Config.WidgetLevelUpColor).DefaultValue; } internal char <AddFloatRow>b__5_0(string _, int _, char c) { if ("0123456789.-".IndexOf(c) < 0) { return '\0'; } return c; } } private static Log.Scoped Logger { get; } = Log.For("SettingsPanelRows"); internal static void Populate(Transform content, Font font, List<Action> resets, Transform skillsFrame, ILabels t) { SettingsPanelLayout.AddSection(content, font, t.SectionGeneral); AddToggleRow(content, font, t.DebugMode, resets, skillsFrame, t, () => Config.DebugMode.Value, delegate(bool v) { Config.DebugMode.Value = v; }, () => (bool)((ConfigEntryBase)Config.DebugMode).DefaultValue); AddToggleRow(content, font, t.HudWidgetsVisible, resets, skillsFrame, t, () => Config.HudWidgetsVisible.Value, delegate(bool v) { Config.HudWidgetsVisible.Value = v; }, () => (bool)((ConfigEntryBase)Config.HudWidgetsVisible).DefaultValue); SettingsPanelLayout.AddSection(content, font, t.SectionSkillsPanel); AddColorRow(content, font, t.StarFavorite, resets, skillsFrame, () => Config.FavoriteStarColor.Value, delegate(Color v) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) Config.FavoriteStarColor.Value = v; }, () => (Color)((ConfigEntryBase)Config.FavoriteStarColor).DefaultValue); AddColorRow(content, font, t.StarUnfavorite, resets, skillsFrame, () => Config.UnfavoriteStarColor.Value, delegate(Color v) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) Config.UnfavoriteStarColor.Value = v; }, () => (Color)((ConfigEntryBase)Config.UnfavoriteStarColor).DefaultValue); SettingsPanelLayout.AddSection(content, font, t.SectionHudPosition); AddFloatRow(content, font, t.PositionX, resets, skillsFrame, () => Config.HudPositionX.Value, delegate(float v) { Config.HudPositionX.Value = v; }, () => (float)((ConfigEntryBase)Config.HudPositionX).DefaultValue); AddFloatRow(content, font, t.PositionY, resets, skillsFrame, () => Config.HudPositionY.Value, delegate(float v) { Config.HudPositionY.Value = v; }, () => (float)((ConfigEntryBase)Config.HudPositionY).DefaultValue); AddSliderFloatRow(content, font, t.HudScale, resets, skillsFrame, 50f, 150f, 0, () => Config.HudScale.Value, delegate(float v) { Config.HudScale.Value = v; }, () => (float)((ConfigEntryBase)Config.HudScale).DefaultValue); SettingsPanelLayout.AddSection(content, font, t.SectionHudSize); AddSliderFloatRow(content, font, t.Width, resets, skillsFrame, 30f, 200f, 1, () => Config.WidgetWidth.Value, delegate(float v) { Config.WidgetWidth.Value = v; }, () => (float)((ConfigEntryBase)Config.WidgetWidth).DefaultValue); AddSliderFloatRow(content, font, t.Height, resets, skillsFrame, 30f, 200f, 1, () => Config.WidgetHeight.Value, delegate(float v) { Config.WidgetHeight.Value = v; }, () => (float)((ConfigEntryBase)Config.WidgetHeight).DefaultValue); AddSliderFloatRow(content, font, t.IconSize, resets, skillsFrame, 10f, 100f, 1, () => Config.WidgetIconSize.Value, delegate(float v) { Config.WidgetIconSize.Value = v; }, () => (float)((ConfigEntryBase)Config.WidgetIconSize).DefaultValue); AddSliderIntRow(content, font, t.FontLevel, resets, skillsFrame, 6, 30, () => Config.WidgetFontSizeLevel.Value, delegate(int v) { Config.WidgetFontSizeLevel.Value = v; }, () => (int)((ConfigEntryBase)Config.WidgetFontSizeLevel).DefaultValue); AddSliderIntRow(content, font, t.FontProgress, resets, skillsFrame, 6, 24, () => Config.WidgetFontSizeProgress.Value, delegate(int v) { Config.WidgetFontSizeProgress.Value = v; }, () => (int)((ConfigEntryBase)Config.WidgetFontSizeProgress).DefaultValue); AddSliderFloatRow(content, font, t.WidgetSpacing, resets, skillsFrame, 0f, 30f, 1, () => Config.WidgetSpacing.Value, delegate(float v) { Config.WidgetSpacing.Value = v; }, () => (float)((ConfigEntryBase)Config.WidgetSpacing).DefaultValue); AddSliderFloatRow(content, font, t.BorderThickness, resets, skillsFrame, 0f, 10f, 1, () => Config.WidgetBorderSize.Value, delegate(float v) { Config.WidgetBorderSize.Value = v; }, () => (float)((ConfigEntryBase)Config.WidgetBorderSize).DefaultValue); AddSliderIntRow(content, font, t.CornerRadius, resets, skillsFrame, 0, 20, () => Config.WidgetCornerRadius.Value, delegate(int v) { Config.WidgetCornerRadius.Value = v; }, () => (int)((ConfigEntryBase)Config.WidgetCornerRadius).DefaultValue); AddSliderFloatRow(content, font, t.LevelUpDuration, resets, skillsFrame, 0f, 5f, 2, () => Config.WidgetLevelUpDuration.Value, delegate(float v) { Config.WidgetLevelUpDuration.Value = v; }, () => (float)((ConfigEntryBase)Config.WidgetLevelUpDuration).DefaultValue); SettingsPanelLayout.AddSection(content, font, t.SectionHudColors); AddColorRow(content, font, t.ColorBorder, resets, skillsFrame, () => Config.WidgetBorderColor.Value, delegate(Color v) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) Config.WidgetBorderColor.Value = v; }, () => (Color)((ConfigEntryBase)Config.WidgetBorderColor).DefaultValue); AddColorRow(content, font, t.ColorBackground, resets, skillsFrame, () => Config.WidgetBgColor.Value, delegate(Color v) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) Config.WidgetBgColor.Value = v; }, () => (Color)((ConfigEntryBase)Config.WidgetBgColor).DefaultValue); AddColorRow(content, font, t.ColorLevelText, resets, skillsFrame, () => Config.WidgetLevelColor.Value, delegate(Color v) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) Config.WidgetLevelColor.Value = v; }, () => (Color)((ConfigEntryBase)Config.WidgetLevelColor).DefaultValue); AddColorRow(content, font, t.ColorProgressText, resets, skillsFrame, () => Config.WidgetProgressColor.Value, delegate(Color v) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) Config.WidgetProgressColor.Value = v; }, () => (Color)((ConfigEntryBase)Config.WidgetProgressColor).DefaultValue); AddColorRow(content, font, t.ColorMaxText, resets, skillsFrame, () => Config.WidgetProgressMaxColor.Value, delegate(Color v) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) Config.WidgetProgressMaxColor.Value = v; }, () => (Color)((ConfigEntryBase)Config.WidgetProgressMaxColor).DefaultValue); AddColorRow(content, font, t.ColorLevelUpFlash, resets, skillsFrame, () => Config.WidgetLevelUpColor.Value, delegate(Color v) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) Config.WidgetLevelUpColor.Value = v; }, () => (Color)((ConfigEntryBase)Config.WidgetLevelUpColor).DefaultValue); } private static void AddToggleRow(Transform parent, Font font, string label, List<Action> resets, Transform skillsFrame, ILabels t, Func<bool> getter, Action<bool> setter, Func<bool> getDefault) { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Expected O, but got Unknown Func<bool> getter2 = getter; Action<bool> setter2 = setter; ILabels t2 = t; string label2 = label; Func<bool> getDefault2 = getDefault; GameObject val = SettingsPanelWidgets.MakeRow(parent, label2); SettingsPanelWidgets.MakeLabel(val.transform, font, label2); GameObject val2 = new GameObject("Toggle", new Type[5] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Image), typeof(Button), typeof(LayoutElement) }); val2.transform.SetParent(val.transform, false); LayoutElement component = val2.GetComponent<LayoutElement>(); float preferredWidth = (component.minWidth = 68f); component.preferredWidth = preferredWidth; Image img = val2.GetComponent<Image>(); ((Graphic)img).color = SettingsPanelWidgets.ToggleColor(getter2()); SettingsPanelWidgets.ApplyRoundedSprite(img); Text labelText = SettingsPanelWidgets.AddChildText(val2.transform, font, getter2() ? t2.ToggleOn : t2.ToggleOff, 12, (FontStyle)1); Button component2 = val2.GetComponent<Button>(); ((Selectable)component2).targetGraphic = (Graphic)(object)img; ((UnityEvent)component2.onClick).AddListener((UnityAction)delegate { //IL_0027: Unknown result type (might be due to invalid IL or missing references) bool flag2 = !getter2(); setter2(flag2); Plugin.SaveConfig(); ((Graphic)img).color = SettingsPanelWidgets.ToggleColor(flag2); labelText.text = (flag2 ? t2.ToggleOn : t2.ToggleOff); Logger.Debug($"Toggle '{label2}' → {flag2}"); }); SettingsPanelWidgets.MakeResetButton(val.transform, Reset, skillsFrame); resets.Add(Reset); void Reset() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) bool flag = getDefault2(); setter2(flag); Plugin.SaveConfig(); ((Graphic)img).color = SettingsPanelWidgets.ToggleColor(flag); labelText.text = (flag ? t2.ToggleOn : t2.ToggleOff); } } private static void AddFloatRow(Transform parent, Font font, string label, List<Action> resets, Transform skillsFrame, Func<float> getter, Action<float> setter, Func<float> getDefault) { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown Action<float> setter2 = setter; Func<float> getter2 = getter; Func<float> getDefault2 = getDefault; GameObject obj = SettingsPanelWidgets.MakeRow(parent, label); SettingsPanelWidgets.MakeLabel(obj.transform, font, label); GameObject val = SettingsPanelWidgets.MakeInputField(obj.transform, font, getter2().ToString("0.##"), "0.0"); InputField input = val.GetComponent<InputField>(); input.characterLimit = 10; InputField obj2 = input; object obj3 = <>c.<>9__5_0; if (obj3 == null) { OnValidateInput val2 = (string _, int _, char c) => ("0123456789.-".IndexOf(c) >= 0) ? c : '\0'; <>c.<>9__5_0 = val2; obj3 = (object)val2; } obj2.onValidateInput = (OnValidateInput)obj3; SettingsPanelWidgets.ApplyRoundedSprite(((Component)input).GetComponent<Image>()); ((UnityEvent<string>)(object)input.onValueChanged).AddListener((UnityAction<string>)delegate(string raw) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (float.TryParse(raw, NumberStyles.Float, CultureInfo.InvariantCulture, out var result2)) { ((Graphic)input.textComponent).color = Color.white; setter2(result2); Plugin.SaveConfig(); } else { ((Graphic)input.textComponent).color = SettingsPanelWidgets.ErrorColor; } }); ((UnityEvent<string>)(object)input.onEndEdit).AddListener((UnityAction<string>)delegate(string raw) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (!float.TryParse(raw, NumberStyles.Float, CultureInfo.InvariantCulture, out var _)) { input.text = getter2().ToString("0.##"); ((Graphic)input.textComponent).color = Color.white; } }); SettingsPanelWidgets.MakeResetButton(obj.transform, Reset, skillsFrame); resets.Add(Reset); void Reset() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) float obj4 = getDefault2(); setter2(obj4); Plugin.SaveConfig(); input.text = obj4.ToString("0.##"); ((Graphic)input.textComponent).color = Color.white; } } private static void AddSliderFloatRow(Transform parent, Font font, string label, List<Action> resets, Transform skillsFrame, float min, float max, int decimals, Func<float> getter, Action<float> setter, Func<float> getDefault) { Action<float> setter2 = setter; Func<float> getDefault2 = getDefault; string fmt = "F" + decimals; GameObject obj = SettingsPanelWidgets.MakeRow(parent, label); SettingsPanelWidgets.MakeLabel(obj.transform, font, label); var (slider, valueText) = SettingsPanelWidgets.MakeSlider(obj.transform, font, min, max, getter(), fmt); ((UnityEvent<float>)(object)slider.onValueChanged).AddListener((UnityAction<float>)delegate(float raw) { float obj2 = (float)Math.Round(raw, decimals); valueText.text = obj2.ToString(fmt); setter2(obj2); Plugin.SaveConfig(); }); SettingsPanelWidgets.MakeResetButton(obj.transform, Reset, skillsFrame); resets.Add(Reset); void Reset() { float num = getDefault2(); setter2(num); Plugin.SaveConfig(); slider.value = num; valueText.text = num.ToString(fmt); } } private static void AddSliderIntRow(Transform parent, Font font, string label, List<Action> resets, Transform skillsFrame, int min, int max, Func<int> getter, Action<int> setter, Func<int> getDefault) { Action<int> setter2 = setter; Func<int> getDefault2 = getDefault; GameObject obj = SettingsPanelWidgets.MakeRow(parent, label); SettingsPanelWidgets.MakeLabel(obj.transform, font, label); var (slider, valueText) = SettingsPanelWidgets.MakeSlider(obj.transform, font, min, max, getter(), "F0"); slider.wholeNumbers = true; ((UnityEvent<float>)(object)slider.onValueChanged).AddListener((UnityAction<float>)delegate(float raw) { int obj2 = Mathf.RoundToInt(raw); valueText.text = obj2.ToString(); setter2(obj2); Plugin.SaveConfig(); }); SettingsPanelWidgets.MakeResetButton(obj.transform, Reset, skillsFrame); resets.Add(Reset); void Reset() { int num = getDefault2(); setter2(num); Plugin.SaveConfig(); slider.value = num; valueText.text = num.ToString(); } } private static void AddColorRow(Transform parent, Font font, string label, List<Action> resets, Transform skillsFrame, Func<Color> getter, Action<Color> setter, Func<Color> getDefault) { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Expected O, but got Unknown //IL_00ca: 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_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Expected O, but got Unknown Action<Color> setter2 = setter; Func<Color> getter2 = getter; Func<Color> getDefault2 = getDefault; GameObject val = SettingsPanelWidgets.MakeRow(parent, label); SettingsPanelWidgets.MakeLabel(val.transform, font, label); GameObject val2 = new GameObject("Preview", new Type[5] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Image), typeof(LayoutElement), typeof(Button) }); val2.transform.SetParent(val.transform, false); LayoutElement component = val2.GetComponent<LayoutElement>(); float preferredWidth = (component.minWidth = 22f); component.preferredWidth = preferredWidth; Image previewImg = val2.GetComponent<Image>(); ((Graphic)previewImg).color = getter2(); SettingsPanelWidgets.ApplyRoundedSprite(previewImg); GameObject val3 = SettingsPanelWidgets.MakeInputField(val.transform, font, ColorUtility.ToHtmlStringRGBA(getter2())); val3.transform.SetSiblingIndex(1); InputField input = val3.GetComponent<InputField>(); Text inputText = input.textComponent; SettingsPanelWidgets.ApplyRoundedSprite(((Component)input).GetComponent<Image>()); (GameObject, Action<Color>) tuple = ColorPickerPopup.Build(parent.parent.parent.parent, getter2, delegate(Color chosen) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) setter2(chosen); Plugin.SaveConfig(); ((Graphic)previewImg).color = chosen; input.text = ColorUtility.ToHtmlStringRGBA(chosen); ((Graphic)inputText).color = Color.white; }); GameObject pickerOverlay = tuple.Item1; Action<Color> syncAlpha = tuple.Item2; Button component2 = val2.GetComponent<Button>(); ((Selectable)component2).targetGraphic = (Graphic)(object)previewImg; ((UnityEvent)component2.onClick).AddListener((UnityAction)delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) ColorPickerPopup.OpenOverlay(pickerOverlay, getter2(), syncAlpha); }); ((UnityEvent<string>)(object)input.onValueChanged).AddListener((UnityAction<string>)delegate(string hex) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) if (SettingsPanelWidgets.TryParseColor(hex, out var color2)) { ((Graphic)previewImg).color = color2; ((Graphic)inputText).color = Color.white; setter2(color2); Plugin.SaveConfig(); syncAlpha(color2); } else { ((Graphic)previewImg).color = SettingsPanelWidgets.ErrorPreviewColor; ((Graphic)inputText).color = SettingsPanelWidgets.ErrorColor; } }); ((UnityEvent<string>)(object)input.onEndEdit).AddListener((UnityAction<string>)delegate(string hex) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!SettingsPanelWidgets.TryParseColor(hex, out var _)) { input.text = ColorUtility.ToHtmlStringRGBA(getter2()); ((Graphic)previewImg).color = getter2(); ((Graphic)inputText).color = Color.white; } }); SettingsPanelWidgets.MakeResetButton(val.transform, Reset, skillsFrame); resets.Add(Reset); void Reset() { //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_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) Color val4 = getDefault2(); setter2(val4); Plugin.SaveConfig(); input.text = ColorUtility.ToHtmlStringRGBA(val4); ((Graphic)previewImg).color = val4; ((Graphic)inputText).color = Color.white; syncAlpha(val4); } } } internal static class SettingsPanelWidgets { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static OnValidateInput <>9__18_0; internal char <MakeInputField>b__18_0(string _, int _, char c) { if ("0123456789ABCDEFabcdef".IndexOf(c) < 0) { return '\0'; } return char.ToUpper(c); } } internal static readonly Color ErrorColor = new Color(1f, 0.4f, 0.4f); internal static readonly Color ErrorPreviewColor = new Color(0.4f, 0f, 0f); private static readonly Color ToggleOnColor = new Color(0.18f, 0.58f, 0.18f); private static readonly Color ToggleOffColor = new Color(0.48f, 0.14f, 0.14f); private static readonly Color LabelColor = new Color(0.9f, 0.88f, 0.82f); private static readonly Color InputBgColor = new Color(0.1f, 0.08f, 0.06f); private static readonly Color SliderTrackColor = new Color(0.1f, 0.08f, 0.06f); private static readonly Color SliderFillColor = new Color(0.58f, 0.44f, 0.18f); private static readonly Color SliderHandleColor = new Color(0.76f, 0.6f, 0.3f); private static readonly Color SliderHandleHighlight = new Color(0.92f, 0.76f, 0.44f); private static readonly Color SliderHandlePressed = new Color(0.46f, 0.34f, 0.12f); private const int LabelFontSize = 14; private const int InputFontSize = 11; private const int PlaceholderFontSize = 10; internal static Color ToggleColor(bool on) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) if (!on) { return ToggleOffColor; } return ToggleOnColor; } internal static void MakeResetButton(Transform parent, Action onClick, Transform skillsFrame) { //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Expected O, but got Unknown //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown Action onClick2 = onClick; Transform obj = skillsFrame.Find("Closebutton"); if ((Object)(object)obj == (Object)null) { throw new InvalidOperationException("Closebutton not found in SkillsFrame"); } GameObject val = Object.Instantiate<GameObject>(((Component)obj).gameObject, parent); ((Object)val).name = "ResetBtn"; LayoutElement obj2 = val.GetComponent<LayoutElement>() ?? val.AddComponent<LayoutElement>(); float num2 = (obj2.minWidth = 28f); float num4 = (obj2.preferredWidth = num2); float preferredHeight = (obj2.minHeight = num4); obj2.preferredHeight = preferredHeight; TMP_Text componentInChildren = val.GetComponentInChildren<TMP_Text>(); if ((Object)(object)componentInChildren != (Object)null) { ((Component)componentInChildren).gameObject.SetActive(false); } GameObject val2 = new GameObject("Icon", new Type[3] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Image) }); val2.transform.SetParent(val.transform, false); RectTransform component = val2.GetComponent<RectTransform>(); component.anchorMin = new Vector2(0.2f, 0.2f); component.anchorMax = new Vector2(0.8f, 0.8f); Vector2 offsetMin = (component.offsetMax = Vector2.zero); component.offsetMin = offsetMin; val2.GetComponent<Image>().sprite = SpriteUtils.ResetIcon(10); Button component2 = val.GetComponent<Button>(); component2.onClick = new ButtonClickedEvent(); ((UnityEvent)component2.onClick).AddListener((UnityAction)delegate { onClick2(); }); } internal static GameObject MakeRow(Transform parent, string name) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown //IL_0098: Expected O, but got Unknown GameObject val = new GameObject("Row_" + name, new Type[3] { typeof(RectTransform), typeof(HorizontalLayoutGroup), typeof(LayoutElement) }); val.transform.SetParent(parent, false); LayoutElement component = val.GetComponent<LayoutElement>(); float preferredHeight = (component.minHeight = 28f); component.preferredHeight = preferredHeight; HorizontalLayoutGroup component2 = val.GetComponent<HorizontalLayoutGroup>(); ((HorizontalOrVerticalLayoutGroup)component2).spacing = 4f; ((HorizontalOrVerticalLayoutGroup)component2).childForceExpandWidth = false; ((HorizontalOrVerticalLayoutGroup)component2).childForceExpandHeight = true; ((LayoutGroup)component2).childAlignment = (TextAnchor)3; ((LayoutGroup)component2).padding = new RectOffset(0, 0, 1, 1); return val; } internal static void MakeLabel(Transform parent, Font font, string text) { //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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Label", new Type[4] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Text), typeof(LayoutElement) }); val.transform.SetParent(parent, false); val.GetComponent<LayoutElement>().flexibleWidth = 1f; Text component = val.GetComponent<Text>(); component.font = font; component.fontSize = 14; component.alignment = (TextAnchor)3; ((Graphic)component).color = LabelColor; component.text = text; ((Graphic)component).raycastTarget = false; } internal static GameObject MakeInputField(Transform parent, Font font, string initialValue, string placeholder = "RRGGBBAA") { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: 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_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_016e: 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_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Expected O, but got Unknown GameObject val = new GameObject("Input", new Type[5] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Image), typeof(InputField), typeof(LayoutElement) }); val.transform.SetParent(parent, false); LayoutElement component = val.GetComponent<LayoutElement>(); float preferredWidth = (component.minWidth = 86f); component.preferredWidth = preferredWidth; ((Graphic)val.GetComponent<Image>()).color = InputBgColor; GameObject val2 = new GameObject("Placeholder", new Type[3] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Text) }); val2.transform.SetParent(val.transform, false); StretchInset(val2.GetComponent<RectTransform>(), 3f); Text component2 = val2.GetComponent<Text>(); component2.font = font; component2.fontSize = 10; ((Graphic)component2).color = new Color(0.35f, 0.35f, 0.35f); component2.text = placeholder; component2.alignment = (TextAnchor)4; ((Graphic)component2).raycastTarget = false; GameObject val3 = new GameObject("Text", new Type[3] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Text) }); val3.transform.SetParent(val.transform, false); StretchInset(val3.GetComponent<RectTransform>(), 3f); Text component3 = val3.GetComponent<Text>(); component3.font = font; component3.fontSize = 11; ((Graphic)component3).color = Color.white; component3.alignment = (TextAnchor)4; component3.supportRichText = false; ((Graphic)component3).raycastTarget = false; InputField component4 = val.GetComponent<InputField>(); component4.textComponent = component3; component4.placeholder = (Graphic)(object)component2; component4.characterLimit = 8; component4.lineType = (LineType)0; component4.text = initialValue; ApplyRoundedSprite(((Component)component4).GetComponent<Image>()); object obj = <>c.<>9__18_0; if (obj == null) { OnValidateInput val4 = (string _, int _, char c) => ("0123456789ABCDEFabcdef".IndexOf(c) >= 0) ? char.ToUpper(c) : '\0'; <>c.<>9__18_0 = val4; obj = (object)val4; } component4.onValidateInput = (OnValidateInput)obj; return val; } internal static Text AddChildText(Transform parent, Font font, string text, int fontSize, FontStyle style) { //IL_0032: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Text", new Type[3] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Text) }); val.transform.SetParent(parent, false); Stretch(val.GetComponent<RectTransform>()); Text component = val.GetComponent<Text>(); component.font = font; component.fontSize = fontSize; component.fontStyle = style; component.alignment = (TextAnchor)4; ((Graphic)component).color = Color.white; component.text = text; ((Graphic)component).raycastTarget = false; return component; } internal static void ApplyRoundedSprite(Image img) { Sprite val = SpriteUtils.RoundedRect(6); if (!((Object)(object)val == (Object)null)) { img.sprite = val; img.type = (Type)1; } } internal static bool TryParseColor(string hex, out Color color) { //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) color = Color.white; if (hex.Length != 8) { return false; } return ColorUtility.TryParseHtmlString("#" + hex, ref color); } internal static void Stretch(RectTransform rt) { //IL_0001: 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_001d: 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_0024: Unknown result type (might be due to invalid IL or missing references) rt.anchorMin = Vector2.zero; rt.anchorMax = Vector2.one; Vector2 offsetMin = (rt.offsetMax = Vector2.zero); rt.offsetMin = offsetMin; } internal static void StretchInset(RectTransform rt, float inset) { //IL_0001: 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_001d: 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) rt.anchorMin = Vector2.zero; rt.anchorMax = Vector2.one; rt.offsetMin = new Vector2(inset, 0f); rt.offsetMax = new Vector2(0f - inset, 0f); } internal static (Slider slider, Text valueText) MakeSlider(Transform parent, Font font, float min, float max, float initialValue, string valueFormat) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_011b: 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_0132: 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_0158: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0181: 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_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Expected O, but got Unknown //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Expected O, but got Unknown //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_0456: Unknown result type (might be due to invalid IL or missing references) //IL_0462: Unknown result type (might be due to invalid IL or missing references) //IL_046e: Unknown result type (might be due to invalid IL or missing references) //IL_047a: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_04b7: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_0502: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_054c: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("SliderWrap", new Type[2] { typeof(RectTransform), typeof(LayoutElement) }); val.transform.SetParent(parent, false); LayoutElement component = val.GetComponent<LayoutElement>(); component.preferredWidth = 160f; component.minWidth = 80f; GameObject val2 = new GameObject("Slider", new Type[2] { typeof(RectTransform), typeof(Slider) }); val2.transform.SetParent(val.transform, false); RectTransform component2 = val2.GetComponent<RectTransform>(); component2.anchorMin = new Vector2(0f, 0.5f); component2.anchorMax = new Vector2(1f, 0.5f); component2.offsetMin = new Vector2(0f, -7f); component2.offsetMax = new Vector2(0f, 7f); GameObject val3 = new GameObject("Background", new Type[3] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Image) }); val3.transform.SetParent(val2.transform, false); RectTransform component3 = val3.GetComponent<RectTransform>(); component3.anchorMin = new Vector2(0f, 0.5f); component3.anchorMax = new Vector2(1f, 0.5f); component3.offsetMin = new Vector2(0f, -1.5f); component3.offsetMax = new Vector2(0f, 1.5f); Image component4 = val3.GetComponent<Image>(); ((Graphic)component4).color = SliderTrackColor; ApplyRoundedSprite(component4); GameObject val4 = new GameObject("Fill Area", new Type[1] { typeof(RectTransform) }); val4.transform.SetParent(val2.transform, false); RectTransform component5 = val4.GetComponent<RectTransform>(); component5.anchorMin = new Vector2(0f, 0.5f); component5.anchorMax = new Vector2(1f, 0.5f); component5.offsetMin = new Vector2(0f, -1.5f); component5.offsetMax = new Vector2(-7f, 1.5f); GameObject val5 = new GameObject("Fill", new Type[3] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Image) }); val5.transform.SetParent(val4.transform, false); RectTransform component6 = val5.GetComponent<RectTransform>(); component6.anchorMin = Vector2.zero; component6.anchorMax = new Vector2(0f, 1f); Vector2 offsetMin = (component6.offsetMax = Vector2.zero); component6.offsetMin = offsetMin; Image component7 = val5.GetComponent<Image>(); ((Graphic)component7).color = SliderFillColor; ApplyRoundedSprite(component7); GameObject val6 = new GameObject("Handle Slide Area", new Type[1] { typeof(RectTransform) }); val6.transform.SetParent(val2.transform, false); RectTransform component8 = val6.GetComponent<RectTransform>(); component8.anchorMin = Vector2.zero; component8.anchorMax = Vector2.one; component8.offsetMin = new Vector2(7f, 0f); component8.offsetMax = new Vector2(-7f, 0f); GameObject val7 = new GameObject("Handle", new Type[3] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Image) }); val7.transform.SetParent(val6.transform, false); RectTransform component9 = val7.GetComponent<RectTransform>(); component9.anchorMin = new Vector2(0f, 0.5f); component9.anchorMax = new Vector2(0f, 0.5f); component9.pivot = new Vector2(0.5f, 0.5f); component9.sizeDelta = new Vector2(14f, 14f); Image component10 = val7.GetComponent<Image>(); ((Graphic)component10).color = SliderHandleColor; ApplyRoundedSprite(component10); Slider component11 = val2.GetComponent<Slider>(); component11.fillRect = component6; component11.handleRect = component9; ((Selectable)component11).targetGraphic = (Graphic)(object)component10; component11.direction = (Direction)0; component11.minValue = min; component11.maxValue = max; component11.value = Mathf.Clamp(initialValue, min, max); ColorBlock colors = default(ColorBlock); ((ColorBlock)(ref colors)).normalColor = SliderHandleColor; ((ColorBlock)(ref colors)).highlightedColor = SliderHandleHighlight; ((ColorBlock)(ref colors)).pressedColor = SliderHandlePressed; ((ColorBlock)(ref colors)).selectedColor = SliderHandleColor; ((ColorBlock)(ref colors)).disabledColor = new Color(0.4f, 0.4f, 0.4f); ((ColorBlock)(ref colors)).colorMultiplier = 1f;