2020-12-21 00:04:06 +09: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.
|
|
|
|
|
2020-12-29 07:51:46 +01:00
|
|
|
using System;
|
2020-12-21 00:04:06 +09:00
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
2020-12-25 16:50:00 +01:00
|
|
|
namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
|
2020-12-21 00:04:06 +09:00
|
|
|
{
|
2020-12-25 13:38:11 +09:00
|
|
|
public class MultiplayerMatchFooter : CompositeDrawable
|
2020-12-21 00:04:06 +09:00
|
|
|
{
|
2021-04-07 17:35:18 +09:00
|
|
|
private const float ready_button_width = 600;
|
|
|
|
private const float spectate_button_width = 200;
|
2020-12-21 00:04:06 +09:00
|
|
|
|
2020-12-30 16:29:36 +01:00
|
|
|
public Action OnReadyClick
|
2020-12-29 07:51:46 +01:00
|
|
|
{
|
2020-12-30 16:29:36 +01:00
|
|
|
set => readyButton.OnReadyClick = value;
|
2020-12-29 07:51:46 +01:00
|
|
|
}
|
|
|
|
|
2021-04-07 17:35:18 +09:00
|
|
|
public Action OnSpectateClick
|
|
|
|
{
|
|
|
|
set => spectateButton.OnSpectateClick = value;
|
|
|
|
}
|
|
|
|
|
2020-12-29 07:51:46 +01:00
|
|
|
private readonly MultiplayerReadyButton readyButton;
|
2021-04-07 17:35:18 +09:00
|
|
|
private readonly MultiplayerSpectateButton spectateButton;
|
2020-12-21 00:04:06 +09:00
|
|
|
|
2020-12-25 13:38:11 +09:00
|
|
|
public MultiplayerMatchFooter()
|
2020-12-21 00:04:06 +09:00
|
|
|
{
|
2021-08-18 20:21:29 +09:00
|
|
|
RelativeSizeAxes = Axes.Both;
|
2020-12-21 00:04:06 +09:00
|
|
|
|
2021-08-18 20:21:29 +09:00
|
|
|
InternalChild = new GridContainer
|
2020-12-21 00:04:06 +09:00
|
|
|
{
|
2021-08-18 20:21:29 +09:00
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Content = new[]
|
2020-12-21 00:04:06 +09:00
|
|
|
{
|
2021-08-18 20:21:29 +09:00
|
|
|
new Drawable[]
|
2021-04-07 17:35:18 +09:00
|
|
|
{
|
2021-08-18 20:21:29 +09:00
|
|
|
null,
|
|
|
|
spectateButton = new MultiplayerSpectateButton
|
2021-04-07 17:35:18 +09:00
|
|
|
{
|
2021-08-18 20:21:29 +09:00
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
},
|
|
|
|
null,
|
|
|
|
readyButton = new MultiplayerReadyButton
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
},
|
|
|
|
null
|
2021-04-07 17:35:18 +09:00
|
|
|
}
|
2021-08-18 20:21:29 +09:00
|
|
|
},
|
|
|
|
ColumnDimensions = new[]
|
|
|
|
{
|
|
|
|
new Dimension(),
|
|
|
|
new Dimension(maxSize: spectate_button_width),
|
2021-08-19 19:08:46 +09:00
|
|
|
new Dimension(GridSizeMode.Absolute, 5),
|
2021-08-18 20:21:29 +09:00
|
|
|
new Dimension(maxSize: ready_button_width),
|
|
|
|
new Dimension()
|
2020-12-21 00:04:06 +09:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|