mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Add the ability to add new ControlPoint types to existing groups
This commit is contained in:
44
osu.Game/Screens/Edit/Timing/SampleSection.cs
Normal file
44
osu.Game/Screens/Edit/Timing/SampleSection.cs
Normal file
@ -0,0 +1,44 @@
|
||||
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}";
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user