Provide cell skin on content creation

This commit is contained in:
Salman Ahmed 2021-06-01 10:13:56 +03:00
parent cd8e3f3a04
commit c090110ae2
1 changed files with 5 additions and 3 deletions

View File

@ -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);