1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 04:02:57 +08:00

Fix mania scrolling speed not including beatmap slider multipli… (#6236)

Fix mania scrolling speed not including beatmap slider multiplier

Co-authored-by: Dean Herbert <pe@ppy.sh>
This commit is contained in:
Dean Herbert 2019-09-25 22:34:46 +09:00 committed by GitHub
commit 7d5544460b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 2 deletions

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
@ -115,6 +116,32 @@ namespace osu.Game.Tests.Visual.Gameplay
assertPosition(4, 1f);
}
[Test]
public void TestSliderMultiplierDoesNotAffectRelativeBeatLength()
{
var beatmap = createBeatmap(new TimingControlPoint { BeatLength = time_range });
beatmap.BeatmapInfo.BaseDifficulty.SliderMultiplier = 2;
createTest(beatmap, d => d.RelativeScaleBeatLengthsOverride = true);
AddStep("adjust time range", () => drawableRuleset.TimeRange.Value = 5000);
for (int i = 0; i < 5; i++)
assertPosition(i, i / 5f);
}
[Test]
public void TestSliderMultiplierAffectsNonRelativeBeatLength()
{
var beatmap = createBeatmap(new TimingControlPoint { BeatLength = time_range });
beatmap.BeatmapInfo.BaseDifficulty.SliderMultiplier = 2;
createTest(beatmap);
AddStep("adjust time range", () => drawableRuleset.TimeRange.Value = 2000);
assertPosition(0, 0);
assertPosition(1, 1);
}
private void assertPosition(int index, float relativeY) => AddAssert($"hitobject {index} at {relativeY}",
() => Precision.AlmostEquals(drawableRuleset.Playfield.AllHitObjects.ElementAt(index).DrawPosition.Y, drawableRuleset.Playfield.HitObjectContainer.DrawHeight * relativeY));
@ -193,6 +220,8 @@ namespace osu.Game.Tests.Visual.Gameplay
protected override ScrollVisualisationMethod VisualisationMethod => ScrollVisualisationMethod.Overlapping;
public new Bindable<double> TimeRange => base.TimeRange;
public TestDrawableScrollingRuleset(Ruleset ruleset, IWorkingBeatmap beatmap, IReadOnlyList<Mod> mods)
: base(ruleset, beatmap, mods)
{

View File

@ -316,8 +316,8 @@ namespace osu.Game.Rulesets.Objects.Drawables
get => lifetimeStart ?? (HitObject.StartTime - InitialLifetimeOffset);
set
{
base.LifetimeStart = value;
lifetimeStart = value;
base.LifetimeStart = value;
}
}

View File

@ -131,7 +131,9 @@ namespace osu.Game.Rulesets.UI.Scrolling
if (duration > maxDuration)
{
maxDuration = duration;
baseBeatLength = timingPoints[i].BeatLength;
// The slider multiplier is post-multiplied to determine the final velocity, but for relative scale beat lengths
// the multiplier should not affect the effective timing point (the longest in the beatmap), so it is factored out here
baseBeatLength = timingPoints[i].BeatLength / Beatmap.BeatmapInfo.BaseDifficulty.SliderMultiplier;
}
}
}

View File

@ -77,6 +77,9 @@ namespace osu.Game.Rulesets.UI.Scrolling
if (!initialStateCache.IsValid)
{
foreach (var cached in hitObjectInitialStateCache.Values)
cached.Invalidate();
switch (direction.Value)
{
case ScrollingDirection.Up: