mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Make judgement text generic to be used between game modes.
This commit is contained in:
@ -1,85 +1,31 @@
|
||||
// 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.Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Transforms;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Modes.Objects.Drawables;
|
||||
using osu.Game.Modes.Osu.Judgements;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Game.Modes.Judgements;
|
||||
|
||||
namespace osu.Game.Modes.Osu.Objects.Drawables
|
||||
{
|
||||
public class HitExplosion : FillFlowContainer
|
||||
public class HitExplosion : DrawableJudgementInfo<OsuJudgementInfo>
|
||||
{
|
||||
private readonly OsuJudgementInfo judgement;
|
||||
private SpriteText line1;
|
||||
private SpriteText line2;
|
||||
|
||||
public HitExplosion(OsuJudgementInfo judgement, OsuHitObject h = null)
|
||||
public HitExplosion(OsuJudgementInfo judgement)
|
||||
: base(judgement)
|
||||
{
|
||||
this.judgement = judgement;
|
||||
AutoSizeAxes = Axes.Both;
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
Direction = FillDirection.Vertical;
|
||||
Spacing = new Vector2(0, 2);
|
||||
Position = (h?.StackedEndPosition ?? Vector2.Zero) + judgement.PositionOffset;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
line1 = new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
Text = judgement.Score.GetDescription(),
|
||||
Font = @"Venera",
|
||||
TextSize = 16,
|
||||
},
|
||||
line2 = new OsuSpriteText
|
||||
{
|
||||
Text = judgement.Combo.GetDescription(),
|
||||
Font = @"Venera",
|
||||
TextSize = 11,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
if (judgement.Result == HitResult.Miss)
|
||||
if (Judgement.Result != HitResult.Miss)
|
||||
{
|
||||
FadeInFromZero(60);
|
||||
|
||||
ScaleTo(1.6f);
|
||||
ScaleTo(1, 100, EasingTypes.In);
|
||||
|
||||
MoveToOffset(new Vector2(0, 100), 800, EasingTypes.InQuint);
|
||||
RotateTo(40, 800, EasingTypes.InQuint);
|
||||
|
||||
Delay(600);
|
||||
FadeOut(200);
|
||||
}
|
||||
else
|
||||
{
|
||||
line1.TransformSpacingTo(new Vector2(14, 0), 1800, EasingTypes.OutQuint);
|
||||
line2.TransformSpacingTo(new Vector2(14, 0), 1800, EasingTypes.OutQuint);
|
||||
JudgementText.TransformSpacingTo(new Vector2(14, 0), 1800, EasingTypes.OutQuint);
|
||||
FadeOut(500);
|
||||
}
|
||||
|
||||
switch (judgement.Result)
|
||||
{
|
||||
case HitResult.Miss:
|
||||
Colour = Color4.Red;
|
||||
break;
|
||||
}
|
||||
|
||||
Expire();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user