public static getColoredCreature ( int colorIds, string species, bool enabledColorRegions, int size = 128, int pieSize = 64, bool onlyColors = false, bool dontCache = false ) : |
||
colorIds | int | |
species | string | |
enabledColorRegions | bool | |
size | int | |
pieSize | int | |
onlyColors | bool | |
dontCache | bool | |
return |
public MultiSetter(Creature creatureSettings, List <bool> appliedSettings, List <Creature>[] parents) { InitializeComponent(); tt.SetToolTip(buttonStatus, "Status: " + c.status.ToString()); tt.SetToolTip(buttonSex, "Sex: " + c.gender.ToString()); if (appliedSettings.Count != 13) { DialogResult = DialogResult.Cancel; // invalid parameters } this.appliedSettings = appliedSettings; this.c = creatureSettings; 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; } else { parentComboBoxMother.ParentList = parents[0]; parentComboBoxFather.ParentList = parents[1]; uniqueSpecies = true; } checkBoxMother.Checked = false; checkBoxFather.Checked = false; pictureBox1.Image = CreatureColored.getColoredCreature(c.colors, (uniqueSpecies ? c.species : ""), new bool[] { true, true, true, true, true, true }); }
private void RegionColorChooser1_RegionColorChosen() { creature.colors = regionColorChooser1.colorIDs; pictureBox1.Image = CreatureColored.getColoredCreature(creature.colors, creature.species, colorRegionUseds); renewLargeImage = true; Changed(creature, false); }
private void pictureBox1_Click(object sender, EventArgs e) { if (renewLargeImage) { largeImage = CreatureColored.getColoredCreature(creature.colors, creature.species, colorRegionUseds, 256); renewLargeImage = false; } }
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 void setCreature(Creature creature) { this.creature = creature; groupBox1.Text = (!onlyLevels && creature.status != CreatureStatus.Available ? "(" + Utils.statusSymbol(creature.status) + ") " : "") + creature.name + " (" + creature.levelHatched + (totalLevelUnknown ? "+" : "") + ")"; if (!onlyLevels && creature.status == CreatureStatus.Dead) { groupBox1.ForeColor = SystemColors.GrayText; tt.SetToolTip(groupBox1, "Creature has passed away"); } else if (!onlyLevels && creature.status == CreatureStatus.Unavailable) { groupBox1.ForeColor = SystemColors.GrayText; tt.SetToolTip(groupBox1, "Creature is currently not available"); } for (int s = 0; s < 7; s++) { if (creature.levelsWild[s] < 0) { labels[s].Text = "?"; labels[s].BackColor = Color.WhiteSmoke; labels[s].ForeColor = Color.LightGray; } else { labels[s].Text = creature.levelsWild[s].ToString(); labels[s].BackColor = Utils.getColorFromPercent((int)(creature.levelsWild[s] * 2.5), (creature.topBreedingStats[s] ? 0.2 : 0.7)); labels[s].ForeColor = SystemColors.ControlText; tt.SetToolTip(labels[s], Utils.statName(s) + ": " + (creature.valuesBreeding[s] * (Utils.precision(s) == 3 ? 100 : 1)).ToString() + (Utils.precision(s) == 3 ? "%" : "")); } labels[s].Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, (creature.topBreedingStats[s] ? System.Drawing.FontStyle.Bold : System.Drawing.FontStyle.Regular), System.Drawing.GraphicsUnit.Point, ((byte)(0))); } if (onlyLevels) { labelSex.Visible = false; pictureBox1.Visible = false; plainTextcurrentValuesToolStripMenuItem.Visible = false; aRKChatcurrentValuesToolStripMenuItem.Visible = false; } else { labelSex.Visible = true; labelSex.Text = Utils.sexSymbol(creature.gender); labelSex.BackColor = creature.neutered ? SystemColors.GrayText : Utils.sexColor(creature.gender); // creature Colors pictureBox1.Image = CreatureColored.getColoredCreature(creature.colors, "", enabledColorRegions, 24, 22, true); labelSex.Visible = true; pictureBox1.Visible = true; plainTextcurrentValuesToolStripMenuItem.Visible = true; aRKChatcurrentValuesToolStripMenuItem.Visible = true; } labelMutations.BackColor = Color.FromArgb(225, 192, 255); labelMutations.Text = creature.mutationCounter.ToString(); labelMutations.Visible = creature.mutationCounter > 0; contextMenuAvailable = true; }
public void updateLabel() { if (creature != null) { labelGender.Text = Utils.sexSymbol(creature.gender); groupBox1.Text = creature.name + " (Lvl " + creature.level + "/" + (creature.levelHatched + maxDomLevel) + ")"; if (creature.Mother != null || creature.Father != null) { labelParents.Text = ""; if (creature.Mother != null) { labelParents.Text = "Mo: " + creature.Mother.name; } if (creature.Father != null && creature.Mother != null) { labelParents.Text += "; "; } if (creature.Father != null) { labelParents.Text += "Fa: " + creature.Father.name; } } else if (creature.isBred) { labelParents.Text = "bred, click 'edit' to add parents"; } else { labelParents.Text = "found wild " + creature.levelFound + (creature.tamingEff >= 0 ? ", tamed with TE: " + (creature.tamingEff * 100).ToString("N1") + "%" : ", TE unknown."); } for (int s = 0; s < 8; s++) { updateStat(s); } labelNotes.Text = creature.note; labelSpecies.Text = creature.species; pictureBox1.Image = CreatureColored.getColoredCreature(creature.colors, creature.species, colorRegionUseds); pictureBox1.Visible = true; for (int c = 0; c < 6; c++) { if (colorRegionUseds[c]) { setColorButton(colorButtons[c], Utils.creatureColor(creature.colors[c])); tt.SetToolTip(colorButtons[c], colorRegions[c].name); colorButtons[c].Visible = true; } else { colorButtons[c].Visible = false; } } } }
private void chooseColor(int region, Button sender) { if (c != null && !cp.isShown) { cp.SetColors(c.colors, region, "Region " + region.ToString()); if (cp.ShowDialog() == DialogResult.OK) { // color was chosen setColorButton(sender, Utils.creatureColor(c.colors[region])); pictureBox1.Image = CreatureColored.getColoredCreature(c.colors, (uniqueSpecies ? c.species : ""), new bool[] { true, true, true, true, true, true }); } } }
private void chooseColor(int region, Button sender) { if (creature != null && !cp.isShown) { cp.SetColors(creature.colors, region); if (cp.ShowDialog() == DialogResult.OK) { // color was chosen setColorButton(sender, Utils.creatureColor(creature.colors[region])); pictureBox1.Image = CreatureColored.getColoredCreature(creature.colors, creature.species, enabledColorRegions); renewLargeImage = true; } } }
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++; } }
public void UpdateLabel() { labelParents.Text = ""; if (creature != null) { groupBox1.Text = $"{creature.name} (Lvl {creature.Level}/{creature.LevelHatched + cc.maxDomLevel})"; if (creature.Mother != null || creature.Father != null) { if (creature.Mother != null) { labelParents.Text = "Mo: " + creature.Mother.name; } if (creature.Father != null && creature.Mother != null) { labelParents.Text += "; "; } if (creature.Father != null) { labelParents.Text += "Fa: " + creature.Father.name; } } else if (creature.isBred) { labelParents.Text = "bred, click 'edit' to add parents"; } else { labelParents.Text = "found wild " + creature.levelFound + (creature.tamingEff >= 0 ? ", tamed with TE: " + (creature.tamingEff * 100).ToString("N1") + "%" : ", TE unknown."); } statsDisplay1.SetCreatureValues(creature); labelNotes.Text = creature.note; labelSpecies.Text = creature.Species.name; pictureBox1.Image = CreatureColored.getColoredCreature(creature.colors, creature.Species, colorRegionUseds); tt.SetToolTip(pictureBox1, CreatureColored.RegionColorInfo(creature.Species, creature.colors) + "\n\nClick to copy creature infos as image to the clipboard"); pictureBox1.Visible = true; } }
/// <summary> /// call this function to create the pedigreeCreature-Elements /// </summary> public void createPedigree() { // clear old pedigreeCreatures ClearControls(); if (creature != null) { SuspendLayout(); bool isGlowSpecies = Values.V.IsGlowSpecies(creature.Species?.name); pedigreeCreature1.IsGlowSpecies = isGlowSpecies; int leftBorder = 40; int pedigreeElementWidth = 325; int margin = 10; lbPedigreeEmpty.Visible = false; // create ancestors createParentsChild(creature, leftBorder + pedigreeElementWidth + margin, 60, true, true); if (creature.Mother != null) { if (createParentsChild(creature.Mother, leftBorder, 20)) { lines[1].Add(new[] { leftBorder + pedigreeElementWidth, 79, leftBorder + pedigreeElementWidth + margin, 79 }); } } if (creature.Father != null) { if (createParentsChild(creature.Father, leftBorder + 2 * (pedigreeElementWidth + margin), 20)) { lines[1].Add(new[] { leftBorder + 2 * pedigreeElementWidth + 2 * margin, 79, leftBorder + 2 * pedigreeElementWidth + margin, 159 }); } } // create descendants int row = 0; // scrolloffsets int xS = AutoScrollPosition.X; int yS = AutoScrollPosition.Y; foreach (Creature c in children) { PedigreeCreature pc = new PedigreeCreature(c, enabledColorRegions) { Location = new Point(leftBorder + xS, 200 + 35 * row + yS) }; for (int s = 0; s < PedigreeCreature.displayedStats.Length; s++) { int si = PedigreeCreature.displayedStats[s]; if (creature.valuesDom[si] > 0 && creature.levelsWild[si] >= 0 && creature.levelsWild[si] == c.levelsWild[si]) { lines[0].Add(new[] { leftBorder + 38 + 29 * s, 200 + 35 * row + 6, leftBorder + 38 + 29 * s, 200 + 35 * row + 15, 0, 0 }); } } pc.CreatureClicked += CreatureClicked; pc.CreatureEdit += CreatureEdit; pc.BestBreedingPartners += BestBreedingPartners; pc.exportToClipboard += exportToClipboard; splitContainer1.Panel2.Controls.Add(pc); pcs.Add(pc); row++; } pictureBox.Image = CreatureColored.getColoredCreature(creature.colors, creature.Species, enabledColorRegions, 256); Invalidate(); ResumeLayout(); } else { noCreatureSelected(); } }
/// <summary> /// call this function to create the pedigreeCreature-Elements /// </summary> public void createPedigree() { // clear old pedigreeCreatures ClearControls(); if (creature != null) { this.SuspendLayout(); int leftBorder = 200; lbPedigreeEmpty.Visible = false; // create ancestors createParentsChild(creature, leftBorder + 325, 60, true, true); if (creature.Mother != null) { if (createParentsChild(creature.Mother, leftBorder + 10, 20, false)) { lines[1].Add(new int[] { leftBorder + 306, 79, leftBorder + 325, 79 }); } } if (creature.Father != null) { if (createParentsChild(creature.Father, leftBorder + 640, 20, false)) { lines[1].Add(new int[] { leftBorder + 640, 79, leftBorder + 621, 159 }); } } // create descendants int row = 0; // scrolloffsets int xS = AutoScrollPosition.X; int yS = AutoScrollPosition.Y; foreach (Creature c in children) { PedigreeCreature pc = new PedigreeCreature(c, enabledColorRegions); pc.Location = new Point(leftBorder + 10 + xS, 200 + 35 * row + yS); for (int s = 0; s < 7; s++) { if (creature.levelsWild[s] >= 0 && creature.levelsWild[s] == c.levelsWild[s]) { lines[0].Add(new int[] { leftBorder + 10 + 38 + 28 * s, 200 + 35 * row + 6, leftBorder + 10 + 38 + 28 * s, 200 + 35 * row + 15, 0, 0 }); } } pc.CreatureClicked += new PedigreeCreature.CreatureChangedEventHandler(CreatureClicked); pc.CreatureEdit += new PedigreeCreature.CreatureEditEventHandler(CreatureEdit); pc.BestBreedingPartners += new PedigreeCreature.CreaturePartnerEventHandler(BestBreedingPartners); pc.exportToClipboard += new PedigreeCreature.ExportToClipboardEventHandler(exportToClipboard); Controls.Add(pc); pcs.Add(pc); row++; } pictureBox.Image = CreatureColored.getColoredCreature(creature.colors, creature.species, enabledColorRegions, 256); this.Invalidate(); this.ResumeLayout(); } else { noCreatureSelected(); } }