diff --git a/ARKBreedingStats/Form1.Designer.cs b/ARKBreedingStats/Form1.Designer.cs index 0eb723b3..5bc73427 100644 --- a/ARKBreedingStats/Form1.Designer.cs +++ b/ARKBreedingStats/Form1.Designer.cs @@ -34,6 +34,7 @@ private void InitializeComponent() this.labelHeaderD = new System.Windows.Forms.Label(); this.numericUpDownLowerTEffBound = new System.Windows.Forms.NumericUpDown(); this.groupBoxTE = new System.Windows.Forms.GroupBox(); + this.labelTE = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.numericUpDownUpperTEffBound = new System.Windows.Forms.NumericUpDown(); this.label1 = new System.Windows.Forms.Label(); @@ -78,10 +79,10 @@ private void InitializeComponent() // // buttonCalculate // - this.buttonCalculate.Location = new System.Drawing.Point(313, 165); + this.buttonCalculate.Location = new System.Drawing.Point(313, 175); this.buttonCalculate.Name = "buttonCalculate"; - this.buttonCalculate.Size = new System.Drawing.Size(154, 46); - this.buttonCalculate.TabIndex = 12; + this.buttonCalculate.Size = new System.Drawing.Size(154, 45); + this.buttonCalculate.TabIndex = 14; this.buttonCalculate.Text = "Extract Level Distribution"; this.buttonCalculate.UseVisualStyleBackColor = true; this.buttonCalculate.Click += new System.EventHandler(this.buttonCalculate_Click); @@ -92,7 +93,7 @@ private void InitializeComponent() this.labelHeaderW.Location = new System.Drawing.Point(133, 41); this.labelHeaderW.Name = "labelHeaderW"; this.labelHeaderW.Size = new System.Drawing.Size(28, 13); - this.labelHeaderW.TabIndex = 17; + this.labelHeaderW.TabIndex = 25; this.labelHeaderW.Text = "Wild"; // // labelHeaderD @@ -101,7 +102,7 @@ private void InitializeComponent() this.labelHeaderD.Location = new System.Drawing.Point(174, 41); this.labelHeaderD.Name = "labelHeaderD"; this.labelHeaderD.Size = new System.Drawing.Size(29, 13); - this.labelHeaderD.TabIndex = 18; + this.labelHeaderD.TabIndex = 26; this.labelHeaderD.Text = "Dom"; // // numericUpDownLowerTEffBound @@ -119,17 +120,27 @@ private void InitializeComponent() // // groupBoxTE // + this.groupBoxTE.Controls.Add(this.labelTE); this.groupBoxTE.Controls.Add(this.label3); 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(313, 58); this.groupBoxTE.Name = "groupBoxTE"; - this.groupBoxTE.Size = new System.Drawing.Size(154, 44); + this.groupBoxTE.Size = new System.Drawing.Size(154, 65); this.groupBoxTE.TabIndex = 11; this.groupBoxTE.TabStop = false; this.groupBoxTE.Text = "TamingEfficiency Range"; // + // labelTE + // + this.labelTE.AutoSize = true; + this.labelTE.Location = new System.Drawing.Point(6, 45); + this.labelTE.Name = "labelTE"; + this.labelTE.Size = new System.Drawing.Size(55, 13); + this.labelTE.TabIndex = 4; + this.labelTE.Text = "Extracted:"; + // // label3 // this.label3.AutoSize = true; @@ -167,7 +178,7 @@ private void InitializeComponent() this.labelHBV.Location = new System.Drawing.Point(213, 41); this.labelHBV.Name = "labelHBV"; this.labelHBV.Size = new System.Drawing.Size(79, 13); - this.labelHBV.TabIndex = 19; + this.labelHBV.TabIndex = 27; this.labelHBV.Text = "Breeding Value"; // // numericUpDownLevel @@ -215,7 +226,7 @@ private void InitializeComponent() this.groupBoxPossibilities.Location = new System.Drawing.Point(473, 12); this.groupBoxPossibilities.Name = "groupBoxPossibilities"; this.groupBoxPossibilities.Size = new System.Drawing.Size(174, 447); - this.groupBoxPossibilities.TabIndex = 13; + this.groupBoxPossibilities.TabIndex = 16; this.groupBoxPossibilities.TabStop = false; this.groupBoxPossibilities.Text = "Possible Levels"; // @@ -245,19 +256,19 @@ private void InitializeComponent() // // labelDoc // - this.labelDoc.Location = new System.Drawing.Point(313, 214); + this.labelDoc.Location = new System.Drawing.Point(313, 223); this.labelDoc.Name = "labelDoc"; this.labelDoc.Size = new System.Drawing.Size(154, 198); - this.labelDoc.TabIndex = 15; + this.labelDoc.TabIndex = 24; this.labelDoc.Text = resources.GetString("labelDoc.Text"); // // buttonCopyClipboard // this.buttonCopyClipboard.Enabled = false; - this.buttonCopyClipboard.Location = new System.Drawing.Point(313, 438); + this.buttonCopyClipboard.Location = new System.Drawing.Point(313, 447); this.buttonCopyClipboard.Name = "buttonCopyClipboard"; - this.buttonCopyClipboard.Size = new System.Drawing.Size(154, 45); - this.buttonCopyClipboard.TabIndex = 13; + this.buttonCopyClipboard.Size = new System.Drawing.Size(154, 36); + this.buttonCopyClipboard.TabIndex = 15; this.buttonCopyClipboard.Text = "Copy retrieved Values to Clipboard"; this.buttonCopyClipboard.UseVisualStyleBackColor = true; this.buttonCopyClipboard.Click += new System.EventHandler(this.buttonCopyClipboard_Click); @@ -269,7 +280,7 @@ private void InitializeComponent() this.linkLabel1.Location = new System.Drawing.Point(579, 473); this.linkLabel1.Name = "linkLabel1"; this.linkLabel1.Size = new System.Drawing.Size(67, 13); - this.linkLabel1.TabIndex = 14; + this.linkLabel1.TabIndex = 20; this.linkLabel1.TabStop = true; this.linkLabel1.Text = "(c) cad 2015"; this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); @@ -279,7 +290,7 @@ private void InitializeComponent() this.labelFootnote.Location = new System.Drawing.Point(12, 462); this.labelFootnote.Name = "labelFootnote"; this.labelFootnote.Size = new System.Drawing.Size(295, 27); - this.labelFootnote.TabIndex = 16; + this.labelFootnote.TabIndex = 18; this.labelFootnote.Text = "label3"; // // labelVersion @@ -288,7 +299,7 @@ private void InitializeComponent() this.labelVersion.Location = new System.Drawing.Point(525, 473); this.labelVersion.Name = "labelVersion"; this.labelVersion.Size = new System.Drawing.Size(46, 13); - this.labelVersion.TabIndex = 20; + this.labelVersion.TabIndex = 19; this.labelVersion.Text = "ver"; this.labelVersion.TextAlign = System.Drawing.ContentAlignment.TopRight; // @@ -298,7 +309,7 @@ private void InitializeComponent() this.label4.Location = new System.Drawing.Point(167, 15); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(33, 13); - this.label4.TabIndex = 21; + this.label4.TabIndex = 17; this.label4.Text = "Level"; // // numericUpDownXP @@ -312,7 +323,7 @@ private void InitializeComponent() 0}); this.numericUpDownXP.Name = "numericUpDownXP"; this.numericUpDownXP.Size = new System.Drawing.Size(81, 20); - this.numericUpDownXP.TabIndex = 22; + this.numericUpDownXP.TabIndex = 0; this.numericUpDownXP.ValueChanged += new System.EventHandler(this.numericUpDownXP_ValueChanged); this.numericUpDownXP.Enter += new System.EventHandler(this.numericUpDown_Enter); // @@ -339,10 +350,10 @@ private void InitializeComponent() // checkBoxAlreadyBred // this.checkBoxAlreadyBred.AutoSize = true; - this.checkBoxAlreadyBred.Location = new System.Drawing.Point(313, 108); + this.checkBoxAlreadyBred.Location = new System.Drawing.Point(313, 129); this.checkBoxAlreadyBred.Name = "checkBoxAlreadyBred"; this.checkBoxAlreadyBred.Size = new System.Drawing.Size(109, 17); - this.checkBoxAlreadyBred.TabIndex = 22; + this.checkBoxAlreadyBred.TabIndex = 12; this.checkBoxAlreadyBred.Text = "Breeded Creature"; this.checkBoxAlreadyBred.UseVisualStyleBackColor = false; this.checkBoxAlreadyBred.CheckedChanged += new System.EventHandler(this.checkBoxAlreadyBred_CheckedChanged); @@ -350,10 +361,10 @@ private void InitializeComponent() // radioButtonOutputTable // this.radioButtonOutputTable.AutoSize = true; - this.radioButtonOutputTable.Location = new System.Drawing.Point(313, 415); + this.radioButtonOutputTable.Location = new System.Drawing.Point(313, 424); this.radioButtonOutputTable.Name = "radioButtonOutputTable"; this.radioButtonOutputTable.Size = new System.Drawing.Size(52, 17); - this.radioButtonOutputTable.TabIndex = 23; + this.radioButtonOutputTable.TabIndex = 21; this.radioButtonOutputTable.Text = "Table"; this.radioButtonOutputTable.UseVisualStyleBackColor = true; // @@ -361,10 +372,10 @@ private void InitializeComponent() // this.radioButtonOutputRow.AutoSize = true; this.radioButtonOutputRow.Checked = true; - this.radioButtonOutputRow.Location = new System.Drawing.Point(371, 415); + this.radioButtonOutputRow.Location = new System.Drawing.Point(371, 424); this.radioButtonOutputRow.Name = "radioButtonOutputRow"; this.radioButtonOutputRow.Size = new System.Drawing.Size(47, 17); - this.radioButtonOutputRow.TabIndex = 24; + this.radioButtonOutputRow.TabIndex = 22; this.radioButtonOutputRow.TabStop = true; this.radioButtonOutputRow.Text = "Row"; this.radioButtonOutputRow.UseVisualStyleBackColor = true; @@ -373,21 +384,20 @@ private void InitializeComponent() // checkBoxOutputRowHeader // this.checkBoxOutputRowHeader.AutoSize = true; - this.checkBoxOutputRowHeader.Enabled = false; - this.checkBoxOutputRowHeader.Location = new System.Drawing.Point(424, 416); + this.checkBoxOutputRowHeader.Location = new System.Drawing.Point(424, 425); this.checkBoxOutputRowHeader.Name = "checkBoxOutputRowHeader"; this.checkBoxOutputRowHeader.Size = new System.Drawing.Size(40, 17); - this.checkBoxOutputRowHeader.TabIndex = 25; + this.checkBoxOutputRowHeader.TabIndex = 23; this.checkBoxOutputRowHeader.Text = "Hd"; this.checkBoxOutputRowHeader.UseVisualStyleBackColor = true; // // checkBoxJustTamed // this.checkBoxJustTamed.AutoSize = true; - this.checkBoxJustTamed.Location = new System.Drawing.Point(313, 131); + this.checkBoxJustTamed.Location = new System.Drawing.Point(313, 152); this.checkBoxJustTamed.Name = "checkBoxJustTamed"; this.checkBoxJustTamed.Size = new System.Drawing.Size(139, 17); - this.checkBoxJustTamed.TabIndex = 26; + this.checkBoxJustTamed.TabIndex = 13; this.checkBoxJustTamed.Text = "Creature was just tamed"; this.checkBoxJustTamed.UseVisualStyleBackColor = true; this.checkBoxJustTamed.CheckedChanged += new System.EventHandler(this.checkBoxJustTamed_CheckedChanged); @@ -396,119 +406,110 @@ private void InitializeComponent() // this.statIOSpeed.BackColor = System.Drawing.SystemColors.Control; this.statIOSpeed.ForeColor = System.Drawing.SystemColors.ControlText; - this.statIOSpeed.Id = 0; this.statIOSpeed.Input = 100D; this.statIOSpeed.Location = new System.Drawing.Point(12, 363); this.statIOSpeed.Name = "statIOSpeed"; this.statIOSpeed.Percent = false; this.statIOSpeed.PostTame = true; this.statIOSpeed.Size = new System.Drawing.Size(295, 45); + this.statIOSpeed.Status = 0; this.statIOSpeed.TabIndex = 8; - this.statIOSpeed.Warning = 0; this.statIOSpeed.Click += new System.EventHandler(this.statIO_Click); // // statIOTorpor // this.statIOTorpor.BackColor = System.Drawing.SystemColors.Control; this.statIOTorpor.ForeColor = System.Drawing.SystemColors.ControlText; - this.statIOTorpor.Id = 0; this.statIOTorpor.Input = 100D; this.statIOTorpor.Location = new System.Drawing.Point(12, 414); this.statIOTorpor.Name = "statIOTorpor"; this.statIOTorpor.Percent = false; this.statIOTorpor.PostTame = true; this.statIOTorpor.Size = new System.Drawing.Size(295, 45); + this.statIOTorpor.Status = 0; this.statIOTorpor.TabIndex = 9; - this.statIOTorpor.Warning = 0; // // statIODamage // this.statIODamage.BackColor = System.Drawing.SystemColors.Control; this.statIODamage.ForeColor = System.Drawing.SystemColors.ControlText; - this.statIODamage.Id = 0; this.statIODamage.Input = 100D; this.statIODamage.Location = new System.Drawing.Point(12, 312); this.statIODamage.Name = "statIODamage"; this.statIODamage.Percent = false; this.statIODamage.PostTame = true; this.statIODamage.Size = new System.Drawing.Size(295, 45); + this.statIODamage.Status = 0; this.statIODamage.TabIndex = 7; - this.statIODamage.Warning = 0; this.statIODamage.Click += new System.EventHandler(this.statIO_Click); // // statIOWeight // this.statIOWeight.BackColor = System.Drawing.SystemColors.Control; this.statIOWeight.ForeColor = System.Drawing.SystemColors.ControlText; - this.statIOWeight.Id = 0; this.statIOWeight.Input = 100D; this.statIOWeight.Location = new System.Drawing.Point(12, 261); this.statIOWeight.Name = "statIOWeight"; this.statIOWeight.Percent = false; this.statIOWeight.PostTame = true; this.statIOWeight.Size = new System.Drawing.Size(295, 45); + this.statIOWeight.Status = 0; this.statIOWeight.TabIndex = 6; - this.statIOWeight.Warning = 0; this.statIOWeight.Click += new System.EventHandler(this.statIO_Click); // // statIOFood // this.statIOFood.BackColor = System.Drawing.SystemColors.Control; this.statIOFood.ForeColor = System.Drawing.SystemColors.ControlText; - this.statIOFood.Id = 0; this.statIOFood.Input = 100D; this.statIOFood.Location = new System.Drawing.Point(12, 210); this.statIOFood.Name = "statIOFood"; this.statIOFood.Percent = false; this.statIOFood.PostTame = true; this.statIOFood.Size = new System.Drawing.Size(295, 45); + this.statIOFood.Status = 0; this.statIOFood.TabIndex = 5; - this.statIOFood.Warning = 0; this.statIOFood.Click += new System.EventHandler(this.statIO_Click); // // statIOHealth // this.statIOHealth.BackColor = System.Drawing.SystemColors.Control; this.statIOHealth.ForeColor = System.Drawing.SystemColors.ControlText; - this.statIOHealth.Id = 0; this.statIOHealth.Input = 100D; this.statIOHealth.Location = new System.Drawing.Point(12, 57); this.statIOHealth.Name = "statIOHealth"; this.statIOHealth.Percent = false; this.statIOHealth.PostTame = true; this.statIOHealth.Size = new System.Drawing.Size(295, 45); + this.statIOHealth.Status = 0; this.statIOHealth.TabIndex = 2; - this.statIOHealth.Warning = 0; this.statIOHealth.Click += new System.EventHandler(this.statIO_Click); // // statIOOxygen // - this.statIOOxygen.BackColor = System.Drawing.SystemColors.Control; this.statIOOxygen.ForeColor = System.Drawing.SystemColors.ControlText; - this.statIOOxygen.Id = 0; this.statIOOxygen.Input = 100D; this.statIOOxygen.Location = new System.Drawing.Point(12, 159); this.statIOOxygen.Name = "statIOOxygen"; this.statIOOxygen.Percent = false; this.statIOOxygen.PostTame = true; this.statIOOxygen.Size = new System.Drawing.Size(295, 45); + this.statIOOxygen.Status = 0; this.statIOOxygen.TabIndex = 4; - this.statIOOxygen.Warning = 0; this.statIOOxygen.Click += new System.EventHandler(this.statIO_Click); // // statIOStamina // this.statIOStamina.BackColor = System.Drawing.SystemColors.Control; this.statIOStamina.ForeColor = System.Drawing.SystemColors.ControlText; - this.statIOStamina.Id = 0; this.statIOStamina.Input = 100D; this.statIOStamina.Location = new System.Drawing.Point(12, 108); this.statIOStamina.Name = "statIOStamina"; this.statIOStamina.Percent = false; this.statIOStamina.PostTame = true; this.statIOStamina.Size = new System.Drawing.Size(295, 45); + this.statIOStamina.Status = 0; this.statIOStamina.TabIndex = 3; - this.statIOStamina.Warning = 0; this.statIOStamina.Click += new System.EventHandler(this.statIO_Click); // // Form1 @@ -601,6 +602,7 @@ private void InitializeComponent() private System.Windows.Forms.RadioButton radioButtonOutputRow; private System.Windows.Forms.CheckBox checkBoxOutputRowHeader; private System.Windows.Forms.CheckBox checkBoxJustTamed; + private System.Windows.Forms.Label labelTE; } } diff --git a/ARKBreedingStats/Form1.cs b/ARKBreedingStats/Form1.cs index aa550567..543deb28 100644 --- a/ARKBreedingStats/Form1.cs +++ b/ARKBreedingStats/Form1.cs @@ -44,12 +44,11 @@ private void Form1_Load(object sender, EventArgs e) for (int s = 0; s < statNames.Length; s++) { statIOs[s].Title = statNames[s]; - statIOs[s].Id = s; if (precisions[s] == 3) { statIOs[s].Percent = true; } } loadFile(); comboBoxCreatures.SelectedIndex = 0; - labelVersion.Text = "v0.9.1"; + labelVersion.Text = "v0.9.2"; ToolTip tt = new ToolTip(); tt.SetToolTip(this.labelDomLevel, "level since domesticated"); tt.SetToolTip(this.checkBoxOutputRowHeader, "Include Headerrow"); @@ -74,6 +73,7 @@ private void clearAll() this.numericUpDownUpperTEffBound.BackColor = SystemColors.Window; this.numericUpDownXP.BackColor = SystemColors.Window; this.checkBoxAlreadyBred.BackColor = System.Drawing.Color.Transparent; + this.checkBoxJustTamed.BackColor = System.Drawing.Color.Transparent; buttonCopyClipboard.Enabled = false; activeStat = -1; } @@ -93,7 +93,7 @@ private void buttonCalculate_Click(object sender, EventArgs e) double maxLW = 0; if (stats[c][s][0] > 0 && stats[c][s][1] > 0) { - maxLW = Math.Floor((inputValue - stats[c][s][0]) / (stats[c][s][0] * stats[c][s][1])); + maxLW = Math.Round((inputValue - stats[c][s][0]) / (stats[c][s][0] * stats[c][s][1])); // floor is too unprecise } double maxLD = 0; if (stats[c][s][0] > 0 && stats[c][s][2] > 0 && postTamed) @@ -199,6 +199,7 @@ private void buttonCalculate_Click(object sender, EventArgs e) } this.numericUpDownXP.BackColor = Color.LightSalmon; this.checkBoxAlreadyBred.BackColor = Color.LightSalmon; + this.checkBoxJustTamed.BackColor = Color.LightSalmon; results.Clear(); resultsValid = false; } @@ -222,8 +223,8 @@ private void buttonCalculate_Click(object sender, EventArgs e) if (maxLW2 < 0 || levelDom < 0) { this.numericUpDownLevel.BackColor = Color.LightSalmon; - statIOs[s].Warning = 2; - statIOs[7].Warning = 2; + statIOs[s].Status = -2; + statIOs[7].Status = -2; results[s].Clear(); break; } @@ -285,12 +286,13 @@ private void buttonCalculate_Click(object sender, EventArgs e) setPossibility(s, r); if (results[s].Count > 1) { - statIOs[s].Warning = 1; + statIOs[s].Status = -1; } + else { statIOs[s].Status = 1; } } else { - statIOs[s].Warning = 2; + statIOs[s].Status = -2; results[s].Clear(); resultsValid = false; if (!checkBoxAlreadyBred.Checked && this.numericUpDownLowerTEffBound.Value > 0) @@ -302,6 +304,7 @@ private void buttonCalculate_Click(object sender, EventArgs e) this.numericUpDownUpperTEffBound.BackColor = Color.LightSalmon; } this.checkBoxAlreadyBred.BackColor = Color.LightSalmon; + this.checkBoxJustTamed.BackColor = Color.LightSalmon; } } } @@ -328,6 +331,8 @@ private void buttonCalculate_Click(object sender, EventArgs e) { buttonCopyClipboard.Enabled = true; setActiveStat(activeStatKeeper); + + setUniqueTE(); } if (!postTamed) { @@ -335,25 +340,39 @@ private void buttonCalculate_Click(object sender, EventArgs e) } } + private void setUniqueTE() + { + double eff = uniqueTE(); + if (eff >= 0) + { + labelTE.Text = "Extracted: " + Math.Round(100 * eff, 1) + " %"; + } + else + { + labelTE.Text = "Extracted: n/a"; + } + } + private void statIO_Click(object sender, EventArgs e) { StatIO se = (StatIO)sender; if (se != null) { - setActiveStat(se.Id); + setActiveStat(statIOs.IndexOf(se)); } } + // when clicking on a stat show the possibilites in the listbox private void setActiveStat(int stat) { this.listBoxPossibilities.Items.Clear(); for (int s = 0; s < 8; s++) { - if (s == stat && statIOs[s].Warning == 1) + if (s == stat && statIOs[s].Status == -1) { statIOs[s].Selected = true; activeStat = s; - setCombobox(s); + setPossibilitiesListbox(s); } else { @@ -362,7 +381,8 @@ private void setActiveStat(int stat) } } - private void setCombobox(int s) + // fill listbox with possible results of stat + private void setPossibilitiesListbox(int s) { if (s < results.Count) { @@ -486,6 +506,7 @@ private void setPossibility(int s, int i) statIOs[s].LevelDom = results[s][i][1].ToString(); statIOs[s].BreedingValue = breedingValue(s, i); chosenResults[s] = i; + setUniqueTE(); } private void buttonCopyClipboard_Click(object sender, EventArgs e) @@ -495,26 +516,13 @@ private void buttonCopyClipboard_Click(object sender, EventArgs e) List tsv = new List(); int wildLevels = 0; for (int s = 0; s < 7; s++) { wildLevels += (int)results[s][chosenResults[s]][0]; } - string rowLevel = comboBoxCreatures.SelectedItem.ToString() + "\t\t" + wildLevels, rowValues = ""; + string rowLevel = comboBoxCreatures.SelectedItem.ToString() + "\t\t\t" + wildLevels, rowValues = ""; // if taming efficiency is unique, display it, too string effString = ""; - if (statWithEff.Count > 0) + double eff = uniqueTE(); + if (eff >= 0) { - double eff = results[statWithEff[0]][chosenResults[statWithEff[0]]][2]; - bool useEff = true; - for (int st = 1; st < statWithEff.Count; st++) - { - // efficiency-calculation can be a bit off due to ingame-rounding - if (Math.Abs(results[statWithEff[st]][chosenResults[statWithEff[st]]][2] - eff) > 0.002) - { - useEff = false; - break; - } - } - if (useEff) - { - effString = "\tTamingEff:\t" + (100 * eff).ToString() + "%"; - } + effString = "\tTamingEff:\t" + (100 * eff).ToString() + "%"; } // headerrow if (radioButtonOutputTable.Checked || checkBoxOutputRowHeader.Checked) @@ -524,7 +532,7 @@ private void buttonCopyClipboard_Click(object sender, EventArgs e) tsv.Add(comboBoxCreatures.SelectedItem.ToString() + "\tLevel " + numericUpDownLevel.Value.ToString() + effString); tsv.Add("Stat\tWildLevel\tDomLevel\tBreedingValue"); } - else { tsv.Add("Species\tName\tWild-Levels\tHP-Level\tSt-Level\tOx-Level\tFo-Level\tWe-Level\tDm-Level\tSp-Level\tTo-Level\tHP-Value\tSt-Value\tOx-Value\tFo-Value\tWe-Value\tDm-Value\tSp-Value\tTo-Value"); } + else { tsv.Add("Species\tName\tSex\tWild-Levels\tHP-Level\tSt-Level\tOx-Level\tFo-Level\tWe-Level\tDm-Level\tSp-Level\tTo-Level\tHP-Value\tSt-Value\tOx-Value\tFo-Value\tWe-Value\tDm-Value\tSp-Value\tTo-Value"); } } for (int s = 0; s < 8; s++) { @@ -556,6 +564,24 @@ private void buttonCopyClipboard_Click(object sender, EventArgs e) } } + private double uniqueTE() + { + if (statWithEff.Count > 0) + { + double eff = results[statWithEff[0]][chosenResults[statWithEff[0]]][2]; + for (int st = 1; st < statWithEff.Count; st++) + { + // efficiency-calculation can be a bit off due to ingame-rounding + if (Math.Abs(results[statWithEff[st]][chosenResults[statWithEff[st]]][2] - eff) > 0.002) + { + return -1; + } + } + return eff; + } + return -1; + } + private double breedingValue(int s, int r) { if (s >= 0 && s < 8) @@ -602,7 +628,7 @@ private void radioButtonOutputRow_CheckedChanged(object sender, EventArgs e) private void checkBoxAlreadyBred_CheckedChanged(object sender, EventArgs e) { groupBoxTE.Enabled = !checkBoxAlreadyBred.Checked; - checkBoxJustTamed.Checked = checkBoxJustTamed.Checked&&!checkBoxAlreadyBred.Checked; + checkBoxJustTamed.Checked = checkBoxJustTamed.Checked && !checkBoxAlreadyBred.Checked; } private void checkBoxJustTamed_CheckedChanged(object sender, EventArgs e) diff --git a/ARKBreedingStats/StatIO.Designer.cs b/ARKBreedingStats/StatIO.Designer.cs index 818564db..c661a2b0 100644 --- a/ARKBreedingStats/StatIO.Designer.cs +++ b/ARKBreedingStats/StatIO.Designer.cs @@ -29,11 +29,11 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.panelBar = new System.Windows.Forms.Panel(); this.labelBValue = new System.Windows.Forms.Label(); this.labelLvD = new System.Windows.Forms.Label(); this.labelLvW = new System.Windows.Forms.Label(); this.numericUpDownInput = new System.Windows.Forms.NumericUpDown(); - this.panelBar = new System.Windows.Forms.Panel(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownInput)).BeginInit(); this.SuspendLayout(); @@ -51,6 +51,15 @@ private void InitializeComponent() this.groupBox1.TabIndex = 0; this.groupBox1.TabStop = false; // + // panelBar + // + this.panelBar.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(128))))); + this.panelBar.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panelBar.Location = new System.Drawing.Point(6, 34); + this.panelBar.Name = "panelBar"; + this.panelBar.Size = new System.Drawing.Size(283, 7); + this.panelBar.TabIndex = 4; + // // labelBValue // this.labelBValue.AutoSize = true; @@ -100,14 +109,6 @@ private void InitializeComponent() 0}); this.numericUpDownInput.Enter += new System.EventHandler(this.numericUpDownInput_Enter); // - // panelBar - // - this.panelBar.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(128))))); - this.panelBar.Location = new System.Drawing.Point(6, 34); - this.panelBar.Name = "panelBar"; - this.panelBar.Size = new System.Drawing.Size(283, 7); - this.panelBar.TabIndex = 4; - // // StatIO // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff --git a/ARKBreedingStats/StatIO.cs b/ARKBreedingStats/StatIO.cs index 3e3a323e..c065dddc 100644 --- a/ARKBreedingStats/StatIO.cs +++ b/ARKBreedingStats/StatIO.cs @@ -14,8 +14,7 @@ namespace ARKBreedingStats public partial class StatIO : UserControl { private bool postTame; - private int id; - private int warning; + private int status; // 0: neutral, 1: good, -1: not unique, -2: error private bool percent; public StatIO() @@ -25,7 +24,6 @@ public StatIO() this.labelLvD.Text = ""; this.labelBValue.Text = ""; postTame = true; - id = 0; percent = false; this.groupBox1.Click += new System.EventHandler(this.groupBox1_Click); } @@ -85,12 +83,6 @@ public bool PostTame get { return postTame; } } - public int Id - { - set { id = value; } - get { return id; } - } - public bool Percent { set { percent = value; } @@ -108,33 +100,36 @@ public bool Selected } else { - Warning = warning; + Status = status; } } } - public int Warning + public int Status { set { - warning = value; + status = value; this.ForeColor = SystemColors.ControlText; this.numericUpDownInput.BackColor = System.Drawing.SystemColors.Window; - switch (warning) + switch (status) { + case 1: + this.BackColor = Color.FromArgb(180, 255, 128); + break; case 0: this.BackColor = SystemColors.Control; break; - case 1: - this.BackColor = SystemColors.ControlDark; + case -1: + this.BackColor = Color.FromArgb(255, 255, 127); break; - case 2: - this.numericUpDownInput.BackColor = Color.LightSalmon; - this.BackColor = SystemColors.ControlDarkDark; + case -2: + this.numericUpDownInput.BackColor = Color.FromArgb(255, 200, 200); + this.BackColor = Color.LightCoral; break; } } - get { return warning; } + get { return status; } } public int BarLength @@ -159,7 +154,7 @@ private void numericUpDownInput_Enter(object sender, EventArgs e) public void Clear() { - Warning = 0; + Status = 0; labelLvD.Text = "n/a"; labelLvW.Text = "n/a"; labelBValue.Text = "";