1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 07:07:45 +08:00

Fix strong hits not being visualised

This commit is contained in:
smoogipoo 2018-08-06 13:01:27 +09:00
parent 60c94a8ea3
commit 5c4c2dff09
2 changed files with 29 additions and 12 deletions

View File

@ -39,8 +39,10 @@ namespace osu.Game.Rulesets.Taiko.Tests
[BackgroundDependencyLoader]
private void load()
{
AddStep("Hit!", () => addHitJudgement(false));
AddStep("Hit", () => addHitJudgement(false));
AddStep("Strong hit", () => addStrongHitJudgement(false));
AddStep("Kiai hit", () => addHitJudgement(true));
AddStep("Strong kiai hit", () => addStrongHitJudgement(true));
AddStep("Miss :(", addMissJudgement);
AddStep("DrumRoll", () => addDrumRoll(false));
AddStep("Strong DrumRoll", () => addDrumRoll(true));
@ -130,10 +132,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
HitResult hitResult = RNG.Next(2) == 0 ? HitResult.Good : HitResult.Great;
var cpi = new ControlPointInfo();
cpi.EffectPoints.Add(new EffectControlPoint
{
KiaiMode = kiai
});
cpi.EffectPoints.Add(new EffectControlPoint { KiaiMode = kiai });
Hit hit = new Hit();
hit.ApplyDefaults(cpi, new BeatmapDifficulty());
@ -141,12 +140,22 @@ namespace osu.Game.Rulesets.Taiko.Tests
var h = new DrawableTestHit(hit) { X = RNG.NextSingle(hitResult == HitResult.Good ? -0.1f : -0.05f, hitResult == HitResult.Good ? 0.1f : 0.05f) };
((TaikoPlayfield)rulesetContainer.Playfield).OnNewResult(h, new JudgementResult(new TaikoJudgement()) { Type = hitResult });
if (RNG.Next(10) == 0)
{
((TaikoPlayfield)rulesetContainer.Playfield).OnNewResult(h, new JudgementResult(new TaikoJudgement()) { Type = hitResult });
((TaikoPlayfield)rulesetContainer.Playfield).OnNewResult(h, new JudgementResult(new TaikoStrongJudgement()) { Type = HitResult.Great });
}
private void addStrongHitJudgement(bool kiai)
{
HitResult hitResult = RNG.Next(2) == 0 ? HitResult.Good : HitResult.Great;
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 == HitResult.Good ? -0.1f : -0.05f, hitResult == HitResult.Good ? 0.1f : 0.05f) };
((TaikoPlayfield)rulesetContainer.Playfield).OnNewResult(h, new JudgementResult(new TaikoJudgement()) { Type = hitResult });
((TaikoPlayfield)rulesetContainer.Playfield).OnNewResult(new TestStrongHandler(h), new JudgementResult(new TaikoStrongJudgement()) { Type = HitResult.Great });
}
private void addMissJudgement()
@ -217,6 +226,16 @@ namespace osu.Game.Rulesets.Taiko.Tests
rulesetContainer.Playfield.Add(new DrawableRimHit(h));
}
private class TestStrongHandler : DrawableStrongHandler
{
public TestStrongHandler(DrawableHitObject mainObject)
: base(null, mainObject)
{
}
public override bool OnPressed(TaikoAction action) => false;
}
private class DrawableTestHit : DrawableHitObject<TaikoHitObject>
{
public DrawableTestHit(TaikoHitObject hitObject)

View File

@ -11,8 +11,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
/// </summary>
public abstract class DrawableStrongHandler : DrawableTaikoHitObject
{
public override bool DisplayResult => false;
public readonly DrawableHitObject MainObject;
protected DrawableStrongHandler(StrongHitObject strong, DrawableHitObject mainObject)