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);
        }
示例#2
0
        protected override void ShowMore()
        {
            base.ShowMore();

            request          = new GetUserBeatmapsRequest(User.Value.Id, type, VisiblePages++ *ItemsPerPage);
            request.Success += sets => Schedule(() =>
            {
                ShowMoreButton.FadeTo(sets.Count == ItemsPerPage ? 1 : 0);
                ShowMoreLoading.Hide();

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

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

                    var panel = new DirectGridPanel(s.ToBeatmapSet(Rulesets));
                    ItemsContainer.Add(panel);
                }
            });

            Api.Queue(request);
        }
示例#3
0
        protected override void ShowMore()
        {
            base.ShowMore();

            request          = new GetUserRecentActivitiesRequest(User.Value.Id, VisiblePages++ *ItemsPerPage);
            request.Success += activities => Schedule(() =>
            {
                ShowMoreButton.FadeTo(activities.Count == ItemsPerPage ? 1 : 0);
                ShowMoreLoading.Hide();

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

                MissingText.Hide();

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

            Api.Queue(request);
        }
        protected override void ShowMore()
        {
            base.ShowMore();

            var req = new GetUserMostPlayedBeatmapsRequest(User.Value.Id, VisiblePages++ *ItemsPerPage);

            req.Success += beatmaps =>
            {
                ShowMoreButton.FadeTo(beatmaps.Count == ItemsPerPage ? 1 : 0);
                ShowMoreLoading.Hide();

                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(req);
        }
 private void BufferTile(int x, int y)
 {
     if (CanBeEdited(x, y))
     {
         _tilesPool.Add(_map.Tiles[x, y]);
         _checkedTiles[x, y] = true;
     }
 }
示例#6
0
        protected override void ShowMore()
        {
            base.ShowMore();

            var req = new GetUserBeatmapsRequest(User.Value.Id, type, VisiblePages++ *ItemsPerPage);

            req.Success += sets =>
            {
                ShowMoreButton.FadeTo(sets.Count == ItemsPerPage ? 1 : 0);
                ShowMoreLoading.Hide();

                if (!sets.Any())
                {
                    MissingText.Show();
                    return;
                }

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

                    var panel = new DirectGridPanel(s.ToBeatmapSet(Rulesets));
                    ItemsContainer.Add(panel);

                    panel.PreviewPlaying.ValueChanged += isPlaying =>
                    {
                        if (!isPlaying)
                        {
                            return;
                        }

                        if (currentlyPlaying != null && currentlyPlaying != panel)
                        {
                            currentlyPlaying.PreviewPlaying.Value = false;
                        }

                        currentlyPlaying = panel;
                    };
                }
            };

            Api.Queue(req);
        }
示例#7
0
        protected override void ShowMore()
        {
            base.ShowMore();

            var req = new GetUserScoresRequest(User.Value.Id, type, VisiblePages++ *ItemsPerPage);

            req.Success += scores =>
            {
                foreach (var s in scores)
                {
                    s.ApplyRuleset(Rulesets.GetRuleset(s.OnlineRulesetID));
                }

                ShowMoreButton.FadeTo(scores.Count == ItemsPerPage ? 1 : 0);
                ShowMoreLoading.Hide();

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

                MissingText.Hide();

                foreach (APIScore score in scores)
                {
                    DrawableProfileScore drawableScore;

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

                    case ScoreType.Recent:
                        drawableScore = new DrawableTotalScore(score);
                        break;
                    }

                    ItemsContainer.Add(drawableScore);
                }
            };

            Api.Queue(req);
        }
示例#8
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 DrawableMostPlayedBeatmap(beatmap.GetBeatmapInfo(Rulesets), beatmap.PlayCount));
                }
            });

            Api.Queue(request);
        }