mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 21:47:25 +08:00
Also add toggle for ticks display
This commit is contained in:
parent
b654396a4c
commit
00a19b4879
@ -25,6 +25,8 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
|
||||
public readonly Bindable<bool> ControlPointsVisible = new Bindable<bool>();
|
||||
|
||||
public readonly Bindable<bool> TicksVisible = new Bindable<bool>();
|
||||
|
||||
public readonly IBindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
|
||||
|
||||
[Resolved]
|
||||
@ -61,6 +63,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
|
||||
private WaveformGraph waveform;
|
||||
private ControlPointPart controlPoints;
|
||||
private TimelineTickDisplay ticks;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(IBindable<WorkingBeatmap> beatmap, OsuColour colours)
|
||||
@ -80,7 +83,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both
|
||||
},
|
||||
new TimelineTickDisplay(),
|
||||
ticks = new TimelineTickDisplay(),
|
||||
});
|
||||
|
||||
// We don't want the centre marker to scroll
|
||||
@ -88,6 +91,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
|
||||
WaveformVisible.ValueChanged += visible => waveform.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint);
|
||||
ControlPointsVisible.ValueChanged += visible => controlPoints.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint);
|
||||
TicksVisible.ValueChanged += visible => ticks.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint);
|
||||
|
||||
Beatmap.BindTo(beatmap);
|
||||
Beatmap.BindValueChanged(b =>
|
||||
|
@ -26,6 +26,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
|
||||
OsuCheckbox waveformCheckbox;
|
||||
OsuCheckbox controlPointsCheckbox;
|
||||
OsuCheckbox ticksCheckbox;
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
@ -72,6 +73,11 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
{
|
||||
LabelText = "Control Points",
|
||||
Current = { Value = true },
|
||||
},
|
||||
ticksCheckbox = new OsuCheckbox
|
||||
{
|
||||
LabelText = "Ticks",
|
||||
Current = { Value = true },
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -131,6 +137,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
|
||||
Timeline.WaveformVisible.BindTo(waveformCheckbox.Current);
|
||||
Timeline.ControlPointsVisible.BindTo(controlPointsCheckbox.Current);
|
||||
Timeline.TicksVisible.BindTo(ticksCheckbox.Current);
|
||||
}
|
||||
|
||||
private void changeZoom(float change) => Timeline.Zoom += change;
|
||||
|
Loading…
Reference in New Issue
Block a user