コード例 #1
0
        public void SetUpSteps()
        {
            AddStep("create layer", () =>
            {
                Child = layer = new FailingLayer();
                layer.BindHealthProcessor(new DrainingHealthProcessor(1));
            });

            AddStep("enable layer", () => config.Set(OsuSetting.FadePlayfieldWhenHealthLow, true));
            AddUntilStep("layer is visible", () => layer.IsPresent);
        }
コード例 #2
0
ファイル: HUDOverlay.cs プロジェクト: gpsbird/osu-1
        public HUDOverlay(ScoreProcessor scoreProcessor, HealthProcessor healthProcessor, DrawableRuleset drawableRuleset, IReadOnlyList <Mod> mods)
        {
            this.scoreProcessor  = scoreProcessor;
            this.healthProcessor = healthProcessor;
            this.drawableRuleset = drawableRuleset;
            this.mods            = mods;

            RelativeSizeAxes = Axes.Both;

            Children = new Drawable[]
            {
                FailingLayer        = CreateFailingLayer(),
                visibilityContainer = new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Children         = new Drawable[]
                    {
                        HealthDisplay     = CreateHealthDisplay(),
                        topScoreContainer = new Container
                        {
                            Anchor       = Anchor.TopCentre,
                            Origin       = Anchor.TopCentre,
                            AutoSizeAxes = Axes.Both,
                            Children     = new Drawable[]
                            {
                                AccuracyCounter = CreateAccuracyCounter(),
                                ScoreCounter    = CreateScoreCounter(),
                                ComboCounter    = CreateComboCounter(),
                            },
                        },
                        Progress              = CreateProgress(),
                        ModDisplay            = CreateModsContainer(),
                        HitErrorDisplay       = CreateHitErrorDisplayOverlay(),
                        PlayerSettingsOverlay = CreatePlayerSettingsOverlay(),
                    }
                },
                new FillFlowContainer
                {
                    Anchor         = Anchor.BottomRight,
                    Origin         = Anchor.BottomRight,
                    Position       = -new Vector2(5, TwoLayerButton.SIZE_RETRACTED.Y),
                    AutoSizeAxes   = Axes.Both,
                    LayoutDuration = fade_duration / 2,
                    LayoutEasing   = fade_easing,
                    Direction      = FillDirection.Vertical,
                    Children       = new Drawable[]
                    {
                        KeyCounter = CreateKeyCounter(),
                        HoldToQuit = CreateHoldForMenuButton(),
                    }
                }
            };
        }
コード例 #3
0
        private void create(HealthProcessor healthProcessor)
        {
            AddStep("create layer", () =>
            {
                Child = new HealthProcessorContainer(healthProcessor)
                {
                    RelativeSizeAxes = Axes.Both,
                    Child            = layer = new FailingLayer()
                };

                layer.ShowHealth.BindTo(showHealth);
            });

            AddStep("show health", () => showHealth.Value = true);
            AddStep("enable layer", () => config.SetValue(OsuSetting.FadePlayfieldWhenHealthLow, true));
        }