コード例 #1
0
ファイル: OsuAutoGenerator.cs プロジェクト: zzzzzz-812/osu
        public OsuAutoGenerator(IBeatmap beatmap)
            : base(beatmap)
        {
            // Already superhuman, but still somewhat realistic
            reactionTime = ApplyModsToRate(100);

            defaultHitWindows = new OsuHitWindows();
            defaultHitWindows.SetDifficulty(Beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty);
        }
コード例 #2
0
        public HitErrorDisplay(ScoreProcessor processor, HitWindows hitWindows)
        {
            this.processor  = processor;
            this.hitWindows = hitWindows;

            RelativeSizeAxes = Axes.Both;

            processor.NewJudgement += onNewJudgement;
        }
コード例 #3
0
        private void recreateDisplay(HitWindows hitWindows, float overallDifficulty)
        {
            this.hitWindows = hitWindows;

            hitWindows?.SetDifficulty(overallDifficulty);

            Clear();

            Add(new FillFlowContainer
            {
                Anchor       = Anchor.Centre,
                Origin       = Anchor.Centre,
                Direction    = FillDirection.Vertical,
                AutoSizeAxes = Axes.Both,
                Children     = new[]
                {
                    new OsuSpriteText {
                        Text = $@"Great: {hitWindows?.WindowFor(HitResult.Great)}"
                    },
                    new OsuSpriteText {
                        Text = $@"Good: {hitWindows?.WindowFor(HitResult.Good)}"
                    },
                    new OsuSpriteText {
                        Text = $@"Meh: {hitWindows?.WindowFor(HitResult.Meh)}"
                    },
                }
            });

            Add(meter = new BarHitErrorMeter(hitWindows, true)
            {
                Anchor = Anchor.CentreRight,
                Origin = Anchor.CentreRight,
            });

            Add(meter2 = new BarHitErrorMeter(hitWindows, false)
            {
                Anchor = Anchor.CentreLeft,
                Origin = Anchor.CentreLeft,
            });
        }
コード例 #4
0
ファイル: OsuAutoGenerator.cs プロジェクト: xenatapes/osu
        private void addDelayedMovements(OsuHitObject h, OsuHitObject prev)
        {
            double endTime = prev.GetEndTime();

            HitWindows hitWindows = null;

            switch (h)
            {
            case HitCircle hitCircle:
                hitWindows = hitCircle.HitWindows;
                break;

            case Slider slider:
                hitWindows = slider.TailCircle.HitWindows;
                break;

            case Spinner _:
                hitWindows = defaultHitWindows;
                break;
            }

            Debug.Assert(hitWindows != null);

            // Make the cursor stay at a hitObject as long as possible (mainly for autopilot).
            if (h.StartTime - hitWindows.WindowFor(HitResult.Miss) > endTime + hitWindows.WindowFor(HitResult.Meh) + 50)
            {
                if (!(prev is Spinner) && h.StartTime - endTime < 1000)
                {
                    AddFrameToReplay(new OsuReplayFrame(endTime + hitWindows.WindowFor(HitResult.Meh), new Vector2(prev.StackedEndPosition.X, prev.StackedEndPosition.Y)));
                }

                if (!(h is Spinner))
                {
                    AddFrameToReplay(new OsuReplayFrame(h.StartTime - hitWindows.WindowFor(HitResult.Miss), new Vector2(h.StackedPosition.X, h.StackedPosition.Y)));
                }
            }
            else if (h.StartTime - hitWindows.WindowFor(HitResult.Meh) > endTime + hitWindows.WindowFor(HitResult.Meh) + 50)
            {
                if (!(prev is Spinner) && h.StartTime - endTime < 1000)
                {
                    AddFrameToReplay(new OsuReplayFrame(endTime + hitWindows.WindowFor(HitResult.Meh), new Vector2(prev.StackedEndPosition.X, prev.StackedEndPosition.Y)));
                }

                if (!(h is Spinner))
                {
                    AddFrameToReplay(new OsuReplayFrame(h.StartTime - hitWindows.WindowFor(HitResult.Meh), new Vector2(h.StackedPosition.X, h.StackedPosition.Y)));
                }
            }
            else if (h.StartTime - hitWindows.WindowFor(HitResult.Good) > endTime + hitWindows.WindowFor(HitResult.Good) + 50)
            {
                if (!(prev is Spinner) && h.StartTime - endTime < 1000)
                {
                    AddFrameToReplay(new OsuReplayFrame(endTime + hitWindows.WindowFor(HitResult.Good), new Vector2(prev.StackedEndPosition.X, prev.StackedEndPosition.Y)));
                }

                if (!(h is Spinner))
                {
                    AddFrameToReplay(new OsuReplayFrame(h.StartTime - hitWindows.WindowFor(HitResult.Good), new Vector2(h.StackedPosition.X, h.StackedPosition.Y)));
                }
            }
        }
コード例 #5
0
        private void recreateDisplay(HitWindows hitWindows, float overallDifficulty)
        {
            hitWindows?.SetDifficulty(overallDifficulty);

            drawableRuleset.HitWindows = hitWindows;

            Clear();

            Add(new FillFlowContainer
            {
                Anchor       = Anchor.Centre,
                Origin       = Anchor.Centre,
                Direction    = FillDirection.Vertical,
                AutoSizeAxes = Axes.Both,
                Children     = new[]
                {
                    new OsuSpriteText {
                        Text = $@"Great: {hitWindows?.WindowFor(HitResult.Great)}"
                    },
                    new OsuSpriteText {
                        Text = $@"Good: {hitWindows?.WindowFor(HitResult.Ok)}"
                    },
                    new OsuSpriteText {
                        Text = $@"Meh: {hitWindows?.WindowFor(HitResult.Meh)}"
                    },
                }
            });

            Add(new BarHitErrorMeter
            {
                Anchor = Anchor.CentreRight,
                Origin = Anchor.CentreRight,
            });

            Add(new BarHitErrorMeter
            {
                Anchor = Anchor.CentreLeft,
                Origin = Anchor.CentreLeft,
            });

            Add(new BarHitErrorMeter
            {
                Anchor   = Anchor.BottomCentre,
                Origin   = Anchor.CentreLeft,
                Rotation = 270,
            });

            Add(new ColourHitErrorMeter
            {
                Anchor = Anchor.CentreRight,
                Origin = Anchor.CentreRight,
                Margin = new MarginPadding {
                    Right = 50
                }
            });

            Add(new ColourHitErrorMeter
            {
                Anchor = Anchor.CentreLeft,
                Origin = Anchor.CentreLeft,
                Margin = new MarginPadding {
                    Left = 50
                }
            });

            Add(new ColourHitErrorMeter
            {
                Anchor   = Anchor.BottomCentre,
                Origin   = Anchor.CentreLeft,
                Rotation = 270,
                Margin   = new MarginPadding {
                    Left = 50
                }
            });
        }
コード例 #6
0
ファイル: BarHitErrorMeter.cs プロジェクト: Rebell10n1/osu
        private void createColourBars(OsuColour colours)
        {
            var windows = HitWindows.GetAllAvailableWindows().ToArray();

            maxHitWindow = windows.First().length;

            for (var i = 0; i < windows.Length; i++)
            {
                var(result, length) = windows[i];

                colourBarsEarly.Add(createColourBar(result, (float)(length / maxHitWindow), i == 0));
                colourBarsLate.Add(createColourBar(result, (float)(length / maxHitWindow), i == 0));
            }

            // a little nub to mark the centre point.
            var centre = createColourBar(windows.Last().result, 0.01f);

            centre.Anchor = centre.Origin = Anchor.y1 | (alignment == Anchor.x2 ? Anchor.x0 : Anchor.x2);
            centre.Width  = 2.5f;
            colourBars.Add(centre);

            Drawable createColourBar(HitResult result, float height, bool first = false)
            {
                var colour = GetColourForHitResult(result);

                if (first)
                {
                    // the first bar needs gradient rendering.
                    const float gradient_start = 0.8f;

                    return(new Container
                    {
                        RelativeSizeAxes = Axes.Both,
                        Children = new Drawable[]
                        {
                            new Box
                            {
                                RelativeSizeAxes = Axes.Both,
                                Colour = colour,
                                Height = height * gradient_start
                            },
                            new Box
                            {
                                RelativeSizeAxes = Axes.Both,
                                RelativePositionAxes = Axes.Both,
                                Colour = ColourInfo.GradientVertical(colour, colour.Opacity(0)),
                                Y = gradient_start,
                                Height = height * (1 - gradient_start)
                            },
                        }
                    });
                }

                return(new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour = colour,
                    Height = height
                });
            }
        }
コード例 #7
0
 public TestHitObject(HitWindows hitWindows)
 {
     HitWindows = hitWindows;
     HitWindows.SetDifficulty(0.5f);
 }
コード例 #8
0
ファイル: OsuAutoGenerator.cs プロジェクト: zi-jing/osu
 public OsuAutoGenerator(IBeatmap beatmap, IReadOnlyList <Mod> mods)
     : base(beatmap, mods)
 {
     defaultHitWindows = new OsuHitWindows();
     defaultHitWindows.SetDifficulty(Beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty);
 }
コード例 #9
0
ファイル: BarHitErrorMeter.cs プロジェクト: nekodex/osu
        private void load()
        {
            const int   centre_marker_size = 8;
            const int   bar_height         = 200;
            const int   bar_width          = 2;
            const float chevron_size       = 8;
            const float icon_size          = 14;

            var hitWindows = HitWindows.GetAllAvailableWindows().ToArray();

            InternalChild = new Container
            {
                AutoSizeAxes = Axes.X,
                Height       = bar_height,
                Margin       = new MarginPadding(2),
                Children     = new Drawable[]
                {
                    colourBars = new Container
                    {
                        Name             = "colour axis",
                        X                = chevron_size,
                        Anchor           = Anchor.CentreLeft,
                        Origin           = Anchor.CentreLeft,
                        Width            = judgement_line_width,
                        RelativeSizeAxes = Axes.Y,
                        Children         = new Drawable[]
                        {
                            iconEarly = new SpriteIcon
                            {
                                Y      = -10,
                                Size   = new Vector2(icon_size),
                                Icon   = FontAwesome.Solid.ShippingFast,
                                Anchor = Anchor.TopCentre,
                                Origin = Anchor.Centre,
                            },
                            iconLate = new SpriteIcon
                            {
                                Y      = 10,
                                Size   = new Vector2(icon_size),
                                Icon   = FontAwesome.Solid.Bicycle,
                                Anchor = Anchor.BottomCentre,
                                Origin = Anchor.Centre,
                            },
                            colourBarsEarly = new Container
                            {
                                Anchor           = Anchor.Centre,
                                Origin           = Anchor.TopCentre,
                                Width            = bar_width,
                                RelativeSizeAxes = Axes.Y,
                                Height           = 0.5f,
                                Scale            = new Vector2(1, -1),
                            },
                            colourBarsLate = new Container
                            {
                                Anchor           = Anchor.Centre,
                                Origin           = Anchor.TopCentre,
                                Width            = bar_width,
                                RelativeSizeAxes = Axes.Y,
                                Height           = 0.5f,
                            },
                            new Circle
                            {
                                Name   = "middle marker behind",
                                Colour = GetColourForHitResult(hitWindows.Last().result),
                                Anchor = Anchor.Centre,
                                Origin = Anchor.Centre,
                                Size   = new Vector2(centre_marker_size),
                            },
                            judgementsContainer = new Container
                            {
                                Name             = "judgements",
                                Anchor           = Anchor.TopCentre,
                                Origin           = Anchor.TopCentre,
                                RelativeSizeAxes = Axes.Y,
                                Width            = judgement_line_width,
                            },
                            new Circle
                            {
                                Name   = "middle marker in front",
                                Colour = GetColourForHitResult(hitWindows.Last().result).Darken(0.3f),
                                Anchor = Anchor.Centre,
                                Origin = Anchor.Centre,
                                Size   = new Vector2(centre_marker_size),
                                Scale  = new Vector2(0.5f),
                            },
                        }
                    },
                    new Container
                    {
                        Name             = "average chevron",
                        Anchor           = Anchor.CentreLeft,
                        Origin           = Anchor.CentreLeft,
                        Width            = chevron_size,
                        RelativeSizeAxes = Axes.Y,
                        Child            = arrow = new SpriteIcon
                        {
                            Anchor = Anchor.TopCentre,
                            Origin = Anchor.Centre,
                            RelativePositionAxes = Axes.Y,
                            Y    = 0.5f,
                            Icon = FontAwesome.Solid.ChevronRight,
                            Size = new Vector2(chevron_size),
                        }
                    },
                }
            };

            createColourBars(hitWindows);
        }
コード例 #10
0
ファイル: HitErrorMeter.cs プロジェクト: shadiwolf/e
 protected HitErrorMeter(HitWindows hitWindows)
 {
     HitWindows = hitWindows;
 }
コード例 #11
0
ファイル: Note.cs プロジェクト: popo930219/osu-RP
        public override void ApplyDefaults(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
        {
            base.ApplyDefaults(controlPointInfo, difficulty);

            HitWindows = new HitWindows(difficulty.OverallDifficulty);
        }
コード例 #12
0
        public HitErrorDisplay(HitWindows hitWindows)
        {
            this.hitWindows = hitWindows;

            RelativeSizeAxes = Axes.Both;
        }
コード例 #13
0
ファイル: ColourHitErrorMeter.cs プロジェクト: shadiwolf/e
 protected override void OnNewJudgement(JudgementResult judgement) => judgementsFlow.Push(GetColourForHitResult(HitWindows.ResultFor(judgement.TimeOffset)));
コード例 #14
0
ファイル: ColourHitErrorMeter.cs プロジェクト: shadiwolf/e
 public ColourHitErrorMeter(HitWindows hitWindows)
     : base(hitWindows)
 {
     AutoSizeAxes  = Axes.Both;
     InternalChild = judgementsFlow = new JudgementFlow();
 }
コード例 #15
0
ファイル: Note.cs プロジェクト: weebaka/osu
        protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
        {
            base.ApplyDefaultsToSelf(controlPointInfo, difficulty);

            HitWindows = new HitWindows(difficulty.OverallDifficulty);
        }