protected void respond_to_tag_menu(string resp) { if (resp == "new_tag") { CraftManager.main_ui.create_tag_dialog(false, CraftData.active_craft); } else { if (CraftData.active_craft.Count == 1) { CraftData craft = CraftData.active_craft[0]; if (craft.tag_names().Contains(resp)) { Tags.untag_craft(craft, resp); } else { Tags.tag_craft(craft, resp); } } else { //if all craft in the active selection have the tag, then remove the tag. if (CraftData.active_craft.FindAll(c => c.tag_names().Contains(resp)).Count == CraftData.active_craft.Count) { CraftData.active_craft.ForEach(c => Tags.untag_craft(c, resp)); } else //otherwise add the tag (in the case where some have it and other not, this will result in all having the tag). { CraftData.active_craft.ForEach(c => Tags.tag_craft(c, resp)); } } } }
public KerbalXUploadData(CraftData for_craft) { craft = for_craft; craft_name = craft.name; List <string> craft_tags = new List <string>(); foreach (string tag in craft.tag_names()) { craft_tags.Add(System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(tag.Trim()).Replace(" ", "")); } hash_tags = String.Join(", ", craft_tags.ToArray()); }