private void Export(object sender, EventArgs args)
            {
                string formats = FileFilters.NUTEXB;

                string[] forms = formats.Split('|');

                List <string> Formats = new List <string>();

                for (int i = 0; i < forms.Length; i++)
                {
                    if (i > 1 || i == (forms.Length - 1)) //Skip lines with all extensions
                    {
                        if (!forms[i].StartsWith("*"))
                        {
                            Formats.Add(forms[i]);
                        }
                    }
                }

                BatchFormatExport form = new BatchFormatExport(Formats);

                if (form.ShowDialog() == DialogResult.OK)
                {
                    string extension = form.GetSelectedExtension();

                    OpenFileDialog ofd = new OpenFileDialog();
                    ofd.Multiselect = true;
                    ofd.Filter      = Utils.GetAllFilters(typeof(NUTEXB));

                    if (ofd.ShowDialog() == DialogResult.OK)
                    {
                        foreach (string file in ofd.FileNames)
                        {
                            NUTEXB texture = new NUTEXB();
                            texture.Read(new FileReader(file));

                            try
                            {
                                texture.Export(System.IO.Path.GetFullPath(file) + texture.ArcOffset + texture.Text + extension);
                            }
                            catch
                            {
                                Console.WriteLine("Something went wrong??");
                            }

                            texture = null;
                            GC.Collect();
                        }
                    }
                }
            }
Exemple #2
0
        protected void ExportAllAction(object sender, EventArgs e)
        {
            if (Nodes.Count <= 0)
            {
                return;
            }

            string formats = ExportFilter;

            string[] forms = formats.Split('|');

            List <string> Formats = new List <string>();

            for (int i = 0; i < forms.Length; i++)
            {
                if (i > 1 || i == (forms.Length - 1)) //Skip lines with all extensions
                {
                    if (!forms[i].StartsWith("*"))
                    {
                        Formats.Add(forms[i]);
                    }
                }
            }

            FolderSelectDialog sfd = new FolderSelectDialog();

            if (sfd.ShowDialog() == DialogResult.OK)
            {
                string folderPath = sfd.SelectedPath;

                BatchFormatExport form = new BatchFormatExport(Formats);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    string extension = form.GetSelectedExtension();
                    extension.Replace(" ", string.Empty);

                    foreach (TreeNode node in Nodes)
                    {
                        if (node is STGenericWrapper)
                        {
                            ((STGenericWrapper)node).Export($"{folderPath}\\{node.Text}{extension}");
                        }
                    }
                }
            }
        }
Exemple #3
0
            public void ExportAl()
            {
                if (Nodes.Count <= 0)
                {
                    return;
                }

                string formats = FileFilters.BONE;

                string[] forms = formats.Split('|');

                List <string> Formats = new List <string>();

                for (int i = 0; i < forms.Length; i++)
                {
                    if (i > 1 || i == (forms.Length - 1)) //Skip lines with all extensions
                    {
                        if (!forms[i].StartsWith("*"))
                        {
                            Formats.Add(forms[i]);
                        }
                    }
                }

                FolderSelectDialog sfd = new FolderSelectDialog();

                if (sfd.ShowDialog() == DialogResult.OK)
                {
                    string folderPath = sfd.SelectedPath;

                    BatchFormatExport form = new BatchFormatExport(Formats);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        string extension = form.GetSelectedExtension();

                        foreach (BfresBone node in fskl.bones)
                        {
                            ((BfresBone)node).Export($"{folderPath}\\{node.Text}{extension}");
                        }
                    }
                }
            }
Exemple #4
0
            private void Export(object sender, EventArgs args)
            {
                string formats = FileFilters.GTX;

                string[] forms = formats.Split('|');

                List <string> Formats = new List <string>();

                for (int i = 0; i < forms.Length; i++)
                {
                    if (i > 1 || i == (forms.Length - 1)) //Skip lines with all extensions
                    {
                        if (!forms[i].StartsWith("*"))
                        {
                            Formats.Add(forms[i]);
                        }
                    }
                }

                BatchFormatExport form = new BatchFormatExport(Formats);

                if (form.ShowDialog() == DialogResult.OK)
                {
                    string Extension = form.GetSelectedExtension();

                    OpenFileDialog ofd = new OpenFileDialog();
                    ofd.Multiselect = true;
                    ofd.Filter      = Utils.GetAllFilters(new Type[] { typeof(BFLIM), typeof(BFFNT), typeof(BFRES), typeof(PTCL), typeof(SARC) });

                    if (ofd.ShowDialog() == DialogResult.OK)
                    {
                        FolderSelectDialog folderDialog = new FolderSelectDialog();
                        if (folderDialog.ShowDialog() == DialogResult.OK)
                        {
                            foreach (string file in ofd.FileNames)
                            {
                                var FileFormat = STFileLoader.OpenFileFormat(file, new Type[] { typeof(BFLIM), typeof(PTCL), typeof(BFRES), typeof(BFFNT), typeof(SARC) });
                                if (FileFormat == null)
                                {
                                    continue;
                                }


                                if (FileFormat is SARC)
                                {
                                    string ArchiveFilePath = Path.Combine(folderDialog.SelectedPath, Path.GetFileNameWithoutExtension(file));
                                    ArchiveFilePath = Path.GetDirectoryName(ArchiveFilePath);

                                    if (!Directory.Exists(ArchiveFilePath))
                                    {
                                        Directory.CreateDirectory(ArchiveFilePath);
                                    }

                                    SearchBinary(FileFormat, ArchiveFilePath, Extension);
                                }
                                else
                                {
                                    SearchBinary(FileFormat, folderDialog.SelectedPath, Extension);
                                }
                            }
                        }
                    }
                }
            }