diff --git a/osu.Game/Screens/Multi/Match/Components/Info.cs b/osu.Game/Screens/Multi/Match/Components/Info.cs index b849cae5d0..ca1ca5f40f 100644 --- a/osu.Game/Screens/Multi/Match/Components/Info.cs +++ b/osu.Game/Screens/Multi/Match/Components/Info.cs @@ -3,12 +3,10 @@ using System; using osu.Framework.Allocation; -using osu.Framework.Configuration; using osu.Framework.Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Online.Multiplayer; @@ -26,11 +24,7 @@ namespace osu.Game.Screens.Multi.Match.Components private OsuColour colours; - public readonly IBindable Name = new Bindable(); - public readonly IBindable Availability = new Bindable(); - public readonly IBindable Status = new Bindable(); - public readonly IBindable Beatmap = new Bindable(); - public readonly IBindable EndDate = new Bindable(); + private readonly RoomBindings bindings = new RoomBindings(); public Info(Room room) { @@ -99,13 +93,15 @@ namespace osu.Game.Screens.Multi.Match.Components }, }; - viewBeatmapButton.Beatmap.BindTo(Beatmap); - readyButton.Beatmap.BindTo(Beatmap); + viewBeatmapButton.Beatmap.BindTo(bindings.CurrentBeatmap); + readyButton.Beatmap.BindTo(bindings.CurrentBeatmap); - Availability.BindValueChanged(_ => updateAvailabilityStatus()); - Status.BindValueChanged(_ => updateAvailabilityStatus()); - Name.BindValueChanged(n => name.Text = n); - EndDate.BindValueChanged(d => endDate.Date = d); + bindings.Availability.BindValueChanged(_ => updateAvailabilityStatus()); + bindings.Status.BindValueChanged(_ => updateAvailabilityStatus()); + bindings.Name.BindValueChanged(n => name.Text = n); + bindings.EndDate.BindValueChanged(d => endDate.Date = d); + + bindings.Room = room; } [BackgroundDependencyLoader] @@ -126,10 +122,10 @@ namespace osu.Game.Screens.Multi.Match.Components if (!IsLoaded) return; - if (Status.Value != null) + if (bindings.Status.Value != null) { - availabilityStatus.FadeColour(Status.Value.GetAppropriateColour(colours), 100); - availabilityStatus.Text = $"{Availability.Value.GetDescription()}, {Status.Value.Message}"; + availabilityStatus.FadeColour(bindings.Status.Value.GetAppropriateColour(colours), 100); + availabilityStatus.Text = $"{bindings.Availability.Value.GetDescription()}, {bindings.Status.Value.Message}"; } } } diff --git a/osu.Game/Screens/Multi/Match/MatchScreen.cs b/osu.Game/Screens/Multi/Match/MatchScreen.cs index 98a980afb2..513b49713a 100644 --- a/osu.Game/Screens/Multi/Match/MatchScreen.cs +++ b/osu.Game/Screens/Multi/Match/MatchScreen.cs @@ -49,7 +49,6 @@ namespace osu.Game.Screens.Multi.Match bindings.Room = room; - Info info; Components.Header header; RoomSettingsOverlay settings; @@ -61,7 +60,7 @@ namespace osu.Game.Screens.Multi.Match Content = new[] { new Drawable[] { header = new Components.Header(room) { Depth = -1 } }, - new Drawable[] { info = new Info(room) { OnStart = onStart } }, + new Drawable[] { new Info(room) { OnStart = onStart } }, new Drawable[] { new GridContainer @@ -106,11 +105,6 @@ namespace osu.Game.Screens.Multi.Match settings.Hide(); }; - info.Name.BindTo(bindings.Name); - info.Status.BindTo(bindings.Status); - info.Availability.BindTo(bindings.Availability); - info.EndDate.BindTo(bindings.EndDate); - info.Beatmap.BindTo(bindings.CurrentBeatmap); header.Type.BindTo(bindings.Type); header.Beatmap.BindTo(bindings.CurrentBeatmap); header.Mods.BindTo(bindings.CurrentMods);