Include download percentage in dialog
This commit is contained in:
parent
1ede37c031
commit
81e4848407
1 changed files with 4 additions and 1 deletions
|
@ -41,8 +41,11 @@ namespace LANCommander.PlaynitePlugin
|
||||||
|
|
||||||
gameManager.OnArchiveExtractionProgress += (long pos, long len) =>
|
gameManager.OnArchiveExtractionProgress += (long pos, long len) =>
|
||||||
{
|
{
|
||||||
|
var percent = Math.Ceiling((pos / (decimal)len) * 100);
|
||||||
|
|
||||||
progress.ProgressMaxValue = len;
|
progress.ProgressMaxValue = len;
|
||||||
progress.CurrentProgressValue = pos;
|
progress.CurrentProgressValue = pos;
|
||||||
|
progress.Text = $"Downloading {Game.Name} ({percent}%)";
|
||||||
};
|
};
|
||||||
|
|
||||||
gameManager.OnArchiveEntryExtractionProgress += (object sender, ArchiveEntryExtractionProgressArgs e) =>
|
gameManager.OnArchiveEntryExtractionProgress += (object sender, ArchiveEntryExtractionProgressArgs e) =>
|
||||||
|
@ -57,7 +60,7 @@ namespace LANCommander.PlaynitePlugin
|
||||||
|
|
||||||
installDirectory = gameManager.Install(gameId);
|
installDirectory = gameManager.Install(gameId);
|
||||||
},
|
},
|
||||||
new GlobalProgressOptions($"Downloading {Game.Name}...")
|
new GlobalProgressOptions($"Preparing to download {Game.Name}")
|
||||||
{
|
{
|
||||||
IsIndeterminate = false,
|
IsIndeterminate = false,
|
||||||
Cancelable = true,
|
Cancelable = true,
|
||||||
|
|
Loading…
Add table
Reference in a new issue