1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 18:47:27 +08:00

Update existing usages

Resolve post-conflict issues
This commit is contained in:
Salman Ahmed 2021-03-07 02:18:31 +03:00
parent 2a2ee3fa5e
commit 43c1e1d217
6 changed files with 28 additions and 36 deletions

View File

@ -5,7 +5,6 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Game.Skinning;
using osuTK.Graphics;
using static osu.Game.Skinning.LegacySkinConfiguration;
namespace osu.Game.Rulesets.Catch.Skinning.Legacy
{
@ -14,7 +13,7 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
/// <summary>
/// For simplicity, let's use legacy combo font texture existence as a way to identify legacy skins from default.
/// </summary>
private bool providesComboCounter => this.HasFont(GetConfig<LegacySetting, string>(LegacySetting.ComboPrefix)?.Value ?? "score");
private bool providesComboCounter => this.HasFont(LegacyFont.Combo);
public CatchLegacySkinTransformer(ISkinSource source)
: base(source)
@ -69,7 +68,6 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
this.GetAnimation("fruit-ryuuta", true, true, true);
case CatchSkinComponents.CatchComboCounter:
if (providesComboCounter)
return new LegacyCatchComboCounter(Source);

View File

@ -7,7 +7,6 @@ using osu.Game.Rulesets.Catch.UI;
using osu.Game.Skinning;
using osuTK;
using osuTK.Graphics;
using static osu.Game.Skinning.LegacySkinConfiguration;
namespace osu.Game.Rulesets.Catch.Skinning.Legacy
{
@ -22,9 +21,6 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
public LegacyCatchComboCounter(ISkin skin)
{
var fontName = skin.GetConfig<LegacySetting, string>(LegacySetting.ComboPrefix)?.Value ?? "score";
var fontOverlap = skin.GetConfig<LegacySetting, float>(LegacySetting.ComboOverlap)?.Value ?? -2f;
AutoSizeAxes = Axes.Both;
Alpha = 0f;
@ -34,7 +30,7 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
InternalChildren = new Drawable[]
{
explosion = new LegacyRollingCounter(skin, fontName, fontOverlap)
explosion = new LegacyRollingCounter(skin, LegacyFont.Combo)
{
Alpha = 0.65f,
Blending = BlendingParameters.Additive,
@ -42,7 +38,7 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
Origin = Anchor.Centre,
Scale = new Vector2(1.5f),
},
counter = new LegacyRollingCounter(skin, fontName, fontOverlap)
counter = new LegacyRollingCounter(skin, LegacyFont.Combo)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,

View File

@ -97,17 +97,14 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
return null;
case OsuSkinComponents.HitCircleText:
var font = GetConfig<OsuSkinConfiguration, string>(OsuSkinConfiguration.HitCirclePrefix)?.Value ?? "default";
var overlap = GetConfig<OsuSkinConfiguration, float>(OsuSkinConfiguration.HitCircleOverlap)?.Value ?? -2;
if (!this.HasFont(LegacyFont.HitCircle))
return null;
return !this.HasFont(font)
? null
: new LegacySpriteText(Source, font)
{
// stable applies a blanket 0.8x scale to hitcircle fonts
Scale = new Vector2(0.8f),
Spacing = new Vector2(-overlap, 0)
};
return new LegacySpriteText(Source, LegacyFont.HitCircle)
{
// stable applies a blanket 0.8x scale to hitcircle fonts
Scale = new Vector2(0.8f),
};
case OsuSkinComponents.SpinnerBody:
bool hasBackground = Source.GetTexture("spinner-background") != null;

View File

@ -6,7 +6,6 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics.Sprites;
using osu.Game.Skinning;
using osuTK;
@ -84,16 +83,16 @@ namespace osu.Game.Screens.Play.HUD
{
InternalChildren = new[]
{
popOutCount = createSpriteText().With(s =>
popOutCount = new LegacySpriteText(skin, LegacyFont.Combo)
{
s.Alpha = 0;
s.Margin = new MarginPadding(0.05f);
s.Blending = BlendingParameters.Additive;
}),
displayedCountSpriteText = createSpriteText().With(s =>
Alpha = 0,
Margin = new MarginPadding(0.05f),
Blending = BlendingParameters.Additive,
},
displayedCountSpriteText = new LegacySpriteText(skin, LegacyFont.Combo)
{
s.Alpha = 0;
})
Alpha = 0,
},
};
Current.ValueChanged += combo => updateCount(combo.NewValue == 0);
@ -247,7 +246,5 @@ namespace osu.Game.Screens.Play.HUD
double difference = currentValue > newValue ? currentValue - newValue : newValue - currentValue;
return difference * rolling_duration;
}
private OsuSpriteText createSpriteText() => (OsuSpriteText)skin.GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.ComboText));
}
}

View File

@ -29,9 +29,11 @@ namespace osu.Game.Skinning
[Resolved(canBeNull: true)]
private HUDOverlay hud { get; set; }
protected sealed override OsuSpriteText CreateSpriteText()
=> (OsuSpriteText)skin?.GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.ScoreText))
?.With(s => s.Anchor = s.Origin = Anchor.TopRight);
protected sealed override OsuSpriteText CreateSpriteText() => new LegacySpriteText(skin, LegacyFont.Score)
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
};
protected override void Update()
{

View File

@ -33,8 +33,10 @@ namespace osu.Game.Skinning
Margin = new MarginPadding(10);
}
protected sealed override OsuSpriteText CreateSpriteText()
=> (OsuSpriteText)skin.GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.ScoreText))
.With(s => s.Anchor = s.Origin = Anchor.TopRight);
protected sealed override OsuSpriteText CreateSpriteText() => new LegacySpriteText(skin, LegacyFont.Score)
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
};
}
}