From d06490220d323c5ee5de302e62bcc2ff6cb24d20 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 6 Sep 2023 18:58:58 +0900 Subject: [PATCH 1/5] Add better xmldoc for `Slider.Velocity` --- osu.Game.Rulesets.Osu/Objects/Slider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 4189f8ba1e..9c0dda1ed3 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -113,7 +113,7 @@ namespace osu.Game.Rulesets.Osu.Objects public double SpanDuration => Duration / this.SpanCount(); /// - /// Velocity of this . + /// The computed velocity of this . This is the amount of path distance travelled in 1 ms. /// public double Velocity { get; private set; } From 1a37543d288fa3b62d19a34d443ee97943920fbd Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 6 Sep 2023 18:59:15 +0900 Subject: [PATCH 2/5] Rename `SliderVelocity` to `SliderVelocityMultiplier` to distinguish from `Velocity` --- .../Editor/TestSceneJuiceStreamPlacementBlueprint.cs | 4 ++-- .../Editor/TestSceneJuiceStreamSelectionBlueprint.cs | 4 ++-- .../Beatmaps/CatchBeatmapConverter.cs | 2 +- .../Edit/Blueprints/Components/EditablePath.cs | 2 +- osu.Game.Rulesets.Catch/Objects/JuiceStream.cs | 12 ++++++------ .../Legacy/DistanceObjectPatternGenerator.cs | 2 +- .../Mods/TestSceneOsuModAutoplay.cs | 2 +- .../TestSceneSliderFollowCircleInput.cs | 2 +- osu.Game.Rulesets.Osu.Tests/TestSceneSliderInput.cs | 2 +- .../TestSceneStartTimeOrderedHitPolicy.cs | 2 +- .../Beatmaps/OsuBeatmapConverter.cs | 2 +- .../Blueprints/Sliders/SliderPlacementBlueprint.cs | 4 ++-- osu.Game.Rulesets.Osu/Mods/OsuModStrictTracking.cs | 2 +- osu.Game.Rulesets.Osu/Objects/Slider.cs | 10 +++++----- .../Beatmaps/TaikoBeatmapConverter.cs | 4 ++-- .../TestSceneHitObjectComposerDistanceSnapping.cs | 6 +++--- .../TestSceneHitObjectDifficultyPointAdjustments.cs | 6 +++--- osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs | 2 +- osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs | 2 +- osu.Game/Rulesets/Edit/DistancedHitObjectComposer.cs | 2 +- osu.Game/Rulesets/Objects/Legacy/ConvertSlider.cs | 10 +++++----- .../Rulesets/Objects/Types/IHasSliderVelocity.cs | 4 ++-- .../Edit/Compose/Components/HitObjectInspector.cs | 2 +- .../Components/Timeline/DifficultyPointPiece.cs | 10 +++++----- .../Timeline/TimelineHitObjectBlueprint.cs | 6 +++--- osu.Game/Screens/Edit/LegacyEditorBeatmapPatcher.cs | 2 +- 26 files changed, 54 insertions(+), 54 deletions(-) diff --git a/osu.Game.Rulesets.Catch.Tests/Editor/TestSceneJuiceStreamPlacementBlueprint.cs b/osu.Game.Rulesets.Catch.Tests/Editor/TestSceneJuiceStreamPlacementBlueprint.cs index 2426f8c886..d010bb02ad 100644 --- a/osu.Game.Rulesets.Catch.Tests/Editor/TestSceneJuiceStreamPlacementBlueprint.cs +++ b/osu.Game.Rulesets.Catch.Tests/Editor/TestSceneJuiceStreamPlacementBlueprint.cs @@ -45,7 +45,7 @@ namespace osu.Game.Rulesets.Catch.Tests.Editor AddAssert("end time is correct", () => Precision.AlmostEquals(lastObject.EndTime, times[1])); AddAssert("start position is correct", () => Precision.AlmostEquals(lastObject.OriginalX, positions[0])); AddAssert("end position is correct", () => Precision.AlmostEquals(lastObject.EndX, positions[1])); - AddAssert("default slider velocity", () => lastObject.SliderVelocityBindable.IsDefault); + AddAssert("default slider velocity", () => lastObject.SliderVelocityMultiplierBindable.IsDefault); } [Test] @@ -76,7 +76,7 @@ namespace osu.Game.Rulesets.Catch.Tests.Editor addPlacementSteps(times, positions); addPathCheckStep(times, positions); - AddAssert("slider velocity changed", () => !lastObject.SliderVelocityBindable.IsDefault); + AddAssert("slider velocity changed", () => !lastObject.SliderVelocityMultiplierBindable.IsDefault); } [Test] diff --git a/osu.Game.Rulesets.Catch.Tests/Editor/TestSceneJuiceStreamSelectionBlueprint.cs b/osu.Game.Rulesets.Catch.Tests/Editor/TestSceneJuiceStreamSelectionBlueprint.cs index beba5811fe..05d7a38a95 100644 --- a/osu.Game.Rulesets.Catch.Tests/Editor/TestSceneJuiceStreamSelectionBlueprint.cs +++ b/osu.Game.Rulesets.Catch.Tests/Editor/TestSceneJuiceStreamSelectionBlueprint.cs @@ -108,11 +108,11 @@ namespace osu.Game.Rulesets.Catch.Tests.Editor double[] times = { 100, 300 }; float[] positions = { 200, 300 }; addBlueprintStep(times, positions); - AddAssert("default slider velocity", () => hitObject.SliderVelocityBindable.IsDefault); + AddAssert("default slider velocity", () => hitObject.SliderVelocityMultiplierBindable.IsDefault); addDragStartStep(times[1], positions[1]); AddMouseMoveStep(times[1], 400); - AddAssert("slider velocity changed", () => !hitObject.SliderVelocityBindable.IsDefault); + AddAssert("slider velocity changed", () => !hitObject.SliderVelocityMultiplierBindable.IsDefault); } [Test] diff --git a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs index 2c8ef9eae0..5e8a0b1216 100644 --- a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs +++ b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs @@ -43,7 +43,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps ComboOffset = comboData?.ComboOffset ?? 0, LegacyLastTickOffset = (obj as IHasLegacyLastTickOffset)?.LegacyLastTickOffset ?? 0, LegacyConvertedY = yPositionData?.Y ?? CatchHitObject.DEFAULT_LEGACY_CONVERT_Y, - SliderVelocity = sliderVelocityData?.SliderVelocity ?? 1 + SliderVelocityMultiplier = sliderVelocityData?.SliderVelocityMultiplier ?? 1 }.Yield(); case IHasDuration endTime: diff --git a/osu.Game.Rulesets.Catch/Edit/Blueprints/Components/EditablePath.cs b/osu.Game.Rulesets.Catch/Edit/Blueprints/Components/EditablePath.cs index 7a577f8a83..df76bf0a8c 100644 --- a/osu.Game.Rulesets.Catch/Edit/Blueprints/Components/EditablePath.cs +++ b/osu.Game.Rulesets.Catch/Edit/Blueprints/Components/EditablePath.cs @@ -91,7 +91,7 @@ namespace osu.Game.Rulesets.Catch.Edit.Blueprints.Components public void UpdateHitObjectFromPath(JuiceStream hitObject) { // The SV setting may need to be changed for the current path. - var svBindable = hitObject.SliderVelocityBindable; + var svBindable = hitObject.SliderVelocityMultiplierBindable; double svToVelocityFactor = hitObject.Velocity / svBindable.Value; double requiredVelocity = path.ComputeRequiredVelocity(); diff --git a/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs b/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs index 169e99c90c..724bdc3401 100644 --- a/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs +++ b/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs @@ -28,17 +28,17 @@ namespace osu.Game.Rulesets.Catch.Objects public int RepeatCount { get; set; } - public BindableNumber SliderVelocityBindable { get; } = new BindableDouble(1) + public BindableNumber SliderVelocityMultiplierBindable { get; } = new BindableDouble(1) { Precision = 0.01, MinValue = 0.1, MaxValue = 10 }; - public double SliderVelocity + public double SliderVelocityMultiplier { - get => SliderVelocityBindable.Value; - set => SliderVelocityBindable.Value = value; + get => SliderVelocityMultiplierBindable.Value; + set => SliderVelocityMultiplierBindable.Value = value; } [JsonIgnore] @@ -48,10 +48,10 @@ namespace osu.Game.Rulesets.Catch.Objects private double tickDistanceFactor; [JsonIgnore] - public double Velocity => velocityFactor * SliderVelocity; + public double Velocity => velocityFactor * SliderVelocityMultiplier; [JsonIgnore] - public double TickDistance => tickDistanceFactor * SliderVelocity; + public double TickDistance => tickDistanceFactor * SliderVelocityMultiplier; /// /// The length of one span of this . diff --git a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/DistanceObjectPatternGenerator.cs b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/DistanceObjectPatternGenerator.cs index 91b7be6e8f..49c1a055a6 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/DistanceObjectPatternGenerator.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/DistanceObjectPatternGenerator.cs @@ -53,7 +53,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy if (hitObject.LegacyBpmMultiplier.HasValue) beatLength = timingPoint.BeatLength * hitObject.LegacyBpmMultiplier.Value; else if (hitObject is IHasSliderVelocity hasSliderVelocity) - beatLength = timingPoint.BeatLength / hasSliderVelocity.SliderVelocity; + beatLength = timingPoint.BeatLength / hasSliderVelocity.SliderVelocityMultiplier; else beatLength = timingPoint.BeatLength; diff --git a/osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModAutoplay.cs b/osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModAutoplay.cs index 32028823ae..6980438b59 100644 --- a/osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModAutoplay.cs +++ b/osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModAutoplay.cs @@ -73,7 +73,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Mods new PathControlPoint(new Vector2(0, 6.25f)) }), RepeatCount = 1, - SliderVelocity = 10 + SliderVelocityMultiplier = 10 } } }, diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderFollowCircleInput.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderFollowCircleInput.cs index fc2e6d1f72..5adc50859f 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderFollowCircleInput.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderFollowCircleInput.cs @@ -46,7 +46,7 @@ namespace osu.Game.Rulesets.Osu.Tests { StartTime = time_slider_start, Position = new Vector2(0, 0), - SliderVelocity = velocity, + SliderVelocityMultiplier = velocity, Path = new SliderPath(PathType.Linear, new[] { Vector2.Zero, diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderInput.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderInput.cs index d83926ab9b..644524f532 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderInput.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderInput.cs @@ -349,7 +349,7 @@ namespace osu.Game.Rulesets.Osu.Tests { StartTime = time_slider_start, Position = new Vector2(0, 0), - SliderVelocity = 0.1f, + SliderVelocityMultiplier = 0.1f, Path = new SliderPath(PathType.PerfectCurve, new[] { Vector2.Zero, diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneStartTimeOrderedHitPolicy.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneStartTimeOrderedHitPolicy.cs index 909eb821cf..f0af3f0c39 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneStartTimeOrderedHitPolicy.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneStartTimeOrderedHitPolicy.cs @@ -451,7 +451,7 @@ namespace osu.Game.Rulesets.Osu.Tests { public TestSlider() { - SliderVelocity = 0.1f; + SliderVelocityMultiplier = 0.1f; DefaultsApplied += _ => { diff --git a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs index 9e786caf0c..f3aaf831d3 100644 --- a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs +++ b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs @@ -49,7 +49,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps // this results in more (or less) ticks being generated in h is Slider && h.GetEndTime() < HitObject.StartTime) as Slider)?.SliderVelocity; + .LastOrDefault(h => h is Slider && h.GetEndTime() < HitObject.StartTime) as Slider)?.SliderVelocityMultiplier; - HitObject.SliderVelocity = nearestSliderVelocity ?? 1; + HitObject.SliderVelocityMultiplier = nearestSliderVelocity ?? 1; HitObject.Position = ToLocalSpace(result.ScreenSpacePosition); // Replacing the DifficultyControlPoint above doesn't trigger any kind of invalidation. diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModStrictTracking.cs b/osu.Game.Rulesets.Osu/Mods/OsuModStrictTracking.cs index 72031b4958..9b5d405025 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModStrictTracking.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModStrictTracking.cs @@ -98,7 +98,7 @@ namespace osu.Game.Rulesets.Osu.Mods ComboOffset = original.ComboOffset; LegacyLastTickOffset = original.LegacyLastTickOffset; TickDistanceMultiplier = original.TickDistanceMultiplier; - SliderVelocity = original.SliderVelocity; + SliderVelocityMultiplier = original.SliderVelocityMultiplier; } protected override void CreateNestedHitObjects(CancellationToken cancellationToken) diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 9c0dda1ed3..1e7e8e2981 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -134,17 +134,17 @@ namespace osu.Game.Rulesets.Osu.Objects /// public bool OnlyJudgeNestedObjects = true; - public BindableNumber SliderVelocityBindable { get; } = new BindableDouble(1) + public BindableNumber SliderVelocityMultiplierBindable { get; } = new BindableDouble(1) { Precision = 0.01, MinValue = 0.1, MaxValue = 10 }; - public double SliderVelocity + public double SliderVelocityMultiplier { - get => SliderVelocityBindable.Value; - set => SliderVelocityBindable.Value = value; + get => SliderVelocityMultiplierBindable.Value; + set => SliderVelocityMultiplierBindable.Value = value; } public bool GenerateTicks { get; set; } = true; @@ -167,7 +167,7 @@ namespace osu.Game.Rulesets.Osu.Objects TimingControlPoint timingPoint = controlPointInfo.TimingPointAt(StartTime); - double scoringDistance = BASE_SCORING_DISTANCE * difficulty.SliderMultiplier * SliderVelocity; + double scoringDistance = BASE_SCORING_DISTANCE * difficulty.SliderMultiplier * SliderVelocityMultiplier; Velocity = scoringDistance / timingPoint.BeatLength; TickDistance = GenerateTicks ? (scoringDistance / difficulty.SliderTickRate * TickDistanceMultiplier) : double.PositiveInfinity; diff --git a/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs b/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs index 5f3d0f898e..3e9252e1fd 100644 --- a/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs +++ b/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs @@ -64,7 +64,7 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps { if (hitObject is not IHasSliderVelocity hasSliderVelocity) continue; - double nextScrollSpeed = hasSliderVelocity.SliderVelocity; + double nextScrollSpeed = hasSliderVelocity.SliderVelocityMultiplier; EffectControlPoint currentEffectPoint = converted.ControlPointInfo.EffectPointAt(hitObject.StartTime); if (!Precision.AlmostEquals(lastScrollSpeed, nextScrollSpeed, acceptableDifference: currentEffectPoint.ScrollSpeedBindable.Precision)) @@ -189,7 +189,7 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps if (obj.LegacyBpmMultiplier.HasValue) beatLength = timingPoint.BeatLength * obj.LegacyBpmMultiplier.Value; else if (obj is IHasSliderVelocity hasSliderVelocity) - beatLength = timingPoint.BeatLength / hasSliderVelocity.SliderVelocity; + beatLength = timingPoint.BeatLength / hasSliderVelocity.SliderVelocityMultiplier; else beatLength = timingPoint.BeatLength; diff --git a/osu.Game.Tests/Editing/TestSceneHitObjectComposerDistanceSnapping.cs b/osu.Game.Tests/Editing/TestSceneHitObjectComposerDistanceSnapping.cs index e30caac95e..6b78eea009 100644 --- a/osu.Game.Tests/Editing/TestSceneHitObjectComposerDistanceSnapping.cs +++ b/osu.Game.Tests/Editing/TestSceneHitObjectComposerDistanceSnapping.cs @@ -78,7 +78,7 @@ namespace osu.Game.Tests.Editing { assertSnapDistance(100, new Slider { - SliderVelocity = multiplier + SliderVelocityMultiplier = multiplier }, false); } @@ -88,7 +88,7 @@ namespace osu.Game.Tests.Editing { assertSnapDistance(100 * multiplier, new Slider { - SliderVelocity = multiplier + SliderVelocityMultiplier = multiplier }, true); } @@ -112,7 +112,7 @@ namespace osu.Game.Tests.Editing var referenceObject = new Slider { - SliderVelocity = slider_velocity + SliderVelocityMultiplier = slider_velocity }; assertSnapDistance(base_distance * slider_velocity, referenceObject, true); diff --git a/osu.Game.Tests/Visual/Editing/TestSceneHitObjectDifficultyPointAdjustments.cs b/osu.Game.Tests/Visual/Editing/TestSceneHitObjectDifficultyPointAdjustments.cs index c78f50c821..530b3db208 100644 --- a/osu.Game.Tests/Visual/Editing/TestSceneHitObjectDifficultyPointAdjustments.cs +++ b/osu.Game.Tests/Visual/Editing/TestSceneHitObjectDifficultyPointAdjustments.cs @@ -59,7 +59,7 @@ namespace osu.Game.Tests.Visual.Editing new PathControlPoint(new Vector2(100, 0)) } }, - SliderVelocity = 2 + SliderVelocityMultiplier = 2 }); }); } @@ -110,7 +110,7 @@ namespace osu.Game.Tests.Visual.Editing AddStep("unify slider velocity", () => { foreach (var h in EditorBeatmap.HitObjects.OfType()) - h.SliderVelocity = 1.5; + h.SliderVelocityMultiplier = 1.5; }); AddStep("select both objects", () => EditorBeatmap.SelectedHitObjects.AddRange(EditorBeatmap.HitObjects)); @@ -194,7 +194,7 @@ namespace osu.Game.Tests.Visual.Editing private void hitObjectHasVelocity(int objectIndex, double velocity) => AddAssert($"{objectIndex.ToOrdinalWords()} has velocity {velocity}", () => { var h = EditorBeatmap.HitObjects.ElementAt(objectIndex); - return h is IHasSliderVelocity hasSliderVelocity && hasSliderVelocity.SliderVelocity == velocity; + return h is IHasSliderVelocity hasSliderVelocity && hasSliderVelocity.SliderVelocityMultiplier == velocity; }); } } diff --git a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs index 5da51f6c8e..7c375b7604 100644 --- a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs @@ -111,7 +111,7 @@ namespace osu.Game.Beatmaps.Formats } if (hitObject is IHasSliderVelocity hasSliderVelocity) - hasSliderVelocity.SliderVelocity = difficultyControlPoint.SliderVelocity; + hasSliderVelocity.SliderVelocityMultiplier = difficultyControlPoint.SliderVelocity; hitObject.ApplyDefaults(beatmap.ControlPointInfo, beatmap.Difficulty); } diff --git a/osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs b/osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs index fc9de13c89..4f8e935ee4 100644 --- a/osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs @@ -269,7 +269,7 @@ namespace osu.Game.Beatmaps.Formats foreach (var hitObject in hitObjects) { if (hitObject is IHasSliderVelocity hasSliderVelocity) - yield return new DifficultyControlPoint { Time = hitObject.StartTime, SliderVelocity = hasSliderVelocity.SliderVelocity }; + yield return new DifficultyControlPoint { Time = hitObject.StartTime, SliderVelocity = hasSliderVelocity.SliderVelocityMultiplier }; } } diff --git a/osu.Game/Rulesets/Edit/DistancedHitObjectComposer.cs b/osu.Game/Rulesets/Edit/DistancedHitObjectComposer.cs index 817e8bd5fe..e08cb41a26 100644 --- a/osu.Game/Rulesets/Edit/DistancedHitObjectComposer.cs +++ b/osu.Game/Rulesets/Edit/DistancedHitObjectComposer.cs @@ -244,7 +244,7 @@ namespace osu.Game.Rulesets.Edit public virtual float GetBeatSnapDistanceAt(HitObject referenceObject, bool useReferenceSliderVelocity = true) { - return (float)(100 * (useReferenceSliderVelocity && referenceObject is IHasSliderVelocity hasSliderVelocity ? hasSliderVelocity.SliderVelocity : 1) * EditorBeatmap.Difficulty.SliderMultiplier * 1 + return (float)(100 * (useReferenceSliderVelocity && referenceObject is IHasSliderVelocity hasSliderVelocity ? hasSliderVelocity.SliderVelocityMultiplier : 1) * EditorBeatmap.Difficulty.SliderMultiplier * 1 / BeatSnapProvider.BeatDivisor); } diff --git a/osu.Game/Rulesets/Objects/Legacy/ConvertSlider.cs b/osu.Game/Rulesets/Objects/Legacy/ConvertSlider.cs index 7ddd372dc9..d91ecf956a 100644 --- a/osu.Game/Rulesets/Objects/Legacy/ConvertSlider.cs +++ b/osu.Game/Rulesets/Objects/Legacy/ConvertSlider.cs @@ -41,12 +41,12 @@ namespace osu.Game.Rulesets.Objects.Legacy public double Velocity = 1; - public BindableNumber SliderVelocityBindable { get; } = new BindableDouble(1); + public BindableNumber SliderVelocityMultiplierBindable { get; } = new BindableDouble(1); - public double SliderVelocity + public double SliderVelocityMultiplier { - get => SliderVelocityBindable.Value; - set => SliderVelocityBindable.Value = value; + get => SliderVelocityMultiplierBindable.Value; + set => SliderVelocityMultiplierBindable.Value = value; } protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, IBeatmapDifficultyInfo difficulty) @@ -55,7 +55,7 @@ namespace osu.Game.Rulesets.Objects.Legacy TimingControlPoint timingPoint = controlPointInfo.TimingPointAt(StartTime); - double scoringDistance = base_scoring_distance * difficulty.SliderMultiplier * SliderVelocity; + double scoringDistance = base_scoring_distance * difficulty.SliderMultiplier * SliderVelocityMultiplier; Velocity = scoringDistance / timingPoint.BeatLength; } diff --git a/osu.Game/Rulesets/Objects/Types/IHasSliderVelocity.cs b/osu.Game/Rulesets/Objects/Types/IHasSliderVelocity.cs index 80fd8dd8dc..e665dcc752 100644 --- a/osu.Game/Rulesets/Objects/Types/IHasSliderVelocity.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasSliderVelocity.cs @@ -13,8 +13,8 @@ namespace osu.Game.Rulesets.Objects.Types /// /// The slider velocity multiplier. /// - double SliderVelocity { get; set; } + double SliderVelocityMultiplier { get; set; } - BindableNumber SliderVelocityBindable { get; } + BindableNumber SliderVelocityMultiplierBindable { get; } } } diff --git a/osu.Game/Screens/Edit/Compose/Components/HitObjectInspector.cs b/osu.Game/Screens/Edit/Compose/Components/HitObjectInspector.cs index 7beaf7d086..ac339dc9d9 100644 --- a/osu.Game/Screens/Edit/Compose/Components/HitObjectInspector.cs +++ b/osu.Game/Screens/Edit/Compose/Components/HitObjectInspector.cs @@ -73,7 +73,7 @@ namespace osu.Game.Screens.Edit.Compose.Components if (selected is IHasSliderVelocity sliderVelocity) { AddHeader("Slider Velocity"); - AddValue($"{sliderVelocity.SliderVelocity:#,0.00}x ({sliderVelocity.SliderVelocity * EditorBeatmap.Difficulty.SliderMultiplier:#,0.00}x)"); + AddValue($"{sliderVelocity.SliderVelocityMultiplier:#,0.00}x ({sliderVelocity.SliderVelocityMultiplier * EditorBeatmap.Difficulty.SliderMultiplier:#,0.00}x)"); } if (selected is IHasRepeats repeats) diff --git a/osu.Game/Screens/Edit/Compose/Components/Timeline/DifficultyPointPiece.cs b/osu.Game/Screens/Edit/Compose/Components/Timeline/DifficultyPointPiece.cs index 99fb2ab874..ca1e9a5d9b 100644 --- a/osu.Game/Screens/Edit/Compose/Components/Timeline/DifficultyPointPiece.cs +++ b/osu.Game/Screens/Edit/Compose/Components/Timeline/DifficultyPointPiece.cs @@ -34,7 +34,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline { HitObject = hitObject; - speedMultiplier = (hitObject as IHasSliderVelocity)?.SliderVelocityBindable.GetBoundCopy(); + speedMultiplier = (hitObject as IHasSliderVelocity)?.SliderVelocityMultiplierBindable.GetBoundCopy(); } protected override Color4 GetRepresentingColour(OsuColour colours) => colours.Lime1; @@ -106,8 +106,8 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline var relevantObjects = (beatmap.SelectedHitObjects.Contains(hitObject) ? beatmap.SelectedHitObjects : hitObject.Yield()).Where(o => o is IHasSliderVelocity).ToArray(); // even if there are multiple objects selected, we can still display a value if they all have the same value. - var selectedPointBindable = relevantObjects.Select(point => ((IHasSliderVelocity)point).SliderVelocity).Distinct().Count() == 1 - ? ((IHasSliderVelocity)relevantObjects.First()).SliderVelocityBindable + var selectedPointBindable = relevantObjects.Select(point => ((IHasSliderVelocity)point).SliderVelocityMultiplier).Distinct().Count() == 1 + ? ((IHasSliderVelocity)relevantObjects.First()).SliderVelocityMultiplierBindable : null; if (selectedPointBindable != null) @@ -127,7 +127,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline foreach (var h in relevantObjects) { - ((IHasSliderVelocity)h).SliderVelocity = val.NewValue.Value; + ((IHasSliderVelocity)h).SliderVelocityMultiplier = val.NewValue.Value; beatmap.Update(h); } @@ -169,7 +169,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline InspectorText.Clear(); - double[] sliderVelocities = EditorBeatmap.HitObjects.OfType().Select(sv => sv.SliderVelocity).OrderBy(v => v).ToArray(); + double[] sliderVelocities = EditorBeatmap.HitObjects.OfType().Select(sv => sv.SliderVelocityMultiplier).OrderBy(v => v).ToArray(); AddHeader("Base velocity (from beatmap setup)"); AddValue($"{beatmapVelocity:#,0.00}x"); diff --git a/osu.Game/Screens/Edit/Compose/Components/Timeline/TimelineHitObjectBlueprint.cs b/osu.Game/Screens/Edit/Compose/Components/Timeline/TimelineHitObjectBlueprint.cs index 55f122669d..77afad2d4f 100644 --- a/osu.Game/Screens/Edit/Compose/Components/Timeline/TimelineHitObjectBlueprint.cs +++ b/osu.Game/Screens/Edit/Compose/Components/Timeline/TimelineHitObjectBlueprint.cs @@ -395,12 +395,12 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline if (e.CurrentState.Keyboard.ShiftPressed && hitObject is IHasSliderVelocity hasSliderVelocity) { - double newVelocity = hasSliderVelocity.SliderVelocity * (repeatHitObject.Duration / proposedDuration); + double newVelocity = hasSliderVelocity.SliderVelocityMultiplier * (repeatHitObject.Duration / proposedDuration); - if (Precision.AlmostEquals(newVelocity, hasSliderVelocity.SliderVelocity)) + if (Precision.AlmostEquals(newVelocity, hasSliderVelocity.SliderVelocityMultiplier)) return; - hasSliderVelocity.SliderVelocity = newVelocity; + hasSliderVelocity.SliderVelocityMultiplier = newVelocity; beatmap.Update(hitObject); } else diff --git a/osu.Game/Screens/Edit/LegacyEditorBeatmapPatcher.cs b/osu.Game/Screens/Edit/LegacyEditorBeatmapPatcher.cs index 565379f391..fe0d4a7822 100644 --- a/osu.Game/Screens/Edit/LegacyEditorBeatmapPatcher.cs +++ b/osu.Game/Screens/Edit/LegacyEditorBeatmapPatcher.cs @@ -114,7 +114,7 @@ namespace osu.Game.Screens.Edit continue; if (oldObject is IHasSliderVelocity oldWithVelocity && newObject is IHasSliderVelocity newWithVelocity) - oldWithVelocity.SliderVelocity = newWithVelocity.SliderVelocity; + oldWithVelocity.SliderVelocityMultiplier = newWithVelocity.SliderVelocityMultiplier; oldObject.Samples = newObject.Samples; From dce6adb8955e4f660e96b3687e9a6dfdf08ca752 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 7 Sep 2023 01:23:56 +0900 Subject: [PATCH 3/5] Add text explanation of icons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bartłomiej Dach --- osu.Game/Skinning/Skin.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Skinning/Skin.cs b/osu.Game/Skinning/Skin.cs index d979cab72b..5bc5549889 100644 --- a/osu.Game/Skinning/Skin.cs +++ b/osu.Game/Skinning/Skin.cs @@ -260,11 +260,11 @@ namespace osu.Game.Skinning switch (type) { case LookupDebugType.Hit: - icon = "🟢"; + icon = "🟢 hit"; break; case LookupDebugType.Miss: - icon = "🔴"; + icon = "🔴 miss"; break; case LookupDebugType.Enter: From f9db0fad8871b9f052544d682579b101d158a26b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 6 Sep 2023 17:57:26 +0200 Subject: [PATCH 4/5] Ignore unused thing inspection harder --- osu.Game/Skinning/LegacySkin.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index f286dfb776..98e2d3e862 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using JetBrains.Annotations; @@ -82,9 +83,9 @@ namespace osu.Game.Skinning } } + [SuppressMessage("ReSharper", "RedundantAssignment")] // for `wasHit` assignments used in `finally` debug logic public override IBindable? GetConfig(TLookup lookup) { - // ReSharper disable once RedundantAssignment (used in `finally` debug logic) bool wasHit = true; try From fe3683ed5b2d977fd14d49697cdef3b0df33f0b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 6 Sep 2023 17:46:42 +0200 Subject: [PATCH 5/5] Adjust formatting slightly The uneven spacing was bothering me... --- osu.Game/Skinning/Skin.cs | 2 +- osu.Game/Skinning/SkinProvidingContainer.cs | 2 +- osu.Game/Skinning/SkinTransformer.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Skinning/Skin.cs b/osu.Game/Skinning/Skin.cs index 5bc5549889..659edc6f5f 100644 --- a/osu.Game/Skinning/Skin.cs +++ b/osu.Game/Skinning/Skin.cs @@ -247,7 +247,7 @@ namespace osu.Game.Skinning #endregion - public override string ToString() => $"{GetType().ReadableName()}{{ Name: {Name} }}"; + public override string ToString() => $"{GetType().ReadableName()} {{ Name: {Name} }}"; private static readonly ThreadLocal nested_level = new ThreadLocal(() => 0); diff --git a/osu.Game/Skinning/SkinProvidingContainer.cs b/osu.Game/Skinning/SkinProvidingContainer.cs index 2d2a2e48f6..acb15da80e 100644 --- a/osu.Game/Skinning/SkinProvidingContainer.cs +++ b/osu.Game/Skinning/SkinProvidingContainer.cs @@ -310,7 +310,7 @@ namespace osu.Game.Skinning } } - public override string ToString() => $"{GetType().ReadableName()}{{ skin: {skin} }}"; + public override string ToString() => $"{GetType().ReadableName()} {{ Skin: {skin} }}"; } } } diff --git a/osu.Game/Skinning/SkinTransformer.cs b/osu.Game/Skinning/SkinTransformer.cs index 4e7dd4f222..95572aa7b1 100644 --- a/osu.Game/Skinning/SkinTransformer.cs +++ b/osu.Game/Skinning/SkinTransformer.cs @@ -47,6 +47,6 @@ namespace osu.Game.Skinning } } - public override string ToString() => $"{nameof(SkinTransformer)}{{ Skin: {Skin} }}"; + public override string ToString() => $"{nameof(SkinTransformer)} {{ Skin: {Skin} }}"; } }