mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 04:52:57 +08:00
Rename SkinComponentsContainerLookup
to GlobalSkinnableContainerLookup
This commit is contained in:
parent
41756520b1
commit
f37cab0c6e
@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
|
||||
{
|
||||
switch (lookup)
|
||||
{
|
||||
case SkinComponentsContainerLookup containerLookup:
|
||||
case GlobalSkinnableContainerLookup containerLookup:
|
||||
// Only handle per ruleset defaults here.
|
||||
if (containerLookup.Ruleset == null)
|
||||
return base.GetDrawableComponent(lookup);
|
||||
@ -46,7 +46,7 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
|
||||
// Our own ruleset components default.
|
||||
switch (containerLookup.Target)
|
||||
{
|
||||
case SkinComponentsContainerLookup.TargetArea.MainHUDComponents:
|
||||
case GlobalSkinnableContainerLookup.GlobalSkinnableContainers.MainHUDComponents:
|
||||
// todo: remove CatchSkinComponents.CatchComboCounter and refactor LegacyCatchComboCounter to be added here instead.
|
||||
return new DefaultSkinComponentsContainer(container =>
|
||||
{
|
||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon
|
||||
{
|
||||
switch (lookup)
|
||||
{
|
||||
case SkinComponentsContainerLookup containerLookup:
|
||||
case GlobalSkinnableContainerLookup containerLookup:
|
||||
// Only handle per ruleset defaults here.
|
||||
if (containerLookup.Ruleset == null)
|
||||
return base.GetDrawableComponent(lookup);
|
||||
@ -39,7 +39,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon
|
||||
|
||||
switch (containerLookup.Target)
|
||||
{
|
||||
case SkinComponentsContainerLookup.TargetArea.MainHUDComponents:
|
||||
case GlobalSkinnableContainerLookup.GlobalSkinnableContainers.MainHUDComponents:
|
||||
return new DefaultSkinComponentsContainer(container =>
|
||||
{
|
||||
var combo = container.ChildrenOfType<ArgonManiaComboCounter>().FirstOrDefault();
|
||||
|
@ -80,7 +80,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
|
||||
{
|
||||
switch (lookup)
|
||||
{
|
||||
case SkinComponentsContainerLookup containerLookup:
|
||||
case GlobalSkinnableContainerLookup containerLookup:
|
||||
// Modifications for global components.
|
||||
if (containerLookup.Ruleset == null)
|
||||
return base.GetDrawableComponent(lookup);
|
||||
@ -95,7 +95,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
|
||||
|
||||
switch (containerLookup.Target)
|
||||
{
|
||||
case SkinComponentsContainerLookup.TargetArea.MainHUDComponents:
|
||||
case GlobalSkinnableContainerLookup.GlobalSkinnableContainers.MainHUDComponents:
|
||||
return new DefaultSkinComponentsContainer(container =>
|
||||
{
|
||||
var combo = container.ChildrenOfType<LegacyManiaComboCounter>().FirstOrDefault();
|
||||
|
@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
||||
{
|
||||
switch (lookup)
|
||||
{
|
||||
case SkinComponentsContainerLookup containerLookup:
|
||||
case GlobalSkinnableContainerLookup containerLookup:
|
||||
// Only handle per ruleset defaults here.
|
||||
if (containerLookup.Ruleset == null)
|
||||
return base.GetDrawableComponent(lookup);
|
||||
@ -60,7 +60,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
||||
// Our own ruleset components default.
|
||||
switch (containerLookup.Target)
|
||||
{
|
||||
case SkinComponentsContainerLookup.TargetArea.MainHUDComponents:
|
||||
case GlobalSkinnableContainerLookup.GlobalSkinnableContainers.MainHUDComponents:
|
||||
return new DefaultSkinComponentsContainer(container =>
|
||||
{
|
||||
var keyCounter = container.OfType<LegacyKeyCounterDisplay>().FirstOrDefault();
|
||||
|
@ -107,7 +107,7 @@ namespace osu.Game.Tests.Skins
|
||||
var skin = new TestSkin(new SkinInfo(), null, storage);
|
||||
|
||||
Assert.That(skin.LayoutInfos, Has.Count.EqualTo(2));
|
||||
Assert.That(skin.LayoutInfos[SkinComponentsContainerLookup.TargetArea.MainHUDComponents].AllDrawables.ToArray(), Has.Length.EqualTo(9));
|
||||
Assert.That(skin.LayoutInfos[GlobalSkinnableContainerLookup.GlobalSkinnableContainers.MainHUDComponents].AllDrawables.ToArray(), Has.Length.EqualTo(9));
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,8 +120,8 @@ namespace osu.Game.Tests.Skins
|
||||
var skin = new TestSkin(new SkinInfo(), null, storage);
|
||||
|
||||
Assert.That(skin.LayoutInfos, Has.Count.EqualTo(2));
|
||||
Assert.That(skin.LayoutInfos[SkinComponentsContainerLookup.TargetArea.MainHUDComponents].AllDrawables.ToArray(), Has.Length.EqualTo(10));
|
||||
Assert.That(skin.LayoutInfos[SkinComponentsContainerLookup.TargetArea.MainHUDComponents].AllDrawables.Select(i => i.Type), Contains.Item(typeof(PlayerName)));
|
||||
Assert.That(skin.LayoutInfos[GlobalSkinnableContainerLookup.GlobalSkinnableContainers.MainHUDComponents].AllDrawables.ToArray(), Has.Length.EqualTo(10));
|
||||
Assert.That(skin.LayoutInfos[GlobalSkinnableContainerLookup.GlobalSkinnableContainers.MainHUDComponents].AllDrawables.Select(i => i.Type), Contains.Item(typeof(PlayerName)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -134,10 +134,10 @@ namespace osu.Game.Tests.Skins
|
||||
var skin = new TestSkin(new SkinInfo(), null, storage);
|
||||
|
||||
Assert.That(skin.LayoutInfos, Has.Count.EqualTo(2));
|
||||
Assert.That(skin.LayoutInfos[SkinComponentsContainerLookup.TargetArea.MainHUDComponents].AllDrawables.ToArray(), Has.Length.EqualTo(6));
|
||||
Assert.That(skin.LayoutInfos[SkinComponentsContainerLookup.TargetArea.SongSelect].AllDrawables.ToArray(), Has.Length.EqualTo(1));
|
||||
Assert.That(skin.LayoutInfos[GlobalSkinnableContainerLookup.GlobalSkinnableContainers.MainHUDComponents].AllDrawables.ToArray(), Has.Length.EqualTo(6));
|
||||
Assert.That(skin.LayoutInfos[GlobalSkinnableContainerLookup.GlobalSkinnableContainers.SongSelect].AllDrawables.ToArray(), Has.Length.EqualTo(1));
|
||||
|
||||
var skinnableInfo = skin.LayoutInfos[SkinComponentsContainerLookup.TargetArea.SongSelect].AllDrawables.First();
|
||||
var skinnableInfo = skin.LayoutInfos[GlobalSkinnableContainerLookup.GlobalSkinnableContainers.SongSelect].AllDrawables.First();
|
||||
|
||||
Assert.That(skinnableInfo.Type, Is.EqualTo(typeof(SkinnableSprite)));
|
||||
Assert.That(skinnableInfo.Settings.First().Key, Is.EqualTo("sprite_name"));
|
||||
@ -148,10 +148,10 @@ namespace osu.Game.Tests.Skins
|
||||
using (var storage = new ZipArchiveReader(stream))
|
||||
{
|
||||
var skin = new TestSkin(new SkinInfo(), null, storage);
|
||||
Assert.That(skin.LayoutInfos[SkinComponentsContainerLookup.TargetArea.MainHUDComponents].AllDrawables.ToArray(), Has.Length.EqualTo(8));
|
||||
Assert.That(skin.LayoutInfos[SkinComponentsContainerLookup.TargetArea.MainHUDComponents].AllDrawables.Select(i => i.Type), Contains.Item(typeof(UnstableRateCounter)));
|
||||
Assert.That(skin.LayoutInfos[SkinComponentsContainerLookup.TargetArea.MainHUDComponents].AllDrawables.Select(i => i.Type), Contains.Item(typeof(ColourHitErrorMeter)));
|
||||
Assert.That(skin.LayoutInfos[SkinComponentsContainerLookup.TargetArea.MainHUDComponents].AllDrawables.Select(i => i.Type), Contains.Item(typeof(LegacySongProgress)));
|
||||
Assert.That(skin.LayoutInfos[GlobalSkinnableContainerLookup.GlobalSkinnableContainers.MainHUDComponents].AllDrawables.ToArray(), Has.Length.EqualTo(8));
|
||||
Assert.That(skin.LayoutInfos[GlobalSkinnableContainerLookup.GlobalSkinnableContainers.MainHUDComponents].AllDrawables.Select(i => i.Type), Contains.Item(typeof(UnstableRateCounter)));
|
||||
Assert.That(skin.LayoutInfos[GlobalSkinnableContainerLookup.GlobalSkinnableContainers.MainHUDComponents].AllDrawables.Select(i => i.Type), Contains.Item(typeof(ColourHitErrorMeter)));
|
||||
Assert.That(skin.LayoutInfos[GlobalSkinnableContainerLookup.GlobalSkinnableContainers.MainHUDComponents].AllDrawables.Select(i => i.Type), Contains.Item(typeof(LegacySongProgress)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
{
|
||||
CreateSkinTest(TrianglesSkin.CreateInfo(), () => new LegacyBeatmapSkin(new BeatmapInfo(), null));
|
||||
AddUntilStep("wait for hud load", () => Player.ChildrenOfType<SkinnableContainer>().All(c => c.ComponentsLoaded));
|
||||
AddAssert("hud from default skin", () => AssertComponentsFromExpectedSource(SkinComponentsContainerLookup.TargetArea.MainHUDComponents, skinManager.CurrentSkin.Value));
|
||||
AddAssert("hud from default skin", () => AssertComponentsFromExpectedSource(GlobalSkinnableContainerLookup.GlobalSkinnableContainers.MainHUDComponents, skinManager.CurrentSkin.Value));
|
||||
}
|
||||
|
||||
protected void CreateSkinTest(SkinInfo gameCurrentSkin, Func<ISkin> getBeatmapSkin)
|
||||
@ -53,7 +53,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
});
|
||||
}
|
||||
|
||||
protected bool AssertComponentsFromExpectedSource(SkinComponentsContainerLookup.TargetArea target, ISkin expectedSource)
|
||||
protected bool AssertComponentsFromExpectedSource(GlobalSkinnableContainerLookup.GlobalSkinnableContainers target, ISkin expectedSource)
|
||||
{
|
||||
var targetContainer = Player.ChildrenOfType<SkinnableContainer>().First(s => s.Lookup.Target == target);
|
||||
var actualComponentsContainer = targetContainer.ChildrenOfType<Container>().SingleOrDefault(c => c.Parent == targetContainer);
|
||||
@ -63,7 +63,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
|
||||
var actualInfo = actualComponentsContainer.CreateSerialisedInfo();
|
||||
|
||||
var expectedComponentsContainer = expectedSource.GetDrawableComponent(new SkinComponentsContainerLookup(target)) as Container;
|
||||
var expectedComponentsContainer = expectedSource.GetDrawableComponent(new GlobalSkinnableContainerLookup(target)) as Container;
|
||||
if (expectedComponentsContainer == null)
|
||||
return false;
|
||||
|
||||
|
@ -378,10 +378,10 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
}
|
||||
|
||||
private SkinnableContainer globalHUDTarget => Player.ChildrenOfType<SkinnableContainer>()
|
||||
.Single(c => c.Lookup.Target == SkinComponentsContainerLookup.TargetArea.MainHUDComponents && c.Lookup.Ruleset == null);
|
||||
.Single(c => c.Lookup.Target == GlobalSkinnableContainerLookup.GlobalSkinnableContainers.MainHUDComponents && c.Lookup.Ruleset == null);
|
||||
|
||||
private SkinnableContainer rulesetHUDTarget => Player.ChildrenOfType<SkinnableContainer>()
|
||||
.Single(c => c.Lookup.Target == SkinComponentsContainerLookup.TargetArea.MainHUDComponents && c.Lookup.Ruleset != null);
|
||||
.Single(c => c.Lookup.Target == GlobalSkinnableContainerLookup.GlobalSkinnableContainers.MainHUDComponents && c.Lookup.Ruleset != null);
|
||||
|
||||
[Test]
|
||||
public void TestMigrationArgon()
|
||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
[Test]
|
||||
public void TestToggleEditor()
|
||||
{
|
||||
var skinComponentsContainer = new SkinnableContainer(new SkinComponentsContainerLookup(SkinComponentsContainerLookup.TargetArea.SongSelect));
|
||||
var skinComponentsContainer = new SkinnableContainer(new GlobalSkinnableContainerLookup(GlobalSkinnableContainerLookup.GlobalSkinnableContainers.SongSelect));
|
||||
|
||||
AddStep("show available components", () => SetContents(_ => new SkinComponentToolbox(skinComponentsContainer, null)
|
||||
{
|
||||
|
@ -72,7 +72,7 @@ namespace osu.Game.Overlays.SkinEditor
|
||||
[Cached]
|
||||
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);
|
||||
|
||||
private readonly Bindable<SkinComponentsContainerLookup?> selectedTarget = new Bindable<SkinComponentsContainerLookup?>();
|
||||
private readonly Bindable<GlobalSkinnableContainerLookup?> selectedTarget = new Bindable<GlobalSkinnableContainerLookup?>();
|
||||
|
||||
private bool hasBegunMutating;
|
||||
|
||||
@ -330,7 +330,7 @@ namespace osu.Game.Overlays.SkinEditor
|
||||
}
|
||||
}
|
||||
|
||||
private void targetChanged(ValueChangedEvent<SkinComponentsContainerLookup?> target)
|
||||
private void targetChanged(ValueChangedEvent<GlobalSkinnableContainerLookup?> target)
|
||||
{
|
||||
foreach (var toolbox in componentsSidebar.OfType<SkinComponentToolbox>())
|
||||
toolbox.Expire();
|
||||
@ -360,7 +360,7 @@ namespace osu.Game.Overlays.SkinEditor
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new SettingsDropdown<SkinComponentsContainerLookup?>
|
||||
new SettingsDropdown<GlobalSkinnableContainerLookup?>
|
||||
{
|
||||
Items = availableTargets.Select(t => t.Lookup).Distinct(),
|
||||
Current = selectedTarget,
|
||||
@ -476,7 +476,7 @@ namespace osu.Game.Overlays.SkinEditor
|
||||
|
||||
private SkinnableContainer? getFirstTarget() => availableTargets.FirstOrDefault();
|
||||
|
||||
private SkinnableContainer? getTarget(SkinComponentsContainerLookup? target)
|
||||
private SkinnableContainer? getTarget(GlobalSkinnableContainerLookup? target)
|
||||
{
|
||||
return availableTargets.FirstOrDefault(c => c.Lookup.Equals(target));
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ namespace osu.Game.Screens.Play
|
||||
private readonly List<Drawable> hideTargets;
|
||||
|
||||
/// <summary>
|
||||
/// The container for skin components attached to <see cref="SkinComponentsContainerLookup.TargetArea.Playfield"/>
|
||||
/// The container for skin components attached to <see cref="GlobalSkinnableContainerLookup.GlobalSkinnableContainers.Playfield"/>
|
||||
/// </summary>
|
||||
internal readonly Drawable PlayfieldSkinLayer;
|
||||
|
||||
@ -132,7 +132,7 @@ namespace osu.Game.Screens.Play
|
||||
? (rulesetComponents = new HUDComponentsContainer(drawableRuleset.Ruleset.RulesetInfo) { AlwaysPresent = true, })
|
||||
: Empty(),
|
||||
PlayfieldSkinLayer = drawableRuleset != null
|
||||
? new SkinnableContainer(new SkinComponentsContainerLookup(SkinComponentsContainerLookup.TargetArea.Playfield, drawableRuleset.Ruleset.RulesetInfo)) { AlwaysPresent = true, }
|
||||
? new SkinnableContainer(new GlobalSkinnableContainerLookup(GlobalSkinnableContainerLookup.GlobalSkinnableContainers.Playfield, drawableRuleset.Ruleset.RulesetInfo)) { AlwaysPresent = true, }
|
||||
: Empty(),
|
||||
topRightElements = new FillFlowContainer
|
||||
{
|
||||
@ -448,7 +448,7 @@ namespace osu.Game.Screens.Play
|
||||
private OsuConfigManager config { get; set; }
|
||||
|
||||
public HUDComponentsContainer([CanBeNull] RulesetInfo ruleset = null)
|
||||
: base(new SkinComponentsContainerLookup(SkinComponentsContainerLookup.TargetArea.MainHUDComponents, ruleset))
|
||||
: base(new GlobalSkinnableContainerLookup(GlobalSkinnableContainerLookup.GlobalSkinnableContainers.MainHUDComponents, ruleset))
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
}
|
||||
|
@ -321,7 +321,7 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
}
|
||||
},
|
||||
new SkinnableContainer(new SkinComponentsContainerLookup(SkinComponentsContainerLookup.TargetArea.SongSelect))
|
||||
new SkinnableContainer(new GlobalSkinnableContainerLookup(GlobalSkinnableContainerLookup.GlobalSkinnableContainers.SongSelect))
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
|
@ -96,14 +96,14 @@ namespace osu.Game.Skinning
|
||||
|
||||
switch (lookup)
|
||||
{
|
||||
case SkinComponentsContainerLookup containerLookup:
|
||||
case GlobalSkinnableContainerLookup containerLookup:
|
||||
|
||||
if (base.GetDrawableComponent(lookup) is UserConfiguredLayoutContainer c)
|
||||
return c;
|
||||
|
||||
switch (containerLookup.Target)
|
||||
{
|
||||
case SkinComponentsContainerLookup.TargetArea.SongSelect:
|
||||
case GlobalSkinnableContainerLookup.GlobalSkinnableContainers.SongSelect:
|
||||
var songSelectComponents = new DefaultSkinComponentsContainer(_ =>
|
||||
{
|
||||
// do stuff when we need to.
|
||||
@ -111,7 +111,7 @@ namespace osu.Game.Skinning
|
||||
|
||||
return songSelectComponents;
|
||||
|
||||
case SkinComponentsContainerLookup.TargetArea.MainHUDComponents:
|
||||
case GlobalSkinnableContainerLookup.GlobalSkinnableContainers.MainHUDComponents:
|
||||
if (containerLookup.Ruleset != null)
|
||||
{
|
||||
return new Container
|
||||
|
@ -9,14 +9,14 @@ using osu.Game.Rulesets;
|
||||
namespace osu.Game.Skinning
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a lookup of a collection of elements that make up a particular skinnable <see cref="TargetArea"/> of the game.
|
||||
/// Represents a lookup of a collection of elements that make up a particular skinnable <see cref="GlobalSkinnableContainers"/> of the game.
|
||||
/// </summary>
|
||||
public class SkinComponentsContainerLookup : ISkinComponentLookup, IEquatable<SkinComponentsContainerLookup>
|
||||
public class GlobalSkinnableContainerLookup : ISkinComponentLookup, IEquatable<GlobalSkinnableContainerLookup>
|
||||
{
|
||||
/// <summary>
|
||||
/// The target area / layer of the game for which skin components will be returned.
|
||||
/// </summary>
|
||||
public readonly TargetArea Target;
|
||||
public readonly GlobalSkinnableContainers Target;
|
||||
|
||||
/// <summary>
|
||||
/// The ruleset for which skin components should be returned.
|
||||
@ -24,7 +24,7 @@ namespace osu.Game.Skinning
|
||||
/// </summary>
|
||||
public readonly RulesetInfo? Ruleset;
|
||||
|
||||
public SkinComponentsContainerLookup(TargetArea target, RulesetInfo? ruleset = null)
|
||||
public GlobalSkinnableContainerLookup(GlobalSkinnableContainers target, RulesetInfo? ruleset = null)
|
||||
{
|
||||
Target = target;
|
||||
Ruleset = ruleset;
|
||||
@ -37,7 +37,7 @@ namespace osu.Game.Skinning
|
||||
return $"{Target.GetDescription()} (\"{Ruleset.Name}\" only)";
|
||||
}
|
||||
|
||||
public bool Equals(SkinComponentsContainerLookup? other)
|
||||
public bool Equals(GlobalSkinnableContainerLookup? other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
@ -51,7 +51,7 @@ namespace osu.Game.Skinning
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() != GetType()) return false;
|
||||
|
||||
return Equals((SkinComponentsContainerLookup)obj);
|
||||
return Equals((GlobalSkinnableContainerLookup)obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
@ -62,7 +62,7 @@ namespace osu.Game.Skinning
|
||||
/// <summary>
|
||||
/// Represents a particular area or part of a game screen whose layout can be customised using the skin editor.
|
||||
/// </summary>
|
||||
public enum TargetArea
|
||||
public enum GlobalSkinnableContainers
|
||||
{
|
||||
[Description("HUD")]
|
||||
MainHUDComponents,
|
@ -50,11 +50,11 @@ namespace osu.Game.Skinning
|
||||
|
||||
public override Drawable? GetDrawableComponent(ISkinComponentLookup lookup)
|
||||
{
|
||||
if (lookup is SkinComponentsContainerLookup containerLookup)
|
||||
if (lookup is GlobalSkinnableContainerLookup containerLookup)
|
||||
{
|
||||
switch (containerLookup.Target)
|
||||
{
|
||||
case SkinComponentsContainerLookup.TargetArea.MainHUDComponents:
|
||||
case GlobalSkinnableContainerLookup.GlobalSkinnableContainers.MainHUDComponents:
|
||||
// this should exist in LegacySkin instead, but there isn't a fallback skin for LegacySkins yet.
|
||||
// therefore keep the check here until fallback default legacy skin is supported.
|
||||
if (!this.HasFont(LegacyFont.Score))
|
||||
|
@ -358,13 +358,13 @@ namespace osu.Game.Skinning
|
||||
{
|
||||
switch (lookup)
|
||||
{
|
||||
case SkinComponentsContainerLookup containerLookup:
|
||||
case GlobalSkinnableContainerLookup containerLookup:
|
||||
if (base.GetDrawableComponent(lookup) is UserConfiguredLayoutContainer c)
|
||||
return c;
|
||||
|
||||
switch (containerLookup.Target)
|
||||
{
|
||||
case SkinComponentsContainerLookup.TargetArea.MainHUDComponents:
|
||||
case GlobalSkinnableContainerLookup.GlobalSkinnableContainers.MainHUDComponents:
|
||||
if (containerLookup.Ruleset != null)
|
||||
{
|
||||
return new DefaultSkinComponentsContainer(container =>
|
||||
|
@ -43,10 +43,10 @@ namespace osu.Game.Skinning
|
||||
|
||||
public SkinConfiguration Configuration { get; set; }
|
||||
|
||||
public IDictionary<SkinComponentsContainerLookup.TargetArea, SkinLayoutInfo> LayoutInfos => layoutInfos;
|
||||
public IDictionary<GlobalSkinnableContainerLookup.GlobalSkinnableContainers, SkinLayoutInfo> LayoutInfos => layoutInfos;
|
||||
|
||||
private readonly Dictionary<SkinComponentsContainerLookup.TargetArea, SkinLayoutInfo> layoutInfos =
|
||||
new Dictionary<SkinComponentsContainerLookup.TargetArea, SkinLayoutInfo>();
|
||||
private readonly Dictionary<GlobalSkinnableContainerLookup.GlobalSkinnableContainers, SkinLayoutInfo> layoutInfos =
|
||||
new Dictionary<GlobalSkinnableContainerLookup.GlobalSkinnableContainers, SkinLayoutInfo>();
|
||||
|
||||
public abstract ISample? GetSample(ISampleInfo sampleInfo);
|
||||
|
||||
@ -123,7 +123,7 @@ namespace osu.Game.Skinning
|
||||
}
|
||||
|
||||
// skininfo files may be null for default skin.
|
||||
foreach (SkinComponentsContainerLookup.TargetArea skinnableTarget in Enum.GetValues<SkinComponentsContainerLookup.TargetArea>())
|
||||
foreach (GlobalSkinnableContainerLookup.GlobalSkinnableContainers skinnableTarget in Enum.GetValues<GlobalSkinnableContainerLookup.GlobalSkinnableContainers>())
|
||||
{
|
||||
string filename = $"{skinnableTarget}.json";
|
||||
|
||||
@ -187,7 +187,7 @@ namespace osu.Game.Skinning
|
||||
case SkinnableSprite.SpriteComponentLookup sprite:
|
||||
return this.GetAnimation(sprite.LookupName, false, false, maxSize: sprite.MaxSize);
|
||||
|
||||
case SkinComponentsContainerLookup containerLookup:
|
||||
case GlobalSkinnableContainerLookup containerLookup:
|
||||
|
||||
// It is important to return null if the user has not configured this yet.
|
||||
// This allows skin transformers the opportunity to provide default components.
|
||||
@ -206,7 +206,7 @@ namespace osu.Game.Skinning
|
||||
|
||||
#region Deserialisation & Migration
|
||||
|
||||
private SkinLayoutInfo? parseLayoutInfo(string jsonContent, SkinComponentsContainerLookup.TargetArea target)
|
||||
private SkinLayoutInfo? parseLayoutInfo(string jsonContent, GlobalSkinnableContainerLookup.GlobalSkinnableContainers target)
|
||||
{
|
||||
SkinLayoutInfo? layout = null;
|
||||
|
||||
@ -245,7 +245,7 @@ namespace osu.Game.Skinning
|
||||
return layout;
|
||||
}
|
||||
|
||||
private void applyMigration(SkinLayoutInfo layout, SkinComponentsContainerLookup.TargetArea target, int version)
|
||||
private void applyMigration(SkinLayoutInfo layout, GlobalSkinnableContainerLookup.GlobalSkinnableContainers target, int version)
|
||||
{
|
||||
switch (version)
|
||||
{
|
||||
@ -253,7 +253,7 @@ namespace osu.Game.Skinning
|
||||
{
|
||||
// Combo counters were moved out of the global HUD components into per-ruleset.
|
||||
// This is to allow some rulesets to customise further (ie. mania and catch moving the combo to within their play area).
|
||||
if (target != SkinComponentsContainerLookup.TargetArea.MainHUDComponents ||
|
||||
if (target != GlobalSkinnableContainerLookup.GlobalSkinnableContainers.MainHUDComponents ||
|
||||
!layout.TryGetDrawableInfo(null, out var globalHUDComponents) ||
|
||||
resources == null)
|
||||
break;
|
||||
|
@ -26,7 +26,7 @@ namespace osu.Game.Skinning
|
||||
/// <summary>
|
||||
/// The lookup criteria which will be used to retrieve components from the active skin.
|
||||
/// </summary>
|
||||
public SkinComponentsContainerLookup Lookup { get; }
|
||||
public GlobalSkinnableContainerLookup Lookup { get; }
|
||||
|
||||
public IBindableList<ISerialisableDrawable> Components => components;
|
||||
|
||||
@ -38,7 +38,7 @@ namespace osu.Game.Skinning
|
||||
|
||||
private CancellationTokenSource? cancellationSource;
|
||||
|
||||
public SkinnableContainer(SkinComponentsContainerLookup lookup)
|
||||
public SkinnableContainer(GlobalSkinnableContainerLookup lookup)
|
||||
{
|
||||
Lookup = lookup;
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ namespace osu.Game.Skinning
|
||||
|
||||
switch (lookup)
|
||||
{
|
||||
case SkinComponentsContainerLookup containerLookup:
|
||||
case GlobalSkinnableContainerLookup containerLookup:
|
||||
if (base.GetDrawableComponent(lookup) is UserConfiguredLayoutContainer c)
|
||||
return c;
|
||||
|
||||
@ -76,7 +76,7 @@ namespace osu.Game.Skinning
|
||||
|
||||
switch (containerLookup.Target)
|
||||
{
|
||||
case SkinComponentsContainerLookup.TargetArea.SongSelect:
|
||||
case GlobalSkinnableContainerLookup.GlobalSkinnableContainers.SongSelect:
|
||||
var songSelectComponents = new DefaultSkinComponentsContainer(_ =>
|
||||
{
|
||||
// do stuff when we need to.
|
||||
@ -84,7 +84,7 @@ namespace osu.Game.Skinning
|
||||
|
||||
return songSelectComponents;
|
||||
|
||||
case SkinComponentsContainerLookup.TargetArea.MainHUDComponents:
|
||||
case GlobalSkinnableContainerLookup.GlobalSkinnableContainers.MainHUDComponents:
|
||||
var skinnableTargetWrapper = new DefaultSkinComponentsContainer(container =>
|
||||
{
|
||||
var score = container.OfType<DefaultScoreCounter>().FirstOrDefault();
|
||||
|
Loading…
Reference in New Issue
Block a user