Exemplo n.º 1
0
        private void showMore()
        {
            var req = new GetUserScoresRequest(user.Value.Id, type, visiblePages++ *5);

            showMoreLoading.Show();
            showMoreButton.Hide();

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

                showMoreButton.FadeTo(scores.Count == 5 ? 1 : 0);
                showMoreLoading.Hide();

                if (!scores.Any())
                {
                    return;
                }

                missing.Hide();

                foreach (OnlineScore score in scores)
                {
                    DrawableScore drawableScore;

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

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

                    drawableScore.RelativeSizeAxes = Axes.X;
                    drawableScore.Height           = 60;

                    scoreContainer.Add(drawableScore);
                }
            };

            api.Queue(req);
        }
Exemplo n.º 2
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);
        }