diff --git a/osu.Game.Rulesets.Karaoke/Edit/Setup/Components/SingerList.cs b/osu.Game.Rulesets.Karaoke/Edit/Setup/Components/SingerList.cs index 6f62c37bc..9798282ee 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Setup/Components/SingerList.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Setup/Components/SingerList.cs @@ -102,7 +102,6 @@ private void updateSingers() singers.Add(new AddSingerButton { - // todo : use better way to create singer with right id. Action = () => Singers.Add(new Singer { Name = "New singer", diff --git a/osu.Game.Rulesets.Karaoke/Edit/Setup/KaraokeSingerSection.cs b/osu.Game.Rulesets.Karaoke/Edit/Setup/KaraokeSingerSection.cs index 1d8008940..75f66ac61 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Setup/KaraokeSingerSection.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Setup/KaraokeSingerSection.cs @@ -4,6 +4,8 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Localisation; +using osu.Game.Rulesets.Karaoke.Beatmaps; +using osu.Game.Rulesets.Karaoke.Edit.ChangeHandlers.Beatmaps; using osu.Game.Rulesets.Karaoke.Edit.Setup.Components; using osu.Game.Screens.Edit.Setup; @@ -13,11 +15,18 @@ public partial class KaraokeSingerSection : SetupSection { public override LocalisableString Title => "Singers"; + [Cached(typeof(IKaraokeBeatmapResourcesProvider))] + private KaraokeBeatmapResourcesProvider karaokeBeatmapResourcesProvider = new(); + + private readonly IBeatmapSingersChangeHandler changeHandler = new BeatmapSingersChangeHandler(); + private LabelledSingerList singerList = null!; [BackgroundDependencyLoader] private void load() { + AddInternal(karaokeBeatmapResourcesProvider); + Children = new Drawable[] { singerList = new LabelledSingerList @@ -28,5 +37,8 @@ private void load() SingerNamePrefix = "#", }, }; + + if (Beatmap.BeatmapSkin != null) + singerList.Singers.BindTo(changeHandler.Singers); } }