1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 21:42:55 +08:00

Hide scroll speed in effect row attribute

This commit is contained in:
OliBomby 2024-08-16 14:43:33 +02:00
parent b253d8ecbf
commit 621c4d65a3

View File

@ -5,6 +5,8 @@ using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Configuration;
using osu.Game.Rulesets.UI.Scrolling;
namespace osu.Game.Screens.Edit.Timing.RowAttributes
{
@ -15,6 +17,10 @@ namespace osu.Game.Screens.Edit.Timing.RowAttributes
private AttributeText kiaiModeBubble = null!;
private AttributeText text = null!;
private AttributeProgressBar progressBar = null!;
[Resolved]
protected EditorBeatmap Beatmap { get; private set; } = null!;
public EffectRowAttribute(EffectControlPoint effect)
: base(effect, "effect")
@ -28,7 +34,7 @@ namespace osu.Game.Screens.Edit.Timing.RowAttributes
{
Content.AddRange(new Drawable[]
{
new AttributeProgressBar(Point)
progressBar = new AttributeProgressBar(Point)
{
Current = scrollSpeed,
},
@ -36,6 +42,14 @@ namespace osu.Game.Screens.Edit.Timing.RowAttributes
kiaiModeBubble = new AttributeText(Point) { Text = "kiai" },
});
var drawableRuleset = Beatmap.BeatmapInfo.Ruleset.CreateInstance().CreateDrawableRulesetWith(Beatmap.PlayableBeatmap);
if (drawableRuleset is not IDrawableScrollingRuleset scrollingRuleset || scrollingRuleset.VisualisationMethod == ScrollVisualisationMethod.Constant)
{
text.Hide();
progressBar.Hide();
}
kiaiMode.BindValueChanged(enabled => kiaiModeBubble.FadeTo(enabled.NewValue ? 1 : 0), true);
scrollSpeed.BindValueChanged(_ => updateText(), true);
}