From b253d8ecbf3c6399e1fd84eb8738d03608db6ba2 Mon Sep 17 00:00:00 2001 From: OliBomby Date: Fri, 16 Aug 2024 14:43:09 +0200 Subject: [PATCH 1/4] Hide scroll speed in bottom timeline --- .../Timelines/Summary/Parts/EffectPointVisualisation.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/EffectPointVisualisation.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/EffectPointVisualisation.cs index 17fedb933a..e3f90558c5 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/EffectPointVisualisation.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/EffectPointVisualisation.cs @@ -9,8 +9,10 @@ using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; using osu.Framework.Localisation; using osu.Game.Beatmaps.ControlPoints; +using osu.Game.Configuration; using osu.Game.Extensions; using osu.Game.Graphics; +using osu.Game.Rulesets.UI.Scrolling; namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts { @@ -79,7 +81,10 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts { ClearInternal(); - AddInternal(new ControlPointVisualisation(effect)); + var drawableRuleset = beatmap.BeatmapInfo.Ruleset.CreateInstance().CreateDrawableRulesetWith(beatmap.PlayableBeatmap); + + if (drawableRuleset is IDrawableScrollingRuleset scrollingRuleset && scrollingRuleset.VisualisationMethod != ScrollVisualisationMethod.Constant) + AddInternal(new ControlPointVisualisation(effect)); if (!kiai.Value) return; From 621c4d65a3d721ebb0547de891c2048d92f32c27 Mon Sep 17 00:00:00 2001 From: OliBomby Date: Fri, 16 Aug 2024 14:43:33 +0200 Subject: [PATCH 2/4] Hide scroll speed in effect row attribute --- .../Timing/RowAttributes/EffectRowAttribute.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Edit/Timing/RowAttributes/EffectRowAttribute.cs b/osu.Game/Screens/Edit/Timing/RowAttributes/EffectRowAttribute.cs index ad22aa81fc..253bfdd73a 100644 --- a/osu.Game/Screens/Edit/Timing/RowAttributes/EffectRowAttribute.cs +++ b/osu.Game/Screens/Edit/Timing/RowAttributes/EffectRowAttribute.cs @@ -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); } From 998b5fdc12122a538dadbd3b7afcda868eb3bdda Mon Sep 17 00:00:00 2001 From: OliBomby Date: Thu, 22 Aug 2024 19:53:34 +0200 Subject: [PATCH 3/4] Add property EditorShowScrollSpeed to Ruleset --- osu.Game.Rulesets.Catch/CatchRuleset.cs | 2 ++ osu.Game.Rulesets.Osu/OsuRuleset.cs | 2 ++ osu.Game/Rulesets/Ruleset.cs | 5 +++++ osu.Game/Rulesets/UI/Scrolling/DrawableScrollingRuleset.cs | 2 -- osu.Game/Rulesets/UI/Scrolling/IDrawableScrollingRuleset.cs | 4 ---- .../Timelines/Summary/Parts/EffectPointVisualisation.cs | 6 +----- osu.Game/Screens/Edit/Timing/EffectSection.cs | 5 +---- .../Screens/Edit/Timing/RowAttributes/EffectRowAttribute.cs | 6 +----- 8 files changed, 12 insertions(+), 20 deletions(-) diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index 3edc23a8b7..7eaf4f2b18 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -254,5 +254,7 @@ namespace osu.Game.Rulesets.Catch return adjustedDifficulty; } + + public override bool EditorShowScrollSpeed => false; } } diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 7042ad0cd4..be48ef9acc 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -359,5 +359,7 @@ namespace osu.Game.Rulesets.Osu return adjustedDifficulty; } + + public override bool EditorShowScrollSpeed => false; } } diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index fb0e225c94..5af1fd386c 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -401,5 +401,10 @@ namespace osu.Game.Rulesets new DifficultySection(), new ColoursSection(), ]; + + /// + /// Can be overridden to avoid showing scroll speed changes in the editor. + /// + public virtual bool EditorShowScrollSpeed => true; } } diff --git a/osu.Game/Rulesets/UI/Scrolling/DrawableScrollingRuleset.cs b/osu.Game/Rulesets/UI/Scrolling/DrawableScrollingRuleset.cs index d23658ac33..ba3a9bd483 100644 --- a/osu.Game/Rulesets/UI/Scrolling/DrawableScrollingRuleset.cs +++ b/osu.Game/Rulesets/UI/Scrolling/DrawableScrollingRuleset.cs @@ -64,8 +64,6 @@ namespace osu.Game.Rulesets.UI.Scrolling MaxValue = time_span_max }; - ScrollVisualisationMethod IDrawableScrollingRuleset.VisualisationMethod => VisualisationMethod; - /// /// Whether the player can change . /// diff --git a/osu.Game/Rulesets/UI/Scrolling/IDrawableScrollingRuleset.cs b/osu.Game/Rulesets/UI/Scrolling/IDrawableScrollingRuleset.cs index b348a22009..27531492d6 100644 --- a/osu.Game/Rulesets/UI/Scrolling/IDrawableScrollingRuleset.cs +++ b/osu.Game/Rulesets/UI/Scrolling/IDrawableScrollingRuleset.cs @@ -1,8 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using osu.Game.Configuration; - namespace osu.Game.Rulesets.UI.Scrolling { /// @@ -10,8 +8,6 @@ namespace osu.Game.Rulesets.UI.Scrolling /// public interface IDrawableScrollingRuleset { - ScrollVisualisationMethod VisualisationMethod { get; } - IScrollingInfo ScrollingInfo { get; } } } diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/EffectPointVisualisation.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/EffectPointVisualisation.cs index e3f90558c5..f1a8dc5e35 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/EffectPointVisualisation.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/EffectPointVisualisation.cs @@ -9,10 +9,8 @@ using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; using osu.Framework.Localisation; using osu.Game.Beatmaps.ControlPoints; -using osu.Game.Configuration; using osu.Game.Extensions; using osu.Game.Graphics; -using osu.Game.Rulesets.UI.Scrolling; namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts { @@ -81,9 +79,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts { ClearInternal(); - var drawableRuleset = beatmap.BeatmapInfo.Ruleset.CreateInstance().CreateDrawableRulesetWith(beatmap.PlayableBeatmap); - - if (drawableRuleset is IDrawableScrollingRuleset scrollingRuleset && scrollingRuleset.VisualisationMethod != ScrollVisualisationMethod.Constant) + if (beatmap.BeatmapInfo.Ruleset.CreateInstance().EditorShowScrollSpeed) AddInternal(new ControlPointVisualisation(effect)); if (!kiai.Value) diff --git a/osu.Game/Screens/Edit/Timing/EffectSection.cs b/osu.Game/Screens/Edit/Timing/EffectSection.cs index f321f7eeb0..a4b9f37dff 100644 --- a/osu.Game/Screens/Edit/Timing/EffectSection.cs +++ b/osu.Game/Screens/Edit/Timing/EffectSection.cs @@ -5,9 +5,7 @@ using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Game.Beatmaps.ControlPoints; -using osu.Game.Configuration; using osu.Game.Graphics.UserInterfaceV2; -using osu.Game.Rulesets.UI.Scrolling; namespace osu.Game.Screens.Edit.Timing { @@ -38,8 +36,7 @@ namespace osu.Game.Screens.Edit.Timing kiai.Current.BindValueChanged(_ => saveChanges()); scrollSpeedSlider.Current.BindValueChanged(_ => saveChanges()); - var drawableRuleset = Beatmap.BeatmapInfo.Ruleset.CreateInstance().CreateDrawableRulesetWith(Beatmap.PlayableBeatmap); - if (drawableRuleset is not IDrawableScrollingRuleset scrollingRuleset || scrollingRuleset.VisualisationMethod == ScrollVisualisationMethod.Constant) + if (!Beatmap.BeatmapInfo.Ruleset.CreateInstance().EditorShowScrollSpeed) scrollSpeedSlider.Hide(); void saveChanges() diff --git a/osu.Game/Screens/Edit/Timing/RowAttributes/EffectRowAttribute.cs b/osu.Game/Screens/Edit/Timing/RowAttributes/EffectRowAttribute.cs index 253bfdd73a..87ee675e7f 100644 --- a/osu.Game/Screens/Edit/Timing/RowAttributes/EffectRowAttribute.cs +++ b/osu.Game/Screens/Edit/Timing/RowAttributes/EffectRowAttribute.cs @@ -5,8 +5,6 @@ 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 { @@ -42,9 +40,7 @@ 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) + if (!Beatmap.BeatmapInfo.Ruleset.CreateInstance().EditorShowScrollSpeed) { text.Hide(); progressBar.Hide(); From ad8e7f1897fbae3c76e8438bd2263217f67819fb Mon Sep 17 00:00:00 2001 From: OliBomby Date: Thu, 22 Aug 2024 20:17:09 +0200 Subject: [PATCH 4/4] Fix scroll speed visualisation missing on start kiai effect points They were being drawn far offscreen because the width of the kiai multiplied with the X coordinate of the scroll speed vis. --- .../Timelines/Summary/Parts/EffectPointVisualisation.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/EffectPointVisualisation.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/EffectPointVisualisation.cs index f1a8dc5e35..b4e6d1ece2 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/EffectPointVisualisation.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/EffectPointVisualisation.cs @@ -80,7 +80,13 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts ClearInternal(); if (beatmap.BeatmapInfo.Ruleset.CreateInstance().EditorShowScrollSpeed) - AddInternal(new ControlPointVisualisation(effect)); + { + AddInternal(new ControlPointVisualisation(effect) + { + // importantly, override the x position being set since we do that in the GroupVisualisation parent drawable. + X = 0, + }); + } if (!kiai.Value) return;