mirror of
https://github.com/osukey/osukey.git
synced 2025-06-09 21:37:59 +09:00
Merge pull request #21774 from peppy/argon-pro-skin-hide-highest-judgement
Don't show great or higher judgements when using argon "pro" skin
This commit is contained in:
commit
73861f332f
@ -1,193 +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 System;
|
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Extensions;
|
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Framework.Graphics.Containers;
|
|
||||||
using osu.Framework.Graphics.Shapes;
|
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osu.Framework.Utils;
|
|
||||||
using osu.Game.Graphics;
|
|
||||||
using osu.Game.Graphics.Sprites;
|
|
||||||
using osu.Game.Rulesets.Judgements;
|
|
||||||
using osu.Game.Rulesets.Scoring;
|
|
||||||
using osuTK;
|
|
||||||
using osuTK.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Skinning.Argon
|
|
||||||
{
|
|
||||||
public partial class ArgonJudgementPiece : CompositeDrawable, IAnimatableJudgement
|
|
||||||
{
|
|
||||||
protected readonly HitResult Result;
|
|
||||||
|
|
||||||
protected SpriteText JudgementText { get; private set; } = null!;
|
|
||||||
|
|
||||||
private RingExplosion? ringExplosion;
|
|
||||||
|
|
||||||
[Resolved]
|
|
||||||
private OsuColour colours { get; set; } = null!;
|
|
||||||
|
|
||||||
public ArgonJudgementPiece(HitResult result)
|
|
||||||
{
|
|
||||||
Result = result;
|
|
||||||
Origin = Anchor.Centre;
|
|
||||||
Y = 160;
|
|
||||||
}
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load()
|
|
||||||
{
|
|
||||||
AutoSizeAxes = Axes.Both;
|
|
||||||
|
|
||||||
InternalChildren = new Drawable[]
|
|
||||||
{
|
|
||||||
JudgementText = new OsuSpriteText
|
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
Text = Result.GetDescription().ToUpperInvariant(),
|
|
||||||
Colour = colours.ForHitResult(Result),
|
|
||||||
Blending = BlendingParameters.Additive,
|
|
||||||
Spacing = new Vector2(10, 0),
|
|
||||||
Font = OsuFont.Default.With(size: 28, weight: FontWeight.Regular),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
if (Result.IsHit())
|
|
||||||
{
|
|
||||||
AddInternal(ringExplosion = new RingExplosion(Result)
|
|
||||||
{
|
|
||||||
Colour = colours.ForHitResult(Result),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Plays the default animation for this judgement piece.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// The base implementation only handles fade (for all result types) and misses.
|
|
||||||
/// Individual rulesets are recommended to implement their appropriate hit animations.
|
|
||||||
/// </remarks>
|
|
||||||
public virtual void PlayAnimation()
|
|
||||||
{
|
|
||||||
switch (Result)
|
|
||||||
{
|
|
||||||
default:
|
|
||||||
JudgementText
|
|
||||||
.ScaleTo(Vector2.One)
|
|
||||||
.ScaleTo(new Vector2(1.4f), 1800, Easing.OutQuint);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case HitResult.Miss:
|
|
||||||
this.ScaleTo(1.6f);
|
|
||||||
this.ScaleTo(1, 100, Easing.In);
|
|
||||||
|
|
||||||
this.MoveTo(Vector2.Zero);
|
|
||||||
this.MoveToOffset(new Vector2(0, 100), 800, Easing.InQuint);
|
|
||||||
|
|
||||||
this.RotateTo(0);
|
|
||||||
this.RotateTo(40, 800, Easing.InQuint);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.FadeOutFromOne(800);
|
|
||||||
|
|
||||||
ringExplosion?.PlayAnimation();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Drawable? GetAboveHitObjectsProxiedContent() => null;
|
|
||||||
|
|
||||||
private partial class RingExplosion : CompositeDrawable
|
|
||||||
{
|
|
||||||
private readonly float travel = 52;
|
|
||||||
|
|
||||||
public RingExplosion(HitResult result)
|
|
||||||
{
|
|
||||||
const float thickness = 4;
|
|
||||||
|
|
||||||
const float small_size = 9;
|
|
||||||
const float large_size = 14;
|
|
||||||
|
|
||||||
Anchor = Anchor.Centre;
|
|
||||||
Origin = Anchor.Centre;
|
|
||||||
|
|
||||||
Blending = BlendingParameters.Additive;
|
|
||||||
|
|
||||||
int countSmall = 0;
|
|
||||||
int countLarge = 0;
|
|
||||||
|
|
||||||
switch (result)
|
|
||||||
{
|
|
||||||
case HitResult.Meh:
|
|
||||||
countSmall = 3;
|
|
||||||
travel *= 0.3f;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case HitResult.Ok:
|
|
||||||
case HitResult.Good:
|
|
||||||
countSmall = 4;
|
|
||||||
travel *= 0.6f;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case HitResult.Great:
|
|
||||||
case HitResult.Perfect:
|
|
||||||
countSmall = 4;
|
|
||||||
countLarge = 4;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < countSmall; i++)
|
|
||||||
AddInternal(new RingPiece(thickness) { Size = new Vector2(small_size) });
|
|
||||||
|
|
||||||
for (int i = 0; i < countLarge; i++)
|
|
||||||
AddInternal(new RingPiece(thickness) { Size = new Vector2(large_size) });
|
|
||||||
}
|
|
||||||
|
|
||||||
public void PlayAnimation()
|
|
||||||
{
|
|
||||||
foreach (var c in InternalChildren)
|
|
||||||
{
|
|
||||||
const float start_position_ratio = 0.3f;
|
|
||||||
|
|
||||||
float direction = RNG.NextSingle(0, 360);
|
|
||||||
float distance = RNG.NextSingle(travel / 2, travel);
|
|
||||||
|
|
||||||
c.MoveTo(new Vector2(
|
|
||||||
MathF.Cos(direction) * distance * start_position_ratio,
|
|
||||||
MathF.Sin(direction) * distance * start_position_ratio
|
|
||||||
));
|
|
||||||
|
|
||||||
c.MoveTo(new Vector2(
|
|
||||||
MathF.Cos(direction) * distance,
|
|
||||||
MathF.Sin(direction) * distance
|
|
||||||
), 600, Easing.OutQuint);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.FadeOutFromOne(1000, Easing.OutQuint);
|
|
||||||
}
|
|
||||||
|
|
||||||
public partial class RingPiece : CircularContainer
|
|
||||||
{
|
|
||||||
public RingPiece(float thickness = 9)
|
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre;
|
|
||||||
Origin = Anchor.Centre;
|
|
||||||
|
|
||||||
Masking = true;
|
|
||||||
BorderThickness = thickness;
|
|
||||||
BorderColour = Color4.White;
|
|
||||||
|
|
||||||
Child = new Box
|
|
||||||
{
|
|
||||||
AlwaysPresent = true,
|
|
||||||
Alpha = 0,
|
|
||||||
RelativeSizeAxes = Axes.Both
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
@ -18,20 +17,18 @@ using osuTK.Graphics;
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Mania.Skinning.Argon
|
namespace osu.Game.Rulesets.Mania.Skinning.Argon
|
||||||
{
|
{
|
||||||
public partial class ArgonJudgementPiece : CompositeDrawable, IAnimatableJudgement
|
public partial class ArgonJudgementPiece : JudgementPiece, IAnimatableJudgement
|
||||||
{
|
{
|
||||||
protected readonly HitResult Result;
|
|
||||||
|
|
||||||
protected SpriteText JudgementText { get; private set; } = null!;
|
|
||||||
|
|
||||||
private RingExplosion? ringExplosion;
|
private RingExplosion? ringExplosion;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private OsuColour colours { get; set; } = null!;
|
private OsuColour colours { get; set; } = null!;
|
||||||
|
|
||||||
public ArgonJudgementPiece(HitResult result)
|
public ArgonJudgementPiece(HitResult result)
|
||||||
|
: base(result)
|
||||||
{
|
{
|
||||||
Result = result;
|
AutoSizeAxes = Axes.Both;
|
||||||
|
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
Y = 160;
|
Y = 160;
|
||||||
}
|
}
|
||||||
@ -39,22 +36,6 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both;
|
|
||||||
|
|
||||||
InternalChildren = new Drawable[]
|
|
||||||
{
|
|
||||||
JudgementText = new OsuSpriteText
|
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
Text = Result.GetDescription().ToUpperInvariant(),
|
|
||||||
Colour = colours.ForHitResult(Result),
|
|
||||||
Blending = BlendingParameters.Additive,
|
|
||||||
Spacing = new Vector2(10, 0),
|
|
||||||
Font = OsuFont.Default.With(size: 28, weight: FontWeight.Regular),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
if (Result.IsHit())
|
if (Result.IsHit())
|
||||||
{
|
{
|
||||||
AddInternal(ringExplosion = new RingExplosion(Result)
|
AddInternal(ringExplosion = new RingExplosion(Result)
|
||||||
@ -64,6 +45,16 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override SpriteText CreateJudgementText() =>
|
||||||
|
new OsuSpriteText
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Blending = BlendingParameters.Additive,
|
||||||
|
Spacing = new Vector2(10, 0),
|
||||||
|
Font = OsuFont.Default.With(size: 28, weight: FontWeight.Regular),
|
||||||
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Plays the default animation for this judgement piece.
|
/// Plays the default animation for this judgement piece.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -27,6 +27,10 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon
|
|||||||
switch (lookup)
|
switch (lookup)
|
||||||
{
|
{
|
||||||
case GameplaySkinComponentLookup<HitResult> resultComponent:
|
case GameplaySkinComponentLookup<HitResult> resultComponent:
|
||||||
|
// This should eventually be moved to a skin setting, when supported.
|
||||||
|
if (Skin is ArgonProSkin && resultComponent.Component >= HitResult.Great)
|
||||||
|
return Drawable.Empty();
|
||||||
|
|
||||||
return new ArgonJudgementPiece(resultComponent.Component);
|
return new ArgonJudgementPiece(resultComponent.Component);
|
||||||
|
|
||||||
case ManiaSkinComponentLookup maniaComponent:
|
case ManiaSkinComponentLookup maniaComponent:
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
@ -17,42 +16,24 @@ using osuTK;
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Skinning.Argon
|
namespace osu.Game.Rulesets.Osu.Skinning.Argon
|
||||||
{
|
{
|
||||||
public partial class ArgonJudgementPiece : CompositeDrawable, IAnimatableJudgement
|
public partial class ArgonJudgementPiece : JudgementPiece, IAnimatableJudgement
|
||||||
{
|
{
|
||||||
protected readonly HitResult Result;
|
|
||||||
|
|
||||||
protected SpriteText JudgementText { get; private set; } = null!;
|
|
||||||
|
|
||||||
private RingExplosion? ringExplosion;
|
private RingExplosion? ringExplosion;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private OsuColour colours { get; set; } = null!;
|
private OsuColour colours { get; set; } = null!;
|
||||||
|
|
||||||
public ArgonJudgementPiece(HitResult result)
|
public ArgonJudgementPiece(HitResult result)
|
||||||
|
: base(result)
|
||||||
{
|
{
|
||||||
Result = result;
|
AutoSizeAxes = Axes.Both;
|
||||||
|
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both;
|
|
||||||
|
|
||||||
InternalChildren = new Drawable[]
|
|
||||||
{
|
|
||||||
JudgementText = new OsuSpriteText
|
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
Text = Result.GetDescription().ToUpperInvariant(),
|
|
||||||
Colour = colours.ForHitResult(Result),
|
|
||||||
Blending = BlendingParameters.Additive,
|
|
||||||
Spacing = new Vector2(5, 0),
|
|
||||||
Font = OsuFont.Default.With(size: 20, weight: FontWeight.Bold),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
if (Result.IsHit())
|
if (Result.IsHit())
|
||||||
{
|
{
|
||||||
AddInternal(ringExplosion = new RingExplosion(Result)
|
AddInternal(ringExplosion = new RingExplosion(Result)
|
||||||
@ -62,6 +43,16 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override SpriteText CreateJudgementText() =>
|
||||||
|
new OsuSpriteText
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Blending = BlendingParameters.Additive,
|
||||||
|
Spacing = new Vector2(5, 0),
|
||||||
|
Font = OsuFont.Default.With(size: 20, weight: FontWeight.Bold),
|
||||||
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Plays the default animation for this judgement piece.
|
/// Plays the default animation for this judgement piece.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -19,6 +19,10 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
|
|||||||
switch (lookup)
|
switch (lookup)
|
||||||
{
|
{
|
||||||
case GameplaySkinComponentLookup<HitResult> resultComponent:
|
case GameplaySkinComponentLookup<HitResult> resultComponent:
|
||||||
|
// This should eventually be moved to a skin setting, when supported.
|
||||||
|
if (Skin is ArgonProSkin && resultComponent.Component >= HitResult.Great)
|
||||||
|
return Drawable.Empty();
|
||||||
|
|
||||||
return new ArgonJudgementPiece(resultComponent.Component);
|
return new ArgonJudgementPiece(resultComponent.Component);
|
||||||
|
|
||||||
case OsuSkinComponentLookup osuComponent:
|
case OsuSkinComponentLookup osuComponent:
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
@ -18,20 +17,16 @@ using osuTK.Graphics;
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Taiko.Skinning.Argon
|
namespace osu.Game.Rulesets.Taiko.Skinning.Argon
|
||||||
{
|
{
|
||||||
public partial class ArgonJudgementPiece : CompositeDrawable, IAnimatableJudgement
|
public partial class ArgonJudgementPiece : JudgementPiece, IAnimatableJudgement
|
||||||
{
|
{
|
||||||
protected readonly HitResult Result;
|
|
||||||
|
|
||||||
protected SpriteText JudgementText { get; private set; } = null!;
|
|
||||||
|
|
||||||
private RingExplosion? ringExplosion;
|
private RingExplosion? ringExplosion;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private OsuColour colours { get; set; } = null!;
|
private OsuColour colours { get; set; } = null!;
|
||||||
|
|
||||||
public ArgonJudgementPiece(HitResult result)
|
public ArgonJudgementPiece(HitResult result)
|
||||||
|
: base(result)
|
||||||
{
|
{
|
||||||
Result = result;
|
|
||||||
RelativePositionAxes = Axes.Both;
|
RelativePositionAxes = Axes.Both;
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
}
|
}
|
||||||
@ -39,21 +34,6 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Argon
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
InternalChildren = new Drawable[]
|
|
||||||
{
|
|
||||||
JudgementText = new OsuSpriteText
|
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
Text = Result.GetDescription().ToUpperInvariant(),
|
|
||||||
Colour = colours.ForHitResult(Result),
|
|
||||||
Blending = BlendingParameters.Additive,
|
|
||||||
Spacing = new Vector2(10, 0),
|
|
||||||
RelativePositionAxes = Axes.Both,
|
|
||||||
Font = OsuFont.Default.With(size: 20, weight: FontWeight.Regular),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
if (Result.IsHit())
|
if (Result.IsHit())
|
||||||
{
|
{
|
||||||
AddInternal(ringExplosion = new RingExplosion(Result)
|
AddInternal(ringExplosion = new RingExplosion(Result)
|
||||||
@ -64,6 +44,17 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Argon
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override SpriteText CreateJudgementText() =>
|
||||||
|
new OsuSpriteText
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Blending = BlendingParameters.Additive,
|
||||||
|
Spacing = new Vector2(10, 0),
|
||||||
|
RelativePositionAxes = Axes.Both,
|
||||||
|
Font = OsuFont.Default.With(size: 20, weight: FontWeight.Regular),
|
||||||
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Plays the default animation for this judgement piece.
|
/// Plays the default animation for this judgement piece.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -19,6 +19,10 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Argon
|
|||||||
switch (component)
|
switch (component)
|
||||||
{
|
{
|
||||||
case GameplaySkinComponentLookup<HitResult> resultComponent:
|
case GameplaySkinComponentLookup<HitResult> resultComponent:
|
||||||
|
// This should eventually be moved to a skin setting, when supported.
|
||||||
|
if (Skin is ArgonProSkin && resultComponent.Component >= HitResult.Great)
|
||||||
|
return Drawable.Empty();
|
||||||
|
|
||||||
return new ArgonJudgementPiece(resultComponent.Component);
|
return new ArgonJudgementPiece(resultComponent.Component);
|
||||||
|
|
||||||
case TaikoSkinComponentLookup taikoComponent:
|
case TaikoSkinComponentLookup taikoComponent:
|
||||||
|
@ -1,12 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Extensions;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
@ -15,39 +10,24 @@ using osuTK;
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Judgements
|
namespace osu.Game.Rulesets.Judgements
|
||||||
{
|
{
|
||||||
public partial class DefaultJudgementPiece : CompositeDrawable, IAnimatableJudgement
|
public partial class DefaultJudgementPiece : JudgementPiece, IAnimatableJudgement
|
||||||
{
|
{
|
||||||
protected readonly HitResult Result;
|
|
||||||
|
|
||||||
protected SpriteText JudgementText { get; private set; }
|
|
||||||
|
|
||||||
[Resolved]
|
|
||||||
private OsuColour colours { get; set; }
|
|
||||||
|
|
||||||
public DefaultJudgementPiece(HitResult result)
|
public DefaultJudgementPiece(HitResult result)
|
||||||
{
|
: base(result)
|
||||||
Result = result;
|
|
||||||
Origin = Anchor.Centre;
|
|
||||||
}
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load()
|
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
|
|
||||||
InternalChildren = new Drawable[]
|
Origin = Anchor.Centre;
|
||||||
{
|
}
|
||||||
JudgementText = new OsuSpriteText
|
|
||||||
|
protected override SpriteText CreateJudgementText() =>
|
||||||
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Text = Result.GetDescription().ToUpperInvariant(),
|
|
||||||
Colour = colours.ForHitResult(Result),
|
|
||||||
Font = OsuFont.Numeric.With(size: 20),
|
Font = OsuFont.Numeric.With(size: 20),
|
||||||
Scale = new Vector2(0.85f, 1),
|
Scale = new Vector2(0.85f, 1),
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Plays the default animation for this judgement piece.
|
/// Plays the default animation for this judgement piece.
|
||||||
@ -75,6 +55,6 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
this.FadeOutFromOne(800);
|
this.FadeOutFromOne(800);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Drawable GetAboveHitObjectsProxiedContent() => null;
|
public Drawable? GetAboveHitObjectsProxiedContent() => null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
38
osu.Game/Rulesets/Judgements/JudgementPiece.cs
Normal file
38
osu.Game/Rulesets/Judgements/JudgementPiece.cs
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
// 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.Allocation;
|
||||||
|
using osu.Framework.Extensions;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Judgements
|
||||||
|
{
|
||||||
|
public abstract partial class JudgementPiece : CompositeDrawable
|
||||||
|
{
|
||||||
|
protected readonly HitResult Result;
|
||||||
|
|
||||||
|
protected SpriteText JudgementText { get; private set; } = null!;
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private OsuColour colours { get; set; } = null!;
|
||||||
|
|
||||||
|
protected JudgementPiece(HitResult result)
|
||||||
|
{
|
||||||
|
Result = result;
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
|
AddInternal(JudgementText = CreateJudgementText());
|
||||||
|
|
||||||
|
JudgementText.Colour = colours.ForHitResult(Result);
|
||||||
|
JudgementText.Text = Result.GetDescription().ToUpperInvariant();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract SpriteText CreateJudgementText();
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user