protected override void LoadComplete()
        {
            base.LoadComplete();

            SelectedItem.BindValueChanged(item =>
            {
                // the underlying playlist is regularly cleared for maintenance purposes (things which probably need to be fixed eventually).
                // to avoid exposing a state change when there may actually be none, ignore all nulls for now.
                if (item.NewValue == null)
                {
                    return;
                }

                downloadTracker?.RemoveAndDisposeImmediately();
                selectedBeatmap = null;

                beatmapLookupCache.GetBeatmapAsync(item.NewValue.Beatmap.OnlineID).ContinueWith(task => Schedule(() =>
                {
                    var beatmap = task.GetResultSafely();

                    if (SelectedItem.Value?.Beatmap.OnlineID == beatmap.OnlineID)
                    {
                        selectedBeatmap = beatmap;
                        beginTracking();
                    }
                }), TaskContinuationOptions.OnlyOnRanToCompletion);
            }, true);
        }
Exemplo n.º 2
0
 private void success(APIBeatmap beatmap)
 {
     Add(new TournamentBeatmapPanel(beatmap)
     {
         Anchor = Anchor.Centre,
         Origin = Anchor.Centre
     });
 }
Exemplo n.º 3
0
        private void success(APIBeatmap apiBeatmap)
        {
            var beatmap = apiBeatmap.ToBeatmap(rulesets);

            Add(new TournamentBeatmapPanel(beatmap)
            {
                Anchor = Anchor.Centre,
                Origin = Anchor.Centre
            });
        }
Exemplo n.º 4
0
        public TournamentBeatmapPanel(APIBeatmap beatmap, string mod = null)
        {
            if (beatmap == null) throw new ArgumentNullException(nameof(beatmap));

            Beatmap = beatmap;
            this.mod = mod;

            Width = 400;
            Height = HEIGHT;
        }
Exemplo n.º 5
0
 public TournamentBeatmap(APIBeatmap beatmap)
 {
     OnlineID       = beatmap.OnlineID;
     DifficultyName = beatmap.DifficultyName;
     BPM            = beatmap.BPM;
     Length         = beatmap.Length;
     StarRating     = beatmap.StarRating;
     Metadata       = beatmap.Metadata;
     Difficulty     = beatmap.Difficulty;
     Covers         = beatmap.BeatmapSet.AsNonNull().Covers;
 }
Exemplo n.º 6
0
        private void success(APIBeatmap beatmap)
        {
            var mods = rulesets.GetRuleset(Ladder.Ruleset.Value.ID ?? 0).CreateInstance().AllMods;

            foreach (var mod in mods)
            {
                fillFlow.Add(new TournamentBeatmapPanel(beatmap, mod.Acronym)
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre
                });
            }
        }
Exemplo n.º 7
0
        private void success(APIBeatmap beatmap)
        {
            var ruleset = rulesets.GetRuleset(Ladder.Ruleset.Value.OnlineID);

            if (ruleset == null)
            {
                return;
            }

            var mods = ruleset.CreateInstance().AllMods;

            foreach (var mod in mods)
            {
                fillFlow.Add(new TournamentBeatmapPanel(new TournamentBeatmap(beatmap), mod.Acronym)
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre
                });
            }
        }