示例#1
0
        private void ExportBMD(string dest, ArgumentsWork.Parameters ParList)
        {
            if (dest == "")
            {
                dest = Util.GetNewPath(source, "(NEW).BMD");
            }

            PersonaEditorLib.FileStructure.BMD.BMD BMD = new PersonaEditorLib.FileStructure.BMD.BMD();
            BMD.Open(PTP);
            File.WriteAllBytes(dest, BMD.Get(ParList.IsLittleEndian));
        }
示例#2
0
        private void ImportPTP(string src, ArgumentsWork.Parameters ParList)
        {
            if (src == "")
            {
                src = Util.GetNewPath(source, ".PTP");
            }

            PersonaEditorLib.FileStructure.PTP.PTP PTP = new PersonaEditorLib.FileStructure.PTP.PTP(ParList.OldFont, ParList.OldMap, ParList.NewFont, ParList.NewMap);
            PersonaEditorLib.FileStructure.BMD.BMD BMD = new PersonaEditorLib.FileStructure.BMD.BMD();
            BMD.Open(PTP);
            BF.SetBMD(BMD.Get(ParList.IsLittleEndian));
        }
示例#3
0
        private void ExportPTP(string dest, ArgumentsWork.Parameters ParList)
        {
            if (dest == "")
            {
                dest = Util.GetNewPath(source, ".PTP");
            }

            PersonaEditorLib.FileStructure.BMD.BMD BMD = new PersonaEditorLib.FileStructure.BMD.BMD();
            BMD.Open(BF.GetBMD(), Path.GetFileNameWithoutExtension(dest), true);
            PersonaEditorLib.FileStructure.PTP.PTP PTP = new PersonaEditorLib.FileStructure.PTP.PTP(ParList.OldFont, ParList.OldMap, ParList.NewFont, ParList.NewMap);
            PTP.Open(BMD, ParList.CopyOld2New);
            PTP.SaveProject(dest);
        }
        private void Open(bool IsLittleEndian)
        {
            if (Path.GetExtension(Static.Paths.OpenFileName).ToUpper() == ".PTP")
            {
                OV.PTP.Open(Static.Paths.OpenFileName);
            }
            else if (Path.GetExtension(Static.Paths.OpenFileName).ToUpper() == ".BMD")
            {
                PersonaEditorLib.FileStructure.BMD.BMD BMD = new PersonaEditorLib.FileStructure.BMD.BMD();
                BMD.Open(File.OpenRead(Static.Paths.OpenFileName), Static.Paths.OpenFileName, IsLittleEndian);

                OV.PTP.Open(BMD, false);
            }
        }
        private void ExportBMD_Click(object sender, RoutedEventArgs e)
        {
            SaveFileDialog sfd = new SaveFileDialog
            {
                Filter           = "BMD files|*.BMD",
                OverwritePrompt  = true,
                InitialDirectory = Path.GetDirectoryName(Static.Paths.OpenFileName),
                FileName         = Path.GetFileNameWithoutExtension(Static.Paths.OpenFileName) + "(NEW).BMD"
            };

            if (sfd.ShowDialog() == true)
            {
                PersonaEditorLib.FileStructure.BMD.BMD BMD = new PersonaEditorLib.FileStructure.BMD.BMD();
                BMD.Open(OV.PTP);
                File.WriteAllBytes(sfd.FileName, BMD.Get(Current.Default.IsLittleEndian));
            }
        }