2020-12-19 01:59:11 +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.
|
|
|
|
|
2020-12-29 14:51:46 +08:00
|
|
|
using System;
|
2022-03-17 17:43:04 +08:00
|
|
|
using System.Diagnostics;
|
2020-12-19 01:59:11 +08:00
|
|
|
using System.Linq;
|
2022-03-17 18:05:28 +08:00
|
|
|
using Humanizer;
|
2022-03-17 17:43:04 +08:00
|
|
|
using JetBrains.Annotations;
|
2020-12-19 01:59:11 +08:00
|
|
|
using osu.Framework.Allocation;
|
2020-12-24 16:17:45 +08:00
|
|
|
using osu.Framework.Audio;
|
|
|
|
using osu.Framework.Audio.Sample;
|
2020-12-19 01:59:11 +08:00
|
|
|
using osu.Framework.Bindables;
|
2022-03-17 18:05:28 +08:00
|
|
|
using osu.Framework.Extensions;
|
2020-12-19 01:59:11 +08:00
|
|
|
using osu.Framework.Graphics;
|
2022-03-17 18:05:28 +08:00
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
using osu.Framework.Graphics.Cursor;
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
using osu.Framework.Graphics.UserInterface;
|
2022-03-17 18:26:42 +08:00
|
|
|
using osu.Framework.Localisation;
|
2021-08-27 17:57:18 +08:00
|
|
|
using osu.Framework.Threading;
|
2020-12-19 01:59:11 +08:00
|
|
|
using osu.Game.Graphics;
|
|
|
|
using osu.Game.Graphics.Backgrounds;
|
2022-03-17 18:05:28 +08:00
|
|
|
using osu.Game.Graphics.UserInterface;
|
|
|
|
using osu.Game.Graphics.UserInterfaceV2;
|
2020-12-19 01:59:11 +08:00
|
|
|
using osu.Game.Online.Multiplayer;
|
2022-03-17 18:26:42 +08:00
|
|
|
using osu.Game.Online.Multiplayer.Countdown;
|
2020-12-19 01:59:11 +08:00
|
|
|
using osuTK;
|
|
|
|
|
2020-12-25 23:50:00 +08:00
|
|
|
namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
|
2020-12-19 01:59:11 +08:00
|
|
|
{
|
2020-12-25 12:38:11 +08:00
|
|
|
public class MultiplayerReadyButton : MultiplayerRoomComposite
|
2020-12-19 01:59:11 +08:00
|
|
|
{
|
2020-12-29 03:59:38 +08:00
|
|
|
[Resolved]
|
2020-12-29 15:20:43 +08:00
|
|
|
private OngoingOperationTracker ongoingOperationTracker { get; set; }
|
2020-12-29 03:59:38 +08:00
|
|
|
|
2022-03-17 17:43:04 +08:00
|
|
|
[CanBeNull]
|
|
|
|
private IDisposable clickOperation;
|
2021-01-08 16:24:55 +08:00
|
|
|
|
2021-08-26 14:29:22 +08:00
|
|
|
private Sample sampleReady;
|
|
|
|
private Sample sampleReadyAll;
|
|
|
|
private Sample sampleUnready;
|
2020-12-24 16:17:45 +08:00
|
|
|
|
2022-03-17 18:05:28 +08:00
|
|
|
private readonly BindableBool enabled = new BindableBool();
|
|
|
|
private readonly CountdownButton countdownButton;
|
2020-12-24 16:17:45 +08:00
|
|
|
private int countReady;
|
2021-08-27 17:57:18 +08:00
|
|
|
private ScheduledDelegate readySampleDelegate;
|
2022-03-17 17:43:04 +08:00
|
|
|
private IBindable<bool> operationInProgress;
|
2021-08-27 17:57:18 +08:00
|
|
|
|
2020-12-25 12:38:11 +08:00
|
|
|
public MultiplayerReadyButton()
|
2020-12-19 01:59:11 +08:00
|
|
|
{
|
2022-03-17 18:05:28 +08:00
|
|
|
InternalChild = new GridContainer
|
2020-12-19 01:59:11 +08:00
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2022-03-17 18:05:28 +08:00
|
|
|
ColumnDimensions = new[]
|
|
|
|
{
|
|
|
|
new Dimension(),
|
|
|
|
new Dimension(GridSizeMode.AutoSize)
|
|
|
|
},
|
|
|
|
Content = new[]
|
|
|
|
{
|
|
|
|
new Drawable[]
|
|
|
|
{
|
|
|
|
new ReadyButton
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Size = Vector2.One,
|
|
|
|
Action = onReadyClick,
|
|
|
|
Enabled = { BindTarget = enabled },
|
|
|
|
},
|
|
|
|
countdownButton = new CountdownButton
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Y,
|
|
|
|
Size = new Vector2(40, 1),
|
|
|
|
Alpha = 0,
|
|
|
|
Action = startCountdown,
|
|
|
|
Enabled = { BindTarget = enabled }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-12-19 01:59:11 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-12-24 16:17:45 +08:00
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load(AudioManager audio)
|
|
|
|
{
|
2020-12-29 15:20:43 +08:00
|
|
|
operationInProgress = ongoingOperationTracker.InProgress.GetBoundCopy();
|
|
|
|
operationInProgress.BindValueChanged(_ => updateState());
|
2021-08-26 14:29:22 +08:00
|
|
|
|
|
|
|
sampleReady = audio.Samples.Get(@"Multiplayer/player-ready");
|
|
|
|
sampleReadyAll = audio.Samples.Get(@"Multiplayer/player-ready-all");
|
|
|
|
sampleUnready = audio.Samples.Get(@"Multiplayer/player-unready");
|
2020-12-24 16:17:45 +08:00
|
|
|
}
|
|
|
|
|
2021-12-10 19:08:59 +08:00
|
|
|
protected override void LoadComplete()
|
|
|
|
{
|
|
|
|
base.LoadComplete();
|
|
|
|
|
2022-02-24 15:20:40 +08:00
|
|
|
CurrentPlaylistItem.BindValueChanged(_ => updateState());
|
2021-12-10 19:08:59 +08:00
|
|
|
}
|
|
|
|
|
2020-12-26 09:48:55 +08:00
|
|
|
protected override void OnRoomUpdated()
|
2020-12-19 01:59:11 +08:00
|
|
|
{
|
2020-12-26 09:48:55 +08:00
|
|
|
base.OnRoomUpdated();
|
2020-12-19 01:59:11 +08:00
|
|
|
updateState();
|
|
|
|
}
|
|
|
|
|
2022-03-17 17:43:04 +08:00
|
|
|
protected override void OnRoomLoadRequested()
|
|
|
|
{
|
|
|
|
base.OnRoomLoadRequested();
|
|
|
|
endOperation();
|
|
|
|
}
|
|
|
|
|
|
|
|
private void onReadyClick()
|
|
|
|
{
|
|
|
|
if (Room == null)
|
|
|
|
return;
|
|
|
|
|
|
|
|
Debug.Assert(clickOperation == null);
|
|
|
|
clickOperation = ongoingOperationTracker.BeginOperation();
|
|
|
|
|
|
|
|
// Ensure the current user becomes ready before being able to do anything else (start match, stop countdown, unready).
|
2022-03-18 21:00:39 +08:00
|
|
|
if (!isReady() || !Client.IsHost || Room.Settings.AutoStartDuration != TimeSpan.Zero)
|
2022-03-17 17:43:04 +08:00
|
|
|
{
|
|
|
|
toggleReady();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2022-03-17 18:26:42 +08:00
|
|
|
// Local user is the room host and is in a ready state.
|
|
|
|
// The only action they can take is to stop a countdown if one's currently running.
|
|
|
|
if (Room.Countdown != null)
|
|
|
|
{
|
|
|
|
stopCountdown();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2022-03-17 17:43:04 +08:00
|
|
|
// And if a countdown isn't running, start the match.
|
|
|
|
startMatch();
|
|
|
|
|
|
|
|
bool isReady() => Client.LocalUser?.State == MultiplayerUserState.Ready || Client.LocalUser?.State == MultiplayerUserState.Spectating;
|
|
|
|
|
|
|
|
void toggleReady() => Client.ToggleReady().ContinueWith(_ => endOperation());
|
|
|
|
|
2022-03-17 18:26:42 +08:00
|
|
|
void stopCountdown() => Client.SendMatchRequest(new StopCountdownRequest()).ContinueWith(_ => endOperation());
|
|
|
|
|
2022-03-17 17:43:04 +08:00
|
|
|
void startMatch() => Client.StartMatch().ContinueWith(t =>
|
|
|
|
{
|
|
|
|
// accessing Exception here silences any potential errors from the antecedent task
|
|
|
|
if (t.Exception != null)
|
|
|
|
{
|
|
|
|
// gameplay was not started due to an exception; unblock button.
|
|
|
|
endOperation();
|
|
|
|
}
|
|
|
|
|
|
|
|
// gameplay is starting, the button will be unblocked on load requested.
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-03-17 18:05:28 +08:00
|
|
|
private void startCountdown(TimeSpan duration)
|
|
|
|
{
|
2022-03-17 18:26:42 +08:00
|
|
|
Debug.Assert(clickOperation == null);
|
|
|
|
clickOperation = ongoingOperationTracker.BeginOperation();
|
|
|
|
|
2022-03-18 20:05:19 +08:00
|
|
|
Client.SendMatchRequest(new StartMatchCountdownRequest { Delay = duration }).ContinueWith(_ => endOperation());
|
2022-03-17 18:05:28 +08:00
|
|
|
}
|
|
|
|
|
2022-03-17 17:43:04 +08:00
|
|
|
private void endOperation()
|
|
|
|
{
|
|
|
|
clickOperation?.Dispose();
|
|
|
|
clickOperation = null;
|
|
|
|
}
|
|
|
|
|
2020-12-19 01:59:11 +08:00
|
|
|
private void updateState()
|
|
|
|
{
|
2022-03-17 17:58:09 +08:00
|
|
|
if (Room == null)
|
2020-12-19 01:59:11 +08:00
|
|
|
{
|
2022-03-17 18:05:28 +08:00
|
|
|
enabled.Value = false;
|
2022-03-17 17:58:09 +08:00
|
|
|
return;
|
2020-12-19 01:59:11 +08:00
|
|
|
}
|
2020-12-24 16:17:45 +08:00
|
|
|
|
2022-03-17 17:58:09 +08:00
|
|
|
var localUser = Client.LocalUser;
|
|
|
|
|
|
|
|
int newCountReady = Room.Users.Count(u => u.State == MultiplayerUserState.Ready);
|
|
|
|
int newCountTotal = Room.Users.Count(u => u.State != MultiplayerUserState.Spectating);
|
|
|
|
|
2022-03-18 21:00:39 +08:00
|
|
|
if (Room.Countdown != null || Room.Settings.AutoStartDuration != TimeSpan.Zero)
|
2022-03-17 18:26:42 +08:00
|
|
|
countdownButton.Alpha = 0;
|
|
|
|
else
|
2022-03-17 18:05:28 +08:00
|
|
|
{
|
2022-03-17 18:26:42 +08:00
|
|
|
switch (localUser?.State)
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
countdownButton.Alpha = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case MultiplayerUserState.Spectating:
|
|
|
|
case MultiplayerUserState.Ready:
|
|
|
|
countdownButton.Alpha = Room.Host?.Equals(localUser) == true ? 1 : 0;
|
|
|
|
break;
|
|
|
|
}
|
2022-03-17 18:05:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
enabled.Value =
|
2022-03-17 17:58:09 +08:00
|
|
|
Room.State == MultiplayerRoomState.Open
|
2022-02-24 15:20:40 +08:00
|
|
|
&& CurrentPlaylistItem.Value?.ID == Room.Settings.PlaylistItemId
|
2021-12-10 19:08:59 +08:00
|
|
|
&& !Room.Playlist.Single(i => i.ID == Room.Settings.PlaylistItemId).Expired
|
2021-11-10 17:42:46 +08:00
|
|
|
&& !operationInProgress.Value;
|
2020-12-29 03:59:38 +08:00
|
|
|
|
2021-04-08 15:30:48 +08:00
|
|
|
// When the local user is the host and spectating the match, the "start match" state should be enabled if any users are ready.
|
2021-07-13 16:59:35 +08:00
|
|
|
if (localUser?.State == MultiplayerUserState.Spectating)
|
2022-03-17 18:05:28 +08:00
|
|
|
enabled.Value &= Room.Host?.Equals(localUser) == true && newCountReady > 0;
|
2021-04-07 15:35:36 +08:00
|
|
|
|
2021-08-26 14:29:22 +08:00
|
|
|
if (newCountReady == countReady)
|
|
|
|
return;
|
|
|
|
|
2021-08-27 17:57:18 +08:00
|
|
|
readySampleDelegate?.Cancel();
|
|
|
|
readySampleDelegate = Schedule(() =>
|
2021-08-26 14:29:22 +08:00
|
|
|
{
|
2021-08-27 17:57:18 +08:00
|
|
|
if (newCountReady > countReady)
|
|
|
|
{
|
|
|
|
if (newCountReady == newCountTotal)
|
|
|
|
sampleReadyAll?.Play();
|
|
|
|
else
|
|
|
|
sampleReady?.Play();
|
|
|
|
}
|
|
|
|
else if (newCountReady < countReady)
|
2021-08-26 14:29:22 +08:00
|
|
|
{
|
|
|
|
sampleUnready?.Play();
|
|
|
|
}
|
2020-12-24 19:45:01 +08:00
|
|
|
|
2021-08-27 17:57:18 +08:00
|
|
|
countReady = newCountReady;
|
|
|
|
});
|
2020-12-19 01:59:11 +08:00
|
|
|
}
|
|
|
|
|
2022-03-17 17:58:09 +08:00
|
|
|
public class ReadyButton : Components.ReadyButton
|
2020-12-19 01:59:11 +08:00
|
|
|
{
|
2022-03-17 17:58:09 +08:00
|
|
|
public new Triangles Triangles => base.Triangles;
|
|
|
|
|
|
|
|
[Resolved]
|
|
|
|
private MultiplayerClient multiplayerClient { get; set; }
|
|
|
|
|
|
|
|
[Resolved]
|
|
|
|
private OsuColour colours { get; set; }
|
|
|
|
|
|
|
|
[CanBeNull]
|
|
|
|
private MultiplayerRoom room => multiplayerClient.Room;
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
2020-12-19 01:59:11 +08:00
|
|
|
{
|
2022-03-17 17:58:09 +08:00
|
|
|
base.LoadComplete();
|
|
|
|
|
|
|
|
multiplayerClient.RoomUpdated += () => Scheduler.AddOnce(onRoomUpdated);
|
|
|
|
onRoomUpdated();
|
2020-12-19 01:59:11 +08:00
|
|
|
}
|
2022-03-17 17:58:09 +08:00
|
|
|
|
2022-03-17 18:26:42 +08:00
|
|
|
protected override void Update()
|
|
|
|
{
|
|
|
|
base.Update();
|
|
|
|
|
|
|
|
if (room?.Countdown != null)
|
|
|
|
{
|
|
|
|
// Update the countdown timer.
|
|
|
|
onRoomUpdated();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-17 17:58:09 +08:00
|
|
|
private void onRoomUpdated()
|
2020-12-19 01:59:11 +08:00
|
|
|
{
|
2022-03-17 17:58:09 +08:00
|
|
|
updateButtonText();
|
|
|
|
updateButtonColour();
|
2020-12-19 01:59:11 +08:00
|
|
|
}
|
|
|
|
|
2022-03-17 17:58:09 +08:00
|
|
|
private void updateButtonText()
|
|
|
|
{
|
|
|
|
if (room == null)
|
|
|
|
{
|
|
|
|
Text = "Ready";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
var localUser = multiplayerClient.LocalUser;
|
|
|
|
|
|
|
|
int countReady = room.Users.Count(u => u.State == MultiplayerUserState.Ready);
|
|
|
|
int countTotal = room.Users.Count(u => u.State != MultiplayerUserState.Spectating);
|
|
|
|
|
2022-03-17 18:26:42 +08:00
|
|
|
string countdownText = room.Countdown == null ? string.Empty : $"Starting in {room.Countdown.EndTime - DateTimeOffset.Now:mm\\:ss}";
|
2022-03-17 17:58:09 +08:00
|
|
|
string countText = $"({countReady} / {countTotal} ready)";
|
|
|
|
|
2022-03-17 18:26:42 +08:00
|
|
|
if (room.Countdown != null)
|
2022-03-17 17:58:09 +08:00
|
|
|
{
|
2022-03-17 18:26:42 +08:00
|
|
|
switch (localUser?.State)
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
Text = $"Ready ({countdownText.ToLowerInvariant()})";
|
|
|
|
break;
|
|
|
|
|
|
|
|
case MultiplayerUserState.Spectating:
|
|
|
|
case MultiplayerUserState.Ready:
|
|
|
|
Text = $"{countdownText} {countText}";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
switch (localUser?.State)
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
Text = "Ready";
|
|
|
|
break;
|
2022-03-17 17:58:09 +08:00
|
|
|
|
2022-03-17 18:26:42 +08:00
|
|
|
case MultiplayerUserState.Spectating:
|
|
|
|
case MultiplayerUserState.Ready:
|
|
|
|
Text = room.Host?.Equals(localUser) == true
|
|
|
|
? $"Start match {countText}"
|
|
|
|
: $"Waiting for host... {countText}";
|
2022-03-17 17:58:09 +08:00
|
|
|
|
2022-03-17 18:26:42 +08:00
|
|
|
break;
|
|
|
|
}
|
2022-03-17 17:58:09 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private void updateButtonColour()
|
|
|
|
{
|
|
|
|
if (room == null)
|
|
|
|
{
|
|
|
|
setGreen();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
var localUser = multiplayerClient.LocalUser;
|
|
|
|
|
2022-03-17 18:26:42 +08:00
|
|
|
if (room.Countdown != null)
|
2022-03-17 17:58:09 +08:00
|
|
|
{
|
2022-03-17 18:26:42 +08:00
|
|
|
switch (localUser?.State)
|
|
|
|
{
|
|
|
|
default:
|
2022-03-17 17:58:09 +08:00
|
|
|
setGreen();
|
2022-03-17 18:26:42 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case MultiplayerUserState.Spectating:
|
|
|
|
case MultiplayerUserState.Ready:
|
2022-03-17 17:58:09 +08:00
|
|
|
setYellow();
|
2022-03-17 18:26:42 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
switch (localUser?.State)
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
setGreen();
|
|
|
|
break;
|
2022-03-17 17:58:09 +08:00
|
|
|
|
2022-03-17 18:26:42 +08:00
|
|
|
case MultiplayerUserState.Spectating:
|
|
|
|
case MultiplayerUserState.Ready:
|
|
|
|
if (room?.Host?.Equals(localUser) == true)
|
|
|
|
setGreen();
|
|
|
|
else
|
|
|
|
setYellow();
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
2022-03-17 17:58:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void setYellow()
|
|
|
|
{
|
|
|
|
BackgroundColour = colours.YellowDark;
|
|
|
|
Triangles.ColourDark = colours.YellowDark;
|
|
|
|
Triangles.ColourLight = colours.Yellow;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setGreen()
|
|
|
|
{
|
|
|
|
BackgroundColour = colours.Green;
|
|
|
|
Triangles.ColourDark = colours.Green;
|
|
|
|
Triangles.ColourLight = colours.GreenLight;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void Dispose(bool isDisposing)
|
|
|
|
{
|
|
|
|
base.Dispose(isDisposing);
|
|
|
|
|
|
|
|
if (multiplayerClient != null)
|
|
|
|
multiplayerClient.RoomUpdated -= onRoomUpdated;
|
|
|
|
}
|
2022-03-17 18:26:42 +08:00
|
|
|
|
|
|
|
public override LocalisableString TooltipText
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
if (room?.Countdown != null && multiplayerClient.IsHost && multiplayerClient.LocalUser?.State == MultiplayerUserState.Ready)
|
|
|
|
return "Cancel countdown";
|
|
|
|
|
|
|
|
return base.TooltipText;
|
|
|
|
}
|
|
|
|
}
|
2020-12-19 01:59:11 +08:00
|
|
|
}
|
2022-03-17 18:05:28 +08:00
|
|
|
|
|
|
|
public class CountdownButton : IconButton, IHasPopover
|
|
|
|
{
|
|
|
|
private static readonly TimeSpan[] available_delays =
|
|
|
|
{
|
|
|
|
TimeSpan.FromSeconds(10),
|
|
|
|
TimeSpan.FromSeconds(30),
|
|
|
|
TimeSpan.FromMinutes(1),
|
|
|
|
TimeSpan.FromMinutes(2)
|
|
|
|
};
|
|
|
|
|
|
|
|
public new Action<TimeSpan> Action;
|
|
|
|
|
|
|
|
private readonly Drawable background;
|
|
|
|
|
|
|
|
public CountdownButton()
|
|
|
|
{
|
|
|
|
Icon = FontAwesome.Solid.CaretDown;
|
|
|
|
IconScale = new Vector2(0.6f);
|
|
|
|
|
|
|
|
Add(background = new Box
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Depth = float.MaxValue
|
|
|
|
});
|
|
|
|
|
|
|
|
base.Action = this.ShowPopover;
|
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
{
|
|
|
|
background.Colour = colours.Green;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Popover GetPopover()
|
|
|
|
{
|
|
|
|
var flow = new FillFlowContainer
|
|
|
|
{
|
|
|
|
Width = 200,
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
Spacing = new Vector2(2),
|
|
|
|
};
|
|
|
|
|
|
|
|
foreach (var duration in available_delays)
|
|
|
|
{
|
|
|
|
flow.Add(new PopoverButton
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
Text = $"Start match in {duration.Humanize()}",
|
|
|
|
BackgroundColour = background.Colour,
|
|
|
|
Action = () =>
|
|
|
|
{
|
|
|
|
Action(duration);
|
|
|
|
this.HidePopover();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
return new OsuPopover { Child = flow };
|
|
|
|
}
|
|
|
|
|
|
|
|
public class PopoverButton : OsuButton
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
2020-12-19 01:59:11 +08:00
|
|
|
}
|
|
|
|
}
|