Esempio n. 1
0
        static void ExtractWZ(FileInfo path, string key)
        {
            var package = new WzPackage(path.FullName, key);

            package.Process();

            var outputDir = globalOutputDirectory.CreateSubdirectory(package.Name);

            if (Environment.GetEnvironmentVariable("EXTRACT_IMGS") == "1")
            {
                Console.WriteLine("Exporting IMGs to {0}", outputDir.FullName);
                package.Extract(outputDir);
            }

            var allTasks = ExtractWZDir(package, outputDir).ToArray();

            ProcessTasks(allTasks);


            var wzMapName = Environment.GetEnvironmentVariable("WZ_MAP_NAME");

            if (wzMapName != null)
            {
                var wzContentsMapPath = Path.Combine(outputDir.FullName, wzMapName + ".json");
                Console.WriteLine("Writing WZ file map to {0}...", wzContentsMapPath);

                File.WriteAllText(wzContentsMapPath, BuildWZContentsMap(package));
            }
        }
Esempio n. 2
0
        private void LoadContentsOfWZFiles(string key, params string[] files)
        {
            var ns = new WzNameSpace();

            foreach (var wzFile in files)
            {
                try
                {
                    var package = new WzPackage(wzFile, key, ns);
                    package.Process();
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Unable to load {0}: {1}", wzFile, ex);
                }
            }

            BeginTreeUpdate();
            LoadContentsSmart(ns);
            EndTreeUpdate();
        }
Esempio n. 3
0
        private void ExtractWZFile(string extractPath, params string[] wzFiles)
        {
            var key = Prompt("WZ Key?");

            foreach (var wzFile in wzFiles)
            {
                var fsp = new WzPackage(wzFile, key);

                try
                {
                    fsp.Process();
                }
                catch (Exception ex)
                {
                    ErrorMessage($"Exception occurred while loading file: {ex}");
                    return;
                }

                fsp.Extract(extractPath);
            }
            InfoMessage("Done extracting!");
        }
Esempio n. 4
0
        private void ExtractWZFile(string extractPath, params string[] wzFiles)
        {
            var outputFolder = new DirectoryInfo(extractPath);
            var key          = Prompt("WZ Key?");

            foreach (var wzFile in wzFiles)
            {
                using (var fsp = new WzPackage(wzFile, key))
                {
                    try
                    {
                        fsp.Process();
                    }
                    catch (Exception ex)
                    {
                        ErrorMessage($"Exception occurred while loading file: {ex}");
                        return;
                    }

                    fsp.Extract(outputFolder.CreateSubdirectory(fsp.Name));
                }
            }
            InfoMessage("Done extracting!");
        }