1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-20 06:12:55 +08:00

Update framework.

This commit is contained in:
smoogipooo 2017-06-21 11:18:52 +09:00
parent c8720bc5d5
commit fc0e44b214
12 changed files with 17 additions and 15 deletions

@ -1 +1 @@
Subproject commit 231a39bf63544566212b02019f1de2518a60946f
Subproject commit a4bd66e369f7ed5c1c0dc7a0157950dac1f11c5c

View File

@ -245,7 +245,7 @@ namespace osu.Game.Rulesets.Mania.UI
barLineContainer.Width = columns.Width;
}
private class TransformTimeSpan : Transform<double>
private class TransformTimeSpan : Transform<double, Drawable>
{
public override double CurrentValue
{

View File

@ -3,6 +3,7 @@
using OpenTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Transforms;
using osu.Game.Graphics.Transforms;
namespace osu.Game.Graphics
@ -26,7 +27,8 @@ namespace osu.Game.Graphics
/// <param name="newColour">The new accent colour.</param>
/// <param name="duration">The tween duration.</param>
/// <param name="easing">The tween easing.</param>
public static void FadeAccent(this IHasAccentColour accentedDrawable, Color4 newColour, double duration = 0, EasingTypes easing = EasingTypes.None)
public static void FadeAccent<T>(this T accentedDrawable, Color4 newColour, double duration = 0, EasingTypes easing = EasingTypes.None)
where T : Transformable<Drawable>, IHasAccentColour
{
accentedDrawable.TransformTo(() => accentedDrawable.AccentColour, newColour, duration, easing, new TransformAccent());
}

View File

@ -8,7 +8,7 @@ using osu.Framework.MathUtils;
namespace osu.Game.Graphics.Transforms
{
public class TransformAccent : Transform<Color4>
public class TransformAccent : Transform<Color4, Drawable>
{
/// <summary>
/// Current value of the transformed colour in linear colour space.

View File

@ -45,7 +45,7 @@ namespace osu.Game.Graphics.UserInterface
Current.Value = Current + amount;
}
protected class TransformAccuracy : Transform<double>
protected class TransformAccuracy : Transform<double, Drawable>
{
public override double CurrentValue
{

View File

@ -27,7 +27,7 @@ namespace osu.Game.Graphics.UserInterface
/// <remarks>
/// Must be a subclass of Transform(T)
/// </remarks>
protected virtual Type TransformType => typeof(Transform<T>);
protected virtual Type TransformType => typeof(Transform<T, Drawable>);
protected SpriteText DisplayedCountSpriteText;
@ -181,17 +181,17 @@ namespace osu.Game.Graphics.UserInterface
protected virtual void TransformCount(T currentValue, T newValue)
{
Debug.Assert(
typeof(Transform<T>).IsAssignableFrom(TransformType),
typeof(Transform<T, Drawable>).IsAssignableFrom(TransformType),
@"transformType should be a subclass of Transform<T>."
);
TransformCount((Transform<T>)Activator.CreateInstance(TransformType), currentValue, newValue);
TransformCount((Transform<T, Drawable>)Activator.CreateInstance(TransformType), currentValue, newValue);
}
/// <summary>
/// Intended to be used by TransformCount(T currentValue, T newValue).
/// </summary>
protected void TransformCount(Transform<T> transform, T currentValue, T newValue)
protected void TransformCount(Transform<T, Drawable> transform, T currentValue, T newValue)
{
Type type = transform.GetType();

View File

@ -56,7 +56,7 @@ namespace osu.Game.Graphics.UserInterface
Current.Value = Current + amount;
}
protected class TransformScore : Transform<double>
protected class TransformScore : Transform<double, Drawable>
{
public override double CurrentValue
{

View File

@ -37,7 +37,7 @@ namespace osu.Game.Graphics.UserInterface
Current.Value = Current + amount;
}
private class TransformCounterCount : Transform<int>
private class TransformCounterCount : Transform<int, Drawable>
{
public override int CurrentValue
{

View File

@ -98,7 +98,7 @@ namespace osu.Game.Overlays
return true;
}
private class TransformSeek : TransformFloat
private class TransformSeek : TransformFloat<Drawable>
{
public override void Apply(Drawable d)
{

View File

@ -205,7 +205,7 @@ namespace osu.Game.Screens.Play.HUD
Transforms.Add(transform);
}
protected class TransformComboRoll : Transform<int>
protected class TransformComboRoll : Transform<int, Drawable>
{
public override int CurrentValue
{

View File

@ -34,7 +34,7 @@ namespace osu.Game.Screens.Play.HUD
Current.Value = Current + amount;
}
protected class TransformComboResult : Transform<ulong>
protected class TransformComboResult : Transform<ulong, Drawable>
{
public override ulong CurrentValue
{

View File

@ -308,7 +308,7 @@ namespace osu.Game.Screens.Tournament
Scrolling
}
public class TransformScrollSpeed : TransformFloat
public class TransformScrollSpeed : TransformFloat<Drawable>
{
public override void Apply(Drawable d)
{