mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 22:26:41 +09:00
Merge remote-tracking branch 'origin/master' into taiko_barlines
Conflicts: osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj
This commit is contained in:
@ -1,8 +1,11 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.MathUtils;
|
||||
using osu.Framework.Screens.Testing;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Modes.Objects.Drawables;
|
||||
using osu.Game.Modes.Taiko.Judgements;
|
||||
@ -27,15 +30,24 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
base.Reset();
|
||||
|
||||
Clock.ProcessFrame();
|
||||
|
||||
AddButton("Hit!", addHitJudgement);
|
||||
AddButton("Miss :(", addMissJudgement);
|
||||
AddStep("Hit!", addHitJudgement);
|
||||
AddStep("Miss :(", addMissJudgement);
|
||||
AddStep("Swell", addSwell);
|
||||
AddStep("Centre", () => addCentreHit(false));
|
||||
AddStep("Strong Centre", () => addCentreHit(true));
|
||||
AddButton("Add bar line", addBarLine);
|
||||
AddStep("Rim", () => addRimHit(false));
|
||||
AddStep("Strong Rim", () => addRimHit(true));
|
||||
|
||||
Add(playfield = new TaikoPlayfield
|
||||
Add(new Container
|
||||
{
|
||||
Y = 200
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Y = 200,
|
||||
Padding = new MarginPadding { Left = 200 },
|
||||
Children = new[]
|
||||
{
|
||||
playfield = new TaikoPlayfield()
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -43,15 +55,14 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
TaikoHitResult hitResult = RNG.Next(2) == 0 ? TaikoHitResult.Good : TaikoHitResult.Great;
|
||||
|
||||
playfield.OnJudgement(new DrawableTestHit(new TaikoHitObject())
|
||||
playfield.OnJudgement(new DrawableTestHit(new Hit())
|
||||
{
|
||||
X = RNG.NextSingle(hitResult == TaikoHitResult.Good ? -0.1f : -0.05f, hitResult == TaikoHitResult.Good ? 0.1f : 0.05f),
|
||||
Judgement = new TaikoJudgementInfo
|
||||
Judgement = new TaikoJudgement
|
||||
{
|
||||
Result = HitResult.Hit,
|
||||
TaikoResult = hitResult,
|
||||
TimeOffset = 0,
|
||||
ComboAtHit = 1,
|
||||
SecondHit = RNG.Next(10) == 0
|
||||
}
|
||||
});
|
||||
@ -59,13 +70,12 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
|
||||
private void addMissJudgement()
|
||||
{
|
||||
playfield.OnJudgement(new DrawableTestHit(new TaikoHitObject())
|
||||
playfield.OnJudgement(new DrawableTestHit(new Hit())
|
||||
{
|
||||
Judgement = new TaikoJudgementInfo
|
||||
Judgement = new TaikoJudgement
|
||||
{
|
||||
Result = HitResult.Miss,
|
||||
TimeOffset = 0,
|
||||
ComboAtHit = 0
|
||||
TimeOffset = 0
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -83,14 +93,52 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
playfield.AddBarLine(isMajor ? new DrawableMajorBarLine(bl) : new DrawableBarLine(bl));
|
||||
}
|
||||
|
||||
private class DrawableTestHit : DrawableHitObject<TaikoHitObject, TaikoJudgementInfo>
|
||||
private void addSwell()
|
||||
{
|
||||
playfield.Add(new DrawableSwell(new Swell
|
||||
{
|
||||
StartTime = Time.Current + 1000,
|
||||
EndTime = Time.Current + 5000,
|
||||
PreEmpt = 1000
|
||||
}));
|
||||
}
|
||||
|
||||
private void addCentreHit(bool strong)
|
||||
{
|
||||
Hit h = new Hit
|
||||
{
|
||||
StartTime = Time.Current + 1000,
|
||||
PreEmpt = 1000
|
||||
};
|
||||
|
||||
if (strong)
|
||||
playfield.Add(new DrawableStrongCentreHit(h));
|
||||
else
|
||||
playfield.Add(new DrawableCentreHit(h));
|
||||
}
|
||||
|
||||
private void addRimHit(bool strong)
|
||||
{
|
||||
Hit h = new Hit
|
||||
{
|
||||
StartTime = Time.Current + 1000,
|
||||
PreEmpt = 1000
|
||||
};
|
||||
|
||||
if (strong)
|
||||
playfield.Add(new DrawableStrongRimHit(h));
|
||||
else
|
||||
playfield.Add(new DrawableRimHit(h));
|
||||
}
|
||||
|
||||
private class DrawableTestHit : DrawableHitObject<TaikoHitObject, TaikoJudgement>
|
||||
{
|
||||
public DrawableTestHit(TaikoHitObject hitObject)
|
||||
: base(hitObject)
|
||||
{
|
||||
}
|
||||
|
||||
protected override TaikoJudgementInfo CreateJudgementInfo() => new TaikoJudgementInfo();
|
||||
protected override TaikoJudgement CreateJudgement() => new TaikoJudgement();
|
||||
|
||||
protected override void UpdateState(ArmedState state)
|
||||
{
|
||||
|
Reference in New Issue
Block a user