Skip to content

Commit

Permalink
Merge pull request #31110 from peppy/timing-current-point-indicator
Browse files Browse the repository at this point in the history
Change the way "current" points are hinted on timing screen
  • Loading branch information
bdach authored Dec 16, 2024
2 parents 573d709 + 98e8d0b commit 9652c5a
Showing 1 changed file with 24 additions and 13 deletions.
37 changes: 24 additions & 13 deletions osu.Game/Screens/Edit/Timing/ControlPointTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
Expand All @@ -21,6 +22,7 @@
using osu.Game.Overlays;
using osu.Game.Screens.Edit.Timing.RowAttributes;
using osuTK;
using osuTK.Graphics;

namespace osu.Game.Screens.Edit.Timing
{
Expand Down Expand Up @@ -177,7 +179,7 @@ public Bindable<ControlPointGroup> Current
private readonly BindableWithCurrent<ControlPointGroup> current = new BindableWithCurrent<ControlPointGroup>();

private Box background = null!;
private Box currentIndicator = null!;
private Drawable currentIndicator = null!;

[Resolved]
private OverlayColourProvider colourProvider { get; set; } = null!;
Expand All @@ -202,19 +204,34 @@ private void load()
{
RelativeSizeAxes = Axes.Both;

InternalChildren = new Drawable[]
InternalChildren = new[]
{
background = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background1,
Alpha = 0,
},
currentIndicator = new Box
currentIndicator = new Container
{
RelativeSizeAxes = Axes.Y,
Width = 5,
RelativeSizeAxes = Axes.Both,
Alpha = 0,
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Y,
Width = 5,
},
new Box
{
RelativeSizeAxes = Axes.Y,
Blending = BlendingParameters.Additive,
X = 5,
Width = 150,
Colour = ColourInfo.GradientHorizontal(Color4.White.Opacity(0.1f), Color4.White.Opacity(0))
},
}
},
new Container
{
Expand Down Expand Up @@ -281,14 +298,8 @@ private void updateState()
bool hasCurrentTimingPoint = activeTimingPoint.Value != null && current.Value.ControlPoints.Contains(activeTimingPoint.Value);
bool hasCurrentEffectPoint = activeEffectPoint.Value != null && current.Value.ControlPoints.Contains(activeEffectPoint.Value);

if (IsHovered || isSelected)
background.FadeIn(100, Easing.OutQuint);
else if (hasCurrentTimingPoint || hasCurrentEffectPoint)
background.FadeTo(0.2f, 100, Easing.OutQuint);
else
background.FadeOut(100, Easing.OutQuint);

background.Colour = isSelected ? colourProvider.Colour3 : colourProvider.Background1;
background.FadeTo(IsHovered || isSelected ? 1 : 0, 100, Easing.OutQuint);
background.FadeColour(isSelected ? colourProvider.Colour3 : colourProvider.Background1, 100, Easing.OutQuint);

if (hasCurrentTimingPoint || hasCurrentEffectPoint)
{
Expand Down

0 comments on commit 9652c5a

Please sign in to comment.