Merge branch 'master' into reduce-skin-lookup-overhead

This commit is contained in:
Bartłomiej Dach 2021-08-17 23:08:52 +02:00
commit e3b00c6c7a
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497

View File

@ -166,14 +166,9 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
} }
if (IsSelected) if (IsSelected)
{
border.Show(); border.Show();
colour = colour.Lighten(0.3f);
}
else else
{
border.Hide(); border.Hide();
}
if (Item is IHasDuration duration && duration.Duration > 0) if (Item is IHasDuration duration && duration.Duration > 0)
circle.Colour = ColourInfo.GradientHorizontal(colour, colour.Lighten(0.4f)); circle.Colour = ColourInfo.GradientHorizontal(colour, colour.Lighten(0.4f));
@ -212,14 +207,9 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
for (int i = 0; i < repeats.RepeatCount; i++) for (int i = 0; i < repeats.RepeatCount; i++)
{ {
repeatsContainer.Add(new Circle repeatsContainer.Add(new Tick
{ {
Size = new Vector2(circle_size / 3), X = (float)(i + 1) / (repeats.RepeatCount + 1)
Alpha = 0.2f,
Anchor = Anchor.CentreLeft,
Origin = Anchor.Centre,
RelativePositionAxes = Axes.X,
X = (float)(i + 1) / (repeats.RepeatCount + 1),
}); });
} }
} }
@ -233,6 +223,17 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
public override Vector2 ScreenSpaceSelectionPoint => ScreenSpaceDrawQuad.TopLeft; public override Vector2 ScreenSpaceSelectionPoint => ScreenSpaceDrawQuad.TopLeft;
private class Tick : Circle
{
public Tick()
{
Size = new Vector2(circle_size / 4);
Anchor = Anchor.CentreLeft;
Origin = Anchor.Centre;
RelativePositionAxes = Axes.X;
}
}
public class DragArea : Circle public class DragArea : Circle
{ {
private readonly HitObject hitObject; private readonly HitObject hitObject;
@ -304,20 +305,15 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
private void updateState() private void updateState()
{ {
if (hasMouseDown) float scale = 0.5f;
{
this.ScaleTo(0.7f, 200, Easing.OutQuint);
}
else if (IsHovered)
{
this.ScaleTo(0.8f, 200, Easing.OutQuint);
}
else
{
this.ScaleTo(0.6f, 200, Easing.OutQuint);
}
this.FadeTo(IsHovered || hasMouseDown ? 0.8f : 0.2f, 200, Easing.OutQuint); if (hasMouseDown)
scale = 0.6f;
else if (IsHovered)
scale = 0.7f;
this.ScaleTo(scale, 200, Easing.OutQuint);
this.FadeTo(IsHovered || hasMouseDown ? 1f : 0.9f, 200, Easing.OutQuint);
} }
[Resolved] [Resolved]