// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Game.Online.Rooms; using osu.Game.Screens.OnlinePlay.Match; namespace osu.Game.Screens.OnlinePlay { /// /// An with additional logic tracking the currently-selected inside a . /// public class RoomSubScreenComposite : OnlinePlayComposite { [Resolved] private IBindable subScreenSelectedItem { get; set; } protected override void LoadComplete() { base.LoadComplete(); subScreenSelectedItem.BindValueChanged(_ => UpdateSelectedItem(), true); } protected override void UpdateSelectedItem() { if (RoomID.Value == null) { // If the room hasn't been created yet, fall-back to the base logic. base.UpdateSelectedItem(); return; } SelectedItem.Value = subScreenSelectedItem.Value; } } }