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

Merge pull request #26703 from peppy/smaller-slider-misses

Adjust slider tick / end defaults again
This commit is contained in:
Bartłomiej Dach 2024-01-29 13:51:07 +01:00 committed by GitHub
commit 2667cb8b36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 174 additions and 43 deletions

View File

@ -17,7 +17,7 @@ using osuTK.Graphics;
namespace osu.Game.Rulesets.Mania.Skinning.Argon namespace osu.Game.Rulesets.Mania.Skinning.Argon
{ {
public partial class ArgonJudgementPiece : JudgementPiece, IAnimatableJudgement public partial class ArgonJudgementPiece : TextJudgementPiece, IAnimatableJudgement
{ {
private const float judgement_y_position = 160; private const float judgement_y_position = 160;

View File

@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{ {
public const double ANIM_DURATION = 150; 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; protected DrawableSlider DrawableSlider => (DrawableSlider)ParentHitObject;
@ -44,8 +44,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{ {
Masking = true, Masking = true,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Size = new Vector2(default_tick_size), Size = new Vector2(DEFAULT_TICK_SIZE),
BorderThickness = default_tick_size / 4, BorderThickness = DEFAULT_TICK_SIZE / 4,
BorderColour = Color4.White, BorderColour = Color4.White,
Child = new Box Child = new Box
{ {
@ -88,8 +88,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
break; break;
case ArmedState.Miss: case ArmedState.Miss:
this.FadeOut(ANIM_DURATION); this.FadeOut(ANIM_DURATION, Easing.OutQuint);
this.TransformBindableTo(AccentColour, Color4.Red, 0);
break; break;
case ArmedState.Hit: case ArmedState.Hit:

View File

@ -28,6 +28,7 @@ using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Replays; using osu.Game.Rulesets.Osu.Replays;
using osu.Game.Rulesets.Osu.Scoring; using osu.Game.Rulesets.Osu.Scoring;
using osu.Game.Rulesets.Osu.Skinning.Argon; 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.Skinning.Legacy;
using osu.Game.Rulesets.Osu.Statistics; using osu.Game.Rulesets.Osu.Statistics;
using osu.Game.Rulesets.Osu.UI; using osu.Game.Rulesets.Osu.UI;
@ -254,6 +255,9 @@ namespace osu.Game.Rulesets.Osu
case ArgonSkin: case ArgonSkin:
return new OsuArgonSkinTransformer(skin); return new OsuArgonSkinTransformer(skin);
case TrianglesSkin:
return new OsuTrianglesSkinTransformer(skin);
} }
return null; return null;

View File

@ -16,7 +16,7 @@ using osuTK;
namespace osu.Game.Rulesets.Osu.Skinning.Argon namespace osu.Game.Rulesets.Osu.Skinning.Argon
{ {
public partial class ArgonJudgementPiece : JudgementPiece, IAnimatableJudgement public partial class ArgonJudgementPiece : TextJudgementPiece, IAnimatableJudgement
{ {
private RingExplosion? ringExplosion; private RingExplosion? ringExplosion;

View File

@ -0,0 +1,51 @@
// 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.Scoring;
using osuTK;
namespace osu.Game.Rulesets.Osu.Skinning.Argon
{
public partial class ArgonJudgementPieceSliderTickMiss : CompositeDrawable, IAnimatableJudgement
{
private readonly HitResult result;
private Circle piece = null!;
[Resolved]
private OsuColour colours { get; set; } = null!;
public ArgonJudgementPieceSliderTickMiss(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(ArgonSliderScorePoint.SIZE)
});
}
public void PlayAnimation()
{
this.ScaleTo(1.4f);
this.ScaleTo(1f, 150, Easing.Out);
this.FadeOutFromOne(400);
}
public Drawable? GetAboveHitObjectsProxiedContent() => piece.CreateProxy();
}
}

View File

@ -16,14 +16,14 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
{ {
private Bindable<Color4> accentColour = null!; private Bindable<Color4> accentColour = null!;
private const float size = 12; public const float SIZE = 12;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(DrawableHitObject hitObject) private void load(DrawableHitObject hitObject)
{ {
Masking = true; Masking = true;
Origin = Anchor.Centre; Origin = Anchor.Centre;
Size = new Vector2(size); Size = new Vector2(SIZE);
BorderThickness = 3; BorderThickness = 3;
BorderColour = Color4.White; BorderColour = Color4.White;
Child = new Box Child = new Box

View File

@ -19,11 +19,21 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
switch (lookup) switch (lookup)
{ {
case GameplaySkinComponentLookup<HitResult> resultComponent: case GameplaySkinComponentLookup<HitResult> resultComponent:
HitResult result = resultComponent.Component;
// This should eventually be moved to a skin setting, when supported. // This should eventually be moved to a skin setting, when supported.
if (Skin is ArgonProSkin && (resultComponent.Component == HitResult.Great || resultComponent.Component == HitResult.Perfect)) if (Skin is ArgonProSkin && (result == HitResult.Great || result == HitResult.Perfect))
return Drawable.Empty(); return Drawable.Empty();
return new ArgonJudgementPiece(resultComponent.Component); switch (result)
{
case HitResult.IgnoreMiss:
case HitResult.LargeTickMiss:
return new ArgonJudgementPieceSliderTickMiss(result);
default:
return new ArgonJudgementPiece(result);
}
case OsuSkinComponentLookup osuComponent: case OsuSkinComponentLookup osuComponent:
// TODO: Once everything is finalised, consider throwing UnsupportedSkinComponentException on missing entries. // TODO: Once everything is finalised, consider throwing UnsupportedSkinComponentException on missing entries.

View File

@ -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();
}
}

View 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.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);
}
}
}

View File

@ -17,7 +17,7 @@ using osuTK.Graphics;
namespace osu.Game.Rulesets.Taiko.Skinning.Argon namespace osu.Game.Rulesets.Taiko.Skinning.Argon
{ {
public partial class ArgonJudgementPiece : JudgementPiece, IAnimatableJudgement public partial class ArgonJudgementPiece : TextJudgementPiece, IAnimatableJudgement
{ {
private RingExplosion? ringExplosion; private RingExplosion? ringExplosion;

View File

@ -77,7 +77,7 @@ namespace osu.Game.Graphics
{ {
case HitResult.IgnoreMiss: case HitResult.IgnoreMiss:
case HitResult.SmallTickMiss: case HitResult.SmallTickMiss:
return Orange1; return Color4.Gray;
case HitResult.Miss: case HitResult.Miss:
case HitResult.LargeTickMiss: case HitResult.LargeTickMiss:

View File

@ -10,7 +10,7 @@ using osuTK;
namespace osu.Game.Rulesets.Judgements namespace osu.Game.Rulesets.Judgements
{ {
public partial class DefaultJudgementPiece : JudgementPiece, IAnimatableJudgement public partial class DefaultJudgementPiece : TextJudgementPiece, IAnimatableJudgement
{ {
public DefaultJudgementPiece(HitResult result) public DefaultJudgementPiece(HitResult result)
: base(result) : base(result)
@ -38,20 +38,6 @@ namespace osu.Game.Rulesets.Judgements
/// </remarks> /// </remarks>
public virtual void PlayAnimation() 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()) if (Result.IsMiss())
{ {
this.ScaleTo(1.6f); this.ScaleTo(1.6f);

View File

@ -10,7 +10,7 @@ using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Judgements namespace osu.Game.Rulesets.Judgements
{ {
public abstract partial class JudgementPiece : CompositeDrawable public abstract partial class TextJudgementPiece : CompositeDrawable
{ {
protected readonly HitResult Result; protected readonly HitResult Result;
@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Judgements
[Resolved] [Resolved]
private OsuColour colours { get; set; } = null!; private OsuColour colours { get; set; } = null!;
protected JudgementPiece(HitResult result) protected TextJudgementPiece(HitResult result)
{ {
Result = result; Result = result;
} }

View File

@ -86,7 +86,6 @@ namespace osu.Game.Rulesets.Scoring
/// Indicates a large tick miss. /// Indicates a large tick miss.
/// </summary> /// </summary>
[EnumMember(Value = "large_tick_miss")] [EnumMember(Value = "large_tick_miss")]
[Description("-")]
[Order(11)] [Order(11)]
LargeTickMiss, LargeTickMiss,
@ -118,7 +117,6 @@ namespace osu.Game.Rulesets.Scoring
/// Indicates a miss that should be ignored for scoring purposes. /// Indicates a miss that should be ignored for scoring purposes.
/// </summary> /// </summary>
[EnumMember(Value = "ignore_miss")] [EnumMember(Value = "ignore_miss")]
[Description("-")]
[Order(14)] [Order(14)]
IgnoreMiss, IgnoreMiss,

View File

@ -46,15 +46,10 @@ namespace osu.Game.Skinning
const double fade_out_length = 600; const double fade_out_length = 600;
this.FadeInFromZero(fade_in_length); this.FadeInFromZero(fade_in_length);
this.Delay(fade_out_delay).FadeOut(fade_out_length);
// legacy judgements don't play any transforms if they are an animation.... UNLESS they are the temporary displayed judgement from new piece. // legacy judgements don't play any transforms if they are an animation.... UNLESS they are the temporary displayed judgement from new piece.
if (animation?.FrameCount > 1 && !forceTransforms) if (animation?.FrameCount > 1 && !forceTransforms)
{
if (isMissedTick())
applyMissedTickScaling();
return; return;
}
if (result.IsMiss()) if (result.IsMiss())
{ {
@ -84,6 +79,8 @@ namespace osu.Game.Skinning
this.RotateTo(0); this.RotateTo(0);
this.RotateTo(rotation, fade_in_length) this.RotateTo(rotation, fade_in_length)
.Then().RotateTo(rotation * 2, fade_out_delay + fade_out_length - fade_in_length, Easing.In); .Then().RotateTo(rotation * 2, fade_out_delay + fade_out_length - fade_in_length, Easing.In);
this.Delay(fade_out_delay).FadeOut(fade_out_length);
} }
} }
else else
@ -97,17 +94,13 @@ namespace osu.Game.Skinning
// so we need to force the current value to be correct at 1.2 (0.95) then complete the // so we need to force the current value to be correct at 1.2 (0.95) then complete the
// second half of the transform. // second half of the transform.
.ScaleTo(0.95f).ScaleTo(finalScale, fade_in_length * 0.2f); // t = 1.4 .ScaleTo(0.95f).ScaleTo(finalScale, fade_in_length * 0.2f); // t = 1.4
this.Delay(fade_out_delay).FadeOut(fade_out_length);
} }
} }
private bool isMissedTick() => result.IsMiss() && result != HitResult.Miss; private bool isMissedTick() => result.IsMiss() && result != HitResult.Miss;
private void applyMissedTickScaling()
{
this.ScaleTo(0.6f);
this.ScaleTo(0.3f, 100, Easing.In);
}
public Drawable GetAboveHitObjectsProxiedContent() => CreateProxy(); public Drawable GetAboveHitObjectsProxiedContent() => CreateProxy();
} }
} }