Make playlist beatmap and ruleset into bindables

This commit is contained in:
smoogipoo
2020-02-13 18:12:47 +09:00
parent 08d0a08d54
commit 91edadfe9d
17 changed files with 79 additions and 68 deletions

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Linq;
using Humanizer;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
@ -38,8 +39,8 @@ namespace osu.Game.Screens.Select
{
var item = new PlaylistItem
{
Beatmap = Beatmap.Value.BeatmapInfo,
Ruleset = Ruleset.Value,
Beatmap = { Value = Beatmap.Value.BeatmapInfo },
Ruleset = { Value = Ruleset.Value },
RulesetID = Ruleset.Value.ID ?? 0
};
@ -60,8 +61,8 @@ namespace osu.Game.Screens.Select
if (CurrentItem.Value != null)
{
Ruleset.Value = CurrentItem.Value.Ruleset;
Beatmap.Value = beatmaps.GetWorkingBeatmap(CurrentItem.Value.Beatmap);
Ruleset.Value = CurrentItem.Value.Ruleset.Value;
Beatmap.Value = beatmaps.GetWorkingBeatmap(CurrentItem.Value.Beatmap.Value);
Mods.Value = CurrentItem.Value.RequiredMods?.ToArray() ?? Array.Empty<Mod>();
}