diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneCursorTrail.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneCursorTrail.cs index afb0246b21..4db66fde4b 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneCursorTrail.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneCursorTrail.cs @@ -49,7 +49,7 @@ public void TestLegacySmoothCursorTrail() { createTest(() => { - var skinContainer = new LegacySkinContainer(renderer, false); + var skinContainer = new LegacySkinContainer(renderer, provideMiddle: false); var legacyCursorTrail = new LegacyCursorTrail(skinContainer); skinContainer.Child = legacyCursorTrail; @@ -63,7 +63,7 @@ public void TestLegacyDisjointCursorTrail() { createTest(() => { - var skinContainer = new LegacySkinContainer(renderer, true); + var skinContainer = new LegacySkinContainer(renderer, provideMiddle: true); var legacyCursorTrail = new LegacyCursorTrail(skinContainer); skinContainer.Child = legacyCursorTrail; @@ -77,7 +77,7 @@ public void TestLegacyDisjointCursorTrailViaNoCursor() { createTest(() => { - var skinContainer = new LegacySkinContainer(renderer, false, false); + var skinContainer = new LegacySkinContainer(renderer, provideMiddle: false, provideCursor: false); var legacyCursorTrail = new LegacyCursorTrail(skinContainer); skinContainer.Child = legacyCursorTrail; @@ -104,13 +104,13 @@ private void createTest(Func createContent) => AddStep("create trail", private partial class LegacySkinContainer : Container, ISkinSource { private readonly IRenderer renderer; - private readonly bool disjoint; + private readonly bool provideMiddle; private readonly bool provideCursor; - public LegacySkinContainer(IRenderer renderer, bool disjoint, bool provideCursor = true) + public LegacySkinContainer(IRenderer renderer, bool provideMiddle, bool provideCursor = true) { this.renderer = renderer; - this.disjoint = disjoint; + this.provideMiddle = provideMiddle; this.provideCursor = provideCursor; RelativeSizeAxes = Axes.Both; @@ -129,7 +129,7 @@ public Texture GetTexture(string componentName, WrapMode wrapModeS, WrapMode wra return new Texture(renderer.WhitePixel); case "cursormiddle": - return disjoint ? null : renderer.WhitePixel; + return provideMiddle ? null : renderer.WhitePixel; } return null; diff --git a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursorTrail.cs b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursorTrail.cs index da52956719..ca0002d8c0 100644 --- a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursorTrail.cs +++ b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursorTrail.cs @@ -37,6 +37,9 @@ private void load(OsuConfigManager config, ISkinSource skinSource) Texture = skin.GetTexture("cursortrail"); + // Cursor and cursor trail components are sourced from potentially different skin sources. + // Stable always chooses cursor trail disjoint behaviour based on the cursor texture lookup source, so we need to fetch where that occurred. + // See https://github.com/peppy/osu-stable-reference/blob/3ea48705eb67172c430371dcfc8a16a002ed0d3d/osu!/Graphics/Skinning/SkinManager.cs#L269 var cursorProvider = skinSource.FindProvider(s => s.GetTexture("cursor") != null); DisjointTrail = cursorProvider?.GetTexture("cursormiddle") == null;