using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyCompany("DashboardOverhaul")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("A series of enhancements for the in-game Dashboard / 为游戏内仪表盘提供一系列优化")] [assembly: AssemblyFileVersion("1.1.0.0")] [assembly: AssemblyInformationalVersion("1.1.0+daef6169a856768b4ce6b07520eb4af0c40d594f")] [assembly: AssemblyProduct("DashboardOverhaul")] [assembly: AssemblyTitle("DashboardOverhaul")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace DashboardOverhaul { public static class ChartRename { private static InputField _input; private static UIChart _target; public static void Begin(UIChart chart) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)chart == (Object)null) { return; } UIDashboard uiDashboard = chart.uiDashboard; if ((Object)(object)uiDashboard == (Object)null || (Object)(object)uiDashboard.chartContentRt == (Object)null) { return; } StatPlan val = ResolveStatPlan(chart); if (val != null) { InputField obj = EnsureInput(uiDashboard); _target = chart; RectTransform val2 = (RectTransform)((Component)obj).transform; RectTransform obj2 = (((Object)(object)chart.titleText != (Object)null) ? ((Graphic)chart.titleText).rectTransform : chart.rectTrans); Transform parent = ((Transform)val2).parent; RectTransform val3 = (RectTransform)(object)((parent is RectTransform) ? parent : null); Vector3[] array = (Vector3[])(object)new Vector3[4]; obj2.GetWorldCorners(array); float num = 140f; float num2 = 22f; if ((Object)(object)val3 != (Object)null) { Vector3 val4 = ((Transform)val3).InverseTransformPoint(array[1]); Vector3 val5 = ((Transform)val3).InverseTransformPoint(array[2]); Vector3 val6 = ((Transform)val3).InverseTransformPoint(array[0]); num = Mathf.Max(140f, Mathf.Abs(val5.x - val4.x)); num2 = Mathf.Max(20f, Mathf.Abs(val4.y - val6.y)); } Vector2 val7 = default(Vector2); ((Vector2)(ref val7))..ctor(0f, 1f); val2.anchorMax = val7; val2.anchorMin = val7; val2.pivot = new Vector2(0f, 1f); val2.sizeDelta = new Vector2(num, num2); ((Transform)val2).position = array[1]; ((Component)obj).gameObject.SetActive(true); obj.text = val.name ?? string.Empty; ((Selectable)obj).Select(); obj.ActivateInputField(); } } public static void CancelIfTargeting(UIChart chart) { if ((Object)(object)_target == (Object)(object)chart) { Hide(); } } public static void Free() { if ((Object)(object)_input != (Object)null) { Object.Destroy((Object)(object)((Component)_input).gameObject); } _input = null; _target = null; } private static StatPlan ResolveStatPlan(UIChart chart) { StatPlanPool val = (((Object)(object)chart != (Object)null && chart.charts != null) ? chart.charts.statPlans : null); if (val == null || val.buffer == null || chart.chartData == null) { return null; } int statPlanId = chart.chartData.statPlanId; if (statPlanId < 0 || statPlanId >= val.buffer.Length) { return null; } return val.buffer[statPlanId]; } private static InputField EnsureInput(UIDashboard dash) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0072: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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_00db: 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_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_input != (Object)null) { return _input; } Font font = (((Object)(object)dash.emptyTip != (Object)null) ? dash.emptyTip.font : null); GameObject val = new GameObject("DO_ChartRenameInput", new Type[1] { typeof(RectTransform) }); RectTransform val2 = (RectTransform)val.transform; ((Transform)val2).SetParent((Transform)(object)dash.chartContentRt, false); val2.sizeDelta = new Vector2(140f, 22f); ((Graphic)val.AddComponent()).color = new Color(0f, 0f, 0f, 0.85f); GameObject val3 = new GameObject("Text", new Type[1] { typeof(RectTransform) }); RectTransform val4 = (RectTransform)val3.transform; ((Transform)val4).SetParent((Transform)(object)val2, false); val4.anchorMin = Vector2.zero; val4.anchorMax = Vector2.one; val4.offsetMin = new Vector2(6f, 0f); val4.offsetMax = new Vector2(-6f, 0f); Text val5 = val3.AddComponent(); val5.font = font; val5.fontSize = 14; val5.alignment = (TextAnchor)3; ((Graphic)val5).color = Color.white; val5.supportRichText = false; val5.verticalOverflow = (VerticalWrapMode)1; InputField obj = val.AddComponent(); obj.textComponent = val5; obj.lineType = (LineType)0; obj.characterLimit = 64; ((UnityEvent)(object)obj.onEndEdit).AddListener((UnityAction)Commit); val.SetActive(false); _input = obj; return obj; } private static void Commit(string value) { UIChart target = _target; Hide(); StatPlan val = ResolveStatPlan(target); if (val != null) { string text = (value ?? string.Empty).Trim(); val.Rename(ref text); target.TruncateStatPlanNameText(); RefreshSidebarName(target.uiDashboard, val); } } private static void RefreshSidebarName(UIDashboard dash, StatPlan statPlan) { UIStatboard val = (((Object)(object)dash != (Object)null) ? dash.statboard : null); if ((Object)(object)val == (Object)null || val.objectEntryPool == null || statPlan == null) { return; } List objectEntryPool = val.objectEntryPool; for (int i = 0; i < objectEntryPool.Count; i++) { UIStatPlanEntry val2 = objectEntryPool[i]; if ((Object)(object)val2 != (Object)null && val2.statPlan != null && val2.statPlan.id == statPlan.id && (Object)(object)val2.nameInput != (Object)null) { val2.nameInput.text = (string.IsNullOrEmpty(statPlan.name) ? null : statPlan.name); } } } private static void Hide() { _target = null; if ((Object)(object)_input != (Object)null) { ((Component)_input).gameObject.SetActive(false); } } } public class ChartTitleRenameTrigger : MonoBehaviour, IPointerClickHandler, IEventSystemHandler { public UIChart Owner; public void OnPointerClick(PointerEventData eventData) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Owner == (Object)null) && (int)eventData.button == 0 && eventData.clickCount >= 2) { ChartRename.Begin(Owner); } } } public static class DashboardLayoutPatch { [HarmonyPrefix] [HarmonyPatch(typeof(DashboardLayout), "Import")] private static void Import_Prefix(DashboardLayout __instance) { if (__instance.pages != null) { __instance.pages[1] = null; } } } [BepInPlugin("org.fyyy.dashboardoverhaul", "DashboardOverhaul", "1.1.0")] public class DashboardOverhaulPlugin : BaseUnityPlugin { public static readonly ManualLogSource Logger = Logger.CreateLogSource("DashboardOverhaul"); private Harmony _harmony; private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown _harmony = new Harmony("org.fyyy.dashboardoverhaul"); _harmony.PatchAll(typeof(UIDashboardPatch)); _harmony.PatchAll(typeof(UIChartPatch)); _harmony.PatchAll(typeof(DashboardLayoutPatch)); Logger.LogInfo((object)"DashboardOverhaul loaded."); } private void OnDestroy() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } } public static class Loc { public static string L(string zh, string en) { if (!Localization.isZHCN) { return en; } return zh; } } public static class PageOps { public static int ActivePageCount(CustomCharts charts) { int num = 0; DashboardPage[] pages = charts.dashboardLayout.pages; for (int i = 1; i < 10; i++) { if (pages[i] != null) { num++; } } return num; } public static int FirstFreeSlot(DashboardLayout layout) { DashboardPage[] pages = layout.pages; for (int i = 1; i < 10; i++) { if (pages[i] == null) { return i; } } return -1; } public static int FirstActiveSlot(DashboardLayout layout) { DashboardPage[] array = layout?.pages; if (array == null) { return -1; } for (int i = 1; i < 10; i++) { if (array[i] != null) { return i; } } return -1; } public static bool IsValidViewPage(CustomCharts charts) { DashboardPage[] array = charts?.dashboardLayout?.pages; if (array == null) { return false; } int pageIndex = charts.currentView.pageIndex; if (pageIndex >= 1 && pageIndex < 10) { return array[pageIndex] != null; } return false; } public static int AddPage(CustomCharts charts) { DashboardLayout dashboardLayout = charts.dashboardLayout; int num = FirstFreeSlot(dashboardLayout); if (num < 0) { return -1; } dashboardLayout.AddPage(num); return num; } public static bool CanDelete(CustomCharts charts) { return ActivePageCount(charts) > 1; } public static int PickPageAfterDelete(DashboardLayout layout, int deletedIndex) { DashboardPage[] pages = layout.pages; for (int num = deletedIndex - 1; num >= 1; num--) { if (pages[num] != null) { return num; } } for (int i = deletedIndex + 1; i < 10; i++) { if (pages[i] != null) { return i; } } return -1; } public static bool RemovePage(CustomCharts charts, int index) { if (index < 1 || index >= 10) { return false; } DashboardPage[] pages = charts.dashboardLayout.pages; DashboardPage val = pages[index]; if (val == null) { return false; } val.Free(); pages[index] = null; return true; } public static void RenamePage(DashboardPage page, string newName) { if (page != null) { page.name = (newName ?? string.Empty).Trim(); } } } public class PageTab : MonoBehaviour, IPointerClickHandler, IEventSystemHandler { public int Slot; private PageTabBar _bar; public Text Label; public Image Background; public void Setup(PageTabBar bar, int slot, string label, bool current) { _bar = bar; Slot = slot; if ((Object)(object)Label != (Object)null) { Label.text = label; } SetCurrent(current); } public void SetCurrent(bool current) { //IL_0029: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Background == (Object)null)) { Color val = ((_bar != null) ? _bar.Dashboard.focusColor : Color.gray); ((Graphic)Background).color = (Color)(current ? val : new Color(val.r, val.g, val.b, 0.15f)); } } public void OnPointerClick(PointerEventData eventData) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Invalid comparison between Unknown and I4 if (_bar != null) { if ((int)eventData.button == 1) { _bar.OpenContextMenu(this); } else if (eventData.clickCount >= 2) { _bar.BeginRename(this); } else { _bar.SwitchTo(Slot); } } } } public class PageTabBar { private RectTransform _root; private Font _font; private readonly List _tabs = new List(); private InputField _renameInput; private int _renamingSlot = -1; private const int kTabHeight = 20; private const int kTabMinWidth = 64; private const float kTabMaxWidth = 160f; private const float kTabHPadding = 20f; private const float kBaseLeftMargin = 40f; private const float kTopOffset = -4f; public UIDashboard Dashboard { get; private set; } public void Build(UIDashboard dashboard) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) Dashboard = dashboard; _font = (((Object)(object)dashboard.emptyTip != (Object)null) ? dashboard.emptyTip.font : null); if ((Object)(object)_font == (Object)null) { DashboardOverhaulPlugin.Logger.LogWarning((object)"[DashboardOverhaul] emptyTip/font is null; tab labels may be invisible."); } GameObject val = new GameObject("DO_PageTabBar", new Type[1] { typeof(RectTransform) }); _root = (RectTransform)val.transform; ((Transform)_root).SetParent((Transform)(object)dashboard.rectTrans, false); _root.anchorMin = new Vector2(0f, 1f); _root.anchorMax = new Vector2(0f, 1f); _root.pivot = new Vector2(0f, 1f); _root.anchoredPosition = new Vector2(40f, -4f); _root.sizeDelta = new Vector2(0f, 20f); HorizontalLayoutGroup obj = val.AddComponent(); ((HorizontalOrVerticalLayoutGroup)obj).spacing = 4f; ((HorizontalOrVerticalLayoutGroup)obj).childForceExpandWidth = false; ((HorizontalOrVerticalLayoutGroup)obj).childForceExpandHeight = true; ((HorizontalOrVerticalLayoutGroup)obj).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)obj).childControlHeight = true; val.AddComponent().horizontalFit = (FitMode)2; } public void Free() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)((Component)_root).gameObject); } _root = null; _renameInput = null; _renamingSlot = -1; _tabs.Clear(); Dashboard = null; } public void UpdateLayout() { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_root == (Object)null) && !((Object)(object)Dashboard == (Object)null)) { float num = 0f; RectTransform statboardTestRt = Dashboard.statboardTestRt; if ((Object)(object)statboardTestRt != (Object)null) { Rect rect = statboardTestRt.rect; num = Mathf.Max(0f, ((Rect)(ref rect)).width + statboardTestRt.anchoredPosition.x); } _root.anchoredPosition = new Vector2(40f + num, -4f); } } public void Refresh() { if ((Object)(object)_root == (Object)null || (Object)(object)Dashboard == (Object)null) { return; } for (int num = ((Transform)_root).childCount - 1; num >= 0; num--) { Object.Destroy((Object)(object)((Component)((Transform)_root).GetChild(num)).gameObject); } _tabs.Clear(); CustomCharts charts = Dashboard.charts; if (charts == null) { return; } DashboardPage[] pages = charts.dashboardLayout.pages; int pageIndex = charts.currentView.pageIndex; float maxWidth = ComputePerTabMax(); for (int i = 1; i < 10; i++) { if (pages[i] != null) { string label = (string.IsNullOrEmpty(pages[i].name) ? i.ToString() : pages[i].name); _tabs.Add(CreateTab(i, label, i == pageIndex, maxWidth)); } } CreateAddButton(); } private PageTab CreateTab(int slot, string label, bool current, float maxWidth) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("DO_Tab_" + slot, new Type[1] { typeof(RectTransform) }); RectTransform val2 = (RectTransform)val.transform; ((Transform)val2).SetParent((Transform)(object)_root, false); Image val3 = val.AddComponent(); ((Graphic)val3).raycastTarget = true; LayoutElement val4 = val.AddComponent(); val4.minWidth = 64f; val4.preferredHeight = 20f; GameObject val5 = new GameObject("Text", new Type[1] { typeof(RectTransform) }); RectTransform val6 = (RectTransform)val5.transform; ((Transform)val6).SetParent((Transform)(object)val2, false); val6.anchorMin = Vector2.zero; val6.anchorMax = Vector2.one; val6.offsetMin = new Vector2(10f, 0f); val6.offsetMax = new Vector2(-10f, 0f); Text val7 = val5.AddComponent(); val7.font = _font; val7.fontSize = 14; val7.alignment = (TextAnchor)4; ((Graphic)val7).color = Color.white; ((Graphic)val7).raycastTarget = false; val7.horizontalOverflow = (HorizontalWrapMode)1; val7.verticalOverflow = (VerticalWrapMode)1; PageTab pageTab = val.AddComponent(); pageTab.Label = val7; pageTab.Background = val3; pageTab.Setup(this, slot, label, current); FitTabWidth(val7, val4, label, maxWidth); return pageTab; } private static void FitTabWidth(Text text, LayoutElement le, string label, float maxWidth) { float num = maxWidth - 20f; text.text = label; if (text.preferredWidth > num) { string text2 = label; while (text2.Length > 1) { text2 = text2.Substring(0, text2.Length - 1); text.text = text2 + "..."; if (text.preferredWidth <= num) { break; } } } le.preferredWidth = Mathf.Clamp(text.preferredWidth + 20f, 64f, maxWidth); } private float ComputePerTabMax() { //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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Dashboard == (Object)null || (Object)(object)Dashboard.rectTrans == (Object)null) { return 160f; } Rect rect = Dashboard.rectTrans.rect; float width = ((Rect)(ref rect)).width; if (width <= 1f) { return 160f; } float num = 0f; RectTransform statboardTestRt = Dashboard.statboardTestRt; if ((Object)(object)statboardTestRt != (Object)null) { rect = statboardTestRt.rect; num = Mathf.Max(0f, ((Rect)(ref rect)).width + statboardTestRt.anchoredPosition.x); } float num2 = (width - num) / 10f; return Mathf.Max(64f, num2); } public void SwitchTo(int slot) { if (!((Object)(object)Dashboard == (Object)null)) { Dashboard.SetViewPage(slot); UpdateHighlights(); } } private void UpdateHighlights() { if ((Object)(object)Dashboard == (Object)null || Dashboard.charts == null) { return; } int pageIndex = Dashboard.charts.currentView.pageIndex; foreach (PageTab tab in _tabs) { if ((Object)(object)tab != (Object)null) { tab.SetCurrent(tab.Slot == pageIndex); } } } public void AddNewPage() { if (!((Object)(object)Dashboard == (Object)null)) { int num = PageOps.AddPage(Dashboard.charts); if (num < 0) { UIRealtimeTip.Popup(Loc.L("已达页面上限", "Page limit reached"), true, 0); return; } Dashboard.SetViewPage(num); Refresh(); } } private void CreateAddButton() { //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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Expected O, but got Unknown GameObject val = new GameObject("DO_AddBtn", new Type[1] { typeof(RectTransform) }); RectTransform val2 = (RectTransform)val.transform; ((Transform)val2).SetParent((Transform)(object)_root, false); Image val3 = val.AddComponent(); Color focusColor = Dashboard.focusColor; ((Graphic)val3).color = new Color(focusColor.r, focusColor.g, focusColor.b, 0.15f); LayoutElement obj = val.AddComponent(); obj.minWidth = 20f; obj.preferredHeight = 20f; AddPlusBar(val2, 12f, 2f); AddPlusBar(val2, 2f, 12f); Button obj2 = val.AddComponent