Add bindings to ProgressBarWidget.

This commit is contained in:
Paul Chote
2014-03-16 18:02:15 +13:00
parent e2e0728e20
commit 6b199d3376
2 changed files with 28 additions and 17 deletions

View File

@@ -43,7 +43,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
void ShowDownloadDialog()
{
statusLabel.GetText = () => "Initializing...";
progressBar.SetIndeterminate(true);
progressBar.Indeterminate = true;
var retryButton = panel.Get<ButtonWidget>("RETRY_BUTTON");
retryButton.IsVisible = () => false;
@@ -55,9 +55,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
Action<DownloadProgressChangedEventArgs> onDownloadProgress = i =>
{
if (progressBar.Indeterminate)
progressBar.SetIndeterminate(false);
progressBar.Indeterminate = false;
progressBar.Percentage = i.ProgressPercentage;
statusLabel.GetText = () => "Downloading {1}/{2} kB ({0}%)".F(i.ProgressPercentage, i.BytesReceived / 1024, i.TotalBytesToReceive / 1024);
};
@@ -91,7 +89,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
// Automatically extract
statusLabel.GetText = () => "Extracting...";
progressBar.SetIndeterminate(true);
progressBar.Indeterminate = true;
if (InstallUtils.ExtractZip(file, dest, onExtractProgress, onError))
{
Game.RunAfterTick(() =>