private void TryExportToCSV()
        {
            string newCSVExportPath = EditorUtility.SaveFilePanel("Save CSV", EditorWindowTools.GetDirectoryName(csvExportPath), csvExportPath, "csv");

            if (!string.IsNullOrEmpty(newCSVExportPath))
            {
                csvExportPath = newCSVExportPath;
                if (Application.platform == RuntimePlatform.WindowsEditor)
                {
                    csvExportPath = csvExportPath.Replace("/", "\\");
                }
                CSVExporter.Export(database, csvExportPath, exportActors, exportItems, exportLocations, exportVariables, exportConversations, exportConversationsAfterEntries, entrytagFormat);
                EditorUtility.DisplayDialog("Export Complete", "The dialogue database was exported to CSV (comma-separated values) format. ", "OK");
            }
        }
 /// <summary>
 /// Draws the articy:draft Project filename field.
 /// </summary>
 private void DrawProjectFilenameField()
 {
     EditorGUI.BeginChangeCheck();
     EditorGUILayout.BeginHorizontal();
     EditorGUILayout.TextField(new GUIContent("articy:draft Project", "The XML file that you exported from articy:draft."), prefs.ProjectFilename);
     if (GUILayout.Button("...", EditorStyles.miniButtonRight, GUILayout.Width(22)))
     {
         prefs.ProjectFilename      = EditorUtility.OpenFilePanel("Select articy:draft Project", EditorWindowTools.GetDirectoryName(prefs.ProjectFilename), "xml");
         GUIUtility.keyboardControl = 0;
     }
     EditorGUILayout.EndHorizontal();
     if (EditorGUI.EndChangeCheck())
     {
         ConverterPrefsTools.Save(prefs);
         articyData = null;
     }
 }
        private void ImportTemplate()
        {
            string importPath = EditorUtility.OpenFilePanel("Import Template from XML", EditorWindowTools.GetDirectoryName(templateExportPath), "xml");

            if (!string.IsNullOrEmpty(importPath))
            {
                XmlSerializer xmlSerializer = new XmlSerializer(typeof(Template));
                Template      newTemplate   = xmlSerializer.Deserialize(new StreamReader(importPath)) as Template;
                if (newTemplate != null)
                {
                    template = newTemplate;
                }
                else
                {
                    EditorUtility.DisplayDialog("Import Error", "Unable to import template data from the XML file.", "OK");
                }
            }
        }
        private void ExportTemplate()
        {
            string newExportPath = EditorUtility.SaveFilePanel("Export Template to XML", EditorWindowTools.GetDirectoryName(templateExportPath), templateExportPath, "xml");

            if (!string.IsNullOrEmpty(newExportPath))
            {
                templateExportPath = newExportPath;
                XmlSerializer xmlSerializer = new XmlSerializer(typeof(Template));
                StreamWriter  streamWriter  = new StreamWriter(templateExportPath, false, System.Text.Encoding.Unicode);
                xmlSerializer.Serialize(streamWriter, template);
                streamWriter.Close();
            }
        }
        private void TryExportToLanguageText()
        {
            string newLanguageTextPath = EditorUtility.SaveFilePanel("Save Language Text", EditorWindowTools.GetDirectoryName(languageTextExportPath), languageTextExportPath, "txt");

            if (!string.IsNullOrEmpty(newLanguageTextPath))
            {
                languageTextExportPath = newLanguageTextPath;
                if (Application.platform == RuntimePlatform.WindowsEditor)
                {
                    languageTextExportPath = languageTextExportPath.Replace("/", "\\");
                }
                LanguageTextExporter.Export(database, languageTextExportPath, encodingType);
                EditorUtility.DisplayDialog("Export Complete", "The language texts have been exported to " + languageTextExportPath + " with the language code appended to the end of each filename. ", "OK");
            }
        }
        private void TryExportToVoiceoverScript()
        {
            string newVoiceoverPath = EditorUtility.SaveFilePanel("Save Voiceover Scripts", EditorWindowTools.GetDirectoryName(voiceoverExportPath), voiceoverExportPath, "csv");

            if (!string.IsNullOrEmpty(newVoiceoverPath))
            {
                voiceoverExportPath = newVoiceoverPath;
                if (Application.platform == RuntimePlatform.WindowsEditor)
                {
                    voiceoverExportPath = voiceoverExportPath.Replace("/", "\\");
                }
                VoiceoverScriptExporter.Export(database, voiceoverExportPath, exportActors, entrytagFormat, encodingType);
                EditorUtility.DisplayDialog("Export Complete", "The voiceover scripts were exported to CSV (comma-separated values) files in " + voiceoverExportPath + ".", "OK");
            }
        }
        private void TryExportToChatMapperXML()
        {
            string newChatMapperExportPath = EditorUtility.SaveFilePanel("Save Chat Mapper XML", EditorWindowTools.GetDirectoryName(chatMapperExportPath), chatMapperExportPath, "xml");

            if (!string.IsNullOrEmpty(newChatMapperExportPath))
            {
                chatMapperExportPath = newChatMapperExportPath;
                if (Application.platform == RuntimePlatform.WindowsEditor)
                {
                    chatMapperExportPath = chatMapperExportPath.Replace("/", "\\");
                }
                if (exportCanvasRect)
                {
                    AddCanvasRectTemplateField();
                }
                ValidateDatabase(database, false);
                ConfirmSyncAssetsAndTemplate();
                ChatMapperExporter.Export(database, chatMapperExportPath, exportActors, exportItems, exportLocations, exportVariables, exportConversations, exportCanvasRect);
                string templatePath = chatMapperExportPath.Replace(".xml", "_Template.txt");
                ExportTemplate(chatMapperExportPath, templatePath);
                EditorUtility.DisplayDialog("Export Complete", "The dialogue database was exported to Chat Mapper XML format.\n\n" +
                                            "Remember to apply a template after importing it into Chat Mapper. " +
                                            "The required fields in the template are listed in " + templatePath + ".\n\n" +
                                            "If you have any issues importing, please contact us at [email protected].", "OK");
            }
        }
Пример #8
0
 /// <summary>
 /// Draws the articy:draft Project filename field.
 /// </summary>
 private void DrawProjectFilenameField()
 {
     EditorGUILayout.BeginHorizontal();
     EditorGUILayout.TextField("articy:draft Project", prefs.ProjectFilename);
     if (GUILayout.Button("...", EditorStyles.miniButtonRight, GUILayout.Width(22)))
     {
         prefs.ProjectFilename      = EditorUtility.OpenFilePanel("Select articy:draft Project", EditorWindowTools.GetDirectoryName(prefs.ProjectFilename), "xml");
         GUIUtility.keyboardControl = 0;
     }
     EditorGUILayout.EndHorizontal();
 }