1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-18 14:03:07 +08:00

Only transform the user's skin, not all fallbacks

This commit is contained in:
Dean Herbert 2024-09-30 18:15:21 +09:00
parent 613379d2ca
commit 96d1b09312
No known key found for this signature in database
3 changed files with 7 additions and 23 deletions

View File

@ -28,7 +28,7 @@ namespace osu.Game.Rulesets.Catch.Tests
CreateTest();
}
AddAssert("legacy HUD combo counter not added", () => !Player.ChildrenOfType<LegacyDefaultComboCounter>().Any());
AddAssert("legacy HUD combo counter not added", () => Player.ChildrenOfType<LegacyDefaultComboCounter>(), () => Is.Empty);
}
}
}

View File

@ -4,7 +4,6 @@
#nullable disable
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using JetBrains.Annotations;
using osu.Framework.Allocation;
@ -67,28 +66,13 @@ namespace osu.Game.Skinning
// Populate a local list first so we can adjust the returned order as we go.
var sources = new List<ISkin>();
Debug.Assert(ParentSource != null);
foreach (var source in ParentSource.AllSources)
{
switch (source)
{
case Skin skin:
sources.Add(GetRulesetTransformedSkin(skin));
break;
}
}
// TODO: check
int lastDefaultSkinIndex = sources.IndexOf(sources.OfType<TrianglesSkin>().LastOrDefault());
// We want to transform the current user's skin for the current ruleset.
// Assume it's the first skin provided by the parent source (generally the case for both SkinManager and tests).
if (ParentSource?.AllSources.FirstOrDefault() is ISkin skin)
sources.Add(GetRulesetTransformedSkin(skin));
// Ruleset resources should be given the ability to override game-wide defaults
// This is achieved by placing them before the last instance of DefaultSkin.
// Note that DefaultSkin may not be present in some test scenes.
if (lastDefaultSkinIndex >= 0)
sources.Insert(lastDefaultSkinIndex, rulesetResourcesSkin);
else
sources.Add(rulesetResourcesSkin);
sources.Add(rulesetResourcesSkin);
SetSources(sources);
}

View File

@ -256,7 +256,7 @@ namespace osu.Game.Skinning
// This handles cases where a user skin doesn't have the required resources for complete display of
// certain elements.
if (CurrentSkin.Value is LegacySkin && CurrentSkin.Value != DefaultClassicSkin)
if (CurrentSkin.Value != DefaultClassicSkin)
yield return DefaultClassicSkin;
if (CurrentSkin.Value != trianglesSkin)