private void ExportQuests_Click(object sender, EventArgs e) { try { if (QuestTree.SelectedNode.Name == "PT2") { SaveFileDialog tempExport = new SaveFileDialog(); //string ExportText = ""; tempExport.DefaultExt = "*.quests"; tempExport.Filter = "Quest Data(*.quests)|*.quests"; tempExport.FileName = CurrentWSG.CharacterName + "'s PT2 Quests.quests"; if (tempExport.ShowDialog() == DialogResult.OK) { // Create empty xml file XmlTextWriter writer = new XmlTextWriter(tempExport.FileName, new System.Text.ASCIIEncoding()); writer.Formatting = Formatting.Indented; writer.Indentation = 2; writer.WriteStartDocument(); writer.WriteStartElement("INI"); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); XmlFile Quests = new XmlFile(tempExport.FileName); List<string> subsectionnames = new List<string>(); List<string> subsectionvalues = new List<string>(); for (int Progress = 0; Progress < CurrentWSG.TotalPT2Quests; Progress++) { subsectionnames.Clear(); subsectionvalues.Clear(); subsectionnames.Add("Progress"); subsectionnames.Add("DLCValue1"); subsectionnames.Add("DLCValue2"); subsectionnames.Add("Objectives"); for (int i = 0; i < 4; i++) subsectionvalues.Add(CurrentWSG.PT2Values[Progress, i].ToString()); //ExportText = ExportText + "[" + CurrentWSG.PT2Strings[Progress] + "]\r\nProgress=" + CurrentWSG.PT2Values[Progress, 0] + "\r\nDLCValue1=" + CurrentWSG.PT2Values[Progress, 1] + "\r\nDLCValue2=" + CurrentWSG.PT2Values[Progress, 2] + "\r\nObjectives=" + CurrentWSG.PT2Values[Progress, 3] + "\r\n"; for (int Folders = 0; Folders < CurrentWSG.PT2Values[Progress, 3]; Folders++) { subsectionnames.Add("FolderName" + Folders); subsectionvalues.Add(CurrentWSG.PT2Subfolders[Progress, Folders]); subsectionnames.Add("FolderValue" + Folders); subsectionvalues.Add(CurrentWSG.PT2Values[Progress, Folders + 4].ToString()); //ExportText = ExportText + "FolderName" + Folders + "=" + CurrentWSG.PT2Subfolders[Progress, Folders] + "\r\nFolderValue" + Folders + "=" + CurrentWSG.PT2Values[Progress, Folders + 4] + "\r\n"; } Quests.AddSection(CurrentWSG.PT2Strings[Progress], subsectionnames, subsectionvalues); } } } else if (QuestTree.SelectedNode.Name == "PT1") { SaveFileDialog tempExport = new SaveFileDialog(); //string ExportText = ""; tempExport.DefaultExt = "*.quests"; tempExport.Filter = "Quest Data(*.quests)|*.quests"; tempExport.FileName = CurrentWSG.CharacterName + "'s PT1 Quests.quests"; if (tempExport.ShowDialog() == DialogResult.OK) { // Create empty xml file XmlTextWriter writer = new XmlTextWriter(tempExport.FileName, new System.Text.ASCIIEncoding()); writer.Formatting = Formatting.Indented; writer.Indentation = 2; writer.WriteStartDocument(); writer.WriteStartElement("INI"); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); XmlFile Quests = new XmlFile(tempExport.FileName); List<string> subsectionnames = new List<string>(); List<string> subsectionvalues = new List<string>(); for (int Progress = 0; Progress < CurrentWSG.TotalPT1Quests; Progress++) { subsectionnames.Clear(); subsectionvalues.Clear(); subsectionnames.Add("Progress"); subsectionnames.Add("DLCValue1"); subsectionnames.Add("DLCValue2"); subsectionnames.Add("Objectives"); for (int i = 0; i < 4; i++) subsectionvalues.Add(CurrentWSG.PT1Values[Progress, i].ToString()); //ExportText = ExportText + "[" + CurrentWSG.PT1Strings[Progress] + "]\r\nProgress=" + CurrentWSG.PT1Values[Progress, 0] + "\r\nDLCValue1=" + CurrentWSG.PT1Values[Progress, 1] + "\r\nDLCValue2=" + CurrentWSG.PT1Values[Progress, 2] + "\r\nObjectives=" + CurrentWSG.PT1Values[Progress, 3] + "\r\n"; for (int Folders = 0; Folders < CurrentWSG.PT1Values[Progress, 3]; Folders++) { subsectionnames.Add("FolderName" + Folders); subsectionvalues.Add(CurrentWSG.PT1Subfolders[Progress, Folders]); subsectionnames.Add("FolderValue" + Folders); subsectionvalues.Add(CurrentWSG.PT1Values[Progress, Folders + 4].ToString()); //ExportText = ExportText + "FolderName" + Folders + "=" + CurrentWSG.PT1Subfolders[Progress, Folders] + "\r\nFolderValue" + Folders + "=" + CurrentWSG.PT1Values[Progress, Folders + 4] + "\r\n"; } Quests.AddSection(CurrentWSG.PT1Strings[Progress], subsectionnames, subsectionvalues); } } } } catch { MessageBox.Show("Select a playthrough to extract first."); } }
private void ExportSkills_Click(object sender, EventArgs e) { SaveFileDialog tempExport = new SaveFileDialog(); //string ExportText = ""; tempExport.DefaultExt = "*.skills"; tempExport.Filter = "Skills Data(*.skills)|*.skills"; tempExport.FileName = CurrentWSG.CharacterName + "'s Skills.skills"; if (tempExport.ShowDialog() == DialogResult.OK) { // Create empty xml file XmlTextWriter writer = new XmlTextWriter(tempExport.FileName, new System.Text.ASCIIEncoding()); writer.Formatting = Formatting.Indented; writer.Indentation = 2; writer.WriteStartDocument(); writer.WriteStartElement("INI"); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); XmlFile Skills = new XmlFile(tempExport.FileName); List<string> subsectionnames = new List<string>(); List<string> subsectionvalues = new List<string>(); for (int Progress = 0; Progress < CurrentWSG.NumberOfSkills; Progress++) { subsectionnames.Clear(); subsectionvalues.Clear(); subsectionnames.Add("Level"); subsectionnames.Add("Experience"); subsectionnames.Add("InUse"); subsectionvalues.Add(CurrentWSG.LevelOfSkills[Progress].ToString()); subsectionvalues.Add(CurrentWSG.ExpOfSkills[Progress].ToString()); subsectionvalues.Add(CurrentWSG.InUse[Progress].ToString()); //ExportText = ExportText + "[" + CurrentWSG.SkillNames[Progress] + "]\r\nLevel=" + CurrentWSG.LevelOfSkills[Progress] + "\r\nExperience=" + CurrentWSG.ExpOfSkills[Progress] + "\r\nInUse=" + CurrentWSG.InUse[Progress] + "\r\n"; Skills.AddSection(CurrentWSG.SkillNames[Progress], subsectionnames, subsectionvalues); } //File.WriteAllText(tempExport.FileName + "s", ExportText); } }
private void ExportEchoes_Click(object sender, EventArgs e) { try { if (EchoTree.SelectedNode.Name == "PT2" || EchoTree.SelectedNode.Text == "Playthrough 2 Echo Logs") { SaveFileDialog tempExport = new SaveFileDialog(); //string ExportText = ""; tempExport.DefaultExt = "*.echologs"; tempExport.Filter = "Echo Logs(*.echologs)|*.echologs"; tempExport.FileName = CurrentWSG.CharacterName + "'s PT2 Echo Logs.echologs"; if (tempExport.ShowDialog() == DialogResult.OK) { // Create empty xml file XmlTextWriter writer = new XmlTextWriter(tempExport.FileName, new System.Text.ASCIIEncoding()); writer.Formatting = Formatting.Indented; writer.Indentation = 2; writer.WriteStartDocument(); writer.WriteStartElement("INI"); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); XmlFile Echos = new XmlFile(tempExport.FileName); List<string> subsectionnames = new List<string>(); List<string> subsectionvalues = new List<string>(); for (int Progress = 0; Progress < CurrentWSG.NumberOfEchosPT2; Progress++) { subsectionnames.Clear(); subsectionvalues.Clear(); subsectionnames.Add("DLCValue1"); subsectionnames.Add("DLCValue2"); subsectionvalues.Add(CurrentWSG.EchoValuesPT2[Progress, 0].ToString()); subsectionvalues.Add(CurrentWSG.EchoValuesPT2[Progress, 1].ToString()); //ExportText = ExportText + "[" + CurrentWSG.EchoStringsPT2[Progress] + "]" + "\r\nDLCValue1=" + CurrentWSG.EchoValuesPT2[Progress, 0] + "\r\nDLCValue2=" + CurrentWSG.EchoValuesPT2[Progress, 1] + "\r\n"; Echos.AddSection(CurrentWSG.EchoStringsPT2[Progress], subsectionnames, subsectionvalues); } //File.WriteAllText(tempExport.FileName + "s", ExportText); } } else if (EchoTree.SelectedNode.Name == "PT1" || EchoTree.SelectedNode.Text == "Playthrough 1 Echo Logs") { SaveFileDialog tempExport = new SaveFileDialog(); //string ExportText = ""; tempExport.DefaultExt = "*.echologs"; tempExport.Filter = "Echo Logs(*.echologs)|*.echologs"; tempExport.FileName = CurrentWSG.CharacterName + "'s PT1 Echo Logs.echologs"; if (tempExport.ShowDialog() == DialogResult.OK) { // Create empty xml file XmlTextWriter writer = new XmlTextWriter(tempExport.FileName, new System.Text.ASCIIEncoding()); writer.Formatting = Formatting.Indented; writer.Indentation = 2; writer.WriteStartDocument(); writer.WriteStartElement("INI"); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); XmlFile Echos = new XmlFile(tempExport.FileName); List<string> subsectionnames = new List<string>(); List<string> subsectionvalues = new List<string>(); for (int Progress = 0; Progress < CurrentWSG.NumberOfEchos; Progress++) { subsectionnames.Clear(); subsectionvalues.Clear(); subsectionnames.Add("DLCValue1"); subsectionnames.Add("DLCValue2"); subsectionvalues.Add(CurrentWSG.EchoValues[Progress, 0].ToString()); subsectionvalues.Add(CurrentWSG.EchoValues[Progress, 1].ToString()); //ExportText = ExportText + "[" + CurrentWSG.EchoStrings[Progress] + "]" + "\r\nDLCValue1=" + CurrentWSG.EchoValues[Progress, 0] + "\r\nDLCValue2=" + CurrentWSG.EchoValues[Progress, 1] + "\r\n"; Echos.AddSection(CurrentWSG.EchoStrings[Progress], subsectionnames, subsectionvalues); } //File.WriteAllText(tempExport.FileName + "s", ExportText); } } } catch { MessageBox.Show("Select a playthrough to export first."); } }