1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 00:42:55 +08:00

Redesign with tab control

This commit is contained in:
Dan Balasescu 2021-12-01 19:44:29 +09:00
parent 95050d6597
commit 7847ce6253

View File

@ -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<DisplayMode> displayModeTabControl;
InternalChildren = new Drawable[]
{
RelativeSizeAxes = Axes.Both,
Content = new[]
displayModeTabControl = new OsuTabControl<DisplayMode>
{
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<DisplayMode> 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,
}
}
}