mirror of
https://github.com/ppy/osu
synced 2024-12-13 18:37:04 +00:00
Add back incorrectly removed control point display toggle
This commit is contained in:
parent
fef56cc29e
commit
843b10ef34
@ -28,6 +28,21 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
|
||||
private readonly Drawable userContent;
|
||||
|
||||
private bool alwaysShowControlPoints;
|
||||
|
||||
public bool AlwaysShowControlPoints
|
||||
{
|
||||
get => alwaysShowControlPoints;
|
||||
set
|
||||
{
|
||||
if (value == alwaysShowControlPoints)
|
||||
return;
|
||||
|
||||
alwaysShowControlPoints = value;
|
||||
controlPointsVisible.TriggerChange();
|
||||
}
|
||||
}
|
||||
|
||||
[Resolved]
|
||||
private EditorClock editorClock { get; set; } = null!;
|
||||
|
||||
@ -63,7 +78,10 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
|
||||
private TimelineTickDisplay ticks = null!;
|
||||
|
||||
private TimelineTimingChangeDisplay controlPoints = null!;
|
||||
|
||||
private Bindable<float> waveformOpacity = null!;
|
||||
private Bindable<bool> controlPointsVisible = null!;
|
||||
private Bindable<bool> ticksVisible = null!;
|
||||
|
||||
private double trackLengthForZoom;
|
||||
@ -93,7 +111,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
AddRange(new Drawable[]
|
||||
{
|
||||
ticks = new TimelineTickDisplay(),
|
||||
new TimelineTimingChangeDisplay
|
||||
controlPoints = new TimelineTimingChangeDisplay
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Anchor = Anchor.CentreLeft,
|
||||
@ -129,6 +147,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
});
|
||||
|
||||
waveformOpacity = config.GetBindable<float>(OsuSetting.EditorWaveformOpacity);
|
||||
controlPointsVisible = config.GetBindable<bool>(OsuSetting.EditorTimelineShowTimingChanges);
|
||||
ticksVisible = config.GetBindable<bool>(OsuSetting.EditorTimelineShowTicks);
|
||||
|
||||
track.BindTo(editorClock.Track);
|
||||
@ -162,6 +181,14 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
waveformOpacity.BindValueChanged(_ => updateWaveformOpacity(), true);
|
||||
|
||||
ticksVisible.BindValueChanged(visible => ticks.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint), true);
|
||||
|
||||
controlPointsVisible.BindValueChanged(visible =>
|
||||
{
|
||||
if (visible.NewValue || alwaysShowControlPoints)
|
||||
controlPoints.FadeIn(400, Easing.OutQuint);
|
||||
else
|
||||
controlPoints.FadeOut(200, Easing.OutQuint);
|
||||
}, true);
|
||||
}
|
||||
|
||||
private void updateWaveformOpacity() =>
|
||||
|
@ -106,10 +106,18 @@ namespace osu.Game.Screens.Edit
|
||||
MainContent.Add(content);
|
||||
content.FadeInFromZero(300, Easing.OutQuint);
|
||||
|
||||
LoadComponentAsync(TimelineArea = new TimelineArea(CreateTimelineContent()), timelineContent.Add);
|
||||
LoadComponentAsync(TimelineArea = new TimelineArea(CreateTimelineContent()), timeline =>
|
||||
{
|
||||
ConfigureTimeline(timeline);
|
||||
timelineContent.Add(timeline);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
protected virtual void ConfigureTimeline(TimelineArea timelineArea)
|
||||
{
|
||||
}
|
||||
|
||||
protected abstract Drawable CreateMainContent();
|
||||
|
||||
protected virtual Drawable CreateTimelineContent() => new Container();
|
||||
|
@ -6,6 +6,7 @@ using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
using osu.Game.Screens.Edit.Compose.Components.Timeline;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Timing
|
||||
{
|
||||
@ -53,5 +54,12 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
SelectedGroup.Value = EditorBeatmap.ControlPointInfo.GroupAt(nearestTimingPoint.Time);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void ConfigureTimeline(TimelineArea timelineArea)
|
||||
{
|
||||
base.ConfigureTimeline(timelineArea);
|
||||
|
||||
timelineArea.Timeline.AlwaysShowControlPoints = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user