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);
        }
Exemple #2
0
        public void SetUpSteps()
        {
            AddStep("create editor overlay", () =>
            {
                SetContents(() =>
                {
                    var ruleset = new OsuRuleset();
                    var working = CreateWorkingBeatmap(ruleset.RulesetInfo);
                    var beatmap = working.GetPlayableBeatmap(ruleset.RulesetInfo);

                    var drawableRuleset = ruleset.CreateDrawableRulesetWith(beatmap);

                    var hudOverlay = new HUDOverlay(drawableRuleset, Array.Empty <Mod>())
                    {
                        Anchor = Anchor.Centre,
                        Origin = Anchor.Centre,
                    };

                    // Add any key just to display the key counter visually.
                    hudOverlay.KeyCounter.Add(new KeyCounterKeyboard(Key.Space));
                    scoreProcessor.Combo.Value = 1;

                    return(new Container
                    {
                        RelativeSizeAxes = Axes.Both,
                        Children = new Drawable[]
                        {
                            drawableRuleset,
                            hudOverlay,
                            new SkinEditor(hudOverlay),
                        }
                    });
                });
            });
        }
Exemple #3
0
    private void Awake()
    {
        GameObject hudObject = Instantiate(hudOverlayPrefab);

        hudOverlay = hudObject.GetComponent <HUDOverlay>();
        LoadSave();
    }
Exemple #4
0
    private void Awake()
    {
        savePath = GetSavePath();
        GameObject hudObject = Instantiate(hudOverlayPrefab);

        hudOverlay = hudObject.GetComponent <HUDOverlay>();
        audioSrc   = GetComponent <AudioSource>();
        LoadSave();
    }
        private void createNew(Action <HUDOverlay> action = null)
        {
            AddStep("create overlay", () =>
            {
                Child = hudOverlay = new HUDOverlay(null, null, Array.Empty <Mod>());

                action?.Invoke(hudOverlay);
            });
        }
Exemple #6
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
            });
        }
        private void createNew(Action <HUDOverlay> action = null)
        {
            AddStep("create overlay", () =>
            {
                Child = hudOverlay = new HUDOverlay(null, null, null, Array.Empty <Mod>());

                // Add any key just to display the key counter visually.
                hudOverlay.KeyCounter.Add(new KeyCounterKeyboard(Key.Space));

                action?.Invoke(hudOverlay);
            });
        }
Exemple #8
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
            });
        }
Exemple #9
0
        private void createNew(Action <HUDOverlay> action = null)
        {
            AddStep("create overlay", () =>
            {
                SetContents(() =>
                {
                    hudOverlay = new HUDOverlay(scoreProcessor, null, null, Array.Empty <Mod>());

                    // Add any key just to display the key counter visually.
                    hudOverlay.KeyCounter.Add(new KeyCounterKeyboard(Key.Space));

                    action?.Invoke(hudOverlay);

                    return(hudOverlay);
                });
            });
        }
Exemple #10
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
            });
        }
Exemple #11
0
 public void ApplyToHUD(HUDOverlay overlay)
 {
     overlay.ShowHealthBar.BindTo(showHealthBar);
 }
Exemple #12
0
 public void ApplyToHUD(HUDOverlay overlay)
 {
     overlay.Add(CreateSnowContainer);
 }
 public void ApplyToHUD(HUDOverlay overlay)
 {
     this.overlay = overlay;
 }