Skip to content

Adjust slider tick / end defaults again #26703

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

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;

Expand Down
9 changes: 4 additions & 5 deletions osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public partial class DrawableSliderTick : DrawableOsuHitObject
{
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;

Expand All @@ -44,8 +44,8 @@ private void load()
{
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
{
Expand Down Expand Up @@ -88,8 +88,7 @@ protected override void UpdateHitStateTransforms(ArmedState state)
break;

case ArmedState.Miss:
this.FadeOut(ANIM_DURATION);
this.TransformBindableTo(AccentColour, Color4.Red, 0);
this.FadeOut(ANIM_DURATION, Easing.OutQuint);
break;

case ArmedState.Hit:
Expand Down
4 changes: 4 additions & 0 deletions osu.Game.Rulesets.Osu/OsuRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
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;
Expand Down Expand Up @@ -254,6 +255,9 @@ public override IEnumerable<Mod> GetModsFor(ModType type)

case ArgonSkin:
return new OsuArgonSkinTransformer(skin);

case TrianglesSkin:
return new OsuTrianglesSkinTransformer(skin);
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace osu.Game.Rulesets.Osu.Skinning.Argon
{
public partial class ArgonJudgementPiece : JudgementPiece, IAnimatableJudgement
public partial class ArgonJudgementPiece : TextJudgementPiece, IAnimatableJudgement
{
private RingExplosion? ringExplosion;

Expand Down
Original file line number Diff line number Diff line change
@@ -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();
}
}
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.Osu/Skinning/Argon/ArgonSliderScorePoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ public partial class ArgonSliderScorePoint : CircularContainer
{
private Bindable<Color4> accentColour = null!;

private const float size = 12;
public const float SIZE = 12;

[BackgroundDependencyLoader]
private void load(DrawableHitObject hitObject)
{
Masking = true;
Origin = Anchor.Centre;
Size = new Vector2(size);
Size = new Vector2(SIZE);
BorderThickness = 3;
BorderColour = Color4.White;
Child = new Box
Expand Down
14 changes: 12 additions & 2 deletions osu.Game.Rulesets.Osu/Skinning/Argon/OsuArgonSkinTransformer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,21 @@ public OsuArgonSkinTransformer(ISkin skin)
switch (lookup)
{
case GameplaySkinComponentLookup<HitResult> resultComponent:
HitResult result = resultComponent.Component;

// 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 new ArgonJudgementPiece(resultComponent.Component);
switch (result)
{
case HitResult.IgnoreMiss:
case HitResult.LargeTickMiss:
return new ArgonJudgementPieceSliderTickMiss(result);

default:
return new ArgonJudgementPiece(result);
}

case OsuSkinComponentLookup osuComponent:
// TODO: Once everything is finalised, consider throwing UnsupportedSkinComponentException on missing entries.
Expand Down
Original file line number Diff line number Diff line change
@@ -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();
}
}
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace osu.Game.Rulesets.Taiko.Skinning.Argon
{
public partial class ArgonJudgementPiece : JudgementPiece, IAnimatableJudgement
public partial class ArgonJudgementPiece : TextJudgementPiece, IAnimatableJudgement
{
private RingExplosion? ringExplosion;

Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Graphics/OsuColour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public Color4 ForHitResult(HitResult result)
{
case HitResult.IgnoreMiss:
case HitResult.SmallTickMiss:
return Orange1;
return Color4.Gray;

case HitResult.Miss:
case HitResult.LargeTickMiss:
Expand Down
16 changes: 1 addition & 15 deletions osu.Game/Rulesets/Judgements/DefaultJudgementPiece.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace osu.Game.Rulesets.Judgements
{
public partial class DefaultJudgementPiece : JudgementPiece, IAnimatableJudgement
public partial class DefaultJudgementPiece : TextJudgementPiece, IAnimatableJudgement
{
public DefaultJudgementPiece(HitResult result)
: base(result)
Expand Down Expand Up @@ -38,20 +38,6 @@ protected override SpriteText CreateJudgementText() =>
/// </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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace osu.Game.Rulesets.Judgements
{
public abstract partial class JudgementPiece : CompositeDrawable
public abstract partial class TextJudgementPiece : CompositeDrawable
{
protected readonly HitResult Result;

Expand All @@ -19,7 +19,7 @@ public abstract partial class JudgementPiece : CompositeDrawable
[Resolved]
private OsuColour colours { get; set; } = null!;

protected JudgementPiece(HitResult result)
protected TextJudgementPiece(HitResult result)
{
Result = result;
}
Expand Down
2 changes: 0 additions & 2 deletions osu.Game/Rulesets/Scoring/HitResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ public enum HitResult
/// Indicates a large tick miss.
/// </summary>
[EnumMember(Value = "large_tick_miss")]
[Description("-")]
[Order(11)]
LargeTickMiss,

Expand Down Expand Up @@ -118,7 +117,6 @@ public enum HitResult
/// Indicates a miss that should be ignored for scoring purposes.
/// </summary>
[EnumMember(Value = "ignore_miss")]
[Description("-")]
[Order(14)]
IgnoreMiss,

Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Skinning/LegacyJudgementPieceNew.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public LegacyJudgementPieceNew(HitResult result, Func<Drawable> createMainDrawab
if (!result.IsMiss())
{
//new judgement shows old as a temporary effect
AddInternal(temporaryOldStyle = new LegacyJudgementPieceOld(result, createMainDrawable, 1.05f, true)
AddInternal(temporaryOldStyle = new LegacyJudgementPieceOld(result, createMainDrawable, 1.05f)
{
Blending = BlendingParameters.Additive,
Anchor = Anchor.Centre,
Expand Down
17 changes: 5 additions & 12 deletions osu.Game/Skinning/LegacyJudgementPieceOld.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,14 @@ public partial class LegacyJudgementPieceOld : CompositeDrawable, IAnimatableJud
private readonly HitResult result;

private readonly float finalScale;
private readonly bool forceTransforms;

[Resolved]
private ISkinSource skin { get; set; } = null!;

public LegacyJudgementPieceOld(HitResult result, Func<Drawable> createMainDrawable, float finalScale = 1f, bool forceTransforms = false)
public LegacyJudgementPieceOld(HitResult result, Func<Drawable> createMainDrawable, float finalScale = 1f)
{
this.result = result;
this.finalScale = finalScale;
this.forceTransforms = forceTransforms;

AutoSizeAxes = Axes.Both;
Origin = Anchor.Centre;
Expand All @@ -46,15 +44,6 @@ public virtual void PlayAnimation()
const double fade_out_length = 600;

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.
if (animation?.FrameCount > 1 && !forceTransforms)
{
if (isMissedTick())
applyMissedTickScaling();
return;
}

if (result.IsMiss())
{
Expand Down Expand Up @@ -84,6 +73,8 @@ public virtual void PlayAnimation()
this.RotateTo(0);
this.RotateTo(rotation, fade_in_length)
.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
Expand All @@ -97,6 +88,8 @@ public virtual void PlayAnimation()
// so we need to force the current value to be correct at 1.2 (0.95) then complete the
// second half of the transform.
.ScaleTo(0.95f).ScaleTo(finalScale, fade_in_length * 0.2f); // t = 1.4

this.Delay(fade_out_delay).FadeOut(fade_out_length);
}
}

Expand Down