private static void SaveMeleeDatXml(string sourceDir, string outputDir, string file)
        {
            MeleeDataNode meleeDataNode = new MeleeDataNode(file);
            if (meleeDataNode.DatFile.Roots.Length == 0)
                return;

            var rootNode = new MeleeRootNode(meleeDataNode.DatFile.Roots[0]);
            var doc = DatMaterialXml.CreateMaterialXml(rootNode);

            string xmlName = Path.GetFileNameWithoutExtension(file);
            string outputFileName = $"{ outputDir }\\{ xmlName }.xml";

            doc.Save(outputFileName);
        }
Exemplo n.º 2
0
        private void ExportMaterialXml_Click(object sender, EventArgs e)
        {
            using (var sfd = new SaveFileDialog())
            {
                sfd.Filter = "XML Material|*.xml";
                DialogResult result = sfd.ShowDialog();

                if (result == DialogResult.OK)
                {
                    if (sfd.FileName.EndsWith(".xml"))
                    {
                        var doc = DatMaterialXml.CreateMaterialXml(this);
                        doc.Save(sfd.FileName);
                    }
                }
            }
        }