private void bAddTag_Click(object sender, EventArgs e) { MultiSetterTag mst = new MultiSetterTag(tbNewTag.Text); mst.Location = new Point(3, 3 + panelTags.Controls.Count * 29 - panelTags.VerticalScroll.Value); panelTags.Controls.Add(mst); tagControls.Add(mst); mst.TagChecked = true; }
public MultiSetter(List <Creature> creatureList, List <bool> appliedSettings, List <Creature>[] parents, List <string> tagList, List <string> speciesList) { InitializeComponent(); Disposed += MultiSetter_Disposed; colors = new int[6]; tagControls = new List <MultiSetterTag>(); this.creatureList = creatureList; parentComboBoxMother.naLabel = " - Mother n/a"; parentComboBoxFather.naLabel = " - Father n/a"; if (parents == null) { // disable parents, probably multiple species selected checkBoxMother.Enabled = false; checkBoxFather.Enabled = false; parentComboBoxMother.Enabled = false; parentComboBoxFather.Enabled = false; uniqueSpecies = false; } else { parentComboBoxMother.ParentList = parents[0]; parentComboBoxFather.ParentList = parents[1]; uniqueSpecies = true; } checkBoxMother.Checked = false; checkBoxFather.Checked = false; creatureStatus = CreatureStatus.Alive; creatureSex = Sex.Unknown; ParentsChanged = false; TagsChanged = false; SpeciesChanged = false; pictureBox1.Image = CreatureColored.getColoredCreature(colors, (uniqueSpecies ? creatureList[0].species : ""), new bool[] { true, true, true, true, true, true }); // tags MultiSetterTag mst; int i = 0; foreach (string t in tagList) { mst = new MultiSetterTag(t); mst.Location = new Point(3, 3 + i * 29 - panelTags.VerticalScroll.Value); panelTags.Controls.Add(mst); tagControls.Add(mst); i++; } foreach (string s in speciesList) { cbbSpecies.Items.Add(s); } tt.SetToolTip(lbTagSettingInfo, "The left checkbox indicates if the setting of that tag is applied, the right checkbox indicates if the tag is added or removed from the selected creatures."); }
public MultiSetter(List <Creature> creatureList, List <bool> appliedSettings, List <Creature>[] parents, List <string> tagList) { InitializeComponent(); colors = new int[6]; tagControls = new List <MultiSetterTag>(); this.creatureList = creatureList; parentComboBoxMother.naLabel = " - Mother n/a"; parentComboBoxFather.naLabel = " - Father n/a"; if (parents == null) { // disable parents, probably multiple species selected checkBoxMother.Enabled = false; checkBoxFather.Enabled = false; parentComboBoxMother.Enabled = false; parentComboBoxFather.Enabled = false; uniqueSpecies = false; } else { parentComboBoxMother.ParentList = parents[0]; parentComboBoxFather.ParentList = parents[1]; uniqueSpecies = true; } checkBoxMother.Checked = false; checkBoxFather.Checked = false; creatureStatus = CreatureStatus.Alive; creatureSex = Sex.Unknown; ParentsChanged = false; TagsChanged = false; pictureBox1.Image = CreatureColored.getColoredCreature(colors, (uniqueSpecies ? creatureList[0].species : ""), new bool[] { true, true, true, true, true, true }); // tags MultiSetterTag mst; int i = 0; foreach (string t in tagList) { mst = new MultiSetterTag(t); mst.Location = new Point(3, 3 + i * 29 - panelTags.VerticalScroll.Value); panelTags.Controls.Add(mst); tagControls.Add(mst); i++; } }