public CostumeManager() { InitializeComponent(); isUpdateAvailable(); pmap = new PortraitMap(); try { Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); } catch (Exception) { } portraitViewers = new List <PortraitViewer> { cssPortraitViewer1, resultPortraitViewer1, resultSinglePortraitViewerStocks1, battlePortraitViewer1, infoStockIconViewer1, infoStockIconViewer1 }; if (!new DirectoryInfo("fighter").Exists) { if (new DirectoryInfo("/private/wii/app/RSBE/pf/fighter").Exists) { Environment.CurrentDirectory = "/private/wii/app/RSBE/pf"; } else if (new DirectoryInfo("/projectm/pf/fighter").Exists) { Environment.CurrentDirectory = "/projectm/pf"; } } cssPortraitViewer1.NamePortraitPreview = nameportraitPreviewToolStripMenuItem.Checked; modelManager1.ZoomOut = defaultZoomLevelToolStripMenuItem.Checked; readDir(); }
private void projectMCheckbox_Click(object sender, EventArgs e) { cBlissCheckbox.Checked = false; pmap = projectMCheckbox.Checked ? new PortraitMap.Brawl() : new PortraitMap(); pmap.BrawlExScan("../BrawlEx"); foreach (PortraitViewer p in portraitViewers) { RefreshPortraits(); } }
public CostumeManager() { InitializeComponent(); pmap = new PortraitMap(); try { Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); } catch (Exception) {} portraitViewers = new List<PortraitViewer> {cssPortraitViewer1, resultPortraitViewer1, battlePortraitViewer1, infoStockIconViewer1}; if (!new DirectoryInfo("fighter").Exists) { if (new DirectoryInfo("/private/wii/app/RSBE/pf/fighter").Exists) { System.Environment.CurrentDirectory = "/private/wii/app/RSBE/pf"; } else if (new DirectoryInfo("/projectm/pf/fighter").Exists) { System.Environment.CurrentDirectory = "/projectm/pf"; } else if (new DirectoryInfo("/minusery/pf/fighter").Exists) { System.Environment.CurrentDirectory = "/minusery/pf"; } } cssPortraitViewer1.NamePortraitPreview = nameportraitPreviewToolStripMenuItem.Checked; modelManager1.ZoomOut = defaultZoomLevelToolStripMenuItem.Checked; readDir(); }
public void BrawlExScan(string brawlExDir) { if (whoWasAdded_Debug == null) { whoWasAdded_Debug = new Dictionary <int, string>(); } if (Directory.Exists(brawlExDir)) { foreach (string fitc in Directory.EnumerateFiles(brawlExDir + "/FighterConfig")) { byte id; if (byte.TryParse(fitc.Substring(fitc.Length - 6, 2), NumberStyles.HexNumber, null, out id)) { byte[] fitc_data = File.ReadAllBytes(fitc); StringBuilder sb = new StringBuilder(); for (int i = 0xb0; i < 0xc0; i++) { char c = (char)fitc_data[i]; if (c == 0) { break; } sb.Append(c); } string name = sb.ToString(); int?cosmeticIndex = PortraitMap.GetCosmeticSlot(id); if (cosmeticIndex != null) { string cosm = brawlExDir + "/CosmeticConfig/Cosmetic" + cosmeticIndex.Value.ToString("X2") + ".dat"; if (File.Exists(cosm)) { Console.WriteLine("Cosmetic" + cosmeticIndex.Value.ToString("X2")); byte[] cosm_data = File.ReadAllBytes(cosm); this.SetCharBustTexIndex(name, cosm_data[0x10]); } } int?cssSlotIndex = PortraitMap.GetCSSSlot(id); if (cssSlotIndex != null) { string cssc = brawlExDir + "/CSSSlotConfig/CSSSlot" + cssSlotIndex.Value.ToString("X2") + ".dat"; if (File.Exists(cssc)) { byte[] cssc_data = File.ReadAllBytes(cssc); List <int> colors = new List <int>(); for (int i = 0x20; i < 0x40; i += 2) { if (cssc_data[i] == 0x0c) { break; } colors.Add(cssc_data[i + 1]); } try { this.AddPortraitMappings(name, colors.ToArray()); } catch (ArgumentException) { string oldname = null; int i = GetCharBustTexIndex(name); whoWasAdded_Debug.TryGetValue(i, out oldname); System.Windows.Forms.MessageBox.Show("Could not add mappings for CSSSlot" + cssSlotIndex.Value.ToString("X2") + ".dat (" + name + ") - mappings were already added for " + (oldname ?? "-null-") + " (char_bust_tex index " + i + ")"); } } } } } } }
private void projectMCheckbox_Click(object sender, EventArgs e) { cBlissCheckbox.Checked = false; pmap = projectMCheckbox.Checked ? new PortraitMap.ProjectM() : new PortraitMap(); pmap.BrawlExScan("../BrawlEx"); foreach (PortraitViewer p in portraitViewers) { RefreshPortraits(); } }