mirror of https://github.com/ppy/osu
Provide cell skin on content creation
This commit is contained in:
parent
cd8e3f3a04
commit
c090110ae2
|
@ -52,7 +52,9 @@ private void load(AudioManager audio, SkinManager skinManager, OsuGameBase game)
|
|||
|
||||
private readonly List<Drawable> createdDrawables = new List<Drawable>();
|
||||
|
||||
public void SetContents(Func<Drawable> creationFunction)
|
||||
public void SetContents(Func<Drawable> creationFunction) => SetContents(_ => creationFunction?.Invoke());
|
||||
|
||||
public void SetContents(Func<ISkin, Drawable> creationFunction)
|
||||
{
|
||||
createdDrawables.Clear();
|
||||
|
||||
|
@ -67,9 +69,9 @@ public void SetContents(Func<Drawable> creationFunction)
|
|||
|
||||
protected IEnumerable<Drawable> CreatedDrawables => createdDrawables;
|
||||
|
||||
private Drawable createProvider(Skin skin, Func<Drawable> creationFunction, IBeatmap beatmap)
|
||||
private Drawable createProvider(Skin skin, Func<ISkin, Drawable> creationFunction, IBeatmap beatmap)
|
||||
{
|
||||
var created = creationFunction();
|
||||
var created = creationFunction(skin);
|
||||
|
||||
createdDrawables.Add(created);
|
||||
|
||||
|
|
Loading…
Reference in New Issue