mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 20:07:29 +08:00
Merge pull request #17520 from smoogipoo/fix-countdown-refresh
Fix countdown timer not refreshing on new countdown
This commit is contained in:
commit
0020102810
@ -36,17 +36,18 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
|
||||
}
|
||||
|
||||
private MultiplayerCountdown countdown;
|
||||
private DateTimeOffset countdownReceivedTime;
|
||||
private DateTimeOffset countdownChangeTime;
|
||||
private ScheduledDelegate countdownUpdateDelegate;
|
||||
|
||||
private void onRoomUpdated() => Scheduler.AddOnce(() =>
|
||||
{
|
||||
if (countdown == null && room?.Countdown != null)
|
||||
countdownReceivedTime = DateTimeOffset.Now;
|
||||
|
||||
if (countdown != room?.Countdown)
|
||||
{
|
||||
countdown = room?.Countdown;
|
||||
countdownChangeTime = DateTimeOffset.Now;
|
||||
}
|
||||
|
||||
if (room?.Countdown != null)
|
||||
if (countdown != null)
|
||||
countdownUpdateDelegate ??= Scheduler.AddDelayed(updateButtonText, 100, true);
|
||||
else
|
||||
{
|
||||
@ -74,7 +75,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
|
||||
|
||||
if (countdown != null)
|
||||
{
|
||||
TimeSpan timeElapsed = DateTimeOffset.Now - countdownReceivedTime;
|
||||
TimeSpan timeElapsed = DateTimeOffset.Now - countdownChangeTime;
|
||||
TimeSpan countdownRemaining;
|
||||
|
||||
if (timeElapsed > countdown.TimeRemaining)
|
||||
|
Loading…
Reference in New Issue
Block a user