private void readDir() { if (!Directory.Exists("mario")) { if (Directory.Exists(System.Environment.CurrentDirectory + "/private/wii/app/RSBE/pf/fighter")) { System.Environment.CurrentDirectory += "/private/wii/app/RSBE/pf/fighter"; readDir(); return; } else if (Directory.Exists(System.Environment.CurrentDirectory + "/projectm/pf/fighter")) { System.Environment.CurrentDirectory += "/projectm/pf/fighter"; readDir(); return; } else if (Directory.Exists(System.Environment.CurrentDirectory + "/minusery/pf/fighter")) { System.Environment.CurrentDirectory += "/minusery/pf/fighter"; readDir(); return; } else if (Directory.Exists("fighter")) { System.Environment.CurrentDirectory += "/fighter"; readDir(); return; } } Text = TITLE + " - " + System.Environment.CurrentDirectory; pmap.ClearAll(); pmap.BrawlExScan("../BrawlEx"); int selectedIndex = listBox1.SelectedIndex; listBox1.Items.Clear(); listBox1.Items.Add(DASH); foreach (string charname in pmap.GetKnownFighterNames()) { if (charname != null) { listBox1.Items.Add(charname); } } foreach (PortraitViewer p in portraitViewers) { p.UpdateDirectory(); } if (selectedIndex >= 0) { listBox1.SelectedIndex = selectedIndex; } }
private void readDir() { if (!Directory.Exists("mario")) { foreach (string path in new[] { "/private/wii/app/RSBE/pf/fighter", "/projectm/pf/fighter", "/fighter" }) { if (Directory.Exists(Environment.CurrentDirectory + path)) { Environment.CurrentDirectory += path; readDir(); return; } } string findFighterFolder(string dir) { if (dir.EndsWith("\\fighter")) { return(dir); } try { foreach (string subdir in Directory.EnumerateDirectories(dir)) { string possible = findFighterFolder(subdir); if (Directory.Exists(possible + "\\mario")) { return(possible); } } } catch (Exception) { } return(null); } string fighterDir = findFighterFolder(Environment.CurrentDirectory); if (fighterDir != null) { Environment.CurrentDirectory = Path.GetDirectoryName(fighterDir); readDir(); return; } } Text = TITLE + " - " + System.Environment.CurrentDirectory; pmap.ClearAll(); pmap.BrawlExScan("../BrawlEx"); int selectedIndex = listBox1.SelectedIndex; listBox1.Items.Clear(); listBox1.Items.Add(DASH); foreach (string charname in pmap.GetKnownFighterNames()) { if (charname != null) { listBox1.Items.Add(charname); } } foreach (PortraitViewer p in portraitViewers) { p.UpdateDirectory(); } if (selectedIndex >= 0) { listBox1.SelectedIndex = selectedIndex; } }