mirror of
https://github.com/ppy/osu.git
synced 2026-05-31 03:11:22 +08:00
Remove flag blocking parent lookups from a SkinProvidingContainer
I can't find a valid reason for this to exist.
This commit is contained in:
@@ -31,12 +31,6 @@ namespace osu.Game.Skinning
|
||||
[CanBeNull]
|
||||
private readonly ISkin beatmapSkin;
|
||||
|
||||
/// <remarks>
|
||||
/// This container already re-exposes all parent <see cref="ISkinSource"/> sources in a ruleset-usable form.
|
||||
/// Therefore disallow falling back to any parent <see cref="ISkinSource"/> any further.
|
||||
/// </remarks>
|
||||
protected override bool AllowFallingBackToParent => false;
|
||||
|
||||
protected override Container<Drawable> Content { get; } = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
|
||||
@@ -30,11 +30,6 @@ namespace osu.Game.Skinning
|
||||
|
||||
protected ISkinSource? ParentSource { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether falling back to parent <see cref="ISkinSource"/>s is allowed in this container.
|
||||
/// </summary>
|
||||
protected virtual bool AllowFallingBackToParent => true;
|
||||
|
||||
protected virtual bool AllowDrawableLookup(ISkinComponentLookup lookup) => true;
|
||||
|
||||
protected virtual bool AllowTextureLookup(string componentName) => true;
|
||||
@@ -93,9 +88,6 @@ namespace osu.Game.Skinning
|
||||
return skin;
|
||||
}
|
||||
|
||||
if (!AllowFallingBackToParent)
|
||||
return null;
|
||||
|
||||
return ParentSource?.FindProvider(lookupFunction);
|
||||
}
|
||||
|
||||
@@ -106,7 +98,7 @@ namespace osu.Game.Skinning
|
||||
foreach (var i in skinSources)
|
||||
yield return i.skin;
|
||||
|
||||
if (AllowFallingBackToParent && ParentSource != null)
|
||||
if (ParentSource != null)
|
||||
{
|
||||
foreach (var skin in ParentSource.AllSources)
|
||||
yield return skin;
|
||||
@@ -123,9 +115,6 @@ namespace osu.Game.Skinning
|
||||
return sourceDrawable;
|
||||
}
|
||||
|
||||
if (!AllowFallingBackToParent)
|
||||
return null;
|
||||
|
||||
return ParentSource?.GetDrawableComponent(lookup);
|
||||
}
|
||||
|
||||
@@ -138,9 +127,6 @@ namespace osu.Game.Skinning
|
||||
return sourceTexture;
|
||||
}
|
||||
|
||||
if (!AllowFallingBackToParent)
|
||||
return null;
|
||||
|
||||
return ParentSource?.GetTexture(componentName, wrapModeS, wrapModeT);
|
||||
}
|
||||
|
||||
@@ -153,9 +139,6 @@ namespace osu.Game.Skinning
|
||||
return sourceSample;
|
||||
}
|
||||
|
||||
if (!AllowFallingBackToParent)
|
||||
return null;
|
||||
|
||||
return ParentSource?.GetSample(sampleInfo);
|
||||
}
|
||||
|
||||
@@ -174,9 +157,6 @@ namespace osu.Game.Skinning
|
||||
return bindable;
|
||||
}
|
||||
|
||||
if (!AllowFallingBackToParent)
|
||||
return null;
|
||||
|
||||
return ParentSource?.GetConfig<TLookup, TValue>(lookup);
|
||||
}
|
||||
finally
|
||||
|
||||
Reference in New Issue
Block a user