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

Redesign hit explosions.

This commit is contained in:
smoogipooo 2017-05-23 17:57:34 +09:00
parent 25a48d832f
commit ae94e6ea85
2 changed files with 25 additions and 30 deletions

View File

@ -16,23 +16,25 @@ namespace osu.Game.Rulesets.Taiko.UI
/// <summary> /// <summary>
/// A circle explodes from the hit target to indicate a hitobject has been hit. /// A circle explodes from the hit target to indicate a hitobject has been hit.
/// </summary> /// </summary>
internal class HitExplosion : CircularContainer internal class HitExplosion : Container
{ {
/// <summary>
/// The judgement this hit explosion visualises.
/// </summary>
public readonly TaikoJudgement Judgement; public readonly TaikoJudgement Judgement;
private readonly Box innerFill; private readonly Box innerFill;
public HitExplosion(TaikoJudgement judgement) private bool isRim;
public HitExplosion(TaikoJudgement judgement, bool isRim)
{ {
this.isRim = isRim;
Judgement = judgement; Judgement = judgement;
Size = new Vector2(TaikoHitObject.DEFAULT_CIRCLE_DIAMETER); RelativeSizeAxes = Axes.Y;
Width = TaikoPlayfield.HIT_TARGET_OFFSET + TaikoHitObject.DEFAULT_CIRCLE_DIAMETER;
Anchor = Anchor.Centre; Anchor = Anchor.CentreLeft;
Origin = Anchor.Centre; Origin = Anchor.CentreLeft;
RelativePositionAxes = Axes.Both; RelativePositionAxes = Axes.Both;
@ -54,22 +56,17 @@ namespace osu.Game.Rulesets.Taiko.UI
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
switch (Judgement.TaikoResult) if (isRim)
{ innerFill.Colour = colours.BlueDarker;
case TaikoHitResult.Good: else
innerFill.Colour = colours.Green; innerFill.Colour = colours.PinkDarker;
break;
case TaikoHitResult.Great:
innerFill.Colour = colours.Blue;
break;
}
} }
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
ScaleTo(5f, 1000, EasingTypes.OutQuint); ScaleTo(new Vector2(2f, 1), 1000, EasingTypes.OutQuint);
FadeOut(500); FadeOut(500);
Expire(); Expire();
@ -80,7 +77,7 @@ namespace osu.Game.Rulesets.Taiko.UI
/// </summary> /// </summary>
public void VisualiseSecondHit() public void VisualiseSecondHit()
{ {
ResizeTo(Size * TaikoHitObject.STRONG_CIRCLE_DIAMETER_SCALE, 50); ResizeTo(new Vector2(TaikoPlayfield.HIT_TARGET_OFFSET + TaikoHitObject.DEFAULT_STRONG_CIRCLE_DIAMETER, 1), 50);
} }
} }
} }

View File

@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Taiko.UI
/// <summary> /// <summary>
/// The offset from <see cref="left_area_size"/> which the center of the hit target lies at. /// The offset from <see cref="left_area_size"/> which the center of the hit target lies at.
/// </summary> /// </summary>
private const float hit_target_offset = TaikoHitObject.DEFAULT_STRONG_CIRCLE_DIAMETER / 2f + 40; public const float HIT_TARGET_OFFSET = TaikoHitObject.DEFAULT_STRONG_CIRCLE_DIAMETER / 2f + 40;
/// <summary> /// <summary>
/// The size of the left area of the playfield. This area contains the input drum. /// The size of the left area of the playfield. This area contains the input drum.
@ -89,21 +89,19 @@ namespace osu.Game.Rulesets.Taiko.UI
Margin = new MarginPadding { Left = left_area_size }, Margin = new MarginPadding { Left = left_area_size },
Children = new Drawable[] Children = new Drawable[]
{ {
hitExplosionContainer = new Container<HitExplosion>
{
RelativeSizeAxes = Axes.Y,
BlendingMode = BlendingMode.Additive
},
new Container new Container
{ {
Name = "Masked elements", Name = "Masked elements",
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Left = hit_target_offset }, Padding = new MarginPadding { Left = HIT_TARGET_OFFSET },
Masking = true, Masking = true,
Children = new Drawable[] Children = new Drawable[]
{ {
hitExplosionContainer = new Container<HitExplosion>
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Y,
BlendingMode = BlendingMode.Additive
},
barLineContainer = new Container<DrawableBarLine> barLineContainer = new Container<DrawableBarLine>
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
@ -123,7 +121,7 @@ namespace osu.Game.Rulesets.Taiko.UI
{ {
Name = "Judgements", Name = "Judgements",
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Y,
Margin = new MarginPadding { Left = hit_target_offset }, Margin = new MarginPadding { Left = HIT_TARGET_OFFSET },
BlendingMode = BlendingMode.Additive BlendingMode = BlendingMode.Additive
}, },
} }
@ -217,7 +215,7 @@ namespace osu.Game.Rulesets.Taiko.UI
topLevelHitContainer.Add(judgedObject.CreateProxy()); topLevelHitContainer.Add(judgedObject.CreateProxy());
} }
hitExplosionContainer.Add(new HitExplosion(judgedObject.Judgement)); hitExplosionContainer.Add(new HitExplosion(judgedObject.Judgement, judgedObject is DrawableRimHit));
} }
else else
hitExplosionContainer.Children.FirstOrDefault(e => e.Judgement == judgedObject.Judgement)?.VisualiseSecondHit(); hitExplosionContainer.Children.FirstOrDefault(e => e.Judgement == judgedObject.Judgement)?.VisualiseSecondHit();