More changes in-line with framework changes.

This commit is contained in:
Dean Herbert
2017-07-10 07:01:25 +09:00
parent f856e89b58
commit 0e2dc9388a
15 changed files with 68 additions and 98 deletions

View File

@ -30,7 +30,7 @@ namespace osu.Game.Graphics
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());
accentedDrawable.TransformTo(newColour, duration, easing, new TransformAccent());
}
}
}

View File

@ -13,7 +13,7 @@ namespace osu.Game.Graphics.Transforms
/// <summary>
/// Current value of the transformed colour in linear colour space.
/// </summary>
public override Color4 CurrentValue
public virtual Color4 CurrentValue
{
get
{
@ -25,13 +25,7 @@ namespace osu.Game.Graphics.Transforms
}
}
public override void Apply(Drawable d)
{
base.Apply(d);
var accented = d as IHasAccentColour;
if (accented != null)
accented.AccentColour = CurrentValue;
}
public override void Apply(Drawable d) => ((IHasAccentColour)d).AccentColour = CurrentValue;
public override void ReadIntoStartValue(Drawable d) => StartValue = ((IHasAccentColour)d).AccentColour;
}
}

View File

@ -47,7 +47,7 @@ namespace osu.Game.Graphics.UserInterface
protected class TransformAccuracy : Transform<double, Drawable>
{
public override double CurrentValue
public virtual double CurrentValue
{
get
{
@ -59,11 +59,8 @@ namespace osu.Game.Graphics.UserInterface
}
}
public override void Apply(Drawable d)
{
base.Apply(d);
((PercentageCounter)d).DisplayedCount = CurrentValue;
}
public override void Apply(Drawable d) => ((PercentageCounter)d).DisplayedCount = CurrentValue;
public override void ReadIntoStartValue(Drawable d) => StartValue = ((PercentageCounter)d).DisplayedCount;
}
}
}

View File

@ -210,7 +210,6 @@ namespace osu.Game.Graphics.UserInterface
transform.StartTime = TransformStartTime;
transform.EndTime = TransformStartTime + rollingTotalDuration;
transform.StartValue = currentValue;
transform.EndValue = newValue;
transform.Easing = RollingEasing;

View File

@ -58,7 +58,7 @@ namespace osu.Game.Graphics.UserInterface
protected class TransformScore : Transform<double, Drawable>
{
public override double CurrentValue
public virtual double CurrentValue
{
get
{
@ -70,11 +70,8 @@ namespace osu.Game.Graphics.UserInterface
}
}
public override void Apply(Drawable d)
{
base.Apply(d);
((ScoreCounter)d).DisplayedCount = CurrentValue;
}
public override void Apply(Drawable d) => ((ScoreCounter)d).DisplayedCount = CurrentValue;
public override void ReadIntoStartValue(Drawable d) => StartValue = ((ScoreCounter)d).DisplayedCount;
}
}
}

View File

@ -39,7 +39,7 @@ namespace osu.Game.Graphics.UserInterface
private class TransformCounterCount : Transform<int, Drawable>
{
public override int CurrentValue
public virtual int CurrentValue
{
get
{
@ -51,11 +51,8 @@ namespace osu.Game.Graphics.UserInterface
}
}
public override void Apply(Drawable d)
{
base.Apply(d);
((SimpleComboCounter)d).DisplayedCount = CurrentValue;
}
public override void Apply(Drawable d) => ((SimpleComboCounter)d).DisplayedCount = CurrentValue;
public override void ReadIntoStartValue(Drawable d) => StartValue = ((SimpleComboCounter)d).DisplayedCount;
}
}
}