コード例 #1
0
        private void showResult(HitResult result)
        {
            AddStep("Show " + result.GetDescription(), () =>
            {
                int poolIndex = 0;

                SetContents(_ =>
                {
                    DrawablePool <TestDrawableTauJudgement> pool;

                    if (poolIndex >= pools.Count)
                    {
                        pools.Add(pool = new DrawablePool <TestDrawableTauJudgement>(1));
                    }
                    else
                    {
                        pool = pools[poolIndex];

                        ((Container)pool.Parent).Clear(false);
                    }

                    var container = new Container
                    {
                        RelativeSizeAxes     = Axes.Both,
                        RelativePositionAxes = Axes.Y,
                        Y        = Extensions.GetCircularPosition(-.6f, 0).Y,
                        Children = new Drawable[]
                        {
                            pool,
                            pool.Get(j => j.Apply(new JudgementResult(new HitObject
                            {
                                StartTime = Time.Current
                            }, new Judgement())
                            {
                                Type = result
                            }, null)).With(j =>
                            {
                                j.Anchor = Anchor.Centre;
                                j.Origin = Anchor.Centre;
                            })
                        }
                    };

                    poolIndex++;

                    return(container);
                });
            });
        }
コード例 #2
0
        private void load()
        {
            AutoSizeAxes = Axes.Both;

            InternalChildren = new Drawable[]
            {
                JudgementText = new OsuSpriteText
                {
                    Text   = Result.GetDescription().ToUpperInvariant(),
                    Colour = colours.ForHitResult(Result),
                    Font   = OsuFont.Numeric.With(size: 20),
                    Scale  = new Vector2(0.85f, 1),
                }
            };
        }
コード例 #3
0
        private void showResult(HitResult result)
        {
            AddStep("Show " + result.GetDescription(), () =>
            {
                int poolIndex = 0;

                SetContents(() =>
                {
                    DrawablePool <TestDrawableOsuJudgement> pool;

                    if (poolIndex >= pools.Count)
                    {
                        pools.Add(pool = new DrawablePool <TestDrawableOsuJudgement>(1));
                    }
                    else
                    {
                        pool = pools[poolIndex];

                        // We need to make sure neither the pool nor the judgement get disposed when new content is set, and they both share the same parent.
                        ((Container)pool.Parent).Clear(false);
                    }

                    var container = new Container
                    {
                        RelativeSizeAxes = Axes.Both,
                        Children         = new Drawable[]
                        {
                            pool,
                            pool.Get(j => j.Apply(new JudgementResult(new HitObject
                            {
                                StartTime = Time.Current
                            }, new Judgement())
                            {
                                Type = result,
                            }, null)).With(j =>
                            {
                                j.Anchor = Anchor.Centre;
                                j.Origin = Anchor.Centre;
                            })
                        }
                    };

                    poolIndex++;
                    return(container);
                });
            });
        }
コード例 #4
0
        public static string GetDisplayNameForSentakkiResult(this HitResult result)
        {
            switch (result)
            {
            case HitResult.Great:
                return("Perfect");

            case HitResult.Good:
                return("Great");

            case HitResult.Ok:
                return("Good");

            default:
                return(result.GetDescription());
            }
        }
コード例 #5
0
        private void load()
        {
            InternalChild = new Container {
                Anchor           = Anchor.Centre,
                Origin           = Anchor.Centre,
                RelativeSizeAxes = Axes.Both,
                Child            = Text = new OsuSpriteText {
                    Anchor   = Anchor.Centre,
                    Origin   = Anchor.Centre,
                    Text     = Type.GetDescription().ToUpperInvariant(),
                    Font     = OsuFont.Numeric.With(size: 20),
                    Colour   = colours.ForHitResult(Type),
                    Scale    = new Vector2(0.5f),
                    Position = new Vector2(0, -45)
                }
            };

            var result = GetADOFAIResult();

            Text.Text = result.GetDescription().ToUpperInvariant();
        }
コード例 #6
0
 private TextColumn createStatisticsColumn(HitResult hitResult, int count) => new TextColumn(hitResult.GetDescription(), smallFont)
 {
     Text = count.ToString()
 };
コード例 #7
0
ファイル: Ruleset.cs プロジェクト: stanriders/osu
 /// <summary>
 /// Get a display friendly name for the specified result type.
 /// </summary>
 /// <param name="result">The result type to get the name for.</param>
 /// <returns>The display name.</returns>
 public virtual string GetDisplayNameForHitResult(HitResult result) => result.GetDescription();
コード例 #8
0
 public HitResultStatistic(HitResult result, int count)
     : base(result.GetDescription(), count)
 {
     this.result = result;
 }
コード例 #9
0
 private TextColumn createStatisticsColumn(HitResult hitResult, int count, int?maxCount) => new TextColumn(hitResult.GetDescription(), smallFont, bottom_columns_min_width)
 {
     Text = maxCount == null ? $"{count}" : $"{count}/{maxCount}"
 };
コード例 #10
0
 private Drawable createStatistic(HitResult result, int count, int?maxCount)
 => createStatistic(result.GetDescription(), maxCount == null ? $"{count}" : $"{count}/{maxCount}");