From 4b0ba86bd0488c3a1b58f3b5fbf51dcf731ad142 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Sun, 20 Nov 2022 04:12:50 +0300 Subject: [PATCH] Identify scrolling rulesets using temporary `DrawableRuleset` instances --- osu.Game/Screens/Edit/Timing/EffectSection.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Edit/Timing/EffectSection.cs b/osu.Game/Screens/Edit/Timing/EffectSection.cs index 8d12317ee9..9be663bb26 100644 --- a/osu.Game/Screens/Edit/Timing/EffectSection.cs +++ b/osu.Game/Screens/Edit/Timing/EffectSection.cs @@ -7,7 +7,9 @@ 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 { @@ -41,10 +43,8 @@ namespace osu.Game.Screens.Edit.Timing omitBarLine.Current.BindValueChanged(_ => saveChanges()); scrollSpeedSlider.Current.BindValueChanged(_ => saveChanges()); - // adjusting scroll speed on osu/catch rulesets results in undefined behaviour during legacy beatmap decoding, and generally shouldn't be shown. - // todo: there should be proper way to identify such rulesets, but this should do for now. - var ruleset = Beatmap.BeatmapInfo.Ruleset; - if (ruleset.OnlineID == 0 || ruleset.OnlineID == 2) + var drawableRuleset = Beatmap.BeatmapInfo.Ruleset.CreateInstance().CreateDrawableRulesetWith(Beatmap.PlayableBeatmap); + if (drawableRuleset is not IDrawableScrollingRuleset scrollingRuleset || scrollingRuleset.VisualisationMethod == ScrollVisualisationMethod.Constant) scrollSpeedSlider.Hide(); void saveChanges()