This commit is contained in:
Paul Chote
2011-06-24 17:08:58 +12:00
parent 8122d63a74
commit 916e63710c
2 changed files with 9 additions and 15 deletions

View File

@@ -48,8 +48,6 @@ namespace OpenRA.FileFormats
destStream.Write(sourceStream.ReadAllBytes());
}
}
onProgress("Extraction complete");
return true;
}
@@ -67,7 +65,6 @@ namespace OpenRA.FileFormats
onProgress("Extracting "+destFile);
File.Copy(fromPath, Path.Combine(destPath, destFile), true);
}
onProgress("Extraction complete");
return true;
}
@@ -84,7 +81,6 @@ namespace OpenRA.FileFormats
{
var z = new ZipInputStream(File.OpenRead(zipFile));
z.ExtractZip(dest, extracted, s => onProgress("Extracting "+s));
onProgress("Extraction complete");
}
catch (SharpZipBaseException)
{

View File

@@ -71,23 +71,21 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
progressBar.SetIndeterminate(false);
var installCounter = 0;
var onProgress = (Action<string>)(s =>
var installTotal = copyFiles.Count() + extractFiles.Count();
var onProgress = (Action<string>)(s => Game.RunAfterTick(() =>
{
progressBar.Percentage = installCounter*100/(copyFiles.Count() + extractFiles.Count());
progressBar.Percentage = installCounter*100/installTotal;
installCounter++;
statusLabel.GetText = () => s;
});
}));
var onError = (Action<string>)(s =>
{
Game.RunAfterTick(() =>
var onError = (Action<string>)(s => Game.RunAfterTick(() =>
{
statusLabel.GetText = () => "Error: "+s;
panel.GetWidget("RETRY_BUTTON").IsVisible = () => true;
panel.GetWidget("BACK_BUTTON").IsVisible = () => true;
});
});
}));
string source;
try