mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +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;
|
||||
}
|
||||
|
||||
public override bool DisplayResult => false;
|
||||
|
||||
protected override SkinnableDrawable CreateMainPiece() => new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.DrumRollTick),
|
||||
_ => 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)
|
||||
{
|
||||
if (!DisplayJudgements.Value)
|
||||
return;
|
||||
|
||||
if ((judgedObject is DrawableDrumRollTick) && result.Type != HitResult.Miss)
|
||||
playDrumrollHit((DrawableDrumRollTick)judgedObject);
|
||||
|
||||
if (!judgedObject.DisplayResult)
|
||||
return;
|
||||
|
||||
@ -214,6 +196,11 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
hitExplosionContainer.Children.FirstOrDefault(e => e.JudgedObject == ((DrawableStrongNestedHit)judgedObject).MainObject)?.VisualiseSecondHit();
|
||||
break;
|
||||
|
||||
case TaikoDrumRollTickJudgement _:
|
||||
if (result.IsHit)
|
||||
playDrumrollHit((DrawableDrumRollTick)judgedObject);
|
||||
break;
|
||||
|
||||
default:
|
||||
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
|
||||
{
|
||||
public new MarginPadding Padding
|
||||
|
Loading…
Reference in New Issue
Block a user