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

View File

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

View File

@ -97,17 +97,14 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
return null; return null;
case OsuSkinComponents.HitCircleText: case OsuSkinComponents.HitCircleText:
var font = GetConfig<OsuSkinConfiguration, string>(OsuSkinConfiguration.HitCirclePrefix)?.Value ?? "default"; if (!this.HasFont(LegacyFont.HitCircle))
var overlap = GetConfig<OsuSkinConfiguration, float>(OsuSkinConfiguration.HitCircleOverlap)?.Value ?? -2; return null;
return !this.HasFont(font) return new LegacySpriteText(Source, LegacyFont.HitCircle)
? null {
: new LegacySpriteText(Source, font) // stable applies a blanket 0.8x scale to hitcircle fonts
{ Scale = new Vector2(0.8f),
// stable applies a blanket 0.8x scale to hitcircle fonts };
Scale = new Vector2(0.8f),
Spacing = new Vector2(-overlap, 0)
};
case OsuSkinComponents.SpinnerBody: case OsuSkinComponents.SpinnerBody:
bool hasBackground = Source.GetTexture("spinner-background") != null; 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;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics.Sprites;
using osu.Game.Skinning; using osu.Game.Skinning;
using osuTK; using osuTK;
@ -84,16 +83,16 @@ namespace osu.Game.Screens.Play.HUD
{ {
InternalChildren = new[] InternalChildren = new[]
{ {
popOutCount = createSpriteText().With(s => popOutCount = new LegacySpriteText(skin, LegacyFont.Combo)
{ {
s.Alpha = 0; Alpha = 0,
s.Margin = new MarginPadding(0.05f); Margin = new MarginPadding(0.05f),
s.Blending = BlendingParameters.Additive; Blending = BlendingParameters.Additive,
}), },
displayedCountSpriteText = createSpriteText().With(s => displayedCountSpriteText = new LegacySpriteText(skin, LegacyFont.Combo)
{ {
s.Alpha = 0; Alpha = 0,
}) },
}; };
Current.ValueChanged += combo => updateCount(combo.NewValue == 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; double difference = currentValue > newValue ? currentValue - newValue : newValue - currentValue;
return difference * rolling_duration; 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)] [Resolved(canBeNull: true)]
private HUDOverlay hud { get; set; } private HUDOverlay hud { get; set; }
protected sealed override OsuSpriteText CreateSpriteText() protected sealed override OsuSpriteText CreateSpriteText() => new LegacySpriteText(skin, LegacyFont.Score)
=> (OsuSpriteText)skin?.GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.ScoreText)) {
?.With(s => s.Anchor = s.Origin = Anchor.TopRight); Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
};
protected override void Update() protected override void Update()
{ {

View File

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