mirror of
https://github.com/ppy/osu.git
synced 2024-11-13 15:27:30 +08:00
Update triangles skin judgment display
This commit is contained in:
parent
0175f6e0b8
commit
107b37494e
@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
{
|
||||
public const double ANIM_DURATION = 150;
|
||||
|
||||
private const float default_tick_size = 16;
|
||||
public const float DEFAULT_TICK_SIZE = 16;
|
||||
|
||||
protected DrawableSlider DrawableSlider => (DrawableSlider)ParentHitObject;
|
||||
|
||||
@ -44,8 +44,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
{
|
||||
Masking = true,
|
||||
Origin = Anchor.Centre,
|
||||
Size = new Vector2(default_tick_size),
|
||||
BorderThickness = default_tick_size / 4,
|
||||
Size = new Vector2(DEFAULT_TICK_SIZE),
|
||||
BorderThickness = DEFAULT_TICK_SIZE / 4,
|
||||
BorderColour = Color4.White,
|
||||
Child = new Box
|
||||
{
|
||||
|
@ -28,6 +28,7 @@ using osu.Game.Rulesets.Osu.Objects;
|
||||
using osu.Game.Rulesets.Osu.Replays;
|
||||
using osu.Game.Rulesets.Osu.Scoring;
|
||||
using osu.Game.Rulesets.Osu.Skinning.Argon;
|
||||
using osu.Game.Rulesets.Osu.Skinning.Default;
|
||||
using osu.Game.Rulesets.Osu.Skinning.Legacy;
|
||||
using osu.Game.Rulesets.Osu.Statistics;
|
||||
using osu.Game.Rulesets.Osu.UI;
|
||||
@ -254,6 +255,9 @@ namespace osu.Game.Rulesets.Osu
|
||||
|
||||
case ArgonSkin:
|
||||
return new OsuArgonSkinTransformer(skin);
|
||||
|
||||
case TrianglesSkin:
|
||||
return new OsuTrianglesSkinTransformer(skin);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -0,0 +1,52 @@
|
||||
// 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.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Skinning.Default
|
||||
{
|
||||
public partial class DefaultJudgementPieceSliderTickMiss : CompositeDrawable, IAnimatableJudgement
|
||||
{
|
||||
private readonly HitResult result;
|
||||
private Circle piece = null!;
|
||||
|
||||
[Resolved]
|
||||
private OsuColour colours { get; set; } = null!;
|
||||
|
||||
public DefaultJudgementPieceSliderTickMiss(HitResult result)
|
||||
{
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
AddInternal(piece = new Circle
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Blending = BlendingParameters.Additive,
|
||||
Colour = colours.ForHitResult(result),
|
||||
Size = new Vector2(DrawableSliderTick.DEFAULT_TICK_SIZE)
|
||||
});
|
||||
}
|
||||
|
||||
public void PlayAnimation()
|
||||
{
|
||||
this.ScaleTo(1.4f);
|
||||
this.ScaleTo(1f, 150, Easing.Out);
|
||||
|
||||
this.FadeOutFromOne(400);
|
||||
}
|
||||
|
||||
public Drawable? GetAboveHitObjectsProxiedContent() => piece.CreateProxy();
|
||||
}
|
||||
}
|
@ -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.Graphics;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Skinning;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Skinning.Default
|
||||
{
|
||||
public class OsuTrianglesSkinTransformer : SkinTransformer
|
||||
{
|
||||
public OsuTrianglesSkinTransformer(ISkin skin)
|
||||
: base(skin)
|
||||
{
|
||||
}
|
||||
|
||||
public override Drawable? GetDrawableComponent(ISkinComponentLookup lookup)
|
||||
{
|
||||
switch (lookup)
|
||||
{
|
||||
case GameplaySkinComponentLookup<HitResult> resultComponent:
|
||||
HitResult result = resultComponent.Component;
|
||||
|
||||
switch (result)
|
||||
{
|
||||
case HitResult.IgnoreMiss:
|
||||
case HitResult.LargeTickMiss:
|
||||
// use argon judgement piece for new tick misses because i don't want to design another one for triangles.
|
||||
return new DefaultJudgementPieceSliderTickMiss(result);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return base.GetDrawableComponent(lookup);
|
||||
}
|
||||
}
|
||||
}
|
@ -38,20 +38,6 @@ namespace osu.Game.Rulesets.Judgements
|
||||
/// </remarks>
|
||||
public virtual void PlayAnimation()
|
||||
{
|
||||
// TODO: make these better. currently they are using a text `-` and it's not centered properly.
|
||||
// Should be an explicit drawable.
|
||||
//
|
||||
// When this is done, remove the [Description] attributes from HitResults which were added for this purpose.
|
||||
if (Result == HitResult.IgnoreMiss || Result == HitResult.LargeTickMiss)
|
||||
{
|
||||
this.RotateTo(-45);
|
||||
this.ScaleTo(1.6f);
|
||||
this.ScaleTo(1.2f, 100, Easing.In);
|
||||
|
||||
this.FadeOutFromOne(400);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Result.IsMiss())
|
||||
{
|
||||
this.ScaleTo(1.6f);
|
||||
|
@ -86,7 +86,6 @@ namespace osu.Game.Rulesets.Scoring
|
||||
/// Indicates a large tick miss.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "large_tick_miss")]
|
||||
[Description("-")]
|
||||
[Order(11)]
|
||||
LargeTickMiss,
|
||||
|
||||
@ -118,7 +117,6 @@ namespace osu.Game.Rulesets.Scoring
|
||||
/// Indicates a miss that should be ignored for scoring purposes.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "ignore_miss")]
|
||||
[Description("-")]
|
||||
[Order(14)]
|
||||
IgnoreMiss,
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user