Introduce the concept of SkinComponents

Removes reliance on string lookups and better defines elements for introduction into database
This commit is contained in:
Dean Herbert
2019-08-30 14:39:02 +09:00
parent ae05faa6d2
commit a15828ab25
43 changed files with 264 additions and 104 deletions

View File

@ -19,11 +19,11 @@ namespace osu.Game.Skinning
[Resolved]
private TextureStore textures { get; set; }
public SkinnableSprite(string name, Func<ISkinSource, bool> allowFallback = null, ConfineMode confineMode = ConfineMode.ScaleDownToFit)
: base(name, allowFallback, confineMode)
public SkinnableSprite(ISkinComponent component, Func<ISkinSource, bool> allowFallback = null, ConfineMode confineMode = ConfineMode.ScaleDownToFit)
: base(component, allowFallback, confineMode)
{
}
protected override Drawable CreateDefault(string name) => new Sprite { Texture = textures.Get(name) };
protected override Drawable CreateDefault(ISkinComponent component) => new Sprite { Texture = textures.Get(component.LookupName) };
}
}