Fixing dls ui and fixed cancel cache validation breaking menu.
This commit is contained in:
@@ -25,6 +25,8 @@ public class DownloadUi : WindowMediatorSubscriberBase
|
|||||||
private readonly ConcurrentDictionary<GameObjectHandler, bool> _uploadingPlayers = new();
|
private readonly ConcurrentDictionary<GameObjectHandler, bool> _uploadingPlayers = new();
|
||||||
private readonly Dictionary<GameObjectHandler, Vector2> _smoothed = [];
|
private readonly Dictionary<GameObjectHandler, Vector2> _smoothed = [];
|
||||||
private readonly Dictionary<GameObjectHandler, DownloadSpeedTracker> _downloadSpeeds = [];
|
private readonly Dictionary<GameObjectHandler, DownloadSpeedTracker> _downloadSpeeds = [];
|
||||||
|
private readonly Dictionary<GameObjectHandler, (int TotalFiles, long TotalBytes)> _downloadInitialTotals = [];
|
||||||
|
|
||||||
|
|
||||||
private byte _transferBoxTransparency = 100;
|
private byte _transferBoxTransparency = 100;
|
||||||
private bool _notificationDismissed = true;
|
private bool _notificationDismissed = true;
|
||||||
@@ -66,6 +68,10 @@ public class DownloadUi : WindowMediatorSubscriberBase
|
|||||||
Mediator.Subscribe<DownloadStartedMessage>(this, (msg) =>
|
Mediator.Subscribe<DownloadStartedMessage>(this, (msg) =>
|
||||||
{
|
{
|
||||||
_currentDownloads[msg.DownloadId] = msg.DownloadStatus;
|
_currentDownloads[msg.DownloadId] = msg.DownloadStatus;
|
||||||
|
// Capture initial totals when download starts
|
||||||
|
var totalFiles = msg.DownloadStatus.Values.Sum(s => s.TotalFiles);
|
||||||
|
var totalBytes = msg.DownloadStatus.Values.Sum(s => s.TotalBytes);
|
||||||
|
_downloadInitialTotals[msg.DownloadId] = (totalFiles, totalBytes);
|
||||||
_notificationDismissed = false;
|
_notificationDismissed = false;
|
||||||
});
|
});
|
||||||
Mediator.Subscribe<DownloadFinishedMessage>(this, (msg) =>
|
Mediator.Subscribe<DownloadFinishedMessage>(this, (msg) =>
|
||||||
@@ -435,9 +441,13 @@ public class DownloadUi : WindowMediatorSubscriberBase
|
|||||||
var handler = transfer.Key;
|
var handler = transfer.Key;
|
||||||
var statuses = transfer.Value.Values;
|
var statuses = transfer.Value.Values;
|
||||||
|
|
||||||
var playerTotalFiles = statuses.Sum(s => s.TotalFiles);
|
var (playerTotalFiles, playerTotalBytes) = _downloadInitialTotals.TryGetValue(handler, out var totals)
|
||||||
var playerTransferredFiles = statuses.Sum(s => s.TransferredFiles);
|
? totals
|
||||||
var playerTotalBytes = statuses.Sum(s => s.TotalBytes);
|
: (statuses.Sum(s => s.TotalFiles), statuses.Sum(s => s.TotalBytes));
|
||||||
|
|
||||||
|
var playerTransferredFiles = statuses.Count(s =>
|
||||||
|
s.DownloadStatus == DownloadStatus.Decompressing ||
|
||||||
|
s.TransferredBytes >= s.TotalBytes);
|
||||||
var playerTransferredBytes = statuses.Sum(s => s.TransferredBytes);
|
var playerTransferredBytes = statuses.Sum(s => s.TransferredBytes);
|
||||||
|
|
||||||
totalFiles += playerTotalFiles;
|
totalFiles += playerTotalFiles;
|
||||||
|
|||||||
@@ -1925,14 +1925,25 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
{
|
{
|
||||||
using (ImRaii.PushIndent(20f))
|
using (ImRaii.PushIndent(20f))
|
||||||
{
|
{
|
||||||
if (_validationTask.IsCompleted)
|
if (_validationTask.IsCompletedSuccessfully)
|
||||||
{
|
{
|
||||||
UiSharedService.TextWrapped(
|
UiSharedService.TextWrapped(
|
||||||
$"The storage validation has completed and removed {_validationTask.Result.Count} invalid files from storage.");
|
$"The storage validation has completed and removed {_validationTask.Result.Count} invalid files from storage.");
|
||||||
}
|
}
|
||||||
|
else if (_validationTask.IsCanceled)
|
||||||
|
{
|
||||||
|
UiSharedService.ColorTextWrapped(
|
||||||
|
"Storage validation was cancelled.",
|
||||||
|
UIColors.Get("LightlessYellow"));
|
||||||
|
}
|
||||||
|
else if (_validationTask.IsFaulted)
|
||||||
|
{
|
||||||
|
UiSharedService.ColorTextWrapped(
|
||||||
|
"Storage validation failed with an error.",
|
||||||
|
UIColors.Get("DimRed"));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
UiSharedService.TextWrapped(
|
UiSharedService.TextWrapped(
|
||||||
$"Storage validation is running: {_currentProgress.Item1}/{_currentProgress.Item2}");
|
$"Storage validation is running: {_currentProgress.Item1}/{_currentProgress.Item2}");
|
||||||
if (_currentProgress.Item3 != null)
|
if (_currentProgress.Item3 != null)
|
||||||
|
|||||||
@@ -76,6 +76,19 @@
|
|||||||
"Microsoft.AspNetCore.SignalR.Common": "10.0.1"
|
"Microsoft.AspNetCore.SignalR.Common": "10.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Microsoft.Extensions.Caching.Memory": {
|
||||||
|
"type": "Direct",
|
||||||
|
"requested": "[10.0.1, )",
|
||||||
|
"resolved": "10.0.1",
|
||||||
|
"contentHash": "NxqSP0Ky4dZ5ybszdZCqs1X2C70s+dXflqhYBUh/vhcQVTIooNCXIYnLVbafoAFGZMs51d9+rHxveXs0ZC3SQQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Extensions.Caching.Abstractions": "10.0.1",
|
||||||
|
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.1",
|
||||||
|
"Microsoft.Extensions.Logging.Abstractions": "10.0.1",
|
||||||
|
"Microsoft.Extensions.Options": "10.0.1",
|
||||||
|
"Microsoft.Extensions.Primitives": "10.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"Microsoft.Extensions.Hosting": {
|
"Microsoft.Extensions.Hosting": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[10.0.1, )",
|
"requested": "[10.0.1, )",
|
||||||
@@ -233,6 +246,14 @@
|
|||||||
"Microsoft.AspNetCore.SignalR.Common": "10.0.1"
|
"Microsoft.AspNetCore.SignalR.Common": "10.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Microsoft.Extensions.Caching.Abstractions": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "10.0.1",
|
||||||
|
"contentHash": "Vb1vVAQDxHpXVdL9fpOX2BzeV7bbhzG4pAcIKRauRl0/VfkE8mq0f+fYC+gWICh3dlzTZInJ/cTeBS2MgU/XvQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Extensions.Primitives": "10.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"Microsoft.Extensions.Configuration": {
|
"Microsoft.Extensions.Configuration": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
"resolved": "10.0.1",
|
"resolved": "10.0.1",
|
||||||
@@ -618,7 +639,7 @@
|
|||||||
"FlatSharp.Compiler": "[7.9.0, )",
|
"FlatSharp.Compiler": "[7.9.0, )",
|
||||||
"FlatSharp.Runtime": "[7.9.0, )",
|
"FlatSharp.Runtime": "[7.9.0, )",
|
||||||
"OtterGui": "[1.0.0, )",
|
"OtterGui": "[1.0.0, )",
|
||||||
"Penumbra.Api": "[5.13.0, )",
|
"Penumbra.Api": "[5.13.1, )",
|
||||||
"Penumbra.String": "[1.0.7, )"
|
"Penumbra.String": "[1.0.7, )"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user