public override void Compile() { List <TlkContents> ret = new List <TlkContents>(); List <TlkDocument> docStack = CTCore.GetOpenProject().GetTlkStack().GetDocuments(); for (int i = 0; i < docStack.Count; ++i) { TlkDocument doc = docStack[i]; CTDebug.Info("Writing from {0}.tlk ({1} lines)", doc.Name, doc.Contents.Length); ret.AddRange(doc.Contents); } try { TLKWriter.SaveFileContents(Path, ret.ToArray()); } catch (Exception) { CTDebug.Error("Could not save {0}. Make sure the file is not in use.", Path); } }
public static void SaveFileContents(string filePath, TlkContents[] data) { TLKWriter writer = new TLKWriter(filePath); writer.Save(data); }