mirror of
https://github.com/osukey/osukey.git
synced 2025-05-30 01:47:30 +09:00
Fix potential crash from missing DownloadProgress
This commit is contained in:
parent
1914c41d0d
commit
0ac28cbecc
@ -1,10 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -25,9 +22,9 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
|
|||||||
{
|
{
|
||||||
private const double fade_time = 50;
|
private const double fade_time = 50;
|
||||||
|
|
||||||
private SpriteIcon icon;
|
private SpriteIcon icon = null!;
|
||||||
private OsuSpriteText text;
|
private OsuSpriteText text = null!;
|
||||||
private ProgressBar progressBar;
|
private ProgressBar progressBar = null!;
|
||||||
|
|
||||||
public StateDisplay()
|
public StateDisplay()
|
||||||
{
|
{
|
||||||
@ -86,7 +83,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private OsuColour colours;
|
private OsuColour colours = null!;
|
||||||
|
|
||||||
public void UpdateStatus(MultiplayerUserState state, BeatmapAvailability availability)
|
public void UpdateStatus(MultiplayerUserState state, BeatmapAvailability availability)
|
||||||
{
|
{
|
||||||
@ -164,10 +161,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case DownloadState.Downloading:
|
case DownloadState.Downloading:
|
||||||
Debug.Assert(availability.DownloadProgress != null);
|
|
||||||
|
|
||||||
progressBar.FadeIn(fade_time);
|
progressBar.FadeIn(fade_time);
|
||||||
progressBar.CurrentTime = availability.DownloadProgress.Value;
|
progressBar.CurrentTime = availability.DownloadProgress ?? 0;
|
||||||
|
|
||||||
text.Text = "downloading map";
|
text.Text = "downloading map";
|
||||||
icon.Icon = FontAwesome.Solid.ArrowAltCircleDown;
|
icon.Icon = FontAwesome.Solid.ArrowAltCircleDown;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user