private static void SaveChatMapperProject(string filename, ChatMapperProject cmp) { XmlSerializer xmlSerializer = new XmlSerializer(typeof(ChatMapperProject)); StreamWriter streamWriter = new StreamWriter(filename, false, System.Text.Encoding.Unicode); xmlSerializer.Serialize(streamWriter, cmp); streamWriter.Close(); }
private static ChatMapperProject DatabaseToChatMapperProject(DialogueDatabase database, bool exportActors, bool exportItems, bool exportLocations, bool exportVariables, bool exportConversations, bool includeCanvasRect) { maxEntryCount = 0; ChatMapperProject cmp = new ChatMapperProject(); cmp.Title = database.name; cmp.Version = "1.5.1.0"; // The version of Chat Mapper XML format that imports properly. cmp.Author = database.author; cmp.EmphasisColor1 = ColorToCmpStyle(database.emphasisSettings[0].color); cmp.EmphasisStyle1 = EmphasisToCmpStyle(database.emphasisSettings[0]); cmp.EmphasisColor2 = ColorToCmpStyle(database.emphasisSettings[1].color); cmp.EmphasisStyle2 = EmphasisToCmpStyle(database.emphasisSettings[1]); cmp.EmphasisColor3 = ColorToCmpStyle(database.emphasisSettings[2].color); cmp.EmphasisStyle3 = EmphasisToCmpStyle(database.emphasisSettings[2]); cmp.EmphasisColor4 = ColorToCmpStyle(database.emphasisSettings[3].color); cmp.EmphasisStyle4 = EmphasisToCmpStyle(database.emphasisSettings[3]); cmp.Description = database.description; cmp.UserScript = database.globalUserScript; cmp.Assets = AssetsToCmp(database, exportActors, exportItems, exportLocations, exportVariables, exportConversations, includeCanvasRect); return(cmp); }
public static void Export(DialogueDatabase database, string filename, bool exportActors, bool exportItems, bool exportLocations, bool exportVariables, bool exportConversations, bool includeCanvasRect = false) { ChatMapperProject cmp = DatabaseToChatMapperProject(database, exportActors, exportItems, exportLocations, exportVariables, exportConversations, includeCanvasRect); SaveChatMapperProject(filename, cmp); }