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,39 +33,31 @@ 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. new Sprite
// 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 Anchor = Anchor.Centre,
{ Origin = Anchor.Centre,
Anchor = Anchor.Centre, Texture = source.GetTexture("spinner-background"),
Origin = Anchor.Centre, Scale = new Vector2(SPRITE_SCALE)
Texture = source.GetTexture("spinner-background"), },
Scale = new Vector2(SPRITE_SCALE) disc = new Sprite
}, {
disc = new Sprite Anchor = Anchor.Centre,
{ Origin = Anchor.Centre,
Anchor = Anchor.Centre, Texture = source.GetTexture("spinner-circle"),
Origin = Anchor.Centre, Scale = new Vector2(SPRITE_SCALE)
Texture = source.GetTexture("spinner-circle"), },
Scale = new Vector2(SPRITE_SCALE) new LegacyCoordinatesContainer
}, {
metre = new Container 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
{ {
spin = new Sprite Depth = float.MinValue,
Children = new Drawable[]
{ {
Anchor = Anchor.Centre, spin = new Sprite
Origin = Anchor.Centre, {
Depth = float.MinValue, Anchor = Anchor.TopCentre,
Texture = source.GetTexture("spinner-spin"), Origin = Anchor.Centre,
Scale = new Vector2(SPRITE_SCALE), Texture = source.GetTexture("spinner-spin"),
Y = 120 - 45 // offset temporarily to avoid overlapping default spin counter Scale = new Vector2(SPRITE_SCALE),
}, Y = LegacyCoordinatesContainer.SPINNER_TOP_OFFSET + 335,
clear = new Sprite },
{ clear = new Sprite
Anchor = Anchor.Centre, {
Origin = Anchor.Centre, Alpha = 0,
Depth = float.MinValue, Anchor = Anchor.TopCentre,
Alpha = 0, 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,
}, },
}
}); });
} }