From b8308b971545ba7589b66aa74fed01acc80febc9 Mon Sep 17 00:00:00 2001 From: Roxie is Flux3on <28934062+Flux3on@users.noreply.github.com> Date: Sun, 24 Oct 2021 15:28:38 -0700 Subject: [PATCH 1/9] Corrected spinner judgement positions. For some reason, spinner judgements would stack from the top left in an awkward fashion. This patch ensures that the judgement location will always be in the centre of the screen. --- .../Objects/Drawables/DrawableOsuJudgement.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs index e4df41a4fe..4762285b37 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs @@ -39,7 +39,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables if (JudgedObject?.HitObject is OsuHitObject osuObject) { - Position = osuObject.StackedEndPosition; + if (JudgedObject?.HitObject is Spinner) + { + Position = osuObject.Position; + } else + { + Position = osuObject.StackedEndPosition; + } Scale = new Vector2(osuObject.Scale); } } From 386910ca2ed4998c4a2c3b56b0e9078bce636b44 Mon Sep 17 00:00:00 2001 From: Roxie is Flux3on <28934062+Flux3on@users.noreply.github.com> Date: Sun, 24 Oct 2021 15:29:47 -0700 Subject: [PATCH 2/9] Cut amount of code down for the spinner judgement fix --- .../Objects/Drawables/DrawableOsuJudgement.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs index 4762285b37..79b8320136 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs @@ -40,12 +40,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables if (JudgedObject?.HitObject is OsuHitObject osuObject) { if (JudgedObject?.HitObject is Spinner) - { Position = osuObject.Position; - } else - { + else Position = osuObject.StackedEndPosition; - } Scale = new Vector2(osuObject.Scale); } } From 861cd4852a41ad12de76604860e2c88ee2e06089 Mon Sep 17 00:00:00 2001 From: Roxie is Flux3on <28934062+Flux3on@users.noreply.github.com> Date: Sun, 24 Oct 2021 18:14:37 -0700 Subject: [PATCH 3/9] Made StackedEndPosition virtual Done to allow overriding in the other object classes. --- osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs index 7c45b2bc07..a9b4027ea7 100644 --- a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs @@ -49,7 +49,7 @@ namespace osu.Game.Rulesets.Osu.Objects public virtual Vector2 EndPosition => Position; - public Vector2 StackedEndPosition => EndPosition + StackOffset; + public virtual Vector2 StackedEndPosition => EndPosition + StackOffset; public readonly Bindable StackHeightBindable = new Bindable(); From a8e3d0baccdbda1da28a4821dc89c620565ba8e9 Mon Sep 17 00:00:00 2001 From: Roxie is Flux3on <28934062+Flux3on@users.noreply.github.com> Date: Sun, 24 Oct 2021 18:15:40 -0700 Subject: [PATCH 4/9] Added an override for StackedEndPosition This ensures the spinner's hit judgement will always be centre instead of in the top left corner. --- osu.Game.Rulesets.Osu/Objects/Spinner.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game.Rulesets.Osu/Objects/Spinner.cs b/osu.Game.Rulesets.Osu/Objects/Spinner.cs index f85dc0d391..efaea88674 100644 --- a/osu.Game.Rulesets.Osu/Objects/Spinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Spinner.cs @@ -8,6 +8,7 @@ using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Osu.Judgements; using osu.Game.Rulesets.Scoring; +using osuTK; namespace osu.Game.Rulesets.Osu.Objects { @@ -31,6 +32,8 @@ namespace osu.Game.Rulesets.Osu.Objects /// public int MaximumBonusSpins { get; protected set; } = 1; + public override Vector2 StackedEndPosition => EndPosition; + protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, IBeatmapDifficultyInfo difficulty) { base.ApplyDefaultsToSelf(controlPointInfo, difficulty); From 0c57453f4d5adb7d374775879e2b38a47c61306c Mon Sep 17 00:00:00 2001 From: Roxie is Flux3on <28934062+Flux3on@users.noreply.github.com> Date: Sun, 24 Oct 2021 18:16:14 -0700 Subject: [PATCH 5/9] Reverted special case code changes As requested by @frenzibyte --- .../Objects/Drawables/DrawableOsuJudgement.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs index 79b8320136..e4df41a4fe 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs @@ -39,10 +39,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables if (JudgedObject?.HitObject is OsuHitObject osuObject) { - if (JudgedObject?.HitObject is Spinner) - Position = osuObject.Position; - else - Position = osuObject.StackedEndPosition; + Position = osuObject.StackedEndPosition; Scale = new Vector2(osuObject.Scale); } } From 27d4201dae129e8ad27ed8522b29b500e40d5ccd Mon Sep 17 00:00:00 2001 From: Roxie Wattz Date: Sun, 24 Oct 2021 19:42:37 -0700 Subject: [PATCH 6/9] Added a spinner spam test Shoutout to Echo for making Wizards in Winter x3 --- .../TestSceneSpinnerSpam.cs | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 osu.Game.Rulesets.Osu.Tests/TestSceneSpinnerSpam.cs diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSpinnerSpam.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSpinnerSpam.cs new file mode 100644 index 0000000000..26729979f9 --- /dev/null +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSpinnerSpam.cs @@ -0,0 +1,35 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System; +using NUnit.Framework; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Osu.Objects; +using osuTK; + +namespace osu.Game.Rulesets.Osu.Tests +{ + [TestFixture] + public class TestSceneSpinnerSpam : TestSceneOsuPlayer + { + protected override IBeatmap CreateBeatmap(RulesetInfo ruleset) + { + var beatmap = new Beatmap + { + BeatmapInfo = new BeatmapInfo + { + BaseDifficulty = new BeatmapDifficulty { OverallDifficulty = 10 }, + Ruleset = ruleset + } + }; + + for (int i = 0; i < 512; i++) + { + if (i % 32 < 20) + beatmap.HitObjects.Add(new Spinner { Position = new Vector2(256, 192), StartTime = i * 200, EndTime = (i * 200) + 100 }); + } + + return beatmap; + } + } +} From 3687f830e8d12f49ad33b49fb7d2792408bcf7b2 Mon Sep 17 00:00:00 2001 From: Roxie Wattz Date: Mon, 25 Oct 2021 16:57:07 -0700 Subject: [PATCH 7/9] Rename my test scene As requested by bdach --- .../{TestSceneSpinnerSpam.cs => TestSceneNoSpinnerStacking.cs} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename osu.Game.Rulesets.Osu.Tests/{TestSceneSpinnerSpam.cs => TestSceneNoSpinnerStacking.cs} (93%) diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSpinnerSpam.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneNoSpinnerStacking.cs similarity index 93% rename from osu.Game.Rulesets.Osu.Tests/TestSceneSpinnerSpam.cs rename to osu.Game.Rulesets.Osu.Tests/TestSceneNoSpinnerStacking.cs index 26729979f9..52597385bb 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneSpinnerSpam.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneNoSpinnerStacking.cs @@ -10,7 +10,7 @@ using osuTK; namespace osu.Game.Rulesets.Osu.Tests { [TestFixture] - public class TestSceneSpinnerSpam : TestSceneOsuPlayer + public class TestSceneNoSpinnerStacking : TestSceneOsuPlayer { protected override IBeatmap CreateBeatmap(RulesetInfo ruleset) { From cf7fbf4b635e5803ddf55036fb705ae5c9420fcf Mon Sep 17 00:00:00 2001 From: Roxie Wattz Date: Mon, 25 Oct 2021 17:15:43 -0700 Subject: [PATCH 8/9] updated bdach's suggestion --- osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs | 4 ++-- osu.Game.Rulesets.Osu/Objects/Spinner.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs index a9b4027ea7..8b7de9e109 100644 --- a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs @@ -49,7 +49,7 @@ namespace osu.Game.Rulesets.Osu.Objects public virtual Vector2 EndPosition => Position; - public virtual Vector2 StackedEndPosition => EndPosition + StackOffset; + public Vector2 StackedEndPosition => EndPosition + StackOffset; public readonly Bindable StackHeightBindable = new Bindable(); @@ -59,7 +59,7 @@ namespace osu.Game.Rulesets.Osu.Objects set => StackHeightBindable.Value = value; } - public Vector2 StackOffset => new Vector2(StackHeight * Scale * -6.4f); + public virtual Vector2 StackOffset => new Vector2(StackHeight * Scale * -6.4f); public double Radius => OBJECT_RADIUS * Scale; diff --git a/osu.Game.Rulesets.Osu/Objects/Spinner.cs b/osu.Game.Rulesets.Osu/Objects/Spinner.cs index efaea88674..0ad8e4ea68 100644 --- a/osu.Game.Rulesets.Osu/Objects/Spinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Spinner.cs @@ -32,7 +32,7 @@ namespace osu.Game.Rulesets.Osu.Objects /// public int MaximumBonusSpins { get; protected set; } = 1; - public override Vector2 StackedEndPosition => EndPosition; + public override Vector2 StackOffset => Vector2.Zero; protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, IBeatmapDifficultyInfo difficulty) { From 0a56e22fa0da644e69c3a692960928b7dd9cc5e3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 29 Oct 2021 12:14:14 +0900 Subject: [PATCH 9/9] Remove unused using statement --- osu.Game.Rulesets.Osu.Tests/TestSceneNoSpinnerStacking.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneNoSpinnerStacking.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneNoSpinnerStacking.cs index 52597385bb..ef05bcd320 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneNoSpinnerStacking.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneNoSpinnerStacking.cs @@ -1,7 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System; using NUnit.Framework; using osu.Game.Beatmaps; using osu.Game.Rulesets.Osu.Objects;