Include download percentage in dialog

pull/32/head
Pat Hartl 2023-11-12 01:26:51 -06:00
parent 1ede37c031
commit 81e4848407
1 changed files with 4 additions and 1 deletions

View File

@ -41,8 +41,11 @@ namespace LANCommander.PlaynitePlugin
gameManager.OnArchiveExtractionProgress += (long pos, long len) =>
{
var percent = Math.Ceiling((pos / (decimal)len) * 100);
progress.ProgressMaxValue = len;
progress.CurrentProgressValue = pos;
progress.Text = $"Downloading {Game.Name} ({percent}%)";
};
gameManager.OnArchiveEntryExtractionProgress += (object sender, ArchiveEntryExtractionProgressArgs e) =>
@ -57,7 +60,7 @@ namespace LANCommander.PlaynitePlugin
installDirectory = gameManager.Install(gameId);
},
new GlobalProgressOptions($"Downloading {Game.Name}...")
new GlobalProgressOptions($"Preparing to download {Game.Name}")
{
IsIndeterminate = false,
Cancelable = true,