1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-14 20:38:33 +08:00
osu-lazer/osu.Game/Screens/Edit/Timing/RowAttributes/DifficultyRowAttribute.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

45 lines
1.3 KiB
C#
Raw Normal View History

// 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.
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Screens.Edit.Timing.RowAttributes
{
public partial class DifficultyRowAttribute : RowAttribute
{
private readonly BindableNumber<double> speedMultiplier;
2023-01-14 07:23:21 +08:00
private OsuSpriteText text = null!;
public DifficultyRowAttribute(DifficultyControlPoint difficulty)
: base(difficulty, "difficulty")
{
speedMultiplier = difficulty.SliderVelocityBindable.GetBoundCopy();
}
[BackgroundDependencyLoader]
private void load()
{
Content.AddRange(new Drawable[]
{
new AttributeProgressBar(Point)
{
Current = speedMultiplier,
2021-04-19 16:57:07 +08:00
},
text = new AttributeText(Point)
{
Width = 45,
2021-04-19 16:57:07 +08:00
},
});
speedMultiplier.BindValueChanged(_ => updateText(), true);
}
private void updateText() => text.Text = $"{speedMultiplier.Value:n2}x";
}
}