extracting d2k setup.z works now, adapting the UI
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2012 The OpenRA Developers (see AUTHORS)
|
||||
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
@@ -78,15 +78,15 @@ namespace OpenRA.Mods.D2k.Widgets.Logic
|
||||
insertDiskContainer.IsVisible = () => false;
|
||||
installingContainer.IsVisible = () => true;
|
||||
|
||||
var dest = new string[] { Platform.SupportDir, "Content", "d2k", "Music" }.Aggregate(Path.Combine);
|
||||
var destMusic = new string[] { Platform.SupportDir, "Content", "d2k", "Music" }.Aggregate(Path.Combine);
|
||||
var destData = new [] { Platform.SupportDir, "Content", "d2k" }.Aggregate (Path.Combine);
|
||||
var copyFiles = new string[] { "music/ambush.aud", "music/arakatak.aud", "music/atregain.aud", "music/entordos.aud", "music/fightpwr.aud", "music/fremen.aud", "music/hark_bat.aud", "music/landsand.aud", "music/options.aud", "music/plotting.aud", "music/risehark.aud", "music/robotix.aud", "music/score.aud", "music/soldappr.aud", "music/spicesct.aud", "music/undercon.aud", "music/waitgame.aud" };
|
||||
|
||||
// TODO: won't work yet:
|
||||
//var extractPackage = "setup/setup.z";
|
||||
//var extractFiles = new string[] { "DATA.R8", "MOUSE.R8", "BLOXBASE.R8", "BLOXBAT.R8", "BLOXBGBS.R8", "BLOXICE.R8", "BLOXTREE.R8", "BLOXWAST.R8" };
|
||||
var extractPackage = "setup/setup.z";
|
||||
var extractFiles = new string[] { "SOUND.RS", "DATA.R8", "MOUSE.R8", "BLOXBASE.R8", "BLOXBAT.R8", "BLOXBGBS.R8", "BLOXICE.R8", "BLOXTREE.R8", "BLOXWAST.R8" };
|
||||
|
||||
var installCounter = 0;
|
||||
var installTotal = copyFiles.Count(); //+ extractFiles.Count();
|
||||
var installTotal = copyFiles.Count() + extractFiles.Count();
|
||||
|
||||
var onProgress = (Action<string>)(s => Game.RunAfterTick(() =>
|
||||
{
|
||||
@@ -107,15 +107,15 @@ namespace OpenRA.Mods.D2k.Widgets.Logic
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!InstallUtils.CopyFiles(source, copyFiles, dest, onProgress, onError))
|
||||
if (!InstallUtils.CopyFiles(source, copyFiles, destMusic, onProgress, onError))
|
||||
return;
|
||||
|
||||
//if (!InstallUtils.ExtractFromPackage(source, extractPackage, extractFiles, dest, onProgress, onError))
|
||||
// return;
|
||||
if (!InstallUtils.ExtractFromPackage(source, extractPackage, extractFiles, destData, onProgress, onError))
|
||||
return;
|
||||
|
||||
Game.RunAfterTick(() =>
|
||||
{
|
||||
statusLabel.GetText = () => "Music has been copied.";
|
||||
statusLabel.GetText = () => "Game assets have been extracted.";
|
||||
backButton.IsDisabled = () => false;
|
||||
continueLoading();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user