1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:12:54 +08:00

Revert legacy spinner presence changes and bonus counter component

No longer necessary, after inlining legacy coordinates logic to `LegacySpinner` and limiting precisely-positioned legacy components there
This commit is contained in:
Salman Ahmed 2021-03-12 02:37:07 +03:00
parent 020a03e01e
commit 8fdab5a7de
3 changed files with 4 additions and 37 deletions

View File

@ -82,7 +82,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
Y = 120,
Alpha = 0
},
new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SpinnerBonusCounter), _ => new DefaultSpinnerBonusCounter()),
spinningSample = new PausableSkinnableSound
{
Volume = { Value = 0 },

View File

@ -19,6 +19,5 @@ namespace osu.Game.Rulesets.Osu
SliderBall,
SliderBody,
SpinnerBody,
SpinnerBonusCounter,
}
}

View File

@ -6,7 +6,6 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Game.Skinning;
using osuTK;
using static osu.Game.Skinning.LegacySkinConfiguration;
namespace osu.Game.Rulesets.Osu.Skinning.Legacy
{
@ -14,12 +13,6 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
{
private Lazy<bool> hasHitCircle;
private Lazy<SpinnerStyle> spinnerStyle;
private bool hasSpinner => spinnerStyle.Value != SpinnerStyle.Modern;
private bool hasScoreFont => this.HasFont(GetConfig<LegacySetting, string>(LegacySetting.ScorePrefix)?.Value ?? "score");
/// <summary>
/// On osu-stable, hitcircles have 5 pixels of transparent padding on each side to allow for shadows etc.
/// Their hittable area is 128px, but the actual circle portion is 118px.
@ -37,19 +30,6 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
private void sourceChanged()
{
hasHitCircle = new Lazy<bool>(() => Source.GetTexture("hitcircle") != null);
spinnerStyle = new Lazy<SpinnerStyle>(() =>
{
bool hasBackground = Source.GetTexture("spinner-background") != null;
if (Source.GetTexture("spinner-top") != null && !hasBackground)
return SpinnerStyle.NewLegacy;
if (hasBackground)
return SpinnerStyle.OldLegacy;
return SpinnerStyle.Modern;
});
}
public override Drawable GetDrawableComponent(ISkinComponent component)
@ -130,18 +110,14 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
};
case OsuSkinComponents.SpinnerBody:
if (spinnerStyle.Value == SpinnerStyle.NewLegacy)
bool hasBackground = Source.GetTexture("spinner-background") != null;
if (Source.GetTexture("spinner-top") != null && !hasBackground)
return new LegacyNewStyleSpinner();
else if (spinnerStyle.Value == SpinnerStyle.OldLegacy)
else if (hasBackground)
return new LegacyOldStyleSpinner();
return null;
case OsuSkinComponents.SpinnerBonusCounter:
if (hasSpinner && hasScoreFont)
return new LegacySpinnerBonusCounter();
return null;
}
return null;
@ -175,12 +151,5 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
return Source.GetConfig<TLookup, TValue>(lookup);
}
private enum SpinnerStyle
{
NewLegacy,
OldLegacy,
Modern,
}
}
}