private void button6_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(textBox1.Text)) { textBox1.Text = "key:00000000:00000000:0000000000000000"; } if (MadScienceSmall.Helpers.validateKey(textBox1.Text)) { MadScience.Wrappers.ResourceKey rKey = new MadScience.Wrappers.ResourceKey(textBox1.Text); MadScience.Wrappers.VPXYEntry entry = new MadScience.Wrappers.VPXYEntry(); entry.type = 1; entry.tgiList.Add(rKey); vpxyFile.vpxy.seprEntries.Add(entry); ListViewItem item = new ListViewItem(); item.Text = (listView3.Items.Count).ToString(); item.SubItems.Add(rKey.ToString()); listView3.Items.Add(item); item = null; entry = null; //rKey = null; } }
private void button1_Click(object sender, EventArgs e) { TextReader r = new StreamReader(@"P:\Stuart\Desktop\fullPatternList.xml"); XmlSerializer s = new XmlSerializer(typeof(files)); files lookupList = (files)s.Deserialize(r); r.Close(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < lookupList.Items.Count; i++) { Stream mem = File.OpenRead(@"P:\Stuart\Desktop\FullBuild0\config\xml\root\" + lookupList.Items[i].fullCasPartname + ".xml"); Patterns.patternDetails pDetails = Patterns.parsePatternComplate(mem); if (String.IsNullOrEmpty(pDetails.category)) continue; patternsFile cPattern = new patternsFile(); MadScience.Wrappers.ResourceKey rKey = new MadScience.Wrappers.ResourceKey("key:" + lookupList.Items[i].typeid.Remove(0, 2) + ":" + lookupList.Items[i].groupid.Remove(0, 2) + ":" + lookupList.Items[i].instanceid.Remove(0,2)); cPattern.key = rKey.ToString(); if (!StreamHelpers.isValidStream(KeyUtils.findKey("key:00B2D882:00000000:" + StringHelpers.HashFNV64(pDetails.name.Substring(pDetails.name.LastIndexOf("\\") + 1)).ToString("X16")))) { cPattern.texturename = pDetails.BackgroundImage; } else { cPattern.texturename = "key:00B2D882:00000000:" + StringHelpers.HashFNV64(pDetails.name.Substring(pDetails.name.LastIndexOf("\\") + 1)).ToString("X16"); } cPattern.casPart = pDetails.name.Substring(pDetails.name.LastIndexOf("\\") + 1); switch (pDetails.category) { case "Old": break; default: //string fullName = pDetails.Substring(patternTexture.LastIndexOf("\\") + 1); string category = pDetails.filename; category = category.Replace(@"($assetRoot)\InGame\Complates\", ""); category = category.Replace(@"Materials\", ""); category = category.Replace(@".tga", ""); category = category.Replace(@".dds", ""); if (category.IndexOf("\\") > -1) { category = category.Substring(0, category.IndexOf("\\")); } else { category = pDetails.category; } string subCategory = pDetails.filename; subCategory = subCategory.Replace(@"($assetRoot)\InGame\Complates\", ""); subCategory = subCategory.Replace(@"Materials\", ""); subCategory = subCategory.Replace(@".tga", ""); subCategory = subCategory.Replace(@".dds", ""); if (subCategory.IndexOf("\\") > -1) { subCategory = subCategory.Substring(subCategory.IndexOf("\\") + 1); } if (subCategory.Contains("\\")) { subCategory = subCategory.Remove(subCategory.IndexOf("\\")); } else { subCategory = ""; } if (subCategory == pDetails.name) subCategory = ""; cPattern.category = category; cPattern.subcategory = subCategory; Console.WriteLine(pDetails.name + " " + category + " " + subCategory); sb.AppendLine("<pattern key=\"" + cPattern.key + "\" texturename=\"\" category=\"" + category + "\" subcategory=\"" + subCategory + "\">" + pDetails.name + "</file>"); break; } //xtr.Close(); mem.Close(); } Clipboard.SetText(sb.ToString()); Console.WriteLine("Done"); }
private void button1_Click(object sender, EventArgs e) { TextReader r = new StreamReader(@"P:\Stuart\Desktop\fullPatternList.xml"); XmlSerializer s = new XmlSerializer(typeof(files)); files lookupList = (files)s.Deserialize(r); r.Close(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < lookupList.Items.Count; i++) { Stream mem = File.OpenRead(@"P:\Stuart\Desktop\FullBuild0\config\xml\root\" + lookupList.Items[i].fullCasPartname + ".xml"); Patterns.patternDetails pDetails = Patterns.parsePatternComplate(mem); if (String.IsNullOrEmpty(pDetails.category)) { continue; } patternsFile cPattern = new patternsFile(); MadScience.Wrappers.ResourceKey rKey = new MadScience.Wrappers.ResourceKey("key:" + lookupList.Items[i].typeid.Remove(0, 2) + ":" + lookupList.Items[i].groupid.Remove(0, 2) + ":" + lookupList.Items[i].instanceid.Remove(0, 2)); cPattern.key = rKey.ToString(); if (!StreamHelpers.isValidStream(KeyUtils.findKey("key:00B2D882:00000000:" + StringHelpers.HashFNV64(pDetails.name.Substring(pDetails.name.LastIndexOf("\\") + 1)).ToString("X16")))) { cPattern.texturename = pDetails.BackgroundImage; } else { cPattern.texturename = "key:00B2D882:00000000:" + StringHelpers.HashFNV64(pDetails.name.Substring(pDetails.name.LastIndexOf("\\") + 1)).ToString("X16"); } cPattern.casPart = pDetails.name.Substring(pDetails.name.LastIndexOf("\\") + 1); switch (pDetails.category) { case "Old": break; default: //string fullName = pDetails.Substring(patternTexture.LastIndexOf("\\") + 1); string category = pDetails.filename; category = category.Replace(@"($assetRoot)\InGame\Complates\", ""); category = category.Replace(@"Materials\", ""); category = category.Replace(@".tga", ""); category = category.Replace(@".dds", ""); if (category.IndexOf("\\") > -1) { category = category.Substring(0, category.IndexOf("\\")); } else { category = pDetails.category; } string subCategory = pDetails.filename; subCategory = subCategory.Replace(@"($assetRoot)\InGame\Complates\", ""); subCategory = subCategory.Replace(@"Materials\", ""); subCategory = subCategory.Replace(@".tga", ""); subCategory = subCategory.Replace(@".dds", ""); if (subCategory.IndexOf("\\") > -1) { subCategory = subCategory.Substring(subCategory.IndexOf("\\") + 1); } if (subCategory.Contains("\\")) { subCategory = subCategory.Remove(subCategory.IndexOf("\\")); } else { subCategory = ""; } if (subCategory == pDetails.name) { subCategory = ""; } cPattern.category = category; cPattern.subcategory = subCategory; Console.WriteLine(pDetails.name + " " + category + " " + subCategory); sb.AppendLine("<pattern key=\"" + cPattern.key + "\" texturename=\"\" category=\"" + category + "\" subcategory=\"" + subCategory + "\">" + pDetails.name + "</file>"); break; } //xtr.Close(); mem.Close(); } Clipboard.SetText(sb.ToString()); Console.WriteLine("Done"); }