Ejemplo n.º 1
0
        public override GameObject CreateObject(Transform parent)
        {
            IconSegmentedControl prefab = Resources.FindObjectsOfTypeAll <IconSegmentedControl>().First(x => x.name == "BeatmapCharacteristicSegmentedControl" && x.GetPrivateField <DiContainer>("_container") != null);
            IconSegmentedControl iconSegmentedControl = MonoBehaviour.Instantiate(prefab, parent, false);

            iconSegmentedControl.name = "BSMLIconSegmentedControl";
            iconSegmentedControl.SetPrivateField("_container", prefab.GetPrivateField <DiContainer>("_container"));
            (iconSegmentedControl.transform as RectTransform).anchoredPosition = new Vector2(0, 0);
            foreach (Transform transform in iconSegmentedControl.transform)
            {
                GameObject.Destroy(transform.gameObject);
            }
            MonoBehaviour.Destroy(iconSegmentedControl.GetComponent <BeatmapCharacteristicSegmentedControlController>());
            return(iconSegmentedControl.gameObject);
        }
Ejemplo n.º 2
0
        static bool Prefix(ref IDifficultyBeatmap ____difficultyBeatmap, ref List <LeaderboardTableView.ScoreData> ____scores, ref bool ____hasScoresData, ref LeaderboardTableView ____leaderboardTableView, ref int[] ____playerScorePos, ref PlatformLeaderboardsModel.ScoresScope ____scoresScope, ref IconSegmentedControl ____scopeSegmentedControl)
        {
            if (____difficultyBeatmap.level is CustomBeatmapLevel)
            {
                IconSegmentedControl.DataItem thirdCell = ____scopeSegmentedControl.GetPrivateField <IconSegmentedControl.DataItem[]>("_dataItems").Last();
                thirdCell.SetPrivateProperty("hintText", "Platform: PC");
                thirdCell.SetPrivateProperty("icon", BeatBoardsUIManager.Instance.PCIcon);

                ____hasScoresData = false;
                ____scores.Clear();
                ____leaderboardTableView.SetScores(____scores, ____playerScorePos[(int)____scoresScope]);

                Events.Instance.leaderboardOpened.Invoke(____difficultyBeatmap, ____leaderboardTableView);
                return(false);
            }
            return(true);
        }