Combine private skin variable into exposed one

This commit is contained in:
Dean Herbert
2022-04-18 13:32:37 +09:00
parent 2cb217e06c
commit 90093c1d9d

View File

@ -24,9 +24,7 @@ namespace osu.Game.Screens.Edit
/// <summary> /// <summary>
/// The underlying beatmap skin. /// The underlying beatmap skin.
/// </summary> /// </summary>
protected internal ISkin Skin => skin; protected internal readonly Skin Skin;
private readonly Skin skin;
/// <summary> /// <summary>
/// The combo colours of this skin. /// The combo colours of this skin.
@ -36,11 +34,11 @@ namespace osu.Game.Screens.Edit
public EditorBeatmapSkin(Skin skin) public EditorBeatmapSkin(Skin skin)
{ {
this.skin = skin; Skin = skin;
ComboColours = new BindableList<Colour4>(); ComboColours = new BindableList<Colour4>();
if (skin.Configuration.ComboColours != null) if (Skin.Configuration.ComboColours != null)
ComboColours.AddRange(skin.Configuration.ComboColours.Select(c => (Colour4)c)); ComboColours.AddRange(Skin.Configuration.ComboColours.Select(c => (Colour4)c));
ComboColours.BindCollectionChanged((_, __) => updateColours()); ComboColours.BindCollectionChanged((_, __) => updateColours());
} }
@ -48,16 +46,16 @@ namespace osu.Game.Screens.Edit
private void updateColours() private void updateColours()
{ {
skin.Configuration.CustomComboColours = ComboColours.Select(c => (Color4)c).ToList(); Skin.Configuration.CustomComboColours = ComboColours.Select(c => (Color4)c).ToList();
invokeSkinChanged(); invokeSkinChanged();
} }
#region Delegated ISkin implementation #region Delegated ISkin implementation
public Drawable GetDrawableComponent(ISkinComponent component) => skin.GetDrawableComponent(component); public Drawable GetDrawableComponent(ISkinComponent component) => Skin.GetDrawableComponent(component);
public Texture GetTexture(string componentName, WrapMode wrapModeS, WrapMode wrapModeT) => skin.GetTexture(componentName, wrapModeS, wrapModeT); public Texture GetTexture(string componentName, WrapMode wrapModeS, WrapMode wrapModeT) => Skin.GetTexture(componentName, wrapModeS, wrapModeT);
public ISample GetSample(ISampleInfo sampleInfo) => skin.GetSample(sampleInfo); public ISample GetSample(ISampleInfo sampleInfo) => Skin.GetSample(sampleInfo);
public IBindable<TValue> GetConfig<TLookup, TValue>(TLookup lookup) => skin.GetConfig<TLookup, TValue>(lookup); public IBindable<TValue> GetConfig<TLookup, TValue>(TLookup lookup) => Skin.GetConfig<TLookup, TValue>(lookup);
#endregion #endregion
} }