private void LoadSpriteDropdown() { linkSpriteCombobox.Items.Add(new files_names("Unchanged", "Unchanged")); linkSpriteCombobox.Items.Add(new files_names("Random", "Random")); linkSpriteCombobox.SelectedIndex = 0; foreach (string f in Directory.GetFiles("sprites\\")) { files_names item = new files_names(Path.GetFileNameWithoutExtension(f), f); linkSpriteCombobox.Items.Add(item); } }
void LoadShieldDropdown() { shieldSpriteCombobox.Items.Clear(); //foreach(var e in Enum.GetValues(typeof(ShieldTypes))) //{ // shieldSpriteCombobox.Items.Add(((ShieldTypes)e).GetDescription()); //} foreach (string f in Directory.GetFiles("shield_gfx\\")) { files_names item = new files_names(Path.GetFileNameWithoutExtension(f), f); shieldSpriteCombobox.Items.Add(item); } }
private void LoadSpriteDropdown() { linkSpriteCombobox.Items.Add(new files_names("Unchanged", "Unchanged")); linkSpriteCombobox.Items.Add(new files_names("Random", "Random")); linkSpriteCombobox.SelectedIndex = 0; foreach (string f in Directory.GetFiles("sprites\\")) { try { var s = new EnemizerLibrary.Sprite(File.ReadAllBytes(f)); files_names item = new files_names(String.IsNullOrEmpty(s.DisplayText) ? Path.GetFileNameWithoutExtension(f) : s.DisplayText, f); linkSpriteCombobox.Items.Add(item); } catch { } // skip the bad sprite } }