mirror of
https://github.com/ppy/osu.git
synced 2025-01-08 00:42:57 +08:00
Fix mania converts scrolling at incorrect speeds
This commit is contained in:
parent
4e061ceabc
commit
b42d1104b7
@ -7,6 +7,7 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
using osu.Game.Input.Handlers;
|
using osu.Game.Input.Handlers;
|
||||||
using osu.Game.Replays;
|
using osu.Game.Replays;
|
||||||
using osu.Game.Rulesets.Mania.Beatmaps;
|
using osu.Game.Rulesets.Mania.Beatmaps;
|
||||||
@ -46,6 +47,18 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
|
bool isForCurrentRuleset = Beatmap.BeatmapInfo.Ruleset.Equals(Ruleset.RulesetInfo);
|
||||||
|
|
||||||
|
foreach (var p in ControlPoints)
|
||||||
|
{
|
||||||
|
// Mania doesn't care about global velocity
|
||||||
|
p.Velocity = 1;
|
||||||
|
|
||||||
|
// For non-mania beatmap, speed changes should only happen through timing points
|
||||||
|
if (!isForCurrentRuleset)
|
||||||
|
p.DifficultyPoint = new DifficultyControlPoint();
|
||||||
|
}
|
||||||
|
|
||||||
BarLines.ForEach(Playfield.Add);
|
BarLines.ForEach(Playfield.Add);
|
||||||
|
|
||||||
Config.BindWith(ManiaRulesetSetting.ScrollDirection, configDirection);
|
Config.BindWith(ManiaRulesetSetting.ScrollDirection, configDirection);
|
||||||
|
@ -74,11 +74,9 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
protected virtual bool RelativeScaleBeatLengths => false;
|
protected virtual bool RelativeScaleBeatLengths => false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides the default <see cref="MultiplierControlPoint"/>s that adjust the scrolling rate of <see cref="HitObject"/>s
|
/// The <see cref="MultiplierControlPoint"/>s that adjust the scrolling rate of <see cref="HitObject"/>s inside this <see cref="DrawableRuleset{TObject}"/>.
|
||||||
/// inside this <see cref="DrawableRuleset{TObject}"/>.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
protected readonly SortedList<MultiplierControlPoint> ControlPoints = new SortedList<MultiplierControlPoint>(Comparer<MultiplierControlPoint>.Default);
|
||||||
private readonly SortedList<MultiplierControlPoint> controlPoints = new SortedList<MultiplierControlPoint>(Comparer<MultiplierControlPoint>.Default);
|
|
||||||
|
|
||||||
protected IScrollingInfo ScrollingInfo => scrollingInfo;
|
protected IScrollingInfo ScrollingInfo => scrollingInfo;
|
||||||
|
|
||||||
@ -95,11 +93,11 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
switch (VisualisationMethod)
|
switch (VisualisationMethod)
|
||||||
{
|
{
|
||||||
case ScrollVisualisationMethod.Sequential:
|
case ScrollVisualisationMethod.Sequential:
|
||||||
scrollingInfo.Algorithm = new SequentialScrollAlgorithm(controlPoints);
|
scrollingInfo.Algorithm = new SequentialScrollAlgorithm(ControlPoints);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ScrollVisualisationMethod.Overlapping:
|
case ScrollVisualisationMethod.Overlapping:
|
||||||
scrollingInfo.Algorithm = new OverlappingScrollAlgorithm(controlPoints);
|
scrollingInfo.Algorithm = new OverlappingScrollAlgorithm(ControlPoints);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ScrollVisualisationMethod.Constant:
|
case ScrollVisualisationMethod.Constant:
|
||||||
@ -168,10 +166,18 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
// Collapse sections with the same start time
|
// Collapse sections with the same start time
|
||||||
.GroupBy(s => s.StartTime).Select(g => g.Last()).OrderBy(s => s.StartTime);
|
.GroupBy(s => s.StartTime).Select(g => g.Last()).OrderBy(s => s.StartTime);
|
||||||
|
|
||||||
controlPoints.AddRange(timingChanges);
|
ControlPoints.AddRange(timingChanges);
|
||||||
|
|
||||||
if (controlPoints.Count == 0)
|
if (ControlPoints.Count == 0)
|
||||||
controlPoints.Add(new MultiplierControlPoint { Velocity = Beatmap.BeatmapInfo.BaseDifficulty.SliderMultiplier });
|
ControlPoints.Add(new MultiplierControlPoint { Velocity = Beatmap.BeatmapInfo.BaseDifficulty.SliderMultiplier });
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
|
||||||
|
if (!(Playfield is ScrollingPlayfield))
|
||||||
|
throw new ArgumentException($"{nameof(Playfield)} must be a {nameof(ScrollingPlayfield)} when using {nameof(DrawableScrollingRuleset<TObject>)}.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool OnPressed(GlobalAction action)
|
public bool OnPressed(GlobalAction action)
|
||||||
@ -193,14 +199,6 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
|
||||||
{
|
|
||||||
base.LoadComplete();
|
|
||||||
|
|
||||||
if (!(Playfield is ScrollingPlayfield))
|
|
||||||
throw new ArgumentException($"{nameof(Playfield)} must be a {nameof(ScrollingPlayfield)} when using {nameof(DrawableScrollingRuleset<TObject>)}.");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnReleased(GlobalAction action)
|
public void OnReleased(GlobalAction action)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user