static public void SaveDialogueFile(Project project, Dialogue dialogue) { //PreSave dialogue.PreSave(project); //Serialize string path = Path.Combine(EditorHelper.GetProjectDirectory(), dialogue.GetFilePathName()); SerializeToFile(path, dialogue); }
static public bool LoadDialogueFile(Project project, Dialogue dialogue) { //Deserialize string path = Path.Combine(EditorHelper.GetProjectDirectory(), dialogue.GetFilePathName()); if (!DeserializeFromFile(path, dialogue)) { return(false); } //PostLoad dialogue.PostLoad(project); return(true); }
private void OnDocumentDelete(object sender, EventArgs e) { Dialogue dialogue = tree.SelectedNode.Tag as Dialogue; if (dialogue != null) { var dialog = new DialogConfirmDelete(dialogue); DialogResult eResult = dialog.ShowDialog(); if (eResult == DialogResult.Cancel) { return; } if (EditorCore.MainWindow != null) { EditorCore.MainWindow.CloseDocumentDialogue(dialogue, true); } TreeNode nodeFolder = tree.SelectedNode.Parent; tree.Nodes.Remove(tree.SelectedNode); tree.SelectedNode = null; DeleteIfEmptyFolder(nodeFolder); ResourcesHandler.RemoveDialogue(dialogue); string filePathName = Path.Combine(EditorHelper.GetProjectDirectory(), dialogue.GetFilePathName()); if (File.Exists(filePathName)) { File.Delete(filePathName); } } }
static public bool RemoveDialogueFile(Dialogue dialogue) { if (RemoveDialogue(dialogue)) { string filePathName = Path.Combine(EditorHelper.GetProjectDirectory(), dialogue.GetFilePathName()); if (File.Exists(filePathName)) { File.Delete(filePathName); } return(true); } return(false); }