Exemple #1
0
        public HUDOverlay(ScoreProcessor scoreProcessor, RulesetContainer rulesetContainer, WorkingBeatmap working, IClock offsetClock, IAdjustableClock adjustableClock)
        {
            RelativeSizeAxes = Axes.Both;

            Children = new Drawable[]
            {
                visibilityContainer = new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Children         = new Drawable[]
                    {
                        new Container
                        {
                            Anchor           = Anchor.TopCentre,
                            Origin           = Anchor.TopCentre,
                            Y                = 30,
                            AutoSizeAxes     = Axes.Both,
                            AutoSizeDuration = 200,
                            AutoSizeEasing   = Easing.Out,
                            Children         = new Drawable[]
                            {
                                AccuracyCounter = CreateAccuracyCounter(),
                                ScoreCounter    = CreateScoreCounter(),
                                ComboCounter    = CreateComboCounter(),
                            },
                        },
                        HealthDisplay = CreateHealthDisplay(),
                        Progress      = CreateProgress(),
                        ModDisplay    = CreateModsContainer(),
                    }
                },
                PlayerSettingsOverlay = CreatePlayerSettingsOverlay(),
                new FillFlowContainer
                {
                    Anchor       = Anchor.BottomRight,
                    Origin       = Anchor.BottomRight,
                    Position     = -new Vector2(5, TwoLayerButton.SIZE_RETRACTED.Y),
                    AutoSizeAxes = Axes.Both,
                    Direction    = FillDirection.Vertical,
                    Children     = new Drawable[]
                    {
                        KeyCounter = CreateKeyCounter(adjustableClock as IFrameBasedClock),
                        HoldToQuit = CreateHoldForMenuButton(),
                    }
                }
            };

            BindProcessor(scoreProcessor);
            BindRulesetContainer(rulesetContainer);

            Progress.Objects      = rulesetContainer.Objects;
            Progress.AudioClock   = offsetClock;
            Progress.AllowSeeking = rulesetContainer.HasReplayLoaded;
            Progress.OnSeek       = pos => adjustableClock.Seek(pos);

            ModDisplay.Current.BindTo(working.Mods);

            PlayerSettingsOverlay.PlaybackSettings.AdjustableClock = adjustableClock;
        }
Exemple #2
0
        public HUDOverlay(ScoreProcessor scoreProcessor, DrawableRuleset drawableRuleset, IReadOnlyList <Mod> mods)
        {
            RelativeSizeAxes = Axes.Both;

            Children = new Drawable[]
            {
                visibilityContainer = new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Children         = new Drawable[]
                    {
                        new Container
                        {
                            Anchor           = Anchor.TopCentre,
                            Origin           = Anchor.TopCentre,
                            Y                = 30,
                            AutoSizeAxes     = Axes.Both,
                            AutoSizeDuration = 200,
                            AutoSizeEasing   = Easing.Out,
                            Children         = new Drawable[]
                            {
                                AccuracyCounter = CreateAccuracyCounter(),
                                ScoreCounter    = CreateScoreCounter(),
                                ComboCounter    = CreateComboCounter(),
                            },
                        },
                        HealthDisplay = CreateHealthDisplay(),
                        Progress      = CreateProgress(),
                        ModDisplay    = CreateModsContainer(),
                    }
                },
                PlayerSettingsOverlay = CreatePlayerSettingsOverlay(),
                new FillFlowContainer
                {
                    Anchor       = Anchor.BottomRight,
                    Origin       = Anchor.BottomRight,
                    Position     = -new Vector2(5, TwoLayerButton.SIZE_RETRACTED.Y),
                    AutoSizeAxes = Axes.Both,
                    Direction    = FillDirection.Vertical,
                    Children     = new Drawable[]
                    {
                        KeyCounter = CreateKeyCounter(),
                        HoldToQuit = CreateHoldForMenuButton(),
                    }
                }
            };

            BindProcessor(scoreProcessor);
            BindDrawableRuleset(drawableRuleset);

            Progress.Objects      = drawableRuleset.Objects;
            Progress.AllowSeeking = drawableRuleset.HasReplayLoaded.Value;
            Progress.RequestSeek  = time => RequestSeek(time);

            ModDisplay.Current.Value = mods;
        }
Exemple #3
0
        public HUDOverlay(ScoreProcessor scoreProcessor, DrawableRuleset drawableRuleset, IReadOnlyList <Mod> mods)
        {
            this.scoreProcessor  = scoreProcessor;
            this.drawableRuleset = drawableRuleset;
            this.mods            = mods;

            RelativeSizeAxes = Axes.Both;

            Children = new Drawable[]
            {
                visibilityContainer = new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Children         = new Drawable[]
                    {
                        new Container
                        {
                            Anchor           = Anchor.TopCentre,
                            Origin           = Anchor.TopCentre,
                            Y                = 30,
                            AutoSizeAxes     = Axes.Both,
                            AutoSizeDuration = 200,
                            AutoSizeEasing   = Easing.Out,
                            Children         = new Drawable[]
                            {
                                AccuracyCounter = CreateAccuracyCounter(),
                                ScoreCounter    = CreateScoreCounter(),
                                ComboCounter    = CreateComboCounter(),
                            },
                        },
                        HealthDisplay = CreateHealthDisplay(),
                        Progress      = CreateProgress(),
                        ModDisplay    = CreateModsContainer(),
                    }
                },
                PlayerSettingsOverlay = CreatePlayerSettingsOverlay(),
                new FillFlowContainer
                {
                    Anchor       = Anchor.BottomRight,
                    Origin       = Anchor.BottomRight,
                    Position     = -new Vector2(5, TwoLayerButton.SIZE_RETRACTED.Y),
                    AutoSizeAxes = Axes.Both,
                    Direction    = FillDirection.Vertical,
                    Children     = new Drawable[]
                    {
                        KeyCounter = CreateKeyCounter(),
                        HoldToQuit = CreateHoldForMenuButton(),
                    }
                }
            };
        }
Exemple #4
0
        public HUDOverlay(ScoreProcessor scoreProcessor, RulesetContainer rulesetContainer, WorkingBeatmap working, IClock offsetClock, IAdjustableClock adjustableClock)
        {
            RelativeSizeAxes = Axes.Both;

            Add(content = new Container
            {
                RelativeSizeAxes = Axes.Both,
                AlwaysPresent    = true, // The hud may be hidden but certain elements may need to still be updated
                Children         = new Drawable[]
                {
                    ComboCounter          = CreateComboCounter(),
                    ScoreCounter          = CreateScoreCounter(),
                    AccuracyCounter       = CreateAccuracyCounter(),
                    HealthDisplay         = CreateHealthDisplay(),
                    Progress              = CreateProgress(),
                    ModDisplay            = CreateModsContainer(),
                    PlayerSettingsOverlay = CreatePlayerSettingsOverlay(),
                    new FillFlowContainer
                    {
                        Anchor       = Anchor.BottomRight,
                        Origin       = Anchor.BottomRight,
                        Position     = -new Vector2(5, TwoLayerButton.SIZE_RETRACTED.Y),
                        AutoSizeAxes = Axes.Both,
                        Direction    = FillDirection.Vertical,
                        Children     = new Drawable[]
                        {
                            KeyCounter = CreateKeyCounter(adjustableClock as IFrameBasedClock),
                            HoldToQuit = CreateHoldForMenuButton(),
                        }
                    }
                }
            });

            BindProcessor(scoreProcessor);
            BindRulesetContainer(rulesetContainer);

            Progress.Objects      = rulesetContainer.Objects;
            Progress.AudioClock   = offsetClock;
            Progress.AllowSeeking = rulesetContainer.HasReplayLoaded;
            Progress.OnSeek       = pos => adjustableClock.Seek(pos);

            ModDisplay.Current.BindTo(working.Mods);

            PlayerSettingsOverlay.PlaybackSettings.AdjustableClock = adjustableClock;
        }