Reposition legacy spinner components in-line with osu!stable

This commit is contained in:
Salman Ahmed 2021-02-28 21:41:11 +03:00
parent 41b43dd39a
commit d528ef426f
2 changed files with 39 additions and 45 deletions

View File

@ -33,16 +33,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
{ {
spinnerBlink = source.GetConfig<OsuSkinConfiguration, bool>(OsuSkinConfiguration.SpinnerNoBlink)?.Value != true; spinnerBlink = source.GetConfig<OsuSkinConfiguration, bool>(OsuSkinConfiguration.SpinnerNoBlink)?.Value != true;
AddInternal(new Container AddRangeInternal(new Drawable[]
{
// the old-style spinner relied heavily on absolute screen-space coordinate values.
// wrap everything in a container simulating absolute coords to preserve alignment
// as there are skins that depend on it.
Width = 640,
Height = 480,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Children = new Drawable[]
{ {
new Sprite new Sprite
{ {
@ -58,14 +49,15 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
Texture = source.GetTexture("spinner-circle"), Texture = source.GetTexture("spinner-circle"),
Scale = new Vector2(SPRITE_SCALE) Scale = new Vector2(SPRITE_SCALE)
}, },
metre = new Container new LegacyCoordinatesContainer
{
Child = metre = new Container
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
// this anchor makes no sense, but that's what stable uses. // this anchor makes no sense, but that's what stable uses.
Anchor = Anchor.TopLeft, Anchor = Anchor.TopLeft,
Origin = Anchor.TopLeft, Origin = Anchor.TopLeft,
// adjustment for stable (metre has additional offset) Margin = new MarginPadding { Top = LegacyCoordinatesContainer.SPINNER_TOP_OFFSET },
Margin = new MarginPadding { Top = 20 },
Masking = true, Masking = true,
Child = metreSprite = new Sprite Child = metreSprite = new Sprite
{ {

View File

@ -30,27 +30,29 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
DrawableSpinner = (DrawableSpinner)drawableHitObject; DrawableSpinner = (DrawableSpinner)drawableHitObject;
AddRangeInternal(new[] AddInternal(new LegacyCoordinatesContainer
{
Depth = float.MinValue,
Children = new Drawable[]
{ {
spin = new Sprite spin = new Sprite
{ {
Anchor = Anchor.Centre, Anchor = Anchor.TopCentre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Depth = float.MinValue,
Texture = source.GetTexture("spinner-spin"), Texture = source.GetTexture("spinner-spin"),
Scale = new Vector2(SPRITE_SCALE), Scale = new Vector2(SPRITE_SCALE),
Y = 120 - 45 // offset temporarily to avoid overlapping default spin counter Y = LegacyCoordinatesContainer.SPINNER_TOP_OFFSET + 335,
}, },
clear = new Sprite clear = new Sprite
{ {
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Depth = float.MinValue,
Alpha = 0, Alpha = 0,
Anchor = Anchor.TopCentre,
Origin = Anchor.Centre,
Texture = source.GetTexture("spinner-clear"), Texture = source.GetTexture("spinner-clear"),
Scale = new Vector2(SPRITE_SCALE), Scale = new Vector2(SPRITE_SCALE),
Y = -60 Y = LegacyCoordinatesContainer.SPINNER_TOP_OFFSET + 115,
}, },
}
}); });
} }