From 17cad7605492370f31a07a46d43a1426eeb95583 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Thu, 3 Aug 2017 13:33:46 +0930 Subject: [PATCH] Make TestCaseTaikoPlayfield able to visualise kiai hits. --- .../Tests/TestCaseTaikoPlayfield.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs index 1faeb7dc35..f5cc7f3120 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs @@ -13,6 +13,8 @@ using osu.Game.Rulesets.Taiko.Objects; using osu.Game.Rulesets.Taiko.Objects.Drawables; using osu.Game.Rulesets.Taiko.UI; using System; +using osu.Game.Beatmaps.ControlPoints; +using osu.Game.Beatmaps; namespace osu.Desktop.VisualTests.Tests { @@ -31,7 +33,8 @@ namespace osu.Desktop.VisualTests.Tests public TestCaseTaikoPlayfield() { - AddStep("Hit!", addHitJudgement); + AddStep("Hit!", () => addHitJudgement(false)); + AddStep("Kiai hit", () => addHitJudgement(true)); AddStep("Miss :(", addMissJudgement); AddStep("DrumRoll", () => addDrumRoll(false)); AddStep("Strong DrumRoll", () => addDrumRoll(true)); @@ -102,11 +105,20 @@ namespace osu.Desktop.VisualTests.Tests } } - private void addHitJudgement() + private void addHitJudgement(bool kiai) { TaikoHitResult hitResult = RNG.Next(2) == 0 ? TaikoHitResult.Good : TaikoHitResult.Great; - var h = new DrawableTestHit(new Hit()) + var cpi = new ControlPointInfo(); + cpi.EffectPoints.Add(new EffectControlPoint + { + KiaiMode = kiai + }); + + Hit hit = new Hit(); + hit.ApplyDefaults(cpi, new BeatmapDifficulty()); + + var h = new DrawableTestHit(hit) { X = RNG.NextSingle(hitResult == TaikoHitResult.Good ? -0.1f : -0.05f, hitResult == TaikoHitResult.Good ? 0.1f : 0.05f), Judgement = new TaikoJudgement