mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 17:07:38 +08:00
Update transforms to not accept clock.
This commit is contained in:
parent
0e39c5cc9c
commit
13b5fb0578
@ -34,8 +34,8 @@ namespace osu.Game.Beatmaps.Objects.Catch.Drawable
|
|||||||
|
|
||||||
Texture = game.Textures.Get(@"Menu/logo");
|
Texture = game.Textures.Get(@"Menu/logo");
|
||||||
|
|
||||||
Transforms.Add(new TransformPosition(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = new Vector2(h.Position, -0.1f), EndValue = new Vector2(h.Position, 0.9f) });
|
Transforms.Add(new TransformPosition { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = new Vector2(h.Position, -0.1f), EndValue = new Vector2(h.Position, 0.9f) });
|
||||||
Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 });
|
Transforms.Add(new TransformAlpha { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 });
|
||||||
Expire(true);
|
Expire(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,8 +25,8 @@ namespace osu.Game.Beatmaps.Objects.Mania.Drawable
|
|||||||
base.Load(game);
|
base.Load(game);
|
||||||
Texture = game.Textures.Get(@"Menu/logo");
|
Texture = game.Textures.Get(@"Menu/logo");
|
||||||
|
|
||||||
Transforms.Add(new TransformPositionY(Clock) { StartTime = note.StartTime - 200, EndTime = note.StartTime, StartValue = -0.1f, EndValue = 0.9f });
|
Transforms.Add(new TransformPositionY() { StartTime = note.StartTime - 200, EndTime = note.StartTime, StartValue = -0.1f, EndValue = 0.9f });
|
||||||
Transforms.Add(new TransformAlpha(Clock) { StartTime = note.StartTime + note.Duration + 200, EndTime = note.StartTime + note.Duration + 400, StartValue = 1, EndValue = 0 });
|
Transforms.Add(new TransformAlpha() { StartTime = note.StartTime + note.Duration + 200, EndTime = note.StartTime + note.Duration + 400, StartValue = 1, EndValue = 0 });
|
||||||
Expire(true);
|
Expire(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,36 +77,36 @@ namespace osu.Game.Beatmaps.Objects.Osu.Drawable
|
|||||||
|
|
||||||
Flush(); //move to DrawableHitObject
|
Flush(); //move to DrawableHitObject
|
||||||
|
|
||||||
Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime - 1000, EndTime = h.StartTime - 800, StartValue = 0, EndValue = 1 });
|
Transforms.Add(new TransformAlpha { StartTime = h.StartTime - 1000, EndTime = h.StartTime - 800, StartValue = 0, EndValue = 1 });
|
||||||
|
|
||||||
approachCircle.Transforms.Add(new TransformScale(Clock) { StartTime = h.StartTime - 1000, EndTime = h.StartTime, StartValue = new Vector2(2f), EndValue = new Vector2(0.6f) });
|
approachCircle.Transforms.Add(new TransformScale { StartTime = h.StartTime - 1000, EndTime = h.StartTime, StartValue = new Vector2(2f), EndValue = new Vector2(0.6f) });
|
||||||
approachCircle.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime, EndTime = h.StartTime, StartValue = 1, EndValue = 0 });
|
approachCircle.Transforms.Add(new TransformAlpha { StartTime = h.StartTime, EndTime = h.StartTime, StartValue = 1, EndValue = 0 });
|
||||||
|
|
||||||
glow.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime, EndTime = h.StartTime + 400, StartValue = glow.Alpha, EndValue = 0 });
|
glow.Transforms.Add(new TransformAlpha { StartTime = h.StartTime, EndTime = h.StartTime + 400, StartValue = glow.Alpha, EndValue = 0 });
|
||||||
|
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case ArmedState.Disarmed:
|
case ArmedState.Disarmed:
|
||||||
Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 });
|
Transforms.Add(new TransformAlpha { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 });
|
||||||
break;
|
break;
|
||||||
case ArmedState.Armed:
|
case ArmedState.Armed:
|
||||||
const float flashIn = 30;
|
const float flashIn = 30;
|
||||||
const float fadeOut = 800;
|
const float fadeOut = 800;
|
||||||
|
|
||||||
//Transforms.Add(new TransformScale(Clock) { StartTime = h.StartTime, EndTime = h.StartTime + 400, StartValue = Scale, EndValue = Scale * 1.1f });
|
//Transforms.Add(new TransformScale() { StartTime = h.StartTime, EndTime = h.StartTime + 400, StartValue = Scale, EndValue = Scale * 1.1f });
|
||||||
|
|
||||||
ring.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + flashIn, EndTime = h.StartTime + flashIn, StartValue = 0, EndValue = 0 });
|
ring.Transforms.Add(new TransformAlpha { StartTime = h.StartTime + flashIn, EndTime = h.StartTime + flashIn, StartValue = 0, EndValue = 0 });
|
||||||
circle.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + flashIn, EndTime = h.StartTime + flashIn, StartValue = 0, EndValue = 0 });
|
circle.Transforms.Add(new TransformAlpha { StartTime = h.StartTime + flashIn, EndTime = h.StartTime + flashIn, StartValue = 0, EndValue = 0 });
|
||||||
number.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + flashIn, EndTime = h.StartTime + flashIn, StartValue = 0, EndValue = 0 });
|
number.Transforms.Add(new TransformAlpha { StartTime = h.StartTime + flashIn, EndTime = h.StartTime + flashIn, StartValue = 0, EndValue = 0 });
|
||||||
|
|
||||||
flash.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime, EndTime = h.StartTime + flashIn, StartValue = 0, EndValue = 0.8f });
|
flash.Transforms.Add(new TransformAlpha { StartTime = h.StartTime, EndTime = h.StartTime + flashIn, StartValue = 0, EndValue = 0.8f });
|
||||||
flash.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + flashIn, EndTime = h.StartTime + flashIn + 100, StartValue = 0.8f, EndValue = 0 });
|
flash.Transforms.Add(new TransformAlpha { StartTime = h.StartTime + flashIn, EndTime = h.StartTime + flashIn + 100, StartValue = 0.8f, EndValue = 0 });
|
||||||
|
|
||||||
explode.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime, EndTime = h.StartTime + flashIn, StartValue = 0, EndValue = 1 });
|
explode.Transforms.Add(new TransformAlpha { StartTime = h.StartTime, EndTime = h.StartTime + flashIn, StartValue = 0, EndValue = 1 });
|
||||||
|
|
||||||
Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + flashIn, EndTime = h.StartTime + flashIn + fadeOut, StartValue = 1, EndValue = 0 });
|
Transforms.Add(new TransformAlpha { StartTime = h.StartTime + flashIn, EndTime = h.StartTime + flashIn + fadeOut, StartValue = 1, EndValue = 0 });
|
||||||
|
|
||||||
Transforms.Add(new TransformScale(Clock) { StartTime = h.StartTime + h.Duration, EndTime = h.StartTime + h.Duration + 400, StartValue = Scale, EndValue = Scale * 1.5f, Easing = EasingTypes.OutQuad });
|
Transforms.Add(new TransformScale { StartTime = h.StartTime + h.Duration, EndTime = h.StartTime + h.Duration + 400, StartValue = Scale, EndValue = Scale * 1.5f, Easing = EasingTypes.OutQuad });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,8 +29,8 @@ namespace osu.Game.Beatmaps.Objects.Taiko.Drawable
|
|||||||
|
|
||||||
Texture = game.Textures.Get(@"Menu/logo");
|
Texture = game.Textures.Get(@"Menu/logo");
|
||||||
|
|
||||||
Transforms.Add(new TransformPositionX(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = 1.1f, EndValue = 0.1f });
|
Transforms.Add(new TransformPositionX { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = 1.1f, EndValue = 0.1f });
|
||||||
Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 });
|
Transforms.Add(new TransformAlpha { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 });
|
||||||
Expire(true);
|
Expire(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ namespace osu.Game.GameModes.Menu
|
|||||||
icon.RotateTo(10, offset, EasingTypes.InOutSine);
|
icon.RotateTo(10, offset, EasingTypes.InOutSine);
|
||||||
icon.ScaleTo(new Vector2(1, 0.9f), offset, EasingTypes.Out);
|
icon.ScaleTo(new Vector2(1, 0.9f), offset, EasingTypes.Out);
|
||||||
|
|
||||||
icon.Transforms.Add(new TransformRotation(Clock)
|
icon.Transforms.Add(new TransformRotation
|
||||||
{
|
{
|
||||||
StartValue = -10,
|
StartValue = -10,
|
||||||
EndValue = 10,
|
EndValue = 10,
|
||||||
@ -128,7 +128,7 @@ namespace osu.Game.GameModes.Menu
|
|||||||
LoopDelay = duration * 2
|
LoopDelay = duration * 2
|
||||||
});
|
});
|
||||||
|
|
||||||
icon.Transforms.Add(new TransformPosition(Clock)
|
icon.Transforms.Add(new TransformPosition()
|
||||||
{
|
{
|
||||||
StartValue = Vector2.Zero,
|
StartValue = Vector2.Zero,
|
||||||
EndValue = new Vector2(0, -10),
|
EndValue = new Vector2(0, -10),
|
||||||
@ -139,7 +139,7 @@ namespace osu.Game.GameModes.Menu
|
|||||||
LoopDelay = duration
|
LoopDelay = duration
|
||||||
});
|
});
|
||||||
|
|
||||||
icon.Transforms.Add(new TransformScale(Clock)
|
icon.Transforms.Add(new TransformScale()
|
||||||
{
|
{
|
||||||
StartValue = new Vector2(1, 0.9f),
|
StartValue = new Vector2(1, 0.9f),
|
||||||
EndValue = Vector2.One,
|
EndValue = Vector2.One,
|
||||||
@ -150,7 +150,7 @@ namespace osu.Game.GameModes.Menu
|
|||||||
LoopDelay = duration
|
LoopDelay = duration
|
||||||
});
|
});
|
||||||
|
|
||||||
icon.Transforms.Add(new TransformPosition(Clock)
|
icon.Transforms.Add(new TransformPosition()
|
||||||
{
|
{
|
||||||
StartValue = new Vector2(0, -10),
|
StartValue = new Vector2(0, -10),
|
||||||
EndValue = Vector2.Zero,
|
EndValue = Vector2.Zero,
|
||||||
@ -161,7 +161,7 @@ namespace osu.Game.GameModes.Menu
|
|||||||
LoopDelay = duration
|
LoopDelay = duration
|
||||||
});
|
});
|
||||||
|
|
||||||
icon.Transforms.Add(new TransformScale(Clock)
|
icon.Transforms.Add(new TransformScale()
|
||||||
{
|
{
|
||||||
StartValue = Vector2.One,
|
StartValue = Vector2.One,
|
||||||
EndValue = new Vector2(1, 0.9f),
|
EndValue = new Vector2(1, 0.9f),
|
||||||
@ -172,7 +172,7 @@ namespace osu.Game.GameModes.Menu
|
|||||||
LoopDelay = duration
|
LoopDelay = duration
|
||||||
});
|
});
|
||||||
|
|
||||||
icon.Transforms.Add(new TransformRotation(Clock)
|
icon.Transforms.Add(new TransformRotation
|
||||||
{
|
{
|
||||||
StartValue = 10,
|
StartValue = 10,
|
||||||
EndValue = -10,
|
EndValue = -10,
|
||||||
|
@ -174,7 +174,7 @@ namespace osu.Game.GameModes.Play
|
|||||||
|
|
||||||
protected virtual void OnCountRolling(ulong currentValue, ulong newValue)
|
protected virtual void OnCountRolling(ulong currentValue, ulong newValue)
|
||||||
{
|
{
|
||||||
transformRoll(new TransformComboRoll(Clock), currentValue, newValue);
|
transformRoll(new TransformComboRoll(), currentValue, newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnCountIncrement(ulong currentValue, ulong newValue) {
|
protected virtual void OnCountIncrement(ulong currentValue, ulong newValue) {
|
||||||
@ -248,11 +248,11 @@ namespace osu.Game.GameModes.Play
|
|||||||
|
|
||||||
protected class TransformComboRoll : Transform<ulong>
|
protected class TransformComboRoll : Transform<ulong>
|
||||||
{
|
{
|
||||||
public override ulong CurrentValue
|
protected override ulong CurrentValue
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
double time = Time;
|
double time = CurrentTime ?? 0;
|
||||||
if (time < StartTime) return StartValue;
|
if (time < StartTime) return StartValue;
|
||||||
if (time >= EndTime) return EndValue;
|
if (time >= EndTime) return EndValue;
|
||||||
|
|
||||||
@ -265,11 +265,6 @@ namespace osu.Game.GameModes.Play
|
|||||||
base.Apply(d);
|
base.Apply(d);
|
||||||
(d as ComboCounter).DisplayedCount = CurrentValue;
|
(d as ComboCounter).DisplayedCount = CurrentValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TransformComboRoll(IClock clock)
|
|
||||||
: base(clock)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,11 +41,11 @@ namespace osu.Game.GameModes.Play
|
|||||||
|
|
||||||
protected class TransformComboResult : Transform<ulong>
|
protected class TransformComboResult : Transform<ulong>
|
||||||
{
|
{
|
||||||
public override ulong CurrentValue
|
protected override ulong CurrentValue
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
double time = Time;
|
double time = CurrentTime ?? 0;
|
||||||
if (time < StartTime) return StartValue;
|
if (time < StartTime) return StartValue;
|
||||||
if (time >= EndTime) return EndValue;
|
if (time >= EndTime) return EndValue;
|
||||||
|
|
||||||
@ -58,11 +58,6 @@ namespace osu.Game.GameModes.Play
|
|||||||
base.Apply(d);
|
base.Apply(d);
|
||||||
(d as ComboResultCounter).DisplayedCount = CurrentValue;
|
(d as ComboResultCounter).DisplayedCount = CurrentValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TransformComboResult(IClock clock)
|
|
||||||
: base(clock)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,11 +57,6 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
base.Apply(d);
|
base.Apply(d);
|
||||||
(d as PercentageCounter).DisplayedCount = CurrentValue;
|
(d as PercentageCounter).DisplayedCount = CurrentValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TransformAccuracy(IClock clock)
|
|
||||||
: base(clock)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -194,14 +194,12 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
/// <seealso cref="TransformType"/>
|
/// <seealso cref="TransformType"/>
|
||||||
protected virtual void TransformCount(T currentValue, T newValue)
|
protected virtual void TransformCount(T currentValue, T newValue)
|
||||||
{
|
{
|
||||||
object[] parameters = { Clock };
|
|
||||||
|
|
||||||
Debug.Assert(
|
Debug.Assert(
|
||||||
TransformType.IsSubclassOf(typeof(Transform<T>)) || TransformType == typeof(Transform<T>),
|
TransformType.IsSubclassOf(typeof(Transform<T>)) || TransformType == typeof(Transform<T>),
|
||||||
@"transformType should be a subclass of Transform<T>."
|
@"transformType should be a subclass of Transform<T>."
|
||||||
);
|
);
|
||||||
|
|
||||||
TransformCount((Transform<T>)Activator.CreateInstance(TransformType, parameters), currentValue, newValue);
|
TransformCount((Transform<T>)Activator.CreateInstance(TransformType), currentValue, newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -56,11 +56,11 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
protected class TransformScore : Transform<ulong>
|
protected class TransformScore : Transform<ulong>
|
||||||
{
|
{
|
||||||
public override ulong CurrentValue
|
protected override ulong CurrentValue
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
double time = Time;
|
double time = CurrentTime ?? 0;
|
||||||
if (time < StartTime) return StartValue;
|
if (time < StartTime) return StartValue;
|
||||||
if (time >= EndTime) return EndValue;
|
if (time >= EndTime) return EndValue;
|
||||||
|
|
||||||
@ -73,11 +73,6 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
base.Apply(d);
|
base.Apply(d);
|
||||||
(d as ScoreCounter).DisplayedCount = CurrentValue;
|
(d as ScoreCounter).DisplayedCount = CurrentValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TransformScore(IClock clock)
|
|
||||||
: base(clock)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user