Skip to content

Commit

Permalink
Only transform the user's skin, not all fallbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Sep 30, 2024
1 parent 52136f0 commit 485eb19
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
24 changes: 4 additions & 20 deletions osu.Game/Skinning/RulesetSkinProvidingContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,28 +67,12 @@ protected override void RefreshSources()
// 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.
if (ParentSource is SkinManager skinManager)
sources.Add(GetRulesetTransformedSkin(skinManager.CurrentSkin.Value));

// 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);
}
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Skinning/SkinManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public IEnumerable<ISkin> AllSources
// 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)
Expand Down

0 comments on commit 485eb19

Please sign in to comment.