mirror of
https://github.com/osukey/osukey.git
synced 2025-05-30 01:47:30 +09:00
Merge pull request #8675 from TimOliver/taiko-drumroll-party
Show visual feedback for taiko drumrolls
This commit is contained in:
commit
495510d02e
@ -21,8 +21,6 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
|
|||||||
public override IReadOnlyList<Type> RequiredTypes => base.RequiredTypes.Concat(new[]
|
public override IReadOnlyList<Type> RequiredTypes => base.RequiredTypes.Concat(new[]
|
||||||
{
|
{
|
||||||
typeof(DrawableHit),
|
typeof(DrawableHit),
|
||||||
typeof(DrawableCentreHit),
|
|
||||||
typeof(DrawableRimHit),
|
|
||||||
typeof(LegacyHit),
|
typeof(LegacyHit),
|
||||||
typeof(LegacyCirclePiece),
|
typeof(LegacyCirclePiece),
|
||||||
}).ToList();
|
}).ToList();
|
||||||
@ -30,25 +28,25 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
AddStep("Centre hit", () => SetContents(() => new DrawableCentreHit(createHitAtCurrentTime())
|
AddStep("Centre hit", () => SetContents(() => new DrawableHit(createHitAtCurrentTime())
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
AddStep("Centre hit (strong)", () => SetContents(() => new DrawableCentreHit(createHitAtCurrentTime(true))
|
AddStep("Centre hit (strong)", () => SetContents(() => new DrawableHit(createHitAtCurrentTime(true))
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
AddStep("Rim hit", () => SetContents(() => new DrawableRimHit(createHitAtCurrentTime())
|
AddStep("Rim hit", () => SetContents(() => new DrawableHit(createHitAtCurrentTime())
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
AddStep("Rim hit (strong)", () => SetContents(() => new DrawableRimHit(createHitAtCurrentTime(true))
|
AddStep("Rim hit (strong)", () => SetContents(() => new DrawableHit(createHitAtCurrentTime(true))
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
|
@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
|
|||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class TestSceneHits : OsuTestScene
|
public class TestSceneHits : OsuTestScene
|
||||||
{
|
{
|
||||||
private const double default_duration = 1000;
|
private const double default_duration = 3000;
|
||||||
private const float scroll_time = 1000;
|
private const float scroll_time = 1000;
|
||||||
|
|
||||||
protected override double TimePerAction => default_duration * 2;
|
protected override double TimePerAction => default_duration * 2;
|
||||||
@ -45,6 +45,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
|
|||||||
AddStep("Miss :(", addMissJudgement);
|
AddStep("Miss :(", addMissJudgement);
|
||||||
AddStep("DrumRoll", () => addDrumRoll(false));
|
AddStep("DrumRoll", () => addDrumRoll(false));
|
||||||
AddStep("Strong DrumRoll", () => addDrumRoll(true));
|
AddStep("Strong DrumRoll", () => addDrumRoll(true));
|
||||||
|
AddStep("Kiai DrumRoll", () => addDrumRoll(true, kiai: true));
|
||||||
AddStep("Swell", () => addSwell());
|
AddStep("Swell", () => addSwell());
|
||||||
AddStep("Centre", () => addCentreHit(false));
|
AddStep("Centre", () => addCentreHit(false));
|
||||||
AddStep("Strong Centre", () => addCentreHit(true));
|
AddStep("Strong Centre", () => addCentreHit(true));
|
||||||
@ -192,7 +193,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
|
|||||||
drawableRuleset.Playfield.Add(new DrawableSwell(swell));
|
drawableRuleset.Playfield.Add(new DrawableSwell(swell));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addDrumRoll(bool strong, double duration = default_duration)
|
private void addDrumRoll(bool strong, double duration = default_duration, bool kiai = false)
|
||||||
{
|
{
|
||||||
addBarLine(true);
|
addBarLine(true);
|
||||||
addBarLine(true, scroll_time + duration);
|
addBarLine(true, scroll_time + duration);
|
||||||
@ -202,9 +203,13 @@ namespace osu.Game.Rulesets.Taiko.Tests
|
|||||||
StartTime = drawableRuleset.Playfield.Time.Current + scroll_time,
|
StartTime = drawableRuleset.Playfield.Time.Current + scroll_time,
|
||||||
IsStrong = strong,
|
IsStrong = strong,
|
||||||
Duration = duration,
|
Duration = duration,
|
||||||
|
TickRate = 8,
|
||||||
};
|
};
|
||||||
|
|
||||||
d.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
|
var cpi = new ControlPointInfo();
|
||||||
|
cpi.Add(-10000, new EffectControlPoint { KiaiMode = kiai });
|
||||||
|
|
||||||
|
d.ApplyDefaults(cpi, new BeatmapDifficulty());
|
||||||
|
|
||||||
drawableRuleset.Playfield.Add(new DrawableDrumRoll(d));
|
drawableRuleset.Playfield.Add(new DrawableDrumRoll(d));
|
||||||
}
|
}
|
||||||
@ -219,7 +224,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
|
|||||||
|
|
||||||
h.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
|
h.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
|
||||||
|
|
||||||
drawableRuleset.Playfield.Add(new DrawableCentreHit(h));
|
drawableRuleset.Playfield.Add(new DrawableHit(h));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addRimHit(bool strong)
|
private void addRimHit(bool strong)
|
||||||
@ -232,7 +237,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
|
|||||||
|
|
||||||
h.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
|
h.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
|
||||||
|
|
||||||
drawableRuleset.Playfield.Add(new DrawableRimHit(h));
|
drawableRuleset.Playfield.Add(new DrawableHit(h));
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TestStrongNestedHit : DrawableStrongNestedHit
|
private class TestStrongNestedHit : DrawableStrongNestedHit
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
|
||||||
|
|
||||||
using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces;
|
|
||||||
using osu.Game.Skinning;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|
||||||
{
|
|
||||||
public class DrawableCentreHit : DrawableHit
|
|
||||||
{
|
|
||||||
public override TaikoAction[] HitActions { get; } = { TaikoAction.LeftCentre, TaikoAction.RightCentre };
|
|
||||||
|
|
||||||
public DrawableCentreHit(Hit hit)
|
|
||||||
: base(hit)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override SkinnableDrawable CreateMainPiece() => new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.CentreHit),
|
|
||||||
_ => new CentreHitCirclePiece(), confineMode: ConfineMode.ScaleToFit);
|
|
||||||
}
|
|
||||||
}
|
|
@ -121,8 +121,11 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
int countHit = NestedHitObjects.Count(o => o.IsHit);
|
int countHit = NestedHitObjects.Count(o => o.IsHit);
|
||||||
|
|
||||||
if (countHit >= HitObject.RequiredGoodHits)
|
if (countHit >= HitObject.RequiredGoodHits)
|
||||||
|
{
|
||||||
ApplyResult(r => r.Type = countHit >= HitObject.RequiredGreatHits ? HitResult.Great : HitResult.Good);
|
ApplyResult(r => r.Type = countHit >= HitObject.RequiredGreatHits ? HitResult.Great : HitResult.Good);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
ApplyResult(r => r.Type = HitResult.Miss);
|
ApplyResult(r => r.Type = HitResult.Miss);
|
||||||
}
|
}
|
||||||
|
@ -12,14 +12,17 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
{
|
{
|
||||||
public class DrawableDrumRollTick : DrawableTaikoHitObject<DrumRollTick>
|
public class DrawableDrumRollTick : DrawableTaikoHitObject<DrumRollTick>
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The hit type corresponding to the <see cref="TaikoAction"/> that the user pressed to hit this <see cref="DrawableDrumRollTick"/>.
|
||||||
|
/// </summary>
|
||||||
|
public HitType JudgementType;
|
||||||
|
|
||||||
public DrawableDrumRollTick(DrumRollTick tick)
|
public DrawableDrumRollTick(DrumRollTick tick)
|
||||||
: base(tick)
|
: base(tick)
|
||||||
{
|
{
|
||||||
FillMode = FillMode.Fit;
|
FillMode = FillMode.Fit;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool DisplayResult => false;
|
|
||||||
|
|
||||||
protected override SkinnableDrawable CreateMainPiece() => new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.DrumRollTick),
|
protected override SkinnableDrawable CreateMainPiece() => new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.DrumRollTick),
|
||||||
_ => new TickPiece
|
_ => new TickPiece
|
||||||
{
|
{
|
||||||
@ -51,7 +54,11 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool OnPressed(TaikoAction action) => UpdateResult(true);
|
public override bool OnPressed(TaikoAction action)
|
||||||
|
{
|
||||||
|
JudgementType = action == TaikoAction.LeftRim || action == TaikoAction.RightRim ? HitType.Rim : HitType.Centre;
|
||||||
|
return UpdateResult(true);
|
||||||
|
}
|
||||||
|
|
||||||
protected override DrawableStrongNestedHit CreateStrongHit(StrongHitObject hitObject) => new StrongNestedHit(hitObject, this);
|
protected override DrawableStrongNestedHit CreateStrongHit(StrongHitObject hitObject) => new StrongNestedHit(hitObject, this);
|
||||||
|
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A hit used specifically for drum rolls, where spawning flying hits is required.
|
||||||
|
/// </summary>
|
||||||
|
public class DrawableFlyingHit : DrawableHit
|
||||||
|
{
|
||||||
|
public DrawableFlyingHit(DrawableDrumRollTick drumRollTick)
|
||||||
|
: base(new IgnoreHit
|
||||||
|
{
|
||||||
|
StartTime = drumRollTick.HitObject.StartTime + drumRollTick.Result.TimeOffset,
|
||||||
|
IsStrong = drumRollTick.HitObject.IsStrong,
|
||||||
|
Type = drumRollTick.JudgementType
|
||||||
|
})
|
||||||
|
{
|
||||||
|
HitObject.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
ApplyResult(r => r.Type = r.Judgement.MaxResult);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -8,31 +8,45 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces;
|
using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces;
|
||||||
|
using osu.Game.Skinning;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||||
{
|
{
|
||||||
public abstract class DrawableHit : DrawableTaikoHitObject<Hit>
|
public class DrawableHit : DrawableTaikoHitObject<Hit>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A list of keys which can result in hits for this HitObject.
|
/// A list of keys which can result in hits for this HitObject.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract TaikoAction[] HitActions { get; }
|
public TaikoAction[] HitActions { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The action that caused this <see cref="DrawableHit"/> to be hit.
|
/// The action that caused this <see cref="DrawableHit"/> to be hit.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public TaikoAction? HitAction { get; private set; }
|
public TaikoAction? HitAction
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
private set;
|
||||||
|
}
|
||||||
|
|
||||||
private bool validActionPressed;
|
private bool validActionPressed;
|
||||||
|
|
||||||
private bool pressHandledThisFrame;
|
private bool pressHandledThisFrame;
|
||||||
|
|
||||||
protected DrawableHit(Hit hit)
|
public DrawableHit(Hit hit)
|
||||||
: base(hit)
|
: base(hit)
|
||||||
{
|
{
|
||||||
FillMode = FillMode.Fit;
|
FillMode = FillMode.Fit;
|
||||||
|
|
||||||
|
HitActions =
|
||||||
|
HitObject.Type == HitType.Centre
|
||||||
|
? new[] { TaikoAction.LeftCentre, TaikoAction.RightCentre }
|
||||||
|
: new[] { TaikoAction.LeftRim, TaikoAction.RightRim };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override SkinnableDrawable CreateMainPiece() => HitObject.Type == HitType.Centre
|
||||||
|
? new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.CentreHit), _ => new CentreHitCirclePiece(), confineMode: ConfineMode.ScaleToFit)
|
||||||
|
: new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.RimHit), _ => new RimHitCirclePiece(), confineMode: ConfineMode.ScaleToFit);
|
||||||
|
|
||||||
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
||||||
{
|
{
|
||||||
Debug.Assert(HitObject.HitWindows != null);
|
Debug.Assert(HitObject.HitWindows != null);
|
||||||
@ -58,7 +72,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
{
|
{
|
||||||
if (pressHandledThisFrame)
|
if (pressHandledThisFrame)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (Judged)
|
if (Judged)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -66,14 +79,12 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
|
|
||||||
// Only count this as handled if the new judgement is a hit
|
// Only count this as handled if the new judgement is a hit
|
||||||
var result = UpdateResult(true);
|
var result = UpdateResult(true);
|
||||||
|
|
||||||
if (IsHit)
|
if (IsHit)
|
||||||
HitAction = action;
|
HitAction = action;
|
||||||
|
|
||||||
// Regardless of whether we've hit or not, any secondary key presses in the same frame should be discarded
|
// Regardless of whether we've hit or not, any secondary key presses in the same frame should be discarded
|
||||||
// E.g. hitting a non-strong centre as a strong should not fall through and perform a hit on the next note
|
// E.g. hitting a non-strong centre as a strong should not fall through and perform a hit on the next note
|
||||||
pressHandledThisFrame = true;
|
pressHandledThisFrame = true;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +92,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
{
|
{
|
||||||
if (action == HitAction)
|
if (action == HitAction)
|
||||||
HitAction = null;
|
HitAction = null;
|
||||||
|
|
||||||
base.OnReleased(action);
|
base.OnReleased(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
|
||||||
|
|
||||||
using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces;
|
|
||||||
using osu.Game.Skinning;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|
||||||
{
|
|
||||||
public class DrawableRimHit : DrawableHit
|
|
||||||
{
|
|
||||||
public override TaikoAction[] HitActions { get; } = { TaikoAction.LeftRim, TaikoAction.RightRim };
|
|
||||||
|
|
||||||
public DrawableRimHit(Hit hit)
|
|
||||||
: base(hit)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override SkinnableDrawable CreateMainPiece() => new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.RimHit),
|
|
||||||
_ => new RimHitCirclePiece(), confineMode: ConfineMode.ScaleToFit);
|
|
||||||
}
|
|
||||||
}
|
|
12
osu.Game.Rulesets.Taiko/Objects/IgnoreHit.cs
Normal file
12
osu.Game.Rulesets.Taiko/Objects/IgnoreHit.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Game.Rulesets.Judgements;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Taiko.Objects
|
||||||
|
{
|
||||||
|
public class IgnoreHit : Hit
|
||||||
|
{
|
||||||
|
public override Judgement CreateJudgement() => new IgnoreJudgement();
|
||||||
|
}
|
||||||
|
}
|
@ -49,10 +49,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
switch (h)
|
switch (h)
|
||||||
{
|
{
|
||||||
case Hit hit:
|
case Hit hit:
|
||||||
if (hit.Type == HitType.Centre)
|
return new DrawableHit(hit);
|
||||||
return new DrawableCentreHit(hit);
|
|
||||||
else
|
|
||||||
return new DrawableRimHit(hit);
|
|
||||||
|
|
||||||
case DrumRoll drumRoll:
|
case DrumRoll drumRoll:
|
||||||
return new DrawableDrumRoll(drumRoll);
|
return new DrawableDrumRoll(drumRoll);
|
||||||
|
35
osu.Game.Rulesets.Taiko/UI/DrumRollHitContainer.cs
Normal file
35
osu.Game.Rulesets.Taiko/UI/DrumRollHitContainer.cs
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
|
using osu.Game.Rulesets.Taiko.Objects.Drawables;
|
||||||
|
using osu.Game.Rulesets.UI.Scrolling;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Taiko.UI
|
||||||
|
{
|
||||||
|
internal class DrumRollHitContainer : ScrollingHitObjectContainer
|
||||||
|
{
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
|
||||||
|
// Remove any auxiliary hit notes that were spawned during a drum roll but subsequently rewound.
|
||||||
|
for (var i = AliveInternalChildren.Count - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
var flyingHit = (DrawableFlyingHit)AliveInternalChildren[i];
|
||||||
|
if (Time.Current <= flyingHit.HitObject.StartTime)
|
||||||
|
Remove(flyingHit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnChildLifetimeBoundaryCrossed(LifetimeBoundaryCrossedEvent e)
|
||||||
|
{
|
||||||
|
base.OnChildLifetimeBoundaryCrossed(e);
|
||||||
|
|
||||||
|
// ensure all old hits are removed on becoming alive (may miss being in the AliveInternalChildren list above).
|
||||||
|
if (e.Kind == LifetimeBoundaryKind.Start && e.Direction == LifetimeBoundaryCrossingDirection.Backward)
|
||||||
|
Remove((DrawableHitObject)e.Child);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -21,16 +21,14 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
public override bool RemoveWhenNotAlive => true;
|
public override bool RemoveWhenNotAlive => true;
|
||||||
|
|
||||||
public readonly DrawableHitObject JudgedObject;
|
public readonly DrawableHitObject JudgedObject;
|
||||||
|
private readonly HitType type;
|
||||||
|
|
||||||
private readonly Box innerFill;
|
private readonly Box innerFill;
|
||||||
|
|
||||||
private readonly bool isRim;
|
public HitExplosion(DrawableHitObject judgedObject, HitType type)
|
||||||
|
|
||||||
public HitExplosion(DrawableHitObject judgedObject, bool isRim)
|
|
||||||
{
|
{
|
||||||
this.isRim = isRim;
|
|
||||||
|
|
||||||
JudgedObject = judgedObject;
|
JudgedObject = judgedObject;
|
||||||
|
this.type = type;
|
||||||
|
|
||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
@ -58,7 +56,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
innerFill.Colour = isRim ? colours.BlueDarker : colours.PinkDarker;
|
innerFill.Colour = type == HitType.Rim ? colours.BlueDarker : colours.PinkDarker;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
|
@ -18,14 +18,12 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
public override bool RemoveWhenNotAlive => true;
|
public override bool RemoveWhenNotAlive => true;
|
||||||
|
|
||||||
public readonly DrawableHitObject JudgedObject;
|
public readonly DrawableHitObject JudgedObject;
|
||||||
|
private readonly HitType type;
|
||||||
|
|
||||||
private readonly bool isRim;
|
public KiaiHitExplosion(DrawableHitObject judgedObject, HitType type)
|
||||||
|
|
||||||
public KiaiHitExplosion(DrawableHitObject judgedObject, bool isRim)
|
|
||||||
{
|
{
|
||||||
this.isRim = isRim;
|
|
||||||
|
|
||||||
JudgedObject = judgedObject;
|
JudgedObject = judgedObject;
|
||||||
|
this.type = type;
|
||||||
|
|
||||||
Anchor = Anchor.CentreLeft;
|
Anchor = Anchor.CentreLeft;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
@ -53,7 +51,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
EdgeEffect = new EdgeEffectParameters
|
EdgeEffect = new EdgeEffectParameters
|
||||||
{
|
{
|
||||||
Type = EdgeEffectType.Glow,
|
Type = EdgeEffectType.Glow,
|
||||||
Colour = isRim ? colours.BlueDarker : colours.PinkDarker,
|
Colour = type == HitType.Rim ? colours.BlueDarker : colours.PinkDarker,
|
||||||
Radius = 60,
|
Radius = 60,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
private Container<HitExplosion> hitExplosionContainer;
|
private Container<HitExplosion> hitExplosionContainer;
|
||||||
private Container<KiaiHitExplosion> kiaiExplosionContainer;
|
private Container<KiaiHitExplosion> kiaiExplosionContainer;
|
||||||
private JudgementContainer<DrawableTaikoJudgement> judgementContainer;
|
private JudgementContainer<DrawableTaikoJudgement> judgementContainer;
|
||||||
|
private ScrollingHitObjectContainer drumRollHitContainer;
|
||||||
internal Drawable HitTarget;
|
internal Drawable HitTarget;
|
||||||
|
|
||||||
private ProxyContainer topLevelHitContainer;
|
private ProxyContainer topLevelHitContainer;
|
||||||
@ -47,7 +48,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new[]
|
||||||
{
|
{
|
||||||
new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.PlayfieldBackgroundRight), _ => new PlayfieldBackgroundRight()),
|
new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.PlayfieldBackgroundRight), _ => new PlayfieldBackgroundRight()),
|
||||||
rightArea = new Container
|
rightArea = new Container
|
||||||
@ -88,7 +89,11 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
{
|
{
|
||||||
Name = "Hit objects",
|
Name = "Hit objects",
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Child = HitObjectContainer
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
HitObjectContainer,
|
||||||
|
drumRollHitContainer = new DrumRollHitContainer()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
kiaiExplosionContainer = new Container<KiaiHitExplosion>
|
kiaiExplosionContainer = new Container<KiaiHitExplosion>
|
||||||
{
|
{
|
||||||
@ -127,7 +132,8 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
{
|
{
|
||||||
Name = "Top level hit objects",
|
Name = "Top level hit objects",
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
}
|
},
|
||||||
|
drumRollHitContainer.CreateProxy()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,7 +150,6 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
public override void Add(DrawableHitObject h)
|
public override void Add(DrawableHitObject h)
|
||||||
{
|
{
|
||||||
h.OnNewResult += OnNewResult;
|
h.OnNewResult += OnNewResult;
|
||||||
|
|
||||||
base.Add(h);
|
base.Add(h);
|
||||||
|
|
||||||
switch (h)
|
switch (h)
|
||||||
@ -163,7 +168,6 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
{
|
{
|
||||||
if (!DisplayJudgements.Value)
|
if (!DisplayJudgements.Value)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!judgedObject.DisplayResult)
|
if (!judgedObject.DisplayResult)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -174,6 +178,16 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
hitExplosionContainer.Children.FirstOrDefault(e => e.JudgedObject == ((DrawableStrongNestedHit)judgedObject).MainObject)?.VisualiseSecondHit();
|
hitExplosionContainer.Children.FirstOrDefault(e => e.JudgedObject == ((DrawableStrongNestedHit)judgedObject).MainObject)?.VisualiseSecondHit();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case TaikoDrumRollTickJudgement _:
|
||||||
|
if (!result.IsHit)
|
||||||
|
break;
|
||||||
|
|
||||||
|
var drawableTick = (DrawableDrumRollTick)judgedObject;
|
||||||
|
|
||||||
|
addDrumRollHit(drawableTick);
|
||||||
|
addExplosion(drawableTick, drawableTick.JudgementType);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
judgementContainer.Add(new DrawableTaikoJudgement(result, judgedObject)
|
judgementContainer.Add(new DrawableTaikoJudgement(result, judgedObject)
|
||||||
{
|
{
|
||||||
@ -186,17 +200,21 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
if (!result.IsHit)
|
if (!result.IsHit)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
bool isRim = (judgedObject.HitObject as Hit)?.Type == HitType.Rim;
|
addExplosion(judgedObject, (judgedObject.HitObject as Hit)?.Type ?? HitType.Centre);
|
||||||
|
|
||||||
hitExplosionContainer.Add(new HitExplosion(judgedObject, isRim));
|
|
||||||
|
|
||||||
if (judgedObject.HitObject.Kiai)
|
|
||||||
kiaiExplosionContainer.Add(new KiaiHitExplosion(judgedObject, isRim));
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void addDrumRollHit(DrawableDrumRollTick drawableTick) =>
|
||||||
|
drumRollHitContainer.Add(new DrawableFlyingHit(drawableTick));
|
||||||
|
|
||||||
|
private void addExplosion(DrawableHitObject drawableObject, HitType type)
|
||||||
|
{
|
||||||
|
hitExplosionContainer.Add(new HitExplosion(drawableObject, type));
|
||||||
|
if (drawableObject.HitObject.Kiai)
|
||||||
|
kiaiExplosionContainer.Add(new KiaiHitExplosion(drawableObject, type));
|
||||||
|
}
|
||||||
|
|
||||||
private class ProxyContainer : LifetimeManagementContainer
|
private class ProxyContainer : LifetimeManagementContainer
|
||||||
{
|
{
|
||||||
public new MarginPadding Padding
|
public new MarginPadding Padding
|
||||||
|
@ -240,7 +240,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (hitObject is IHasEndTime _)
|
if (hitObject is IHasEndTime)
|
||||||
addEndTimeData(writer, hitObject);
|
addEndTimeData(writer, hitObject);
|
||||||
|
|
||||||
writer.Write(getSampleBank(hitObject.Samples));
|
writer.Write(getSampleBank(hitObject.Samples));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user