From 1cbc2f07ab039c54d3788063e5028ab34577937a Mon Sep 17 00:00:00 2001 From: Hivie Date: Fri, 23 Feb 2024 14:01:12 +0100 Subject: [PATCH] use more correct implementation --- .../Mods/TaikoModConstantSpeed.cs | 20 +++++++++---------- .../UI/DrawableTaikoRuleset.cs | 7 ++++++- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModConstantSpeed.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModConstantSpeed.cs index 28de360eee..4ecb94467e 100644 --- a/osu.Game.Rulesets.Taiko/Mods/TaikoModConstantSpeed.cs +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModConstantSpeed.cs @@ -1,15 +1,17 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using osu.Framework.Localisation; using osu.Framework.Graphics.Sprites; -using osu.Game.Beatmaps; +using osu.Framework.Localisation; +using osu.Game.Configuration; +using osu.Game.Rulesets.Taiko.Objects; +using osu.Game.Rulesets.Taiko.UI; using osu.Game.Rulesets.Mods; -using osu.Game.Rulesets.Taiko.Beatmaps; +using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Taiko.Mods { - public class TaikoModConstantSpeed : Mod, IApplicableToBeatmap + public class TaikoModConstantSpeed : Mod, IApplicableToDrawableRuleset { public override string Name => "Constant Speed"; public override string Acronym => "CS"; @@ -18,14 +20,10 @@ namespace osu.Game.Rulesets.Taiko.Mods public override IconUsage? Icon => FontAwesome.Solid.Equals; public override ModType Type => ModType.Conversion; - public void ApplyToBeatmap(IBeatmap beatmap) + public void ApplyToDrawableRuleset(DrawableRuleset drawableRuleset) { - var taikoBeatmap = (TaikoBeatmap)beatmap; - - foreach (var effectControlPoint in taikoBeatmap.ControlPointInfo.EffectPoints) - { - effectControlPoint.ScrollSpeed = 1; - } + var taikoRuleset = (DrawableTaikoRuleset)drawableRuleset; + taikoRuleset.VisualisationMethod = ScrollVisualisationMethod.Constant; } } } diff --git a/osu.Game.Rulesets.Taiko/UI/DrawableTaikoRuleset.cs b/osu.Game.Rulesets.Taiko/UI/DrawableTaikoRuleset.cs index 77b2b06c0e..a476634fb8 100644 --- a/osu.Game.Rulesets.Taiko/UI/DrawableTaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/UI/DrawableTaikoRuleset.cs @@ -69,7 +69,12 @@ namespace osu.Game.Rulesets.Taiko.UI TimeRange.Value = ComputeTimeRange(); } - protected virtual double ComputeTimeRange() => PlayfieldAdjustmentContainer.ComputeTimeRange(); + protected virtual double ComputeTimeRange() + { + // Adjust when we're using constant algorithm to not be sluggish. + double multiplier = VisualisationMethod == ScrollVisualisationMethod.Overlapping ? 1 : 4; + return PlayfieldAdjustmentContainer.ComputeTimeRange() / multiplier; + } protected override void UpdateAfterChildren() {