private void OnForceSaveAll(object sender, EventArgs e) { if (ResourcesHandler.Project == null) { return; } foreach (DocumentDialogue document in documentDialogues) { document.ResolvePendingDirty(); } EditorCore.LogInfo("Checking all Dialogues - Begin"); ResourcesHandler.CheckAll(); EditorCore.LogInfo("Checking all Dialogues - End"); ResourcesHandler.SaveAll(); foreach (DocumentDialogue document in documentDialogues) { document.OnPostSave(); } RefreshDirtyFlags(); EditorCore.LogInfo("All Project Files Saved"); }
private void OnReloadAllFiles(object sender, EventArgs e) { if (ResourcesHandler.Project == null) { return; } // Backup opened dialogues names. List <string> openedDialogues = new List <string>(); foreach (DocumentDialogue document in documentDialogues) { openedDialogues.Add(document.Dialogue.GetName()); } if (CloseAllDocuments()) { EditorCore.Properties?.Clear(); EditorCore.CustomProperties?.Clear(); EditorCore.ProjectExplorer?.Clear(); ResourcesHandler.ReloadAll(); EditorCore.ProjectExplorer.ResyncAllFiles(); // Re-open dialogues if possible. foreach (string name in openedDialogues) { OpenDocumentDialogue(name); } EditorCore.LogInfo("Reloaded all project files"); } }
private void OnExportLipsyncFaceFX(object sender, EventArgs e) { if (ResourcesHandler.Project != null) { if (ExporterLipsync.ExportFaceFx()) EditorCore.LogInfo("Export Face FX Finished"); } }
private void OnExportStats(object sender, EventArgs e) { if (ResourcesHandler.Project != null) { if (ExporterStats.ExportAll()) EditorCore.LogInfo("Export Stats Finished"); } }
private void OnExportLocalizationUnreal4(object sender, EventArgs e) { if (ResourcesHandler.Project != null) { if (ExporterLocalization.ExportToUnreal4()) EditorCore.LogInfo("Export Localization Finished"); } }
private void OnExportDialogues(object sender, EventArgs e) { if (ResourcesHandler.Project != null) { if (ExporterDialogues.ExportToCsv()) EditorCore.LogInfo("Export Dialogues Finished"); } }
private void OnExportConstantsUnreal4(object sender, EventArgs e) { if (ResourcesHandler.Project != null) { if (ExporterConstants.ExportToUnreal4()) EditorCore.LogInfo("Export Constants Finished"); } }
private void exportShardsCodeToolStripMenuItem_Click(object sender, EventArgs e) { if (ResourcesHandler.Project != null) { if (ExporterDialogues.ExportToAriaCode()) { EditorCore.LogInfo("Export Code Finished"); } } }
private void OnReloadAllFiles(object sender, EventArgs e) { if (ResourcesHandler.Project == null) { return; } Project project = null; var dialogues = new List <Dialogue>(); if (documentProject != null && ResourcesHandler.Project.Dirty) { project = ResourcesHandler.Project; } if (documentDialogues.Count > 0) { foreach (DocumentDialogue document in documentDialogues) { var documentDialogue = document as DocumentDialogue; documentDialogue.ResolvePendingDirty(); if (ResourcesHandler.IsDirty(documentDialogue.Dialogue)) { dialogues.Add(documentDialogue.Dialogue); } } } bool reloadOK = true; if (project != null || dialogues.Count > 0) { var dialog = new DialogConfirmReload(project, dialogues); DialogResult result = dialog.ShowDialog(); reloadOK = (result == DialogResult.OK); } if (reloadOK) { ResourcesHandler.ReloadAll(); if (documentProject != null) { documentProject.OnPostReload(); } foreach (DocumentDialogue document in documentDialogues) { var documentDialogue = document as DocumentDialogue; documentDialogue.OnPostReload(); } EditorCore.LogInfo("Reloaded all project files"); } }
private void OnCheckAll(object sender, EventArgs e) { if (ResourcesHandler.Project == null) return; EditorCore.LogInfo("Checking all Dialogues - Begin"); ResourcesHandler.CheckAll(); EditorCore.LogInfo("Checking all Dialogues - End"); }
private void OnExportVoicing(object sender, EventArgs e) { if (ResourcesHandler.Project != null) { if (ExporterVoicing.ExportAll()) { RefreshDirtyFlags(); EditorCore.LogInfo("Export Voicing Finished"); } } }
private void OnCheckCurrent(object sender, EventArgs e) { if (ResourcesHandler.Project == null) return; if (dockPanel.ActiveDocument is DocumentDialogue) { EditorCore.LogInfo("Checking Dialogue - Begin"); var dialogue = dockPanel.ActiveDocument as DocumentDialogue; ResourcesHandler.Check(dialogue.Dialogue); EditorCore.LogInfo("Checking Dialogue - End"); } }
//-------------------------------------------------------------------------------------------------------------- // Imports static public bool ImportFromCsv() { var project = ResourcesHandler.Project; string projectDirectory = EditorHelper.GetProjectDirectory(); string importPath = Path.Combine(projectDirectory, EditorCore.Settings.DirectoryExportDialogues); var dialog = new DialogImport(importPath); DialogResult result = dialog.ShowDialog(); if (result == DialogResult.Cancel) { return(false); } bool resultConstants = false; if (dialog.ImportConstants) { resultConstants = ImportConstantsFromCsv(dialog.ImportPathConstants, dialog.ListLanguages, true, false, false); if (resultConstants) { EditorCore.LogInfo("Import Constants Finished"); } else { EditorCore.LogError("Import Constants Failed"); } } bool resultDialogues = false; if (dialog.ImportLocalization || dialog.ImportWorkstring || dialog.ImportInformation) { resultDialogues = ImportDialoguesFromCsv(dialog.ImportPathDialogues, dialog.ListPackages, dialog.ListLanguages, dialog.ImportLocalization, dialog.ImportWorkstring, dialog.ImportInformation); if (resultDialogues) { EditorCore.LogInfo("Import Dialogues Finished"); } else { EditorCore.LogError("Import Dialogues Failed"); } } return(resultConstants || resultDialogues); }
private void OnReloadFile(object sender, EventArgs e) { if (ResourcesHandler.Project == null) { return; } if (dockPanel.ActiveDocument is DocumentProject && ResourcesHandler.Project.Dirty) { var dialog = new DialogConfirmReload(ResourcesHandler.Project, new List <Dialogue>()); DialogResult result = dialog.ShowDialog(); if (result == DialogResult.OK) { ResourcesHandler.ReloadProject(); documentProject.OnPostReload(); EditorCore.LogInfo("Reloaded project file"); } } else if (dockPanel.ActiveDocument is DocumentDialogue) { var document = dockPanel.ActiveDocument as DocumentDialogue; document.ResolvePendingDirty(); bool proceed = true; if (ResourcesHandler.IsDirty(document.Dialogue)) { var dialog = new DialogConfirmReload(null, new List <Dialogue>() { document.Dialogue }); DialogResult result = dialog.ShowDialog(); proceed = (result == DialogResult.OK); } if (proceed) { ResourcesHandler.ReloadDialogue(document.Dialogue); document.OnPostReload(); EditorCore.LogInfo("Reloaded current dialogue file"); } } }