Skip to content

Commit

Permalink
Revert "Remove dead code" (mostly)
Browse files Browse the repository at this point in the history
This reverts commit 6070eac.
  • Loading branch information
peppy committed Jan 29, 2024
1 parent fd9527d commit 8341da7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion osu.Game/Skinning/LegacyJudgementPieceNew.cs
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)
AddInternal(temporaryOldStyle = new LegacyJudgementPieceOld(result, createMainDrawable, 1.05f, true)
{
Blending = BlendingParameters.Additive,
Anchor = Anchor.Centre,
Expand Down
14 changes: 7 additions & 7 deletions osu.Game/Skinning/LegacyJudgementPieceOld.cs
Expand Up @@ -18,14 +18,16 @@ 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)
public LegacyJudgementPieceOld(HitResult result, Func<Drawable> createMainDrawable, float finalScale = 1f, bool forceTransforms = false)
{
this.result = result;
this.finalScale = finalScale;
this.forceTransforms = forceTransforms;

AutoSizeAxes = Axes.Both;
Origin = Anchor.Centre;
Expand All @@ -45,6 +47,10 @@ public virtual void PlayAnimation()

this.FadeInFromZero(fade_in_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)
return;

if (result.IsMiss())
{
decimal? legacyVersion = skin.GetConfig<SkinConfiguration.LegacySetting, decimal>(SkinConfiguration.LegacySetting.Version)?.Value;
Expand Down Expand Up @@ -95,12 +101,6 @@ public virtual void PlayAnimation()

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

0 comments on commit 8341da7

Please sign in to comment.