mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08:00
Refactor
This commit is contained in:
parent
bc6b02664f
commit
dd36b839b9
@ -24,8 +24,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
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
|
||||||
{
|
{
|
||||||
|
@ -181,29 +181,11 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void playDrumrollHit(DrawableDrumRollTick drumrollTick)
|
|
||||||
{
|
|
||||||
TaikoAction action = drumrollTick.JudgedAction;
|
|
||||||
bool isStrong = drumrollTick.HitObject.IsStrong;
|
|
||||||
double time = drumrollTick.HitObject.GetEndTime();
|
|
||||||
|
|
||||||
DrawableHit drawableHit;
|
|
||||||
if (action == TaikoAction.LeftRim || action == TaikoAction.RightRim)
|
|
||||||
drawableHit = new DrawableFlyingRimHit(time, isStrong);
|
|
||||||
else
|
|
||||||
drawableHit = new DrawableFlyingCentreHit(time, isStrong);
|
|
||||||
|
|
||||||
drumRollHitContainer.Add(drawableHit);
|
|
||||||
}
|
|
||||||
|
|
||||||
internal void OnNewResult(DrawableHitObject judgedObject, JudgementResult result)
|
internal void OnNewResult(DrawableHitObject judgedObject, JudgementResult result)
|
||||||
{
|
{
|
||||||
if (!DisplayJudgements.Value)
|
if (!DisplayJudgements.Value)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ((judgedObject is DrawableDrumRollTick) && result.Type != HitResult.Miss)
|
|
||||||
playDrumrollHit((DrawableDrumRollTick)judgedObject);
|
|
||||||
|
|
||||||
if (!judgedObject.DisplayResult)
|
if (!judgedObject.DisplayResult)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -214,6 +196,11 @@ 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)
|
||||||
|
playDrumrollHit((DrawableDrumRollTick)judgedObject);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
judgementContainer.Add(new DrawableTaikoJudgement(result, judgedObject)
|
judgementContainer.Add(new DrawableTaikoJudgement(result, judgedObject)
|
||||||
{
|
{
|
||||||
@ -237,6 +224,21 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void playDrumrollHit(DrawableDrumRollTick drumrollTick)
|
||||||
|
{
|
||||||
|
TaikoAction action = drumrollTick.JudgedAction;
|
||||||
|
bool isStrong = drumrollTick.HitObject.IsStrong;
|
||||||
|
double time = drumrollTick.HitObject.GetEndTime();
|
||||||
|
|
||||||
|
DrawableHit drawableHit;
|
||||||
|
if (action == TaikoAction.LeftRim || action == TaikoAction.RightRim)
|
||||||
|
drawableHit = new DrawableFlyingRimHit(time, isStrong);
|
||||||
|
else
|
||||||
|
drawableHit = new DrawableFlyingCentreHit(time, isStrong);
|
||||||
|
|
||||||
|
drumRollHitContainer.Add(drawableHit);
|
||||||
|
}
|
||||||
|
|
||||||
private class ProxyContainer : LifetimeManagementContainer
|
private class ProxyContainer : LifetimeManagementContainer
|
||||||
{
|
{
|
||||||
public new MarginPadding Padding
|
public new MarginPadding Padding
|
||||||
|
Loading…
Reference in New Issue
Block a user