2019-10-28 03:42:17 +00:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
2019-10-27 06:19:36 +00:00
|
|
|
using osu.Framework.Allocation;
|
2019-11-06 05:36:43 +00:00
|
|
|
using osu.Framework.Bindables;
|
2019-10-27 06:19:36 +00:00
|
|
|
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(),
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2019-11-06 05:36:43 +00:00
|
|
|
protected override void OnControlPointChanged(ValueChangedEvent<SampleControlPoint> point)
|
2019-10-27 06:19:36 +00:00
|
|
|
{
|
2019-11-06 05:36:43 +00:00
|
|
|
bank.Text = $"Bank: {point.NewValue?.SampleBank}";
|
|
|
|
volume.Text = $"Volume: {point.NewValue?.SampleVolume}%";
|
2019-10-27 06:19:36 +00:00
|
|
|
}
|
2019-11-06 03:17:18 +00:00
|
|
|
|
|
|
|
protected override SampleControlPoint CreatePoint()
|
|
|
|
{
|
|
|
|
var reference = Beatmap.Value.Beatmap.ControlPointInfo.SamplePointAt(SelectedGroup.Value.Time);
|
|
|
|
|
|
|
|
return new SampleControlPoint
|
|
|
|
{
|
|
|
|
SampleBank = reference.SampleBank,
|
|
|
|
SampleVolume = reference.SampleVolume,
|
|
|
|
};
|
|
|
|
}
|
2019-10-27 06:19:36 +00:00
|
|
|
}
|
2019-10-28 03:31:38 +00:00
|
|
|
}
|