Rename ISkinComponent to ISkinLookup

This commit is contained in:
Dean Herbert
2022-11-09 14:11:41 +09:00
parent ab458320c4
commit c908969d9b
90 changed files with 224 additions and 213 deletions

View File

@ -5,13 +5,13 @@ using osu.Game.Skinning;
namespace osu.Game.Rulesets.Mania
{
public class ManiaSkinComponent : GameplaySkinComponent<ManiaSkinComponents>
public class ManiaSkinLookup : GameplaySkinLookup<ManiaSkinComponents>
{
/// <summary>
/// Creates a new <see cref="ManiaSkinComponent"/>.
/// Creates a new <see cref="ManiaSkinLookup"/>.
/// </summary>
/// <param name="component">The component.</param>
public ManiaSkinComponent(ManiaSkinComponents component)
public ManiaSkinLookup(ManiaSkinComponents component)
: base(component)
{
}

View File

@ -105,7 +105,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
headContainer = new Container<DrawableHoldNoteHead> { RelativeSizeAxes = Axes.Both }
}
},
bodyPiece = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.HoldNoteBody), _ => new DefaultBodyPiece
bodyPiece = new SkinnableDrawable(new ManiaSkinLookup(ManiaSkinComponents.HoldNoteBody), _ => new DefaultBodyPiece
{
RelativeSizeAxes = Axes.Both,
})

View File

@ -54,7 +54,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
{
rulesetConfig?.BindWith(ManiaRulesetSetting.TimingBasedNoteColouring, configTimingBasedNoteColouring);
AddInternal(headPiece = new SkinnableDrawable(new ManiaSkinComponent(Component), _ => new DefaultNotePiece())
AddInternal(headPiece = new SkinnableDrawable(new ManiaSkinLookup(Component), _ => new DefaultNotePiece())
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y

View File

@ -22,14 +22,14 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon
this.beatmap = (ManiaBeatmap)beatmap;
}
public override Drawable? GetDrawableComponent(ISkinComponent component)
public override Drawable? GetDrawableComponent(ISkinLookup lookup)
{
switch (component)
switch (lookup)
{
case GameplaySkinComponent<HitResult> resultComponent:
case GameplaySkinLookup<HitResult> resultComponent:
return new ArgonJudgementPiece(resultComponent.Component);
case ManiaSkinComponent maniaComponent:
case ManiaSkinLookup maniaComponent:
// TODO: Once everything is finalised, consider throwing UnsupportedSkinComponentException on missing entries.
switch (maniaComponent.Component)
{
@ -62,7 +62,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon
break;
}
return base.GetDrawableComponent(component);
return base.GetDrawableComponent(lookup);
}
public override IBindable<TValue>? GetConfig<TLookup, TValue>(TLookup lookup)

View File

@ -74,14 +74,14 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
});
}
public override Drawable GetDrawableComponent(ISkinComponent component)
public override Drawable GetDrawableComponent(ISkinLookup lookup)
{
switch (component)
switch (lookup)
{
case GameplaySkinComponent<HitResult> resultComponent:
case GameplaySkinLookup<HitResult> resultComponent:
return getResult(resultComponent.Component);
case ManiaSkinComponent maniaComponent:
case ManiaSkinLookup maniaComponent:
if (!isLegacySkin.Value || !hasKeyTexture.Value)
return null;
@ -120,11 +120,11 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
return new LegacyStageForeground();
default:
throw new UnsupportedSkinComponentException(component);
throw new UnsupportedSkinComponentException(lookup);
}
}
return base.GetDrawableComponent(component);
return base.GetDrawableComponent(lookup);
}
private Drawable getResult(HitResult result)

View File

@ -76,7 +76,7 @@ namespace osu.Game.Rulesets.Mania.UI
skin.SourceChanged += onSourceChanged;
onSourceChanged();
Drawable background = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.ColumnBackground), _ => new DefaultColumnBackground())
Drawable background = new SkinnableDrawable(new ManiaSkinLookup(ManiaSkinComponents.ColumnBackground), _ => new DefaultColumnBackground())
{
RelativeSizeAxes = Axes.Both,
};
@ -88,7 +88,7 @@ namespace osu.Game.Rulesets.Mania.UI
// For input purposes, the background is added at the highest depth, but is then proxied back below all other elements
background.CreateProxy(),
HitObjectArea,
keyArea = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.KeyArea), _ => new DefaultKeyArea())
keyArea = new SkinnableDrawable(new ManiaSkinLookup(ManiaSkinComponents.KeyArea), _ => new DefaultKeyArea())
{
RelativeSizeAxes = Axes.Both,
},

View File

@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Mania.UI.Components
RelativeSizeAxes = Axes.Both,
Depth = 2,
},
hitTarget = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.HitTarget), _ => new DefaultHitTarget())
hitTarget = new SkinnableDrawable(new ManiaSkinLookup(ManiaSkinComponents.HitTarget), _ => new DefaultHitTarget())
{
RelativeSizeAxes = Axes.X,
Depth = 1

View File

@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Mania.UI
[BackgroundDependencyLoader]
private void load()
{
InternalChild = skinnableExplosion = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.HitExplosion), _ => new DefaultHitExplosion())
InternalChild = skinnableExplosion = new SkinnableDrawable(new ManiaSkinLookup(ManiaSkinComponents.HitExplosion), _ => new DefaultHitExplosion())
{
RelativeSizeAxes = Axes.Both
};

View File

@ -73,7 +73,7 @@ namespace osu.Game.Rulesets.Mania.UI
AutoSizeAxes = Axes.X,
Children = new Drawable[]
{
new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.StageBackground), _ => new DefaultStageBackground())
new SkinnableDrawable(new ManiaSkinLookup(ManiaSkinComponents.StageBackground), _ => new DefaultStageBackground())
{
RelativeSizeAxes = Axes.Both
},
@ -98,7 +98,7 @@ namespace osu.Game.Rulesets.Mania.UI
RelativeSizeAxes = Axes.Y,
}
},
new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.StageForeground), _ => null)
new SkinnableDrawable(new ManiaSkinLookup(ManiaSkinComponents.StageForeground), _ => null)
{
RelativeSizeAxes = Axes.Both
},