Esempio n. 1
0
        // NOTE: also deletes any elements added in by other mods
        private void ModifyPanelElements()
        {
            RectTransform[] rectTransforms = _levelParamsPanel.GetComponentsInChildren <RectTransform>();

            // remove unneeded elements and reposition time and bpm
            foreach (var rt in rectTransforms)
            {
                if (rt.name == "Time" || rt.name == "BPM")
                {
                    rt.anchorMin = new Vector2(0.5f, 1f);
                    rt.anchorMax = new Vector2(0.5f, 1f);
                    rt.pivot     = new Vector2(0.5f, 1f);
                    rt.sizeDelta = new Vector2(20f, 0f);

                    // remove the hoverhint, otherwise we get null exceptions from onpointerenter/exit
                    Destroy(rt.GetComponentInChildren <HoverHint>());
                }
                else if ((rt.parent.name == "Time" || rt.parent.name == "BPM") && rt.name == "Icon")
                {
                    rt.anchorMin        = new Vector2(0f, 0.5f);
                    rt.anchorMax        = new Vector2(0f, 0.5f);
                    rt.pivot            = new Vector2(0f, 0.5f);
                    rt.sizeDelta        = new Vector2(5f, 5f);
                    rt.anchoredPosition = new Vector2(1f, 0f);
                }
                else if ((rt.parent.name == "Time" || rt.parent.name == "BPM") && rt.name == "ValueText")
                {
                    rt.anchorMin        = new Vector2(0f, 0.5f);
                    rt.anchorMax        = new Vector2(0f, 0.5f);
                    rt.pivot            = new Vector2(0f, 0.5f);
                    rt.sizeDelta        = new Vector2(12f, 7f);
                    rt.anchoredPosition = new Vector2(6f, 0f);

                    rt.GetComponentInChildren <TextMeshProUGUI>().fontSize = 5f;
                }
                else if (rt.name != "LevelParamsPanel")
                {
                    Destroy(rt.gameObject);
                }
            }

            // remove favorites toggle
            Destroy(_standardLevelDetailView.transform.Find("LevelInfo/FavoritesToggle").gameObject);
        }
        // NOTE: also deletes any elements added in by other mods
        private void ModifyPanelElements()
        {
            RectTransform[] rectTransforms = _levelParamsPanel.GetComponentsInChildren <RectTransform>();

            // remove unneeded elements and reposition time and bpm
            foreach (var rt in rectTransforms)
            {
                if (rt.name == "Time" || rt.name == "BPM")
                {
                    rt.anchorMin = new Vector2(0.5f, 1f);
                    rt.anchorMax = new Vector2(0.5f, 1f);
                    rt.pivot     = new Vector2(0.5f, 1f);
                    rt.sizeDelta = new Vector2(20f, 0f);
                }
                else if ((rt.parent.name == "Time" || rt.parent.name == "BPM") && rt.name == "Icon")
                {
                    rt.anchorMin        = new Vector2(0f, 0.5f);
                    rt.anchorMax        = new Vector2(0f, 0.5f);
                    rt.pivot            = new Vector2(0f, 0.5f);
                    rt.sizeDelta        = new Vector2(5f, 5f);
                    rt.anchoredPosition = new Vector2(1f, 0f);
                }
                else if ((rt.parent.name == "Time" || rt.parent.name == "BPM") && rt.name == "ValueText")
                {
                    rt.anchorMin        = new Vector2(0f, 0.5f);
                    rt.anchorMax        = new Vector2(0f, 0.5f);
                    rt.pivot            = new Vector2(0f, 0.5f);
                    rt.sizeDelta        = new Vector2(12f, 7f);
                    rt.anchoredPosition = new Vector2(6f, 0f);

                    rt.GetComponentInChildren <TextMeshProUGUI>().fontSize = 5f;
                }
                else if (rt.name != "LevelParamsPanel")
                {
                    Destroy(rt.gameObject);
                }
            }
        }