protected override void ShowMore()
        {
            request          = new GetUserBeatmapsRequest(User.Value.Id, type, VisiblePages++, ItemsPerPage);
            request.Success += sets => Schedule(() =>
            {
                MoreButton.FadeTo(sets.Count == ItemsPerPage ? 1 : 0);
                MoreButton.IsLoading = false;

                if (!sets.Any() && VisiblePages == 1)
                {
                    MissingText.Show();
                    return;
                }

                foreach (var s in sets)
                {
                    if (!s.OnlineBeatmapSetID.HasValue)
                    {
                        continue;
                    }

                    ItemsContainer.Add(new DirectGridPanel(s.ToBeatmapSet(Rulesets))
                    {
                        Anchor = Anchor.TopCentre,
                        Origin = Anchor.TopCentre,
                    });
                }
            });

            Api.Queue(request);
        }
Example #2
0
        protected override void ShowMore()
        {
            request          = new GetUserScoresRequest(User.Value.Id, type, VisiblePages++, ItemsPerPage);
            request.Success += scores => Schedule(() =>
            {
                foreach (var s in scores)
                {
                    s.Ruleset = Rulesets.GetRuleset(s.RulesetID);
                }

                if (!scores.Any() && VisiblePages == 1)
                {
                    MoreButton.Hide();
                    MoreButton.IsLoading = false;
                    MissingText.Show();
                    return;
                }

                IEnumerable <DrawableProfileScore> drawableScores;

                switch (type)
                {
                default:
                    drawableScores = scores.Select(score => new DrawablePerformanceScore(score, includeWeight ? Math.Pow(0.95, ItemsContainer.Count) : (double?)null));
                    break;

                case ScoreType.Recent:
                    drawableScores = scores.Select(score => new DrawableTotalScore(score));
                    break;
                }

                LoadComponentsAsync(drawableScores, s =>
                {
                    MissingText.Hide();
                    MoreButton.FadeTo(scores.Count == ItemsPerPage ? 1 : 0);
                    MoreButton.IsLoading = false;

                    ItemsContainer.AddRange(s);
                });
            });

            Api.Queue(request);
        }
Example #3
0
        protected override void ShowMore()
        {
            request          = new GetUserMostPlayedBeatmapsRequest(User.Value.Id, VisiblePages++ *ItemsPerPage);
            request.Success += beatmaps => Schedule(() =>
            {
                MoreButton.FadeTo(beatmaps.Count == ItemsPerPage ? 1 : 0);
                MoreButton.IsLoading = false;

                if (!beatmaps.Any() && VisiblePages == 1)
                {
                    MissingText.Show();
                    return;
                }

                MissingText.Hide();

                foreach (var beatmap in beatmaps)
                {
                    ItemsContainer.Add(new DrawableMostPlayedRow(beatmap.GetBeatmapInfo(Rulesets), beatmap.PlayCount));
                }
            });

            Api.Queue(request);
        }
Example #4
0
        protected override void ShowMore()
        {
            request          = new GetUserRecentActivitiesRequest(User.Value.Id, VisiblePages++ *ItemsPerPage);
            request.Success += activities => Schedule(() =>
            {
                MoreButton.FadeTo(activities.Count == ItemsPerPage ? 1 : 0);
                MoreButton.IsLoading = false;

                if (!activities.Any() && VisiblePages == 1)
                {
                    MissingText.Show();
                    return;
                }

                MissingText.Hide();

                foreach (APIRecentActivity activity in activities)
                {
                    ItemsContainer.Add(new DrawableRecentActivity(activity));
                }
            });

            Api.Queue(request);
        }