private void CloseSettings(bool save) { panel1.Visible = false; if (save) { SuspendLayout(); creature.name = textBoxName.Text; creature.sex = sex; creature.owner = textBoxOwner.Text; Creature parent = null; if (checkBoxIsBred.Checked) { parent = parentComboBoxMother.SelectedParent; } creature.motherGuid = parent?.guid ?? Guid.Empty; bool parentsChanged = false; if (creature.Mother != parent) { creature.Mother = parent; parentsChanged = true; } parent = null; if (checkBoxIsBred.Checked) { parent = parentComboBoxFather.SelectedParent; } creature.fatherGuid = parent?.guid ?? Guid.Empty; if (creature.Father != parent) { creature.Father = parent; parentsChanged = true; } if (parentsChanged) { creature.RecalculateAncestorGenerations(); } creature.isBred = checkBoxIsBred.Checked; creature.note = textBoxNote.Text; bool creatureStatusChanged = (creature.status != creatureStatus); creature.status = creatureStatus; Changed(creature, creatureStatusChanged, true); UpdateLabel(); ResumeLayout(); } }
private void PbCreatureColorsExtractor_Click(object sender, EventArgs e) { var creature = new Creature { Species = speciesSelector1.SelectedSpecies, levelsWild = GetCurrentWildLevels(true), levelsDom = GetCurrentDomLevels(true) }; creature.tamingEff = _extractor.UniqueTamingEffectiveness(); creature.isBred = rbBredExtractor.Checked; creature.imprintingBonus = _extractor.ImprintingBonus; creatureInfoInputExtractor.SetCreatureData(creature); creature.RecalculateAncestorGenerations(); creature.RecalculateNewMutations(); creature.RecalculateCreatureValues(CreatureCollection.CurrentCreatureCollection.wildLevelStep); creature.ExportInfoGraphicToClipboard(CreatureCollection.CurrentCreatureCollection); }
private void pictureBoxColorRegionsTester_Click(object sender, EventArgs e) { var creature = new Creature { Species = speciesSelector1.SelectedSpecies, levelsWild = GetCurrentWildLevels(false), levelsDom = GetCurrentDomLevels(false), tamingEff = TamingEffectivenessTester, isBred = rbBredTester.Checked, imprintingBonus = (double)numericUpDownImprintingBonusTester.Value / 100 }; creatureInfoInputTester.SetCreatureData(creature); creature.RecalculateAncestorGenerations(); creature.RecalculateNewMutations(); creature.RecalculateCreatureValues(CreatureCollection.CurrentCreatureCollection.wildLevelStep); creature.ExportInfoGraphicToClipboard(CreatureCollection.CurrentCreatureCollection); }