mirror of
https://github.com/ppy/osu.git
synced 2025-03-05 10:53:10 +08:00
Implement waveform checkbox
This commit is contained in:
parent
3c35a7a6ae
commit
db672becbc
@ -23,6 +23,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Timeline
|
|||||||
Masking = true;
|
Masking = true;
|
||||||
CornerRadius = 5;
|
CornerRadius = 5;
|
||||||
|
|
||||||
|
OsuCheckbox waveformCheckbox;
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
new Box
|
new Box
|
||||||
@ -60,7 +61,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Timeline
|
|||||||
{
|
{
|
||||||
new OsuCheckbox { LabelText = "Hitobjects" },
|
new OsuCheckbox { LabelText = "Hitobjects" },
|
||||||
new OsuCheckbox { LabelText = "Hitsounds" },
|
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.Beatmap.BindTo(Beatmap);
|
||||||
|
timelineContainer.WaveformVisible.BindTo(waveformCheckbox.Current);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
|
@ -14,6 +14,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Timeline
|
|||||||
{
|
{
|
||||||
internal class ScrollingTimelineContainer : ScrollContainer
|
internal class ScrollingTimelineContainer : ScrollContainer
|
||||||
{
|
{
|
||||||
|
public readonly Bindable<bool> WaveformVisible = new Bindable<bool>();
|
||||||
public readonly Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
|
public readonly Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
|
||||||
|
|
||||||
private readonly BeatmapWaveformGraph waveform;
|
private readonly BeatmapWaveformGraph waveform;
|
||||||
@ -34,6 +35,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Timeline
|
|||||||
Content.RelativeSizeAxes = Axes.Both;
|
Content.RelativeSizeAxes = Axes.Both;
|
||||||
|
|
||||||
waveform.Beatmap.BindTo(Beatmap);
|
waveform.Beatmap.BindTo(Beatmap);
|
||||||
|
WaveformVisible.ValueChanged += waveformVisibilityChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
private float minZoom = 1;
|
private float minZoom = 1;
|
||||||
@ -129,5 +131,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Timeline
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void waveformVisibilityChanged(bool visible) => waveform.FadeTo(visible ? 1 : 0, 200, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user