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:
commit
7d5544460b
@ -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)
|
||||
{
|
||||
|
@ -316,8 +316,8 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
get => lifetimeStart ?? (HitObject.StartTime - InitialLifetimeOffset);
|
||||
set
|
||||
{
|
||||
base.LifetimeStart = value;
|
||||
lifetimeStart = value;
|
||||
base.LifetimeStart = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user