diff --git a/osu.Game.Tests/Online/TestSceneMultiplayerBeatmapTracker.cs b/osu.Game.Tests/Online/TestSceneMultiplayerBeatmapTracker.cs index 05e8f8b2e4..60a4508b3d 100644 --- a/osu.Game.Tests/Online/TestSceneMultiplayerBeatmapTracker.cs +++ b/osu.Game.Tests/Online/TestSceneMultiplayerBeatmapTracker.cs @@ -77,10 +77,10 @@ public void TestBeatmapDownloadingFlow() addAvailabilityCheckStep("state not downloaded", BeatmapAvailability.NotDownloaded); AddStep("start downloading", () => beatmaps.Download(testBeatmapSet)); - addAvailabilityCheckStep("state downloading 0%", () => BeatmapAvailability.Downloading(0.0)); + addAvailabilityCheckStep("state downloading 0%", () => BeatmapAvailability.Downloading(0.0f)); - AddStep("set progress 40%", () => ((TestDownloadRequest)beatmaps.GetExistingDownload(testBeatmapSet)).SetProgress(0.4)); - addAvailabilityCheckStep("state downloading 40%", () => BeatmapAvailability.Downloading(0.4)); + AddStep("set progress 40%", () => ((TestDownloadRequest)beatmaps.GetExistingDownload(testBeatmapSet)).SetProgress(0.4f)); + addAvailabilityCheckStep("state downloading 40%", () => BeatmapAvailability.Downloading(0.4f)); AddStep("finish download", () => ((TestDownloadRequest)beatmaps.GetExistingDownload(testBeatmapSet)).TriggerSuccess(testBeatmapFile)); addAvailabilityCheckStep("state importing", BeatmapAvailability.Importing); @@ -165,7 +165,7 @@ public override async Task Import(BeatmapSetInfo item, ArchiveRe private class TestDownloadRequest : ArchiveDownloadRequest { - public new void SetProgress(double progress) => base.SetProgress(progress); + public new void SetProgress(float progress) => base.SetProgress(progress); public TestDownloadRequest(BeatmapSetInfo model) : base(model) diff --git a/osu.Game/Online/API/ArchiveDownloadRequest.cs b/osu.Game/Online/API/ArchiveDownloadRequest.cs index fdb2a984dc..ccb4e9c119 100644 --- a/osu.Game/Online/API/ArchiveDownloadRequest.cs +++ b/osu.Game/Online/API/ArchiveDownloadRequest.cs @@ -12,16 +12,16 @@ public abstract class ArchiveDownloadRequest : APIDownloadRequest public double Progress { get; private set; } - public event Action DownloadProgressed; + public event Action DownloadProgressed; protected ArchiveDownloadRequest(TModel model) { Model = model; - Progressed += (current, total) => SetProgress((double)current / total); + Progressed += (current, total) => SetProgress((float)current / total); } - protected void SetProgress(double progress) + protected void SetProgress(float progress) { Progress = progress; DownloadProgressed?.Invoke(progress); diff --git a/osu.Game/Online/DownloadTrackingComposite.cs b/osu.Game/Online/DownloadTrackingComposite.cs index b72cf38369..1631d9790b 100644 --- a/osu.Game/Online/DownloadTrackingComposite.cs +++ b/osu.Game/Online/DownloadTrackingComposite.cs @@ -144,7 +144,7 @@ private void attachDownload(ArchiveDownloadRequest request) private void onRequestSuccess(string _) => Schedule(() => State.Value = DownloadState.Importing); - private void onRequestProgress(double progress) => Schedule(() => Progress.Value = progress); + private void onRequestProgress(float progress) => Schedule(() => Progress.Value = progress); private void onRequestFailure(Exception e) => Schedule(() => attachDownload(null)); diff --git a/osu.Game/Online/Rooms/BeatmapAvailability.cs b/osu.Game/Online/Rooms/BeatmapAvailability.cs index e7dbc5f436..170009a85b 100644 --- a/osu.Game/Online/Rooms/BeatmapAvailability.cs +++ b/osu.Game/Online/Rooms/BeatmapAvailability.cs @@ -19,17 +19,17 @@ public class BeatmapAvailability : IEquatable /// /// The beatmap's downloading progress, null when not in state. /// - public readonly double? DownloadProgress; + public readonly float? DownloadProgress; [JsonConstructor] - private BeatmapAvailability(DownloadState state, double? downloadProgress = null) + private BeatmapAvailability(DownloadState state, float? downloadProgress = null) { State = state; DownloadProgress = downloadProgress; } public static BeatmapAvailability NotDownloaded() => new BeatmapAvailability(DownloadState.NotDownloaded); - public static BeatmapAvailability Downloading(double progress) => new BeatmapAvailability(DownloadState.Downloading, progress); + public static BeatmapAvailability Downloading(float progress) => new BeatmapAvailability(DownloadState.Downloading, progress); public static BeatmapAvailability Importing() => new BeatmapAvailability(DownloadState.Importing); public static BeatmapAvailability LocallyAvailable() => new BeatmapAvailability(DownloadState.LocallyAvailable); diff --git a/osu.Game/Online/Rooms/MultiplayerBeatmapTracker.cs b/osu.Game/Online/Rooms/MultiplayerBeatmapTracker.cs index b22d17f3ef..b15399ad62 100644 --- a/osu.Game/Online/Rooms/MultiplayerBeatmapTracker.cs +++ b/osu.Game/Online/Rooms/MultiplayerBeatmapTracker.cs @@ -70,7 +70,7 @@ private void updateAvailability() break; case DownloadState.Downloading: - availability.Value = BeatmapAvailability.Downloading(Progress.Value); + availability.Value = BeatmapAvailability.Downloading((float)Progress.Value); break; case DownloadState.Importing: diff --git a/osu.Game/Overlays/Notifications/ProgressNotification.cs b/osu.Game/Overlays/Notifications/ProgressNotification.cs index e18bab8e83..3105ecd742 100644 --- a/osu.Game/Overlays/Notifications/ProgressNotification.cs +++ b/osu.Game/Overlays/Notifications/ProgressNotification.cs @@ -23,9 +23,9 @@ public string Text public string CompletionText { get; set; } = "Task has completed!"; - private double progress; + private float progress; - public double Progress + public float Progress { get => progress; set @@ -185,9 +185,9 @@ private class ProgressBar : Container private Color4 colourActive; private Color4 colourInactive; - private double progress; + private float progress; - public double Progress + public float Progress { get => progress; set @@ -195,7 +195,7 @@ public double Progress if (progress == value) return; progress = value; - box.ResizeTo(new Vector2((float)progress, 1), 100, Easing.OutQuad); + box.ResizeTo(new Vector2(progress, 1), 100, Easing.OutQuad); } }