Ejemplo n.º 1
0
        // Export FPK archive with specified parameters
        public static void WriteFpkArchive(string FileName, string SourceDirectory, List <string> Files)
        {
            FpkFile q = new FpkFile()
            {
                Name = FileName
            };

            foreach (string s in Files)
            {
                q.Entries.Add(new FpkEntry()
                {
                    FilePath = s
                });
            }

            using (FileStream outFile = new FileStream(FileName, FileMode.Create))
            {
                IDirectory fileDirectory = new FileSystemDirectory(SourceDirectory);
                q.Write(outFile, fileDirectory);
            }
        }
Ejemplo n.º 2
0
        // Export FPK archive with specified parameters
        public static void WriteFpkArchive(string FileName, string SourceDirectory, List <string> Files)
        {
            Debug.LogLine(String.Format("[GzsLib] Writing FPK archive: {0}", FileName));
            FpkFile q = new FpkFile()
            {
                Name = FileName
            };

            foreach (string s in Files)
            {
                q.Entries.Add(new FpkEntry()
                {
                    FilePath = Tools.ToQarPath(s)
                });
            }

            using (FileStream outFile = new FileStream(FileName, FileMode.Create))
            {
                IDirectory fileDirectory = new FileSystemDirectory(SourceDirectory);
                q.Write(outFile, fileDirectory);
            }
        }
Ejemplo n.º 3
0
        // Export FPK archive with specified parameters
        public static void WriteFpkArchive(string FileName, string SourceDirectory, List <string> Files, List <string> references)
        {
            Debug.LogLine(String.Format("[GzsLib] Writing FPK archive: {0}", FileName));
            //tex smakebite for a for a long time (till 2021) only created fpkds with the FpkType as Fpk
            //to no obvious issue with fox engine (and I wouldn't think FpkType would be used, maybe for some editor/data managment stuff, but wouldn't imagine it being used for runtime).
            string        fpkType        = FileName.EndsWith(".fpkd") ? "fpkd" : "fpk";
            List <string> fpkFilesSorted = SortFpksFiles(fpkType, Files);

            FpkFile q = new FpkFile()
            {
                Name = FileName, FpkType = (fpkType == "fpkd" ? FpkType.Fpkd : FpkType.Fpk)
            };

            foreach (string s in fpkFilesSorted)
            {
                q.Entries.Add(new FpkEntry()
                {
                    FilePath = Tools.ToQarPath(s)
                });
            }
            //tex likewise smakebite didn't write/preserve references, to no apparent issue for fox.
            foreach (string fpk in references)
            {
                FpkReference reference = new FpkReference()
                {
                    ReferenceFilePath = new FpkString()
                    {
                        Value = fpk
                    }
                };
                q.References.Add(reference);
            }

            using (FileStream outFile = new FileStream(FileName, FileMode.Create))
            {
                IDirectory fileDirectory = new FileSystemDirectory(SourceDirectory);
                q.Write(outFile, fileDirectory);
            }
        }