示例#1
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);
        }
示例#2
0
        public void SetControlData(IDifficultyBeatmapSet[] difficultyBeatmapSets, BeatmapCharacteristicSO selectedBeatmapCharacteristic)
        {
            _beatmapCharacteristics.Clear();
            List <IDifficultyBeatmapSet> list = new List <IDifficultyBeatmapSet>(difficultyBeatmapSets);

            list.Sort((IDifficultyBeatmapSet a, IDifficultyBeatmapSet b) => a.beatmapCharacteristic.sortingOrder.CompareTo(b.beatmapCharacteristic.sortingOrder));
            difficultyBeatmapSets = list.ToArray();
            IconSegmentedControl.DataItem[] array = new IconSegmentedControl.DataItem[difficultyBeatmapSets.Length];
            int num = 0;

            for (int i = 0; i < difficultyBeatmapSets.Length; i++)
            {
                BeatmapCharacteristicSO beatmapCharacteristic = difficultyBeatmapSets[i].beatmapCharacteristic;
                array[i] = new IconSegmentedControl.DataItem(beatmapCharacteristic.icon, Localization.Get(beatmapCharacteristic.descriptionLocalizationKey));
                _beatmapCharacteristics.Add(beatmapCharacteristic);
                if (beatmapCharacteristic == selectedBeatmapCharacteristic)
                {
                    num = i;
                }
            }
            characteristicControl.SetData(array);
            characteristicControl.SelectCellWithNumber(num);
            SetSelectedCharateristic(null, num);
        }