1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-07 02:27:51 +08:00
osu-lazer/osu.Game/Screens/OnlinePlay/Multiplayer/Match/MultiplayerMatchFooter.cs

64 lines
2.0 KiB
C#
Raw Normal View History

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