2019-01-24 16:43:03 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-05-29 12:51:04 +08:00
|
|
|
|
|
2018-12-11 16:32:01 +08:00
|
|
|
|
using System;
|
2019-02-05 18:00:01 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
2018-05-29 12:51:04 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
|
using osu.Game.Graphics.Sprites;
|
|
|
|
|
using osu.Game.Overlays.SearchableList;
|
|
|
|
|
using osu.Game.Screens.Multi.Components;
|
2018-11-20 15:51:59 +08:00
|
|
|
|
using osuTK;
|
2018-05-29 12:51:04 +08:00
|
|
|
|
|
2018-12-10 18:20:41 +08:00
|
|
|
|
namespace osu.Game.Screens.Multi.Match.Components
|
2018-05-29 12:51:04 +08:00
|
|
|
|
{
|
2019-02-05 18:00:01 +08:00
|
|
|
|
public class Info : MultiplayerComposite
|
2018-05-29 12:51:04 +08:00
|
|
|
|
{
|
2018-12-11 16:32:01 +08:00
|
|
|
|
public Action OnStart;
|
|
|
|
|
|
2019-02-05 18:00:01 +08:00
|
|
|
|
public Info()
|
2018-05-29 12:51:04 +08:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X;
|
2018-12-14 13:20:03 +08:00
|
|
|
|
AutoSizeAxes = Axes.Y;
|
2019-02-05 18:00:01 +08:00
|
|
|
|
}
|
2018-05-29 12:51:04 +08:00
|
|
|
|
|
2019-02-05 18:00:01 +08:00
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load()
|
|
|
|
|
{
|
2018-12-14 14:04:04 +08:00
|
|
|
|
ReadyButton readyButton;
|
|
|
|
|
ViewBeatmapButton viewBeatmapButton;
|
2018-12-25 17:07:19 +08:00
|
|
|
|
HostInfo hostInfo;
|
2018-12-27 15:18:48 +08:00
|
|
|
|
RoomStatusInfo statusInfo;
|
2018-12-07 15:20:05 +08:00
|
|
|
|
|
2019-02-05 18:00:01 +08:00
|
|
|
|
InternalChildren = new Drawable[]
|
2018-05-29 12:51:04 +08:00
|
|
|
|
{
|
|
|
|
|
new Box
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Colour = OsuColour.FromHex(@"28242d"),
|
|
|
|
|
},
|
|
|
|
|
new Container
|
|
|
|
|
{
|
2018-12-14 13:20:03 +08:00
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
2019-01-25 13:10:59 +08:00
|
|
|
|
Padding = new MarginPadding { Horizontal = SearchableListOverlay.WIDTH_PADDING + OsuScreen.HORIZONTAL_OVERFLOW_PADDING },
|
2018-05-29 12:51:04 +08:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2018-12-14 13:20:03 +08:00
|
|
|
|
new FillFlowContainer
|
2018-05-29 12:51:04 +08:00
|
|
|
|
{
|
2018-12-14 13:20:03 +08:00
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
|
Spacing = new Vector2(0, 10),
|
2018-05-29 12:51:04 +08:00
|
|
|
|
Padding = new MarginPadding { Vertical = 20 },
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new FillFlowContainer
|
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2018-12-27 15:18:48 +08:00
|
|
|
|
new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
TextSize = 30,
|
2019-02-05 18:00:01 +08:00
|
|
|
|
Current = Name
|
2018-12-27 15:18:48 +08:00
|
|
|
|
},
|
2019-02-05 18:00:01 +08:00
|
|
|
|
new RoomStatusInfo(),
|
2018-12-14 13:20:03 +08:00
|
|
|
|
}
|
2018-05-29 12:51:04 +08:00
|
|
|
|
},
|
2018-12-25 17:07:19 +08:00
|
|
|
|
hostInfo = new HostInfo(),
|
2018-05-29 12:51:04 +08:00
|
|
|
|
},
|
|
|
|
|
},
|
2018-12-14 13:20:03 +08:00
|
|
|
|
new FillFlowContainer
|
2018-05-29 12:51:04 +08:00
|
|
|
|
{
|
2018-12-14 13:20:03 +08:00
|
|
|
|
Anchor = Anchor.CentreRight,
|
|
|
|
|
Origin = Anchor.CentreRight,
|
|
|
|
|
AutoSizeAxes = Axes.X,
|
|
|
|
|
Height = 70,
|
|
|
|
|
Spacing = new Vector2(10, 0),
|
|
|
|
|
Direction = FillDirection.Horizontal,
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2018-12-14 14:04:04 +08:00
|
|
|
|
viewBeatmapButton = new ViewBeatmapButton(),
|
2019-02-05 18:00:01 +08:00
|
|
|
|
readyButton = new ReadyButton
|
2018-12-14 13:20:03 +08:00
|
|
|
|
{
|
|
|
|
|
Action = () => OnStart?.Invoke()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-05-29 12:51:04 +08:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
2018-12-07 15:20:05 +08:00
|
|
|
|
|
2019-02-21 17:56:34 +08:00
|
|
|
|
CurrentItem.BindValueChanged(e =>
|
2019-02-11 18:11:34 +08:00
|
|
|
|
{
|
2019-02-21 17:56:34 +08:00
|
|
|
|
viewBeatmapButton.Beatmap.Value = e.NewValue?.Beatmap;
|
|
|
|
|
readyButton.Beatmap.Value = e.NewValue?.Beatmap;
|
2019-02-11 18:11:34 +08:00
|
|
|
|
}, true);
|
|
|
|
|
|
2019-02-05 18:00:01 +08:00
|
|
|
|
hostInfo.Host.BindTo(Host);
|
2018-05-29 12:51:04 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|