1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:07:44 +08:00

Implement waveform checkbox

This commit is contained in:
smoogipoo 2017-10-12 17:50:51 +09:00
parent 3c35a7a6ae
commit db672becbc
2 changed files with 9 additions and 1 deletions

View File

@ -23,6 +23,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Timeline
Masking = true;
CornerRadius = 5;
OsuCheckbox waveformCheckbox;
InternalChildren = new Drawable[]
{
new Box
@ -60,7 +61,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Timeline
{
new OsuCheckbox { LabelText = "Hitobjects" },
new OsuCheckbox { LabelText = "Hitsounds" },
new OsuCheckbox { LabelText = "Waveform" }
waveformCheckbox = new OsuCheckbox { LabelText = "Waveform" }
}
}
}
@ -106,7 +107,10 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Timeline
}
};
waveformCheckbox.Current.Value = true;
timelineContainer.Beatmap.BindTo(Beatmap);
timelineContainer.WaveformVisible.BindTo(waveformCheckbox.Current);
}
protected override void Update()

View File

@ -14,6 +14,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Timeline
{
internal class ScrollingTimelineContainer : ScrollContainer
{
public readonly Bindable<bool> WaveformVisible = new Bindable<bool>();
public readonly Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
private readonly BeatmapWaveformGraph waveform;
@ -34,6 +35,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Timeline
Content.RelativeSizeAxes = Axes.Both;
waveform.Beatmap.BindTo(Beatmap);
WaveformVisible.ValueChanged += waveformVisibilityChanged;
}
private float minZoom = 1;
@ -129,5 +131,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Timeline
return true;
}
private void waveformVisibilityChanged(bool visible) => waveform.FadeTo(visible ? 1 : 0, 200, Easing.OutQuint);
}
}