mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Fix timeline control point display not updating with changes
This commit is contained in:
@ -0,0 +1,46 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Screens.Edit.Components.Timelines.Summary.Visualisations;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
|
||||
{
|
||||
public class GroupVisualisation : PointVisualisation
|
||||
{
|
||||
public readonly ControlPointGroup Group;
|
||||
|
||||
private BindableList<ControlPoint> controlPoints;
|
||||
|
||||
[Resolved]
|
||||
private OsuColour colours { get; set; }
|
||||
|
||||
public GroupVisualisation(ControlPointGroup group)
|
||||
: base(group.Time)
|
||||
{
|
||||
Group = group;
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
controlPoints = (BindableList<ControlPoint>)Group.ControlPoints.GetBoundCopy();
|
||||
controlPoints.BindCollectionChanged((_, __) =>
|
||||
{
|
||||
if (controlPoints.Count == 0)
|
||||
{
|
||||
Colour = Color4.Transparent;
|
||||
return;
|
||||
}
|
||||
|
||||
Colour = controlPoints.Any(c => c is TimingControlPoint) ? colours.YellowDark : colours.Green;
|
||||
}, true);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user