private void load()
        {
            // todo: this should be implemented via a custom HUD implementation, and correctly masked to the main content area.
            LoadComponentAsync(leaderboard = new MultiplayerGameplayLeaderboard(ScoreProcessor, userIds), HUDOverlay.Add);

            HUDOverlay.Add(loadingDisplay = new LoadingLayer(true)
            {
                Depth = float.MaxValue
            });

            if (Token == null)
            {
                return; // Todo: Somehow handle token retrieval failure.
            }
            client.MatchStarted += onMatchStarted;
            client.ResultsReady += onResultsReady;

            ScoreProcessor.HasCompleted.BindValueChanged(completed =>
            {
                // wait for server to tell us that results are ready (see SubmitScore implementation)
                loadingDisplay.Show();
            });

            isConnected = client.IsConnected.GetBoundCopy();
            isConnected.BindValueChanged(connected =>
            {
                if (!connected.NewValue)
                {
                    // messaging to the user about this disconnect will be provided by the MultiplayerMatchSubScreen.
                    failAndBail();
                }
            }, true);

            Debug.Assert(client.Room != null);
        }
Beispiel #2
0
        private void load()
        {
            // todo: this should be implemented via a custom HUD implementation, and correctly masked to the main content area.
            LoadComponentAsync(leaderboard = new MultiplayerGameplayLeaderboard(ScoreProcessor, userIds), HUDOverlay.Add);

            HUDOverlay.Add(loadingDisplay = new LoadingLayer(true)
            {
                Depth = float.MaxValue
            });
        }
Beispiel #3
0
        private void load()
        {
            if (!LoadedBeatmapSuccessfully)
            {
                return;
            }

            HUDOverlay.Add(leaderboardFlow = new FillFlowContainer
            {
                AutoSizeAxes = Axes.Both,
                Direction    = FillDirection.Vertical,
                Spacing      = new Vector2(5)
            });

            HUDOverlay.HoldingForHUD.BindValueChanged(_ => updateLeaderboardExpandedState());
            LocalUserPlaying.BindValueChanged(_ => updateLeaderboardExpandedState(), true);

            // todo: this should be implemented via a custom HUD implementation, and correctly masked to the main content area.
            LoadComponentAsync(leaderboard = new MultiplayerGameplayLeaderboard(users), l =>
            {
                if (!LoadedBeatmapSuccessfully)
                {
                    return;
                }

                leaderboard.Expanded.BindTo(leaderboardExpanded);

                leaderboardFlow.Insert(0, l);

                if (leaderboard.TeamScores.Count >= 2)
                {
                    LoadComponentAsync(new GameplayMatchScoreDisplay
                    {
                        Team1Score = { BindTarget = leaderboard.TeamScores.First().Value },
                        Team2Score = { BindTarget = leaderboard.TeamScores.Last().Value },
                        Expanded   = { BindTarget = HUDOverlay.ShowHud },
                    }, scoreDisplay => leaderboardFlow.Insert(1, scoreDisplay));
                }
            });

            LoadComponentAsync(new GameplayChatDisplay(Room)
            {
                Expanded = { BindTarget = leaderboardExpanded },
            }, chat => leaderboardFlow.Insert(2, chat));

            HUDOverlay.Add(loadingDisplay = new LoadingLayer(true)
            {
                Depth = float.MaxValue
            });
        }
Beispiel #4
0
        private void load()
        {
            if (!LoadedBeatmapSuccessfully)
            {
                return;
            }

            HUDOverlay.Add(leaderboardFlow = new FillFlowContainer
            {
                AutoSizeAxes = Axes.Both,
                Direction    = FillDirection.Vertical,
            });

            // todo: this should be implemented via a custom HUD implementation, and correctly masked to the main content area.
            LoadComponentAsync(leaderboard = new MultiplayerGameplayLeaderboard(ScoreProcessor, users), l =>
            {
                if (!LoadedBeatmapSuccessfully)
                {
                    return;
                }

                ((IBindable <bool>)leaderboard.Expanded).BindTo(HUDOverlay.ShowHud);

                leaderboardFlow.Add(l);

                if (leaderboard.TeamScores.Count >= 2)
                {
                    LoadComponentAsync(new GameplayMatchScoreDisplay
                    {
                        Team1Score = { BindTarget = leaderboard.TeamScores.First().Value },
                        Team2Score = { BindTarget = leaderboard.TeamScores.Last().Value },
                        Expanded   = { BindTarget = HUDOverlay.ShowHud },
                    }, leaderboardFlow.Add);
                }
            });

            HUDOverlay.Add(loadingDisplay = new LoadingLayer(true)
            {
                Depth = float.MaxValue
            });
        }
Beispiel #5
0
 public void ApplyToHUD(HUDOverlay overlay)
 {
     overlay.Add(CreateSnowContainer);
 }