mirror of
https://github.com/osukey/osukey.git
synced 2025-05-09 15:47:38 +09:00
Apply new style spinner scale to only local sprites
This commit is contained in:
parent
11c18952e3
commit
5ec6011340
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
@ -30,44 +31,51 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
|||||||
|
|
||||||
private readonly Color4 glowColour = new Color4(3, 151, 255, 255);
|
private readonly Color4 glowColour = new Color4(3, 151, 255, 255);
|
||||||
|
|
||||||
|
private Container scaleContainer;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(ISkinSource source)
|
private void load(ISkinSource source)
|
||||||
{
|
{
|
||||||
Scale = new Vector2(final_scale);
|
AddInternal(scaleContainer = new Container
|
||||||
|
|
||||||
AddRangeInternal(new Drawable[]
|
|
||||||
{
|
{
|
||||||
glow = new Sprite
|
Scale = new Vector2(final_scale),
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
glow = new Sprite
|
||||||
Origin = Anchor.Centre,
|
{
|
||||||
Texture = source.GetTexture("spinner-glow"),
|
Anchor = Anchor.Centre,
|
||||||
Blending = BlendingParameters.Additive,
|
Origin = Anchor.Centre,
|
||||||
Colour = glowColour,
|
Texture = source.GetTexture("spinner-glow"),
|
||||||
},
|
Blending = BlendingParameters.Additive,
|
||||||
discBottom = new Sprite
|
Colour = glowColour,
|
||||||
{
|
},
|
||||||
Anchor = Anchor.Centre,
|
discBottom = new Sprite
|
||||||
Origin = Anchor.Centre,
|
{
|
||||||
Texture = source.GetTexture("spinner-bottom")
|
Anchor = Anchor.Centre,
|
||||||
},
|
Origin = Anchor.Centre,
|
||||||
discTop = new Sprite
|
Texture = source.GetTexture("spinner-bottom")
|
||||||
{
|
},
|
||||||
Anchor = Anchor.Centre,
|
discTop = new Sprite
|
||||||
Origin = Anchor.Centre,
|
{
|
||||||
Texture = source.GetTexture("spinner-top")
|
Anchor = Anchor.Centre,
|
||||||
},
|
Origin = Anchor.Centre,
|
||||||
fixedMiddle = new Sprite
|
Texture = source.GetTexture("spinner-top")
|
||||||
{
|
},
|
||||||
Anchor = Anchor.Centre,
|
fixedMiddle = new Sprite
|
||||||
Origin = Anchor.Centre,
|
{
|
||||||
Texture = source.GetTexture("spinner-middle")
|
Anchor = Anchor.Centre,
|
||||||
},
|
Origin = Anchor.Centre,
|
||||||
spinningMiddle = new Sprite
|
Texture = source.GetTexture("spinner-middle")
|
||||||
{
|
},
|
||||||
Anchor = Anchor.Centre,
|
spinningMiddle = new Sprite
|
||||||
Origin = Anchor.Centre,
|
{
|
||||||
Texture = source.GetTexture("spinner-middle2")
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Texture = source.GetTexture("spinner-middle2")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -119,7 +127,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
|||||||
|
|
||||||
glow.Alpha = DrawableSpinner.Progress;
|
glow.Alpha = DrawableSpinner.Progress;
|
||||||
|
|
||||||
Scale = new Vector2(final_scale * (0.8f + (float)Interpolation.ApplyEasing(Easing.Out, DrawableSpinner.Progress) * 0.2f));
|
scaleContainer.Scale = new Vector2(final_scale * (0.8f + (float)Interpolation.ApplyEasing(Easing.Out, DrawableSpinner.Progress) * 0.2f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user