Add initial support for spinner disc skinning
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 162 KiB |
BIN
osu.Game.Rulesets.Osu.Tests/Resources/old-skin/spinner-clear.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
osu.Game.Rulesets.Osu.Tests/Resources/old-skin/spinner-metre.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
osu.Game.Rulesets.Osu.Tests/Resources/old-skin/spinner-osu.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
osu.Game.Rulesets.Osu.Tests/Resources/old-skin/spinner-spin.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
osu.Game.Rulesets.Osu.Tests/Resources/old-skin/spinnerbonus.wav
Normal file
BIN
osu.Game.Rulesets.Osu.Tests/Resources/old-skin/spinnerspin.wav
Normal file
@ -175,8 +175,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
|
||||
Background.AccentColour = normalColour;
|
||||
Ticks.AccentColour = normalColour;
|
||||
|
||||
Disc.AccentColour = fillColour;
|
||||
|
||||
circle.Colour = colours.BlueDark;
|
||||
glow.Colour = colours.BlueDark;
|
||||
|
||||
|
@ -9,6 +9,7 @@ using osu.Game.Graphics;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Skinning;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
{
|
||||
@ -16,13 +17,20 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
{
|
||||
private readonly Spinner spinner;
|
||||
|
||||
private Color4 accentColour;
|
||||
|
||||
public Color4 AccentColour
|
||||
{
|
||||
get => background.AccentColour;
|
||||
set => background.AccentColour = value;
|
||||
get => accentColour;
|
||||
set
|
||||
{
|
||||
accentColour = value;
|
||||
if (background.Drawable is IHasAccentColour accent)
|
||||
accent.AccentColour = value;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly SpinnerBackground background;
|
||||
private readonly SkinnableDrawable background;
|
||||
|
||||
private const float idle_alpha = 0.2f;
|
||||
private const float tracking_alpha = 0.4f;
|
||||
@ -37,7 +45,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
background = new SpinnerBackground { Alpha = idle_alpha },
|
||||
background = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SpinnerDisc), _ => new SpinnerBackground { Alpha = idle_alpha }),
|
||||
};
|
||||
}
|
||||
|
||||
@ -54,7 +62,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
|
||||
tracking = value;
|
||||
|
||||
background.FadeTo(tracking ? tracking_alpha : idle_alpha, 100);
|
||||
// todo: new default only
|
||||
background.Drawable.FadeTo(tracking ? tracking_alpha : idle_alpha, 100);
|
||||
}
|
||||
}
|
||||
|
||||
@ -121,11 +130,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
|
||||
if (Complete && updateCompleteTick())
|
||||
{
|
||||
background.FinishTransforms(false, nameof(Alpha));
|
||||
background
|
||||
.FadeTo(tracking_alpha + 0.2f, 60, Easing.OutExpo)
|
||||
.Then()
|
||||
.FadeTo(tracking_alpha, 250, Easing.OutQuint);
|
||||
// todo: new default only
|
||||
background.Drawable.FinishTransforms(false, nameof(Alpha));
|
||||
background.Drawable
|
||||
.FadeTo(tracking_alpha + 0.2f, 60, Easing.OutExpo)
|
||||
.Then()
|
||||
.FadeTo(tracking_alpha, 250, Easing.OutQuint);
|
||||
}
|
||||
|
||||
Rotation = (float)Interpolation.Lerp(Rotation, currentRotation / 2, Math.Clamp(Math.Abs(Time.Elapsed) / 40, 0, 1));
|
||||
|
@ -17,5 +17,6 @@ namespace osu.Game.Rulesets.Osu
|
||||
SliderFollowCircle,
|
||||
SliderBall,
|
||||
SliderBody,
|
||||
SpinnerDisc
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
using System;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Skinning;
|
||||
using osuTK;
|
||||
|
||||
@ -102,6 +103,14 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
||||
Scale = new Vector2(0.8f),
|
||||
Spacing = new Vector2(-overlap, 0)
|
||||
};
|
||||
|
||||
case OsuSkinComponents.SpinnerDisc:
|
||||
if (Source.GetTexture("spinner-background") != null)
|
||||
return new Sprite { Texture = Source.GetTexture("spinner-circle") };
|
||||
else if (Source.GetTexture("spinner-top") != null)
|
||||
return new Sprite { Texture = Source.GetTexture("spinner-top") };
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
|