mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 23:12:56 +08:00
IAccented -> IHasAccentColour.
This commit is contained in:
parent
591ecc0ef4
commit
43c306d658
@ -19,7 +19,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces
|
|||||||
/// a rounded (_[-Width-]_) figure such that a regular "circle" is the result of a parent with Width = 0.
|
/// a rounded (_[-Width-]_) figure such that a regular "circle" is the result of a parent with Width = 0.
|
||||||
/// </para>
|
/// </para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CirclePiece : Container, IAccented
|
public class CirclePiece : Container, IHasAccentColour
|
||||||
{
|
{
|
||||||
public const float SYMBOL_SIZE = TaikoHitObject.CIRCLE_RADIUS * 2f * 0.45f;
|
public const float SYMBOL_SIZE = TaikoHitObject.CIRCLE_RADIUS * 2f * 0.45f;
|
||||||
public const float SYMBOL_BORDER = 8;
|
public const float SYMBOL_BORDER = 8;
|
||||||
|
@ -12,12 +12,12 @@ namespace osu.Game.Graphics
|
|||||||
/// The accent colour is used to colorize various objects inside a drawable
|
/// The accent colour is used to colorize various objects inside a drawable
|
||||||
/// without colorizing the drawable itself.
|
/// without colorizing the drawable itself.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IAccented : IDrawable
|
public interface IHasAccentColour : IDrawable
|
||||||
{
|
{
|
||||||
Color4 AccentColour { get; set; }
|
Color4 AccentColour { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class AccentedExtensions
|
public static class AccentedColourExtensions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tweens the accent colour of a drawable to another colour.
|
/// Tweens the accent colour of a drawable to another colour.
|
||||||
@ -28,7 +28,7 @@ namespace osu.Game.Graphics
|
|||||||
/// <param name="duration">The tween duration.</param>
|
/// <param name="duration">The tween duration.</param>
|
||||||
/// <param name="easing">The tween easing.</param>
|
/// <param name="easing">The tween easing.</param>
|
||||||
public static void FadeAccent<TDrawable>(this TDrawable drawable, Color4 newColour, double duration = 0, EasingTypes easing = EasingTypes.None)
|
public static void FadeAccent<TDrawable>(this TDrawable drawable, Color4 newColour, double duration = 0, EasingTypes easing = EasingTypes.None)
|
||||||
where TDrawable : Drawable, IAccented
|
where TDrawable : Drawable, IHasAccentColour
|
||||||
{
|
{
|
||||||
drawable.TransformTo(drawable.AccentColour, newColour, duration, easing, new TransformAccent());
|
drawable.TransformTo(drawable.AccentColour, newColour, duration, easing, new TransformAccent());
|
||||||
}
|
}
|
@ -29,7 +29,7 @@ namespace osu.Game.Graphics.Transforms
|
|||||||
{
|
{
|
||||||
base.Apply(d);
|
base.Apply(d);
|
||||||
|
|
||||||
var accented = d as IAccented;
|
var accented = d as IHasAccentColour;
|
||||||
if (accented != null)
|
if (accented != null)
|
||||||
accented.AccentColour = CurrentValue;
|
accented.AccentColour = CurrentValue;
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@
|
|||||||
<Compile Include="Graphics\Backgrounds\Triangles.cs" />
|
<Compile Include="Graphics\Backgrounds\Triangles.cs" />
|
||||||
<Compile Include="Graphics\Cursor\CursorTrail.cs" />
|
<Compile Include="Graphics\Cursor\CursorTrail.cs" />
|
||||||
<Compile Include="Graphics\Cursor\GameplayCursor.cs" />
|
<Compile Include="Graphics\Cursor\GameplayCursor.cs" />
|
||||||
<Compile Include="Graphics\IAccented.cs" />
|
<Compile Include="Graphics\IHasAccentColour.cs" />
|
||||||
<Compile Include="Graphics\Sprites\OsuSpriteText.cs" />
|
<Compile Include="Graphics\Sprites\OsuSpriteText.cs" />
|
||||||
<Compile Include="Graphics\Transforms\TransformAccent.cs" />
|
<Compile Include="Graphics\Transforms\TransformAccent.cs" />
|
||||||
<Compile Include="Graphics\UserInterface\BackButton.cs" />
|
<Compile Include="Graphics\UserInterface\BackButton.cs" />
|
||||||
|
Loading…
Reference in New Issue
Block a user