Add Dictionary support to InstallUtils and fix D2k locking asset files;

Also fix D2k assets locations
This commit is contained in:
penev92
2015-05-10 19:20:53 +03:00
parent a4f85c6201
commit c8ab1e8370
6 changed files with 98 additions and 39 deletions

View File

@@ -80,8 +80,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var extractFiles = installData.ExtractFilesFromCD;
var overwrite = installData.OverwriteFiles;
var installCounter = 0;
var installTotal = copyFiles.Length + extractFiles.Length;
var installTotal = copyFiles.SelectMany(x => x.Value).Count() + extractFiles.SelectMany(x => x.Value).Count();
var onProgress = (Action<string>)(s => Game.RunAfterTick(() =>
{
progressBar.Percentage = installCounter * 100 / installTotal;
@@ -101,7 +102,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
try
{
if (!InstallUtils.CopyFiles(source, copyFiles, dest, onProgress, onError))
if (!InstallUtils.CopyFiles(source, copyFiles, dest, overwrite, onProgress, onError))
{
onError("Copying files from CD failed.");
return;
@@ -109,7 +110,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
if (!string.IsNullOrEmpty(extractPackage))
{
if (!InstallUtils.ExtractFromPackage(source, extractPackage, annotation, extractFiles, dest, onProgress, onError))
if (!InstallUtils.ExtractFromPackage(source, extractPackage, annotation, extractFiles, dest, overwrite, onProgress, onError))
{
onError("Extracting files from CD failed.");
return;