mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 17:13:06 +08:00
Add comment + test for slider multiplier
This commit is contained in:
parent
ccb5623487
commit
244627ff10
@ -129,6 +129,19 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
assertPosition(i, i / 5f);
|
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}",
|
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));
|
() => Precision.AlmostEquals(drawableRuleset.Playfield.AllHitObjects.ElementAt(index).DrawPosition.Y, drawableRuleset.Playfield.HitObjectContainer.DrawHeight * relativeY));
|
||||||
|
|
||||||
|
@ -131,6 +131,8 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
if (duration > maxDuration)
|
if (duration > maxDuration)
|
||||||
{
|
{
|
||||||
maxDuration = duration;
|
maxDuration = duration;
|
||||||
|
// 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;
|
baseBeatLength = timingPoints[i].BeatLength / Beatmap.BeatmapInfo.BaseDifficulty.SliderMultiplier;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user