diff --git a/ARKBreedingStats/AboutBox1.cs b/ARKBreedingStats/AboutBox1.cs index 67390740..c809f15e 100644 --- a/ARKBreedingStats/AboutBox1.cs +++ b/ARKBreedingStats/AboutBox1.cs @@ -44,7 +44,7 @@ public string AssemblyVersion { get { - return "0.16.3"; + return Application.ProductVersion; //return Assembly.GetExecutingAssembly().GetName().Version.ToString(); } } diff --git a/ARKBreedingStats/Form1.Designer.cs b/ARKBreedingStats/Form1.Designer.cs index 04ca19ef..62d7dba3 100644 --- a/ARKBreedingStats/Form1.Designer.cs +++ b/ARKBreedingStats/Form1.Designer.cs @@ -37,7 +37,7 @@ private void InitializeComponent() this.buttonExtract = new System.Windows.Forms.Button(); this.buttonClear = new System.Windows.Forms.Button(); this.buttonCopyClipboard = new System.Windows.Forms.Button(); - this.cbbStatTestingRace = new System.Windows.Forms.ComboBox(); + this.cbbStatTestingSpecies = new System.Windows.Forms.ComboBox(); this.checkBoxAlreadyBred = new System.Windows.Forms.CheckBox(); this.checkBoxJustTamed = new System.Windows.Forms.CheckBox(); this.checkBoxWildTamedAuto = new System.Windows.Forms.CheckBox(); @@ -129,6 +129,8 @@ private void InitializeComponent() this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); this.buttonTester2Extractor = new System.Windows.Forms.Button(); this.statTestingTamingEfficiency = new System.Windows.Forms.NumericUpDown(); + this.labelNotTamedNoteTesting = new System.Windows.Forms.Label(); + this.checkBoxQuickWildCheck = new System.Windows.Forms.CheckBox(); this.statTestingTorpor = new ARKBreedingStats.StatIO(); this.statTestingSpeed = new ARKBreedingStats.StatIO(); this.statTestingDamage = new ARKBreedingStats.StatIO(); @@ -222,9 +224,9 @@ private void InitializeComponent() // // buttonExtract // - this.buttonExtract.Location = new System.Drawing.Point(307, 179); + this.buttonExtract.Location = new System.Drawing.Point(307, 204); this.buttonExtract.Name = "buttonExtract"; - this.buttonExtract.Size = new System.Drawing.Size(161, 48); + this.buttonExtract.Size = new System.Drawing.Size(161, 35); this.buttonExtract.TabIndex = 10; this.buttonExtract.Text = "Extract Level Distribution"; this.buttonExtract.UseVisualStyleBackColor = true; @@ -243,29 +245,29 @@ private void InitializeComponent() // buttonCopyClipboard // this.buttonCopyClipboard.Enabled = false; - this.buttonCopyClipboard.Location = new System.Drawing.Point(307, 454); + this.buttonCopyClipboard.Location = new System.Drawing.Point(307, 471); this.buttonCopyClipboard.Name = "buttonCopyClipboard"; - this.buttonCopyClipboard.Size = new System.Drawing.Size(161, 56); + this.buttonCopyClipboard.Size = new System.Drawing.Size(161, 39); this.buttonCopyClipboard.TabIndex = 14; this.buttonCopyClipboard.Text = "Copy retrieved Values to Clipboard for Spreadsheet"; this.buttonCopyClipboard.UseVisualStyleBackColor = true; this.buttonCopyClipboard.Click += new System.EventHandler(this.buttonCopyClipboard_Click); // - // cbbStatTestingRace + // cbbStatTestingSpecies // - this.cbbStatTestingRace.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; - this.cbbStatTestingRace.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; - this.cbbStatTestingRace.FormattingEnabled = true; - this.cbbStatTestingRace.Location = new System.Drawing.Point(6, 6); - this.cbbStatTestingRace.Name = "cbbStatTestingRace"; - this.cbbStatTestingRace.Size = new System.Drawing.Size(149, 21); - this.cbbStatTestingRace.TabIndex = 0; - this.cbbStatTestingRace.SelectedIndexChanged += new System.EventHandler(this.cbbStatTestingRace_SelectedIndexChanged); + this.cbbStatTestingSpecies.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; + this.cbbStatTestingSpecies.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.cbbStatTestingSpecies.FormattingEnabled = true; + this.cbbStatTestingSpecies.Location = new System.Drawing.Point(6, 6); + this.cbbStatTestingSpecies.Name = "cbbStatTestingSpecies"; + this.cbbStatTestingSpecies.Size = new System.Drawing.Size(149, 21); + this.cbbStatTestingSpecies.TabIndex = 0; + this.cbbStatTestingSpecies.SelectedIndexChanged += new System.EventHandler(this.cbbStatTestingRace_SelectedIndexChanged); // // checkBoxAlreadyBred // this.checkBoxAlreadyBred.AutoSize = true; - this.checkBoxAlreadyBred.Location = new System.Drawing.Point(307, 88); + this.checkBoxAlreadyBred.Location = new System.Drawing.Point(307, 117); this.checkBoxAlreadyBred.Name = "checkBoxAlreadyBred"; this.checkBoxAlreadyBred.Size = new System.Drawing.Size(91, 17); this.checkBoxAlreadyBred.TabIndex = 11; @@ -275,9 +277,9 @@ private void InitializeComponent() // // checkBoxJustTamed // - this.checkBoxJustTamed.Location = new System.Drawing.Point(307, 142); + this.checkBoxJustTamed.Location = new System.Drawing.Point(307, 171); this.checkBoxJustTamed.Name = "checkBoxJustTamed"; - this.checkBoxJustTamed.Size = new System.Drawing.Size(161, 31); + this.checkBoxJustTamed.Size = new System.Drawing.Size(107, 31); this.checkBoxJustTamed.TabIndex = 13; this.checkBoxJustTamed.Text = "Since Taming no Server-Restart"; this.checkBoxJustTamed.UseVisualStyleBackColor = true; @@ -396,6 +398,7 @@ private void InitializeComponent() this.checkBoxStatTestingTamed.TabIndex = 41; this.checkBoxStatTestingTamed.Text = "Tamed"; this.checkBoxStatTestingTamed.UseVisualStyleBackColor = true; + this.checkBoxStatTestingTamed.CheckedChanged += new System.EventHandler(this.checkBoxStatTestingTamed_CheckedChanged); // // NumericUpDownTestingTE // @@ -409,6 +412,7 @@ private void InitializeComponent() 0, 0, 0}); + this.NumericUpDownTestingTE.ValueChanged += new System.EventHandler(this.NumericUpDownTestingTE_ValueChanged); // // label9 // @@ -498,7 +502,7 @@ private void InitializeComponent() this.groupBoxTE.Controls.Add(this.numericUpDownUpperTEffBound); this.groupBoxTE.Controls.Add(this.label1); this.groupBoxTE.Controls.Add(this.numericUpDownLowerTEffBound); - this.groupBoxTE.Location = new System.Drawing.Point(310, 6); + this.groupBoxTE.Location = new System.Drawing.Point(310, 35); this.groupBoxTE.Name = "groupBoxTE"; this.groupBoxTE.Size = new System.Drawing.Size(158, 76); this.groupBoxTE.TabIndex = 11; @@ -595,7 +599,7 @@ private void InitializeComponent() // // labelDoc // - this.labelDoc.Location = new System.Drawing.Point(307, 230); + this.labelDoc.Location = new System.Drawing.Point(307, 242); this.labelDoc.Name = "labelDoc"; this.labelDoc.Size = new System.Drawing.Size(158, 198); this.labelDoc.TabIndex = 24; @@ -756,7 +760,7 @@ private void InitializeComponent() this.panel1.Controls.Add(this.checkBoxOutputRowHeader); this.panel1.Controls.Add(this.radioButtonOutputRow); this.panel1.Controls.Add(this.radioButtonOutputTable); - this.panel1.Location = new System.Drawing.Point(307, 429); + this.panel1.Location = new System.Drawing.Point(307, 443); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(158, 22); this.panel1.TabIndex = 40; @@ -811,9 +815,9 @@ private void InitializeComponent() this.panelWildTamedAuto.Controls.Add(this.radioButtonTamed); this.panelWildTamedAuto.Controls.Add(this.radioButtonWild); this.panelWildTamedAuto.Controls.Add(this.checkBoxWildTamedAuto); - this.panelWildTamedAuto.Location = new System.Drawing.Point(307, 111); + this.panelWildTamedAuto.Location = new System.Drawing.Point(304, 140); this.panelWildTamedAuto.Name = "panelWildTamedAuto"; - this.panelWildTamedAuto.Size = new System.Drawing.Size(161, 25); + this.panelWildTamedAuto.Size = new System.Drawing.Size(164, 25); this.panelWildTamedAuto.TabIndex = 12; // // radioButtonTamed @@ -856,6 +860,7 @@ private void InitializeComponent() // // tabPageStatTesting // + this.tabPageStatTesting.Controls.Add(this.labelNotTamedNoteTesting); this.tabPageStatTesting.Controls.Add(this.groupBoxTestingName); this.tabPageStatTesting.Controls.Add(this.buttonAddTest2Lib); this.tabPageStatTesting.Controls.Add(this.statTestingDinoLevel); @@ -867,7 +872,7 @@ private void InitializeComponent() this.tabPageStatTesting.Controls.Add(this.statTestingTorpor); this.tabPageStatTesting.Controls.Add(this.groupBox1); this.tabPageStatTesting.Controls.Add(this.btnPerfectKibbleTame); - this.tabPageStatTesting.Controls.Add(this.cbbStatTestingRace); + this.tabPageStatTesting.Controls.Add(this.cbbStatTestingSpecies); this.tabPageStatTesting.Controls.Add(this.label5); this.tabPageStatTesting.Controls.Add(this.label7); this.tabPageStatTesting.Controls.Add(this.label8); @@ -933,6 +938,7 @@ private void InitializeComponent() // // tabPageExtractor // + this.tabPageExtractor.Controls.Add(this.checkBoxQuickWildCheck); this.tabPageExtractor.Controls.Add(this.buttonExtractor2Tester); this.tabPageExtractor.Controls.Add(this.groupBoxNameExtractor); this.tabPageExtractor.Controls.Add(this.buttonAdd2Library); @@ -1205,6 +1211,26 @@ private void InitializeComponent() 0, 0}); // + // labelNotTamedNoteTesting + // + this.labelNotTamedNoteTesting.Location = new System.Drawing.Point(3, 459); + this.labelNotTamedNoteTesting.Name = "labelNotTamedNoteTesting"; + this.labelNotTamedNoteTesting.Size = new System.Drawing.Size(295, 16); + this.labelNotTamedNoteTesting.TabIndex = 41; + this.labelNotTamedNoteTesting.Text = "*Creature is not yet tamed and may get better values then."; + this.labelNotTamedNoteTesting.Visible = false; + // + // checkBoxQuickWildCheck + // + this.checkBoxQuickWildCheck.AutoSize = true; + this.checkBoxQuickWildCheck.Location = new System.Drawing.Point(307, 12); + this.checkBoxQuickWildCheck.Name = "checkBoxQuickWildCheck"; + this.checkBoxQuickWildCheck.Size = new System.Drawing.Size(155, 17); + this.checkBoxQuickWildCheck.TabIndex = 43; + this.checkBoxQuickWildCheck.Text = "Quick Wild-Creature Check"; + this.checkBoxQuickWildCheck.UseVisualStyleBackColor = true; + this.checkBoxQuickWildCheck.CheckedChanged += new System.EventHandler(this.checkBoxQuickWildCheck_CheckedChanged); + // // statTestingTorpor // this.statTestingTorpor.BackColor = System.Drawing.SystemColors.Control; @@ -1612,7 +1638,7 @@ private void InitializeComponent() private StatIO statTestingFood; private StatIO statTestingOxygen; private StatIO statTestingStamina; - private System.Windows.Forms.ComboBox cbbStatTestingRace; + private System.Windows.Forms.ComboBox cbbStatTestingSpecies; private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label7; private System.Windows.Forms.Label label8; @@ -1676,5 +1702,7 @@ private void InitializeComponent() private System.Windows.Forms.Button buttonTester2Extractor; private System.Windows.Forms.Button buttonExtractor2Tester; private System.Windows.Forms.NumericUpDown statTestingTamingEfficiency; + private System.Windows.Forms.Label labelNotTamedNoteTesting; + private System.Windows.Forms.CheckBox checkBoxQuickWildCheck; } } diff --git a/ARKBreedingStats/Form1.cs b/ARKBreedingStats/Form1.cs index d9380c6a..8f2cdd52 100644 --- a/ARKBreedingStats/Form1.cs +++ b/ARKBreedingStats/Form1.cs @@ -38,6 +38,8 @@ public partial class Form1 : Form private int localFileVer = 0; private bool pedigreeNeedsUpdate = false; public delegate void LevelChangedEventHandler(StatIO s); + public delegate void InputValueChangedEventHandler(StatIO s); + private bool updateTorporInTester; public Form1() { @@ -75,24 +77,26 @@ private void Form1_Load(object sender, EventArgs e) if (precisions[s] == 3) { statIOs[s].Percent = true; testingIOs[s].Percent = true; } statIOs[s].statIndex = s; testingIOs[s].statIndex = s; - statIOs[s].LevelChanged += new LevelChangedEventHandler(this.statIOUpdateValue); testingIOs[s].LevelChanged += new LevelChangedEventHandler(this.statIOUpdateValue); + statIOs[s].InputValueChanged += new InputValueChangedEventHandler(this.statIOQuickWildLevelCheck); } statIOTorpor.ShowBar = false; // torpor should not show bar, it get's too wide and is not interesting for breeding statTestingTorpor.ShowBar = false; labelSumDomSB.Text = ""; + updateTorporInTester = true; // ToolTips ToolTip tt = new ToolTip(); tt.SetToolTip(this.checkBoxOutputRowHeader, "Include Headerrow"); tt.SetToolTip(this.checkBoxJustTamed, "Check this if there was no server-restart or if you didn't logout since you tamed the creature.\nUncheck this if you know there was a server-restart (many servers restart every night).\nIf it is some days ago (IRL) you tamed the creature you should probably uncheck this checkbox."); tt.SetToolTip(checkBoxWildTamedAuto, "For most creatures the tool recognizes if they are wild or tamed.\nFor Giganotosaurus and maybe if you have custom server-settings you have to select manually if the creature is wild or tamed."); + tt.SetToolTip(checkBoxQuickWildCheck, "Check this if you just want a quick check of the levels of a wild (untamed) creature.\nThe levels are then shown without the extraction-process (and without validation)."); loadStatFile(); if (speciesNames.Count > 0) { comboBoxCreatures.SelectedIndex = 0; - cbbStatTestingRace.SelectedIndex = 0; + cbbStatTestingSpecies.SelectedIndex = 0; } else { @@ -585,7 +589,7 @@ private bool loadStatFile() string species = values[0].Trim(); speciesNames.Add(species); this.comboBoxCreatures.Items.Add(species); - this.cbbStatTestingRace.Items.Add(species); + this.cbbStatTestingSpecies.Items.Add(species); c++; } else if (values.Length > 1 && values.Length < 6) @@ -646,13 +650,14 @@ private void comboBoxCreatures_SelectedIndexChanged(object sender, EventArgs e) private void cbbStatTestingRace_SelectedIndexChanged(object sender, EventArgs e) { - int i = cbbStatTestingRace.SelectedIndex; + int i = cbbStatTestingSpecies.SelectedIndex; if (i >= 0) { for (int s = 0; s < 8; s++) { testingIOs[s].Enabled = (stats[i][s].BaseValue > 0); } + updateAllTesterValues(); } } @@ -796,7 +801,7 @@ private double calculateValue(int speciesIndex, int stat, int levelWild, int lev double add = 0, domMult = 1; if (dom) { - add = stats[cC][stat].AddWhenTamed; + add = stats[speciesIndex][stat].AddWhenTamed; domMult = (tamingEff >= 0 ? (1 + tamingEff * stats[speciesIndex][stat].MultAffinity) : 1) * (1 + levelDom * stats[speciesIndex][stat].IncPerTamedLevel); } return Math.Round((stats[speciesIndex][stat].BaseValue * (1 + stats[speciesIndex][stat].IncPerWildLevel * levelWild) + add) * domMult, precisions[stat], MidpointRounding.AwayFromZero); @@ -886,7 +891,7 @@ private void buttonAdd2Library_Click(object sender, EventArgs e) private void buttonAddTest2Lib_Click(object sender, EventArgs e) { - Creature creature = new Creature(speciesNames[cbbStatTestingRace.SelectedIndex], textBoxTestingName.Text, 0, getCurrentWildLevels(false), getCurrentDomLevels(false), (double)NumericUpDownTestingTE.Value / 100, (NumericUpDownTestingTE.Value == 100)); + Creature creature = new Creature(speciesNames[cbbStatTestingSpecies.SelectedIndex], textBoxTestingName.Text, 0, getCurrentWildLevels(false), getCurrentDomLevels(false), (double)NumericUpDownTestingTE.Value / 100, (NumericUpDownTestingTE.Value == 100)); recalculateCreatureValues(creature); creature.guid = Guid.NewGuid(); creatureCollection.creatures.Add(creature); @@ -1563,7 +1568,7 @@ private void creatureLevelTesting(Creature c) { if (c != null) { - cbbStatTestingRace.SelectedIndex = speciesNames.IndexOf(c.species); + cbbStatTestingSpecies.SelectedIndex = speciesNames.IndexOf(c.species); for (int s = 0; s < 7; s++) { testingIOs[s].LevelWild = c.levelsWild[s]; @@ -1581,7 +1586,7 @@ private void listViewLibrary_MouseClick(object sender, MouseEventArgs e) private void buttonExtractor2Tester_Click(object sender, EventArgs e) { - cbbStatTestingRace.SelectedIndex = comboBoxCreatures.SelectedIndex; + cbbStatTestingSpecies.SelectedIndex = comboBoxCreatures.SelectedIndex; NumericUpDownTestingTE.Value = (decimal)uniqueTE() * 100; for (int s = 0; s < 8; s++) { @@ -1594,7 +1599,7 @@ private void buttonExtractor2Tester_Click(object sender, EventArgs e) private void buttonTester2Extractor_Click(object sender, EventArgs e) { - comboBoxCreatures.SelectedIndex = cbbStatTestingRace.SelectedIndex; + comboBoxCreatures.SelectedIndex = cbbStatTestingSpecies.SelectedIndex; for (int s = 0; s < 8; s++) { statIOs[s].Input = testingIOs[s].Input; @@ -1602,13 +1607,53 @@ private void buttonTester2Extractor_Click(object sender, EventArgs e) tabControl1.SelectedIndex = 1; } + private void updateAllTesterValues() + { + updateTorporInTester = false; + for (int s = 0; s < 7; s++) + { + if (s == 6) + updateTorporInTester = true; + statIOUpdateValue(testingIOs[s]); + } + statIOUpdateValue(testingIOs[7]); + } + + private void NumericUpDownTestingTE_ValueChanged(object sender, EventArgs e) + { + updateAllTesterValues(); + } + + private void checkBoxStatTestingTamed_CheckedChanged(object sender, EventArgs e) + { + for (int s = 0; s < 8; s++) + testingIOs[s].postTame = !checkBoxStatTestingTamed.Checked; + labelNotTamedNoteTesting.Visible = !checkBoxStatTestingTamed.Checked; + updateAllTesterValues(); + } + + private void checkBoxQuickWildCheck_CheckedChanged(object sender, EventArgs e) + { + if (checkBoxQuickWildCheck.Checked) + { + buttonAdd2Library.Enabled = false; + clearAll(); + } + bool enabled = !checkBoxQuickWildCheck.Checked; + buttonExtract.Enabled = enabled; + checkBoxAlreadyBred.Enabled = enabled; + panelWildTamedAuto.Enabled = enabled; + checkBoxJustTamed.Enabled = enabled; + groupBoxTE.Enabled = enabled; + } + private void statIOUpdateValue(StatIO sIo) { - sIo.BreedingValue = calculateValue(cbbStatTestingRace.SelectedIndex, sIo.statIndex, sIo.LevelWild, 0, checkBoxStatTestingTamed.Checked, (double)NumericUpDownTestingTE.Value / 100); - sIo.Input = calculateValue(cbbStatTestingRace.SelectedIndex, sIo.statIndex, sIo.LevelWild, sIo.LevelDom, checkBoxStatTestingTamed.Checked, (double)NumericUpDownTestingTE.Value / 100); + sIo.BreedingValue = calculateValue(cbbStatTestingSpecies.SelectedIndex, sIo.statIndex, sIo.LevelWild, 0, true, (double)NumericUpDownTestingTE.Value / 100); + sIo.Input = calculateValue(cbbStatTestingSpecies.SelectedIndex, sIo.statIndex, sIo.LevelWild, sIo.LevelDom, checkBoxStatTestingTamed.Checked, (double)NumericUpDownTestingTE.Value / 100); // update Torpor-level if changed value is not from torpor-StatIO - if (sIo != statTestingTorpor) + if (updateTorporInTester && sIo != statTestingTorpor) { int torporLvl = 0; for (int s = 0; s < 7; s++) @@ -1619,6 +1664,20 @@ private void statIOUpdateValue(StatIO sIo) } } + /// + /// Display the wild-levels, assuming it's a wild creature + /// + /// + private void statIOQuickWildLevelCheck(StatIO sIO) + { + if (checkBoxQuickWildCheck.Checked) + { + int lvlWild = (int)Math.Round((sIO.Input - stats[cC][sIO.statIndex].BaseValue) / (stats[cC][sIO.statIndex].BaseValue * stats[cC][sIO.statIndex].IncPerWildLevel)); + sIO.LevelWild = (lvlWild < 0 ? 0 : lvlWild); + sIO.LevelDom = 0; + } + } + } } diff --git a/ARKBreedingStats/PedigreeCreature.cs b/ARKBreedingStats/PedigreeCreature.cs index bdd21fc2..d8640ee0 100644 --- a/ARKBreedingStats/PedigreeCreature.cs +++ b/ARKBreedingStats/PedigreeCreature.cs @@ -16,6 +16,7 @@ public partial class PedigreeCreature : UserControl private Creature creature; public event Pedigree.CreatureChangedEventHandler CreatureChanged; private List