private void saveToolStripMenuItem_Click(object sender, EventArgs e) { if (m_resStaticMesh != null) { using (VirtualFileDialog dlg = new VirtualFileDialog(false, "", "nmdl")) { dlg.SetResourceLocation(NLevelEditorEngine.Instance.CurrentFolder); dlg.Text = "保存模型 ..."; int i = m_resStaticMesh.Name.LastIndexOf('\\'); if (i == -1) { i = m_resStaticMesh.Name.LastIndexOf('/'); } if (i >= 0) { dlg.SetFileName(m_resStaticMesh.Name.Substring(i + 1, m_resStaticMesh.Name.Length - i - 1)); } else { dlg.SetFileName(m_resStaticMesh.Name); } if (dlg.ShowDialog(this) == DialogResult.OK) { NResourceLoc loc = dlg.GetResourceLocation(); using (NexusEngineExtension.NWaitCursor wc = new NexusEngineExtension.NWaitCursor(this)) m_resStaticMesh.SaveToFile(loc, this.toolBtnXML.Checked); } } }// end of if else { NexusEditor.Program.ShowError("Static Mesh Resource Save FAILED!"); } }
private void SaveCurrentSkeletalMesh() { //-- 检测资源是否可用 if (SkeletalMeshPreview == null) { NexusEditor.Program.ShowError("Skeletal Mesh 资源尚未创建!"); return; } using (VirtualFileDialog dlg = new VirtualFileDialog(false, "", "skm")) { //-- 设置dialogue属性 dlg.SetResourceLocation(NLevelEditorEngine.Instance.CurrentFolder); dlg.Text = "保存Skeletal Mesh ..."; int i = skeletalMeshProperty.Name.LastIndexOf('\\'); if (i == -1) { i = skeletalMeshProperty.Name.LastIndexOf('/'); } if (i >= 0) { dlg.SetFileName(skeletalMeshProperty.Name.Substring(i + 1, skeletalMeshProperty.Name.Length - i - 1)); } else { dlg.SetFileName(skeletalMeshProperty.Name); } //-- 请用户确认 if (dlg.ShowDialog(this) == DialogResult.OK) { NResourceLoc loc = dlg.GetResourceLocation(); using (NexusEngineExtension.NWaitCursor wc = new NexusEngineExtension.NWaitCursor(this)) SkeletalMeshPreview.SaveToFile(loc, this.toolBtnXML.Checked); } }// end of using(dg) }