mirror of
https://github.com/ppy/osu.git
synced 2025-03-04 00:02:54 +08:00
More line wrapping
This commit is contained in:
parent
841707b61f
commit
01da3ca474
@ -42,8 +42,8 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
public bool IsRollingProportional = false;
|
public bool IsRollingProportional = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// If IsRollingProportional = false, duration in milliseconds for the counter roll-up animation for each element.
|
/// If IsRollingProportional = false, duration in milliseconds for the counter roll-up animation for each
|
||||||
/// If IsRollingProportional = true, duration in milliseconds for the counter roll-up animation in total.
|
/// element; else duration in milliseconds for the counter roll-up animation in total.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ulong RollingDuration = 0;
|
public ulong RollingDuration = 0;
|
||||||
|
|
||||||
@ -103,7 +103,10 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
protected RollingCounter()
|
protected RollingCounter()
|
||||||
{
|
{
|
||||||
Debug.Assert(transformType.IsSubclassOf(typeof(Transform<T>)) || transformType == typeof(Transform<T>), @"transformType should be a subclass of Transform<T>.");
|
Debug.Assert(
|
||||||
|
transformType.IsSubclassOf(typeof(Transform<T>)) || transformType == typeof(Transform<T>),
|
||||||
|
@"transformType should be a subclass of Transform<T>."
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load()
|
||||||
|
@ -97,7 +97,9 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
if (t.GetType() == typeof(TransformAlpha) || t.GetType() == typeof(TransformScaleVector))
|
if (t.GetType() == typeof(TransformAlpha) || t.GetType() == typeof(TransformScaleVector))
|
||||||
t.Apply(stars[i]);
|
t.Apply(stars[i]);
|
||||||
|
|
||||||
stars[i].Transforms.RemoveAll(t => t.GetType() == typeof(TransformScaleVector) || t.GetType() == typeof(TransformAlpha));
|
stars[i].Transforms.RemoveAll(t =>
|
||||||
|
t.GetType() == typeof(TransformScaleVector) || t.GetType() == typeof(TransformAlpha)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void transformStarScale(int i, TransformScaleVector transform, bool isIncrement, double startTime)
|
protected void transformStarScale(int i, TransformScaleVector transform, bool isIncrement, double startTime)
|
||||||
@ -105,7 +107,15 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
transform.StartTime = startTime;
|
transform.StartTime = startTime;
|
||||||
transform.EndTime = transform.StartTime + StarAnimationDuration;
|
transform.EndTime = transform.StartTime + StarAnimationDuration;
|
||||||
transform.StartValue = stars[i].Scale;
|
transform.StartValue = stars[i].Scale;
|
||||||
transform.EndValue = new Vector2(Interpolation.ValueAt((isIncrement ? Math.Min(i + 1, Count) : Math.Max(i, Count)), MinStarSize, 1.0f, i, i + 1));
|
transform.EndValue = new Vector2(
|
||||||
|
Interpolation.ValueAt(
|
||||||
|
(isIncrement ? Math.Min(i + 1, Count) : Math.Max(i, Count)),
|
||||||
|
MinStarSize,
|
||||||
|
1.0f,
|
||||||
|
i,
|
||||||
|
i + 1
|
||||||
|
)
|
||||||
|
);
|
||||||
transform.Easing = EasingTypes.OutElasticHalf;
|
transform.Easing = EasingTypes.OutElasticHalf;
|
||||||
|
|
||||||
stars[i].Transforms.Add(transform);
|
stars[i].Transforms.Add(transform);
|
||||||
@ -136,10 +146,12 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
double startTime = Time;
|
double startTime = Time;
|
||||||
// If incrementing, animation should had started when VisibleCount crossed start of star (i)
|
// If incrementing, animation should had started when VisibleCount crossed start of star (i)
|
||||||
if (isIncrement)
|
if (isIncrement)
|
||||||
startTime -= i == (int)Math.Floor(prevCount) ? getProportionalDuration(prevCount, VisibleCount) : getProportionalDuration(i, VisibleCount);
|
startTime -= i == (int)Math.Floor(prevCount) ?
|
||||||
|
getProportionalDuration(prevCount, VisibleCount) : getProportionalDuration(i, VisibleCount);
|
||||||
// If decrementing, animation should had started when VisibleCount crossed end of star (i + 1)
|
// If decrementing, animation should had started when VisibleCount crossed end of star (i + 1)
|
||||||
else
|
else
|
||||||
startTime -= i == (int)Math.Floor(prevCount) ? getProportionalDuration(prevCount, VisibleCount) : getProportionalDuration(i + 1, VisibleCount);
|
startTime -= i == (int)Math.Floor(prevCount) ?
|
||||||
|
getProportionalDuration(prevCount, VisibleCount) : getProportionalDuration(i + 1, VisibleCount);
|
||||||
|
|
||||||
updateTransformStar(i);
|
updateTransformStar(i);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user