Implement MatchBeatmapPanel

This commit is contained in:
Andrei Zavatski
2019-08-08 07:08:51 +03:00
parent 94206f0aaa
commit ffed642929
3 changed files with 67 additions and 0 deletions

View File

@ -29,6 +29,10 @@ namespace osu.Game.Screens.Multi.Match.Components
public Action RequestBeatmapSelection;
public BindableBool ShowBeatmapPanel = new BindableBool();
private MatchBeatmapPanel beatmapPanel;
public Header()
{
RelativeSizeAxes = Axes.X;
@ -55,6 +59,12 @@ namespace osu.Game.Screens.Multi.Match.Components
RelativeSizeAxes = Axes.Both,
Colour = ColourInfo.GradientVertical(Color4.Black.Opacity(0.4f), Color4.Black.Opacity(0.6f)),
},
beatmapPanel = new MatchBeatmapPanel
{
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight,
Margin = new MarginPadding { Right = 100 },
}
}
},
new Box
@ -114,6 +124,12 @@ namespace osu.Game.Screens.Multi.Match.Components
beatmapButton.Action = () => RequestBeatmapSelection?.Invoke();
}
protected override void LoadComplete()
{
base.LoadComplete();
ShowBeatmapPanel.BindValueChanged(value => beatmapPanel.FadeTo(value.NewValue ? 1 : 0, 200, Easing.OutQuint), true);
}
private class BeatmapSelectButton : HeaderButton
{
[Resolved(typeof(Room), nameof(Room.RoomID))]