mirror of
https://github.com/ppy/osu
synced 2025-01-09 15:49:32 +00:00
45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
using osu.Framework.Allocation;
|
|
using osu.Game.Beatmaps.ControlPoints;
|
|
using osu.Game.Graphics.Sprites;
|
|
|
|
namespace osu.Game.Screens.Edit.Timing
|
|
{
|
|
internal class SampleSection : Section<SampleControlPoint>
|
|
{
|
|
private OsuSpriteText bank;
|
|
private OsuSpriteText volume;
|
|
|
|
[BackgroundDependencyLoader]
|
|
private void load()
|
|
{
|
|
Flow.AddRange(new[]
|
|
{
|
|
bank = new OsuSpriteText(),
|
|
volume = new OsuSpriteText(),
|
|
});
|
|
}
|
|
|
|
protected override SampleControlPoint CreatePoint()
|
|
{
|
|
var reference = Beatmap.Value.Beatmap.ControlPointInfo.SamplePointAt(SelectedGroup.Value.Time);
|
|
|
|
return new SampleControlPoint
|
|
{
|
|
SampleBank = reference.SampleBank,
|
|
SampleVolume = reference.SampleVolume,
|
|
};
|
|
}
|
|
|
|
protected override void LoadComplete()
|
|
{
|
|
base.LoadComplete();
|
|
|
|
ControlPoint.BindValueChanged(point =>
|
|
{
|
|
bank.Text = $"Bank: {point.NewValue?.SampleBank}";
|
|
volume.Text = $"Volume: {point.NewValue?.SampleVolume}%";
|
|
});
|
|
}
|
|
}
|
|
}
|