private void UpdateRegionColorImage() { if (PbColorRegion == null) { return; } PbColorRegion.Image = CreatureColored.GetColoredCreature(RegionColors, _selectedSpecies, regionColorChooser1.ColorRegionsUseds, 256, onlyImage: true, creatureSex: CreatureSex); }
/// <summary> /// Updates the displayed colors of the creature. /// </summary> private void UpdateRegionColorImage() { ParentInheritance?.UpdateColors(RegionColors); ColorsChanged?.Invoke(this); if (PbColorRegion != null) { PbColorRegion.Image = CreatureColored.GetColoredCreature(RegionColors, _selectedSpecies, regionColorChooser1.ColorRegionsUseds, 256, onlyImage: true, creatureSex: CreatureSex); } }
private void RegionColorChooser1_RegionColorChosen() { if (_creature == null) { return; } pictureBox1.Image = CreatureColored.GetColoredCreature(_creature.colors, _creature.Species, colorRegionUseds, creatureSex: _creature.sex); _creature.colors = regionColorChooser1.ColorIDs; Changed?.Invoke(_creature, false, false); }
private void RegionColorChooser1_RegionColorChosen() { if (_creature == null) { return; } _creature.colors = regionColorChooser1.ColorIds; pictureBox1.SetImageAndDisposeOld(CreatureColored.GetColoredCreature(_creature.colors, _creature.Species, _colorRegionUseds, creatureSex: _creature.sex)); Changed?.Invoke(_creature, false, false); }
public void UpdateLabel() { LbMotherAndWildInfo.Text = ""; if (_creature != null) { groupBox1.Text = $"{_creature.name} (Lvl {_creature.Level}/{_creature.LevelHatched + _cc.maxDomLevel})"; void SetParentLabel(Label l, string lbText = null, bool clickable = false) { l.Text = lbText; l.Cursor = clickable ? Cursors.Hand : null; _tt.SetToolTip(l, clickable ? lbText : null); } if (_creature.Mother != null || _creature.Father != null) { SetParentLabel(LbMotherAndWildInfo, _creature.Mother != null ? $"{Loc.S("Mother")}: {_creature.Mother.name}" : null, _creature.Mother != null); SetParentLabel(LbFather, _creature.Father != null ? $"{Loc.S("Father")}: {_creature.Father.name}" : null, _creature.Father != null); } else if (_creature.isBred) { SetParentLabel(LbMotherAndWildInfo, "bred, click 'edit' to add parents"); SetParentLabel(LbFather); } else { SetParentLabel(LbMotherAndWildInfo, "found wild " + _creature.levelFound + (_creature.tamingEff >= 0 ? ", tamed with TE: " + (_creature.tamingEff * 100).ToString("N1") + "%" : ", TE unknown.")); SetParentLabel(LbFather); } statsDisplay1.SetCreatureValues(_creature); labelNotes.Text = _creature.note; _tt.SetToolTip(labelNotes, _creature.note); labelSpecies.Text = _creature.Species.name; pictureBox1.SetImageAndDisposeOld(CreatureColored.GetColoredCreature(_creature.colors, _creature.Species, _colorRegionUseds, creatureSex: _creature.sex)); _tt.SetToolTip(pictureBox1, CreatureColored.RegionColorInfo(_creature.Species, _creature.colors) + "\n\nClick to copy creature infos as image to the clipboard"); pictureBox1.Visible = true; } }
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, creatureSex: _creature.sex); tt.SetToolTip(pictureBox1, CreatureColored.RegionColorInfo(_creature.Species, _creature.colors) + "\n\nClick to copy creature infos as image to the clipboard"); pictureBox1.Visible = true; } }
/// <summary> /// Creates the pedigree with creature controls. /// </summary> private void CreatePedigree() { // clear old pedigreeCreatures ClearControls(); if (_selectedCreature == null) { NoCreatureSelected(); return; } SuspendLayout(); pedigreeCreature1.SetCustomStatNames(_selectedCreature?.Species?.statNames); const int leftBorder = 40; const int pedigreeElementWidth = 325; const int margin = 10; lbPedigreeEmpty.Visible = false; // create ancestors CreateParentsChild(_selectedCreature, leftBorder + pedigreeElementWidth + margin, 60, true, true); if (_selectedCreature.Mother != null) { if (CreateParentsChild(_selectedCreature.Mother, leftBorder, 20)) { _lines[1].Add(new[] { leftBorder + pedigreeElementWidth, 79, leftBorder + pedigreeElementWidth + margin, 79 }); } } if (_selectedCreature.Father != null) { if (CreateParentsChild(_selectedCreature.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 _creatureChildren) { PedigreeCreature pc = new PedigreeCreature(c, _enabledColorRegions) { Location = new Point(leftBorder + xS, 200 + 35 * row + yS) }; for (int s = 0; s < PedigreeCreature.displayedStatsCount; s++) { int si = PedigreeCreature.displayedStats[s]; if (_selectedCreature.valuesDom[si] > 0 && _selectedCreature.levelsWild[si] >= 0 && _selectedCreature.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(_selectedCreature.colors, _selectedCreature.Species, _enabledColorRegions, 256, creatureSex: _selectedCreature.sex); pictureBox.Visible = true; Invalidate(); ResumeLayout(); }
/// <summary> /// Updates the displayed colors of the creature. /// </summary> private void UpdateRegionColorImage() { ParentInheritance?.UpdateColors(RegionColors); ColorsChanged?.Invoke(this); PbColorRegion?.SetImageAndDisposeOld(CreatureColored.GetColoredCreature(RegionColors, _selectedSpecies, regionColorChooser1.ColorRegionsUseds, 256, onlyImage: true, creatureSex: CreatureSex)); }