From 7847ce6253e5c3bc8ba43b838852273d65f8bc68 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 1 Dec 2021 19:44:29 +0900 Subject: [PATCH] Redesign with tab control --- .../Match/Playlist/MultiplayerPlaylist.cs | 39 ++++++++++++++++--- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/osu.Game/Screens/OnlinePlay/Multiplayer/Match/Playlist/MultiplayerPlaylist.cs b/osu.Game/Screens/OnlinePlay/Multiplayer/Match/Playlist/MultiplayerPlaylist.cs index f853333b08..a44e086814 100644 --- a/osu.Game/Screens/OnlinePlay/Multiplayer/Match/Playlist/MultiplayerPlaylist.cs +++ b/osu.Game/Screens/OnlinePlay/Multiplayer/Match/Playlist/MultiplayerPlaylist.cs @@ -3,8 +3,11 @@ using System.Linq; using osu.Framework.Allocation; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.UserInterface; +using osu.Game.Graphics.UserInterface; using osu.Game.Online.Rooms; namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match.Playlist @@ -18,24 +21,42 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match.Playlist [BackgroundDependencyLoader] private void load() { - InternalChild = new GridContainer + TabControl displayModeTabControl; + + InternalChildren = new Drawable[] { - RelativeSizeAxes = Axes.Both, - Content = new[] + displayModeTabControl = new OsuTabControl { - new Drawable[] + RelativeSizeAxes = Axes.X, + Height = 25 + }, + new Container + { + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding { Top = 27 }, + Masking = true, + Children = new Drawable[] { queueList = new MultiplayerQueueList { - RelativeSizeAxes = Axes.Both + RelativeSizeAxes = Axes.Both, }, historyList = new MultiplayerHistoryList { - RelativeSizeAxes = Axes.Both + RelativeSizeAxes = Axes.Both, + Alpha = 0, } } } }; + + displayModeTabControl.Current.BindValueChanged(onDisplayModeChanged, true); + } + + private void onDisplayModeChanged(ValueChangedEvent mode) + { + historyList.FadeTo(mode.NewValue == DisplayMode.History ? 1 : 0, 100); + queueList.FadeTo(mode.NewValue == DisplayMode.Queue ? 1 : 0, 100); } protected override void OnRoomUpdated() @@ -86,5 +107,11 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match.Playlist PlaylistItemRemoved(item.ID); PlaylistItemAdded(item); } + + private enum DisplayMode + { + Queue, + History, + } } }