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();
                        }
                    }
                }
            }
Esempio n. 2
0
            private void ExportAllAction(object sender, EventArgs args)
            {
                LoadTextures();

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

                Formats.Add("Microsoft DDS (.dds)");
                Formats.Add("Portable Graphics Network (.png)");
                Formats.Add("Joint Photographic Experts Group (.jpg)");
                Formats.Add("Bitmap Image (.bmp)");
                Formats.Add("Tagged Image File Format (.tiff)");

                FolderSelectDialog sfd = new FolderSelectDialog();

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

                    BatchFormatExport form = new BatchFormatExport(Formats);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        foreach (STGenericTexture tex in Textures)
                        {
                            if (form.Index == 0)
                            {
                                tex.SaveDDS(folderPath + '\\' + tex.Text + ".dds");
                            }
                            else if (form.Index == 1)
                            {
                                tex.SaveBitMap(folderPath + '\\' + tex.Text + ".png");
                            }
                            else if (form.Index == 2)
                            {
                                tex.SaveBitMap(folderPath + '\\' + tex.Text + ".jpg");
                            }
                            else if (form.Index == 3)
                            {
                                tex.SaveBitMap(folderPath + '\\' + tex.Text + ".bmp");
                            }
                            else if (form.Index == 4)
                            {
                                tex.SaveBitMap(folderPath + '\\' + tex.Text + ".tiff");
                            }
                        }
                    }
                }
            }
Esempio n. 3
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}");
                        }
                    }
                }
            }
        }
Esempio n. 4
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}");
                        }
                    }
                }
            }
Esempio n. 5
0
            private void ExportAllAction(object sender, EventArgs args)
            {
                OnExpand();

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

                Formats.Add("SMD (.smd)");
                Formats.Add("SEANIM (.seanim)");

                FolderSelectDialog sfd = new FolderSelectDialog();

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

                    BatchFormatExport form = new BatchFormatExport(Formats);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        foreach (TreeNode node in Nodes)
                        {
                            Console.WriteLine($"node {node}");
                            if (!(node is IAnimationContainer))
                            {
                                continue;
                            }

                            var    anim = ((IAnimationContainer)node).AnimationController;
                            string name = Path.GetFileNameWithoutExtension(node.Text);

                            if (form.Index == 0)
                            {
                                SMD.Save((STSkeletonAnimation)anim, $"{folderPath}/{name}.smd");
                            }
                            if (form.Index == 1)
                            {
                                SEANIM.Save((STSkeletonAnimation)anim, $"{folderPath}/{name}.seanim");
                            }
                        }
                    }
                }
            }
Esempio n. 6
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);
                                }
                            }
                        }
                    }
                }
            }
Esempio n. 7
0
        private void ActionExportTexture(object sender, EventArgs e)
        {
            List <STGenericTexture> textures = new List <STGenericTexture>();

            foreach (ListViewItem item in listViewCustom1.SelectedItems)
            {
                if (TextureList.ContainsKey(item.Text))
                {
                    textures.Add(TextureList[item.Text]);
                }
            }

            if (textures.Count == 1)
            {
                textures[0].ExportImage();
            }
            else if (textures.Count > 1)
            {
                List <string> Formats = new List <string>();
                Formats.Add("Microsoft DDS (.dds)");
                Formats.Add("Portable Graphics Network (.png)");
                Formats.Add("Joint Photographic Experts Group (.jpg)");
                Formats.Add("Bitmap Image (.bmp)");
                Formats.Add("Tagged Image File Format (.tiff)");

                FolderSelectDialog sfd = new FolderSelectDialog();

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

                    BatchFormatExport form = new BatchFormatExport(Formats);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        foreach (STGenericTexture tex in textures)
                        {
                            if (form.Index == 0)
                            {
                                tex.SaveDDS(folderPath + '\\' + tex.Text + ".dds");
                            }
                            else if (form.Index == 1)
                            {
                                tex.SaveBitMap(folderPath + '\\' + tex.Text + ".png");
                            }
                            else if (form.Index == 2)
                            {
                                tex.SaveBitMap(folderPath + '\\' + tex.Text + ".jpg");
                            }
                            else if (form.Index == 3)
                            {
                                tex.SaveBitMap(folderPath + '\\' + tex.Text + ".bmp");
                            }
                            else if (form.Index == 4)
                            {
                                tex.SaveBitMap(folderPath + '\\' + tex.Text + ".tiff");
                            }
                        }
                    }
                }
            }

            textures.Clear();
        }