diff --git a/ARKBreedingStats/CreatureInfoInput.cs b/ARKBreedingStats/CreatureInfoInput.cs index 0d98e744..cb1b2d14 100644 --- a/ARKBreedingStats/CreatureInfoInput.cs +++ b/ARKBreedingStats/CreatureInfoInput.cs @@ -314,7 +314,7 @@ public int[] RegionColors regionColorChooser1.setCreature(Values.V.speciesNames[speciesIndex], regionColorIDs); } } - get { return regionColorIDs; } + get { return (int[])regionColorIDs.Clone(); } } public int SpeciesIndex diff --git a/ARKBreedingStats/Form1.Designer.cs b/ARKBreedingStats/Form1.Designer.cs index d0c58649..256c0559 100644 --- a/ARKBreedingStats/Form1.Designer.cs +++ b/ARKBreedingStats/Form1.Designer.cs @@ -53,8 +53,8 @@ private void InitializeComponent() this.groupBox1 = new System.Windows.Forms.GroupBox(); this.lbImprintedCount = new System.Windows.Forms.Label(); this.labelImprintingTester = new System.Windows.Forms.Label(); - this.numericUpDownImprintingBonusTester = new System.Windows.Forms.NumericUpDown(); - this.NumericUpDownTestingTE = new System.Windows.Forms.NumericUpDown(); + this.numericUpDownImprintingBonusTester = new uiControls.Nud(); + this.NumericUpDownTestingTE = new uiControls.Nud(); this.labelTesterTE = new System.Windows.Forms.Label(); this.groupBoxPossibilities = new System.Windows.Forms.GroupBox(); this.listViewPossibilities = new System.Windows.Forms.ListView(); @@ -67,14 +67,14 @@ private void InitializeComponent() this.cbExactlyImprinting = new System.Windows.Forms.CheckBox(); this.labelImprintingBonus = new System.Windows.Forms.Label(); this.lbImprintingCuddleCountExtractor = new System.Windows.Forms.Label(); - this.numericUpDownImprintingBonusExtractor = new System.Windows.Forms.NumericUpDown(); + this.numericUpDownImprintingBonusExtractor = new uiControls.Nud(); this.panelExtrTE = new System.Windows.Forms.Panel(); this.labelTE = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); - this.numericUpDownUpperTEffBound = new System.Windows.Forms.NumericUpDown(); + this.numericUpDownUpperTEffBound = new uiControls.Nud(); this.label3 = new System.Windows.Forms.Label(); - this.numericUpDownLowerTEffBound = new System.Windows.Forms.NumericUpDown(); + this.numericUpDownLowerTEffBound = new uiControls.Nud(); this.lbLevel = new System.Windows.Forms.Label(); this.lbBreedingValueTester = new System.Windows.Forms.Label(); this.lbTesterWildLevel = new System.Windows.Forms.Label(); @@ -122,7 +122,7 @@ private void InitializeComponent() this.extractionIssuesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator(); this.checkForUpdatedStatsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.numericUpDownLevel = new System.Windows.Forms.NumericUpDown(); + this.numericUpDownLevel = new uiControls.Nud(); this.panelSums = new System.Windows.Forms.Panel(); this.lbShouldBe = new System.Windows.Forms.Label(); this.lbSumDomSB = new System.Windows.Forms.Label(); @@ -1630,7 +1630,7 @@ private void InitializeComponent() // // creatureInfoInputTester // - this.creatureInfoInputTester.Cooldown = new System.DateTime(2018, 5, 3, 21, 35, 7, 709); + this.creatureInfoInputTester.Cooldown = new System.DateTime(2018, 5, 6, 15, 30, 49, 625); this.creatureInfoInputTester.CreatureName = ""; this.creatureInfoInputTester.CreatureNote = ""; this.creatureInfoInputTester.CreatureOwner = ""; @@ -1640,7 +1640,7 @@ private void InitializeComponent() this.creatureInfoInputTester.CreatureTribe = ""; this.creatureInfoInputTester.domesticatedAt = new System.DateTime(2016, 7, 5, 13, 11, 41, 997); this.creatureInfoInputTester.father = null; - this.creatureInfoInputTester.Grown = new System.DateTime(2018, 5, 3, 21, 35, 7, 710); + this.creatureInfoInputTester.Grown = new System.DateTime(2018, 5, 6, 15, 30, 49, 626); this.creatureInfoInputTester.Location = new System.Drawing.Point(321, 184); this.creatureInfoInputTester.mother = null; this.creatureInfoInputTester.MutationCounterFather = 0; @@ -1973,7 +1973,7 @@ private void InitializeComponent() // // creatureInfoInputExtractor // - this.creatureInfoInputExtractor.Cooldown = new System.DateTime(2018, 5, 3, 21, 35, 7, 745); + this.creatureInfoInputExtractor.Cooldown = new System.DateTime(2018, 5, 6, 15, 30, 49, 658); this.creatureInfoInputExtractor.CreatureName = ""; this.creatureInfoInputExtractor.CreatureNote = ""; this.creatureInfoInputExtractor.CreatureOwner = ""; @@ -1983,7 +1983,7 @@ private void InitializeComponent() this.creatureInfoInputExtractor.CreatureTribe = ""; this.creatureInfoInputExtractor.domesticatedAt = new System.DateTime(2016, 7, 5, 13, 12, 15, 968); this.creatureInfoInputExtractor.father = null; - this.creatureInfoInputExtractor.Grown = new System.DateTime(2018, 5, 3, 21, 35, 7, 746); + this.creatureInfoInputExtractor.Grown = new System.DateTime(2018, 5, 6, 15, 30, 49, 659); this.creatureInfoInputExtractor.Location = new System.Drawing.Point(321, 184); this.creatureInfoInputExtractor.mother = null; this.creatureInfoInputExtractor.MutationCounterFather = 0; @@ -2001,7 +2001,7 @@ private void InitializeComponent() this.creatureInfoInputExtractor.Size = new System.Drawing.Size(229, 438); this.creatureInfoInputExtractor.TabIndex = 7; this.creatureInfoInputExtractor.TribeLock = false; - this.creatureInfoInputExtractor.Add2Library_Clicked += new ARKBreedingStats.CreatureInfoInput.Add2LibraryClickedEventHandler(this.creatureInfoInput1_Add2Library_Clicked); + this.creatureInfoInputExtractor.Add2Library_Clicked += new ARKBreedingStats.CreatureInfoInput.Add2LibraryClickedEventHandler(this.creatureInfoInputExtractor_Add2Library_Clicked); this.creatureInfoInputExtractor.ParentListRequested += new ARKBreedingStats.CreatureInfoInput.RequestParentListEventHandler(this.creatureInfoInput_ParentListRequested); // // tabPageLibrary @@ -3427,7 +3427,7 @@ private void InitializeComponent() #endregion private System.Windows.Forms.Label lbExtractorWildLevel; private System.Windows.Forms.Label lbExtractorDomLevel; - private System.Windows.Forms.NumericUpDown numericUpDownLowerTEffBound; + private uiControls.Nud numericUpDownLowerTEffBound; private System.Windows.Forms.GroupBox groupBoxDetailsExtractor; private System.Windows.Forms.Label label1; private StatIO statIOHealth; @@ -3439,12 +3439,12 @@ private void InitializeComponent() private StatIO statIODamage; private StatIO statIOSpeed; private StatIO statIOTorpor; - private System.Windows.Forms.NumericUpDown numericUpDownLevel; + private uiControls.Nud numericUpDownLevel; private System.Windows.Forms.GroupBox groupBoxPossibilities; private System.Windows.Forms.Label lbInfoYellowStats; private System.Windows.Forms.Label labelFootnote; private System.Windows.Forms.Label label3; - private System.Windows.Forms.NumericUpDown numericUpDownUpperTEffBound; + private uiControls.Nud numericUpDownUpperTEffBound; private System.Windows.Forms.Label lbLevel; private System.Windows.Forms.Label labelTE; private System.Windows.Forms.Label lbSum; @@ -3454,7 +3454,7 @@ private void InitializeComponent() private System.Windows.Forms.TabControl tabControlMain; private System.Windows.Forms.TabPage tabPageStatTesting; private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.NumericUpDown NumericUpDownTestingTE; + private uiControls.Nud NumericUpDownTestingTE; private System.Windows.Forms.Label labelTesterTE; private StatIO statTestingSpeed; private StatIO statTestingDamage; @@ -3583,9 +3583,9 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripButton toolStripButtonAddPlayer; private System.Windows.Forms.ToolStripButton toolStripButtonAddTribe; private System.Windows.Forms.Label labelImprintingBonus; - private System.Windows.Forms.NumericUpDown numericUpDownImprintingBonusExtractor; + private uiControls.Nud numericUpDownImprintingBonusExtractor; private System.Windows.Forms.Label labelImprintingTester; - private System.Windows.Forms.NumericUpDown numericUpDownImprintingBonusTester; + private uiControls.Nud numericUpDownImprintingBonusTester; private System.Windows.Forms.ToolStripMenuItem exportValuesToClipboardToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem forSpreadsheetToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem exportToClipboardToolStripMenuItem1; diff --git a/ARKBreedingStats/Form1.cs b/ARKBreedingStats/Form1.cs index a03cd213..8d26ccd3 100644 --- a/ARKBreedingStats/Form1.cs +++ b/ARKBreedingStats/Form1.cs @@ -51,6 +51,8 @@ public partial class Form1 : Form private ExportedCreatureList exportedCreatureList; private uiControls.ExportedCreatureControl exportedCreatureControl; private ToolTip tt; + private bool reactOnSelectionChange; + private CancellationTokenSource cancelTokenLibrarySelection; // OCR stuff public ARKOverlay overlay; @@ -122,6 +124,7 @@ public Form1() timerGlobal.Tick += TimerGlobal_Tick; tt = new ToolTip(); + reactOnSelectionChange = true; } private void Form1_Load(object sender, EventArgs e) @@ -447,7 +450,7 @@ private bool extractLevels(bool autoExtraction = false) (double)numericUpDownImprintingBonusExtractor.Value / 100, !cbExactlyImprinting.Checked, creatureCollection.allowMoreThanHundredImprinting, creatureCollection.imprintingMultiplier, Values.V.babyCuddleIntervalMultiplier, creatureCollection.considerWildLevelSteps, creatureCollection.wildLevelStep, out bool imprintingBonusChanged); - numericUpDownImprintingBonusExtractor.Value = (decimal)extractor.imprintingBonus * 100; + numericUpDownImprintingBonusExtractor.ValueSave = (decimal)extractor.imprintingBonus * 100; numericUpDownImprintingBonusExtractor_ValueChanged(null, null); if (imprintingBonusChanged && !autoExtraction) @@ -1137,7 +1140,7 @@ private void recalculateAllCreaturesValues() toolStripProgressBar1.Visible = false; } - private void creatureInfoInput1_Add2Library_Clicked(CreatureInfoInput sender) + private void creatureInfoInputExtractor_Add2Library_Clicked(CreatureInfoInput sender) { add2Lib(true); } @@ -2296,44 +2299,67 @@ private void listView_ColumnClick(object sender, ColumnClickEventArgs e) } // onlibrarychange - private void listViewLibrary_SelectedIndexChanged(object sender, EventArgs e) + private async void listViewLibrary_SelectedIndexChanged(object sender, EventArgs e) { - int cnt = listViewLibrary.SelectedItems.Count; - if (cnt > 0) + cancelTokenLibrarySelection?.Cancel(); + using (cancelTokenLibrarySelection = new CancellationTokenSource()) { - if (cnt == 1) + try { - Creature c = (Creature)listViewLibrary.SelectedItems[0].Tag; - creatureBoxListView.setCreature(c); - if (tabControlLibFilter.SelectedTab == tabPageLibRadarChart) - radarChartLibrary.setLevels(c.levelsWild); - pedigreeNeedsUpdate = true; + reactOnSelectionChange = false; + await Task.Delay(20, cancelTokenLibrarySelection.Token); // recalculate breedingplan at most a certain interval + reactOnSelectionChange = true; + librarySelectedIndexChanged(); } - - // display infos about the selected creatures - List selCrs = new List(); - for (int i = 0; i < cnt; i++) - selCrs.Add((Creature)listViewLibrary.SelectedItems[i].Tag); - - List tagList = new List(); - foreach (Creature cr in selCrs) + catch (TaskCanceledException) { - foreach (string t in cr.tags) - if (!tagList.Contains(t)) - tagList.Add(t); + return; } - tagList.Sort(); - - setMessageLabelText(cnt.ToString() + " creatures selected, " - + selCrs.Count(cr => cr.sex == Sex.Female).ToString() + " females, " - + selCrs.Count(cr => cr.sex == Sex.Male).ToString() + " males\n" - + "level-range: " + selCrs.Min(cr => cr.level).ToString() + " - " + selCrs.Max(cr => cr.level).ToString() - + "\nTags: " + String.Join(", ", tagList)); } - else + cancelTokenLibrarySelection = null; + } + + private void librarySelectedIndexChanged() + { + if (reactOnSelectionChange) { - setMessageLabelText(); - creatureBoxListView.Clear(); + int cnt = listViewLibrary.SelectedItems.Count; + if (cnt > 0) + { + if (cnt == 1) + { + Creature c = (Creature)listViewLibrary.SelectedItems[0].Tag; + creatureBoxListView.setCreature(c); + if (tabControlLibFilter.SelectedTab == tabPageLibRadarChart) + radarChartLibrary.setLevels(c.levelsWild); + pedigreeNeedsUpdate = true; + } + + // display infos about the selected creatures + List selCrs = new List(); + for (int i = 0; i < cnt; i++) + selCrs.Add((Creature)listViewLibrary.SelectedItems[i].Tag); + + List tagList = new List(); + foreach (Creature cr in selCrs) + { + foreach (string t in cr.tags) + if (!tagList.Contains(t)) + tagList.Add(t); + } + tagList.Sort(); + + setMessageLabelText(cnt.ToString() + " creatures selected, " + + selCrs.Count(cr => cr.sex == Sex.Female).ToString() + " females, " + + selCrs.Count(cr => cr.sex == Sex.Male).ToString() + " males\n" + + "level-range: " + selCrs.Min(cr => cr.level).ToString() + " - " + selCrs.Max(cr => cr.level).ToString() + + "\nTags: " + String.Join(", ", tagList)); + } + else + { + setMessageLabelText(); + creatureBoxListView.Clear(); + } } } @@ -3392,6 +3418,17 @@ private void listViewLibrary_KeyUp(object sender, KeyEventArgs e) if (listViewLibrary.SelectedIndices.Count > 0) showMultiSetter(); } + else if (e.KeyCode == Keys.A && e.Control) + { + // select all list-entries + reactOnSelectionChange = false; + listViewLibrary.BeginUpdate(); + foreach (ListViewItem i in listViewLibrary.Items) + i.Selected = true; + listViewLibrary.EndUpdate(); + reactOnSelectionChange = true; + listViewLibrary_SelectedIndexChanged(null, null); + } } private void exportForSpreadsheet() @@ -3515,16 +3552,6 @@ private void forSpreadsheetToolStripMenuItem_Click(object sender, EventArgs e) exportForSpreadsheet(); } - private void forARKChatToolStripMenuItem_Click(object sender, EventArgs e) - { - exportSelectedCreatureToClipboard(true, true); // REMOVE - } - - private void forARKChatcurrentValuesToolStripMenuItem_Click(object sender, EventArgs e) - { - exportSelectedCreatureToClipboard(false, true); // REMOVE - } - private void plainTextbreedingValuesToolStripMenuItem_Click(object sender, EventArgs e) { exportSelectedCreatureToClipboard(true, false); @@ -4043,12 +4070,10 @@ private void setCreatureValuesToExtractor(Creature c, bool onlyWild = false) else if (c.tamingEff >= 0) rbTamedExtractor.Checked = true; else rbWildExtractor.Checked = true; - numericUpDownImprintingBonusExtractor.Value = (decimal)c.imprintingBonus * 100; + numericUpDownImprintingBonusExtractor.ValueSave = (decimal)c.imprintingBonus * 100; // set total level int level = (onlyWild ? c.levelsWild[7] : c.level); - if (level >= 0 && level <= numericUpDownLevel.Maximum) - numericUpDownLevel.Value = level; - else numericUpDownLevel.Value = 0; + numericUpDownLevel.ValueSave = level; tabControlMain.SelectedTab = tabPageExtractor; } @@ -4078,8 +4103,7 @@ public void doOCR(string imageFilePath = "", bool manuallyTriggered = true) ocrControl1.output.Text = debugText; if (OCRvalues.Length <= 1) return; - if ((decimal)OCRvalues[9] <= numericUpDownLevel.Maximum) - numericUpDownLevel.Value = (decimal)OCRvalues[9]; + numericUpDownLevel.ValueSave = (decimal)OCRvalues[9]; creatureInfoInputExtractor.CreatureName = dinoName; if (!creatureInfoInputExtractor.OwnerLock) @@ -4098,10 +4122,10 @@ public void doOCR(string imageFilePath = "", bool manuallyTriggered = true) } // use imprinting if existing - if (OCRvalues.Length > 8 && OCRvalues[8] >= 0 && (OCRvalues[8] <= 100 || (creatureCollection.allowMoreThanHundredImprinting && OCRvalues[8] <= (double)numericUpDownImprintingBonusExtractor.Maximum))) + if (OCRvalues.Length > 8 && OCRvalues[8] >= 0 && (OCRvalues[8] <= 100 || creatureCollection.allowMoreThanHundredImprinting)) { rbBredExtractor.Checked = true; - numericUpDownImprintingBonusExtractor.Value = (decimal)OCRvalues[8]; + numericUpDownImprintingBonusExtractor.ValueSave = (decimal)OCRvalues[8]; } else { rbTamedExtractor.Checked = true; } @@ -4537,7 +4561,7 @@ private void labelImprintedCount_MouseClick(object sender, MouseEventArgs e) imprintingBonus = Math.Round(100 * cuddleCount * imprintingGainPerCuddle, 5); cuddleCount--; } while (imprintingBonus > 100 && !creatureCollection.allowMoreThanHundredImprinting); - numericUpDownImprintingBonusTester.Value = (decimal)imprintingBonus; + numericUpDownImprintingBonusTester.ValueSave = (decimal)imprintingBonus; } } else if (e.Button == MouseButtons.Right) @@ -4546,7 +4570,7 @@ private void labelImprintedCount_MouseClick(object sender, MouseEventArgs e) double imprintingBonus = (statIOs[7].Input / Stats.calculateValue(speciesSelector1.speciesIndex, 7, testingIOs[7].LevelWild, 0, true, 1, 0) - 1) / (0.2 * creatureCollection.imprintingMultiplier); if (imprintingBonus < 0) imprintingBonus = 0; if (!creatureCollection.allowMoreThanHundredImprinting && imprintingBonus > 1) imprintingBonus = 1; - numericUpDownImprintingBonusTester.Value = 100 * (decimal)imprintingBonus; + numericUpDownImprintingBonusTester.ValueSave = 100 * (decimal)imprintingBonus; } } @@ -4692,22 +4716,22 @@ private void setCreatureValuesToExtractor(CreatureValues cv) creatureInfoInputExtractor.father = cv.Father; creatureInfoInputExtractor.RegionColors = cv.colorIDs; - numericUpDownLevel.Value = cv.level; + numericUpDownLevel.ValueSave = cv.level; // for backwards-compatibility. can probably removed in 07/2018 TODO if (cv.tamingEffMin > 1) cv.tamingEffMin *= 0.01; if (cv.tamingEffMax > 1) cv.tamingEffMax *= 0.01; if (cv.imprintingBonus > 1.5) cv.imprintingBonus *= 0.01; - numericUpDownLowerTEffBound.Value = (decimal)cv.tamingEffMin * 100; - numericUpDownUpperTEffBound.Value = (decimal)cv.tamingEffMax * 100; + numericUpDownLowerTEffBound.ValueSave = (decimal)cv.tamingEffMin * 100; + numericUpDownUpperTEffBound.ValueSave = (decimal)cv.tamingEffMax * 100; if (cv.isBred) rbBredExtractor.Checked = true; else if (cv.isTamed) rbTamedExtractor.Checked = true; else rbWildExtractor.Checked = true; - numericUpDownImprintingBonusExtractor.Value = (decimal)cv.imprintingBonus * 100; + numericUpDownImprintingBonusExtractor.ValueSave = (decimal)cv.imprintingBonus * 100; } private void setCreatureValuesToTester(CreatureValues cv) @@ -4729,14 +4753,14 @@ private void setCreatureValuesToTester(CreatureValues cv) creatureInfoInputTester.father = cv.Father; creatureInfoInputTester.RegionColors = cv.colorIDs; - NumericUpDownTestingTE.Value = (decimal)cv.tamingEffMin * 100; + NumericUpDownTestingTE.ValueSave = (decimal)cv.tamingEffMin * 100; if (cv.isBred) rbBredTester.Checked = true; else if (cv.isTamed) rbTamedTester.Checked = true; else rbWildTester.Checked = true; - numericUpDownImprintingBonusTester.Value = (decimal)cv.imprintingBonus * 100; + numericUpDownImprintingBonusTester.ValueSave = (decimal)cv.imprintingBonus * 100; } private void toolStripButtonSaveCreatureValuesTemp_Click(object sender, EventArgs e) @@ -4893,7 +4917,7 @@ private void ExtractionTestControl1_CopyToExtractor(string species, int level, d } speciesSelector1.setSpecies(species); - numericUpDownLevel.Value = level; + numericUpDownLevel.ValueSave = level; numericUpDownLowerTEffBound.Value = 0; numericUpDownUpperTEffBound.Value = 100; @@ -4902,7 +4926,7 @@ private void ExtractionTestControl1_CopyToExtractor(string species, int level, d else if (postTamed) rbTamedExtractor.Checked = true; else rbWildExtractor.Checked = true; - numericUpDownImprintingBonusExtractor.Value = (decimal)imprintingBonus * 100; + numericUpDownImprintingBonusExtractor.ValueSave = (decimal)imprintingBonus * 100; loadMultipliersFromTestCase(tcc.testCase); diff --git a/ARKBreedingStats/Properties/AssemblyInfo.cs b/ARKBreedingStats/Properties/AssemblyInfo.cs index fa242d72..28c939e6 100644 --- a/ARKBreedingStats/Properties/AssemblyInfo.cs +++ b/ARKBreedingStats/Properties/AssemblyInfo.cs @@ -34,6 +34,6 @@ // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("0.28.0")] +[assembly: AssemblyFileVersion("0.28.1")] [assembly: NeutralResourcesLanguage("en")] diff --git a/ARKBreedingStats/multiplierTesting/StatMultiplierTestingControl.cs b/ARKBreedingStats/multiplierTesting/StatMultiplierTestingControl.cs index 0f9e4006..f119e85f 100644 --- a/ARKBreedingStats/multiplierTesting/StatMultiplierTestingControl.cs +++ b/ARKBreedingStats/multiplierTesting/StatMultiplierTestingControl.cs @@ -125,12 +125,11 @@ public double statValue { set { - decimal v = (decimal)value * (_percent ? 100 : 1); - nudStatValue.Value = v > nudStatValue.Maximum ? nudStatValue.Maximum : v; + nudStatValue.ValueSave = (decimal)value * (_percent ? 100 : 1); } } - public int levelWild { set { nudLw.Value = value > 0 ? value : 0; } get { return (int)nudLw.Value; } } - public int levelDom { set { nudLd.Value = value > 0 ? value : 0; } get { return (int)nudLd.Value; } } + public int levelWild { set { nudLw.ValueSave = value > 0 ? value : 0; } get { return (int)nudLw.Value; } } + public int levelDom { set { nudLd.ValueSave = value > 0 ? value : 0; } get { return (int)nudLd.Value; } } public bool Wild { @@ -214,7 +213,7 @@ public bool calculateIwM(bool silent = true) if (nudLw.Value != 0 && nudIw.Value != 0) { var IwM = (decimal)((((double)nudStatValue.Value * (_percent ? 0.01 : 1) / ((1 + (_bred ? 1 : _TE) * (double)nudTm.Value * (nudTm.Value > 0 ? (double)nudTmM.Value * spTm : 1)) * (1 + (double)nudLd.Value * (double)nudId.Value * spId * (double)nudIdM.Value)) - ((double)nudTa.Value * (nudTa.Value > 0 ? (double)nudTaM.Value * spTa : 1))) / ((double)nudB.Value * (double)nudTBHM.Value * (!_NoIB && _bred ? 1 + _IB * _IBM * 0.2 : 1)) - 1) / ((double)nudLw.Value * (double)nudIw.Value * spIw)); - nudIwM.Value = IwM < 0 ? 0 : (IwM > nudIwM.Maximum ? nudIwM.Maximum : Math.Round(IwM, 5)); + nudIwM.ValueSave = Math.Round(IwM, 5); return true; } else if (!silent) MessageBox.Show("Divide by Zero-error, e.g. Lw or Iw needs to be at least 1."); @@ -227,7 +226,7 @@ public bool calculateIdM(bool silent = true) if (Vd != 0 && nudLd.Value != 0 && nudId.Value != 0) { var IdM = ((nudStatValue.Value / (decimal)(Vd * (_percent ? 100 : 1)) - 1) / (nudLd.Value * nudId.Value * (decimal)spId)); - nudIdM.Value = IdM < 0 ? 0 : (IdM > nudIdM.Maximum ? nudIdM.Maximum : Math.Round(IdM, 5)); + nudIdM.ValueSave = Math.Round(IdM, 5); return true; } else if (!silent) MessageBox.Show("Divide by Zero-error, e.g. Ld needs to be at least 1."); @@ -240,7 +239,7 @@ public bool calculateTaM(bool silent = true) if (nudTa.Value > 0) { var TaM = (decimal)(((double)nudStatValue.Value * Vd / ((_percent ? 100 : 1) * V * (1 + (_bred ? 1 : _TE) * (double)nudTm.Value * (nudTm.Value > 0 ? (double)nudTmM.Value * spTm : 1))) - (double)nudB.Value * (1 + (double)nudLw.Value * (double)nudIw.Value * spIw * (double)nudIwM.Value) * (double)nudTBHM.Value * (!_NoIB && _bred ? 1 + _IB * _IBM * 0.2 : 1)) / ((double)nudTa.Value * spTa)); - nudTaM.Value = TaM < nudTaM.Minimum ? nudTaM.Minimum : (TaM > nudTaM.Maximum ? nudTaM.Maximum : Math.Round(TaM, 5)); + nudTaM.ValueSave = Math.Round(TaM, 5); return true; } else if (!silent) MessageBox.Show("Divide by Zero-error, e.g. Ta needs to be > 0."); @@ -254,7 +253,7 @@ public bool calculateTmM(bool silent = true) { // TODO formula wrong? var TmM = (decimal)(((double)nudStatValue.Value * Vd / ((_percent ? 100 : 1) * V * ((double)nudB.Value * (1 + (double)nudLw.Value * (double)nudIw.Value * spIw * (double)nudIwM.Value) * (double)nudTBHM.Value * (!_NoIB && _bred ? 1 + _IB * _IBM * 0.2 : 1) + ((double)nudTa.Value * (nudTa.Value > 0 ? (double)nudTaM.Value * spTa : 1)))) - 1) / ((_bred ? 1 : _TE) * (double)nudTm.Value * spTm)); - nudTmM.Value = TmM < nudTmM.Minimum ? nudTmM.Minimum : (TmM > nudTmM.Maximum ? nudTmM.Maximum : Math.Round(TmM, 5)); + nudTmM.ValueSave = Math.Round(TmM, 5); return true; } else if (!silent) MessageBox.Show("Divide by Zero-error, e.g. Tm and TE needs to be > 0."); diff --git a/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.Designer.cs b/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.Designer.cs index 8cd012b5..0b57c756 100644 --- a/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.Designer.cs +++ b/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.Designer.cs @@ -32,8 +32,8 @@ private void InitializeComponent() this.groupBox4 = new System.Windows.Forms.GroupBox(); this.button1 = new System.Windows.Forms.Button(); this.cbUpdateOnSpeciesChange = new System.Windows.Forms.CheckBox(); - this.btAllWildZero = new System.Windows.Forms.Button(); - this.btAllLdToZero = new System.Windows.Forms.Button(); + this.groupBox5 = new System.Windows.Forms.GroupBox(); + this.cbSingleplayerSettings = new System.Windows.Forms.CheckBox(); this.llStatCalculation = new System.Windows.Forms.LinkLabel(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.rbBred = new System.Windows.Forms.RadioButton(); @@ -48,6 +48,7 @@ private void InitializeComponent() this.nudIB = new ARKBreedingStats.uiControls.Nud(); this.gbFineAdjustment = new System.Windows.Forms.GroupBox(); this.tbFineAdjustments = new System.Windows.Forms.TrackBar(); + this.lBDummyEmptyFlowBreak = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.label15 = new System.Windows.Forms.Label(); this.label14 = new System.Windows.Forms.Label(); @@ -78,10 +79,12 @@ private void InitializeComponent() this.idMToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.taMToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tmMToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.groupBox5 = new System.Windows.Forms.GroupBox(); - this.cbSingleplayerSettings = new System.Windows.Forms.CheckBox(); + this.setAllLvlToToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.allWildLvlToToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.allDomLvlToToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.flowLayoutPanel1.SuspendLayout(); this.groupBox4.SuspendLayout(); + this.groupBox5.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudTE)).BeginInit(); @@ -94,7 +97,6 @@ private void InitializeComponent() this.gbLevel.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudCreatureLevel)).BeginInit(); this.menuStrip1.SuspendLayout(); - this.groupBox5.SuspendLayout(); this.SuspendLayout(); // // flowLayoutPanel1 @@ -102,13 +104,12 @@ private void InitializeComponent() this.flowLayoutPanel1.AutoScroll = true; this.flowLayoutPanel1.Controls.Add(this.groupBox4); this.flowLayoutPanel1.Controls.Add(this.groupBox5); - this.flowLayoutPanel1.Controls.Add(this.btAllWildZero); - this.flowLayoutPanel1.Controls.Add(this.btAllLdToZero); this.flowLayoutPanel1.Controls.Add(this.llStatCalculation); this.flowLayoutPanel1.Controls.Add(this.groupBox1); this.flowLayoutPanel1.Controls.Add(this.groupBox2); this.flowLayoutPanel1.Controls.Add(this.groupBox3); this.flowLayoutPanel1.Controls.Add(this.gbFineAdjustment); + this.flowLayoutPanel1.Controls.Add(this.lBDummyEmptyFlowBreak); this.flowLayoutPanel1.Controls.Add(this.panel1); this.flowLayoutPanel1.Controls.Add(this.gbLevel); this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; @@ -150,31 +151,32 @@ private void InitializeComponent() this.cbUpdateOnSpeciesChange.Text = "update on species-change"; this.cbUpdateOnSpeciesChange.UseVisualStyleBackColor = true; // - // btAllWildZero + // groupBox5 // - this.btAllWildZero.Location = new System.Drawing.Point(511, 3); - this.btAllWildZero.Name = "btAllWildZero"; - this.btAllWildZero.Size = new System.Drawing.Size(90, 38); - this.btAllWildZero.TabIndex = 1; - this.btAllWildZero.Text = "set all Lw to…"; - this.btAllWildZero.UseVisualStyleBackColor = true; - this.btAllWildZero.Click += new System.EventHandler(this.btAllWildZero_Click); + this.groupBox5.Controls.Add(this.cbSingleplayerSettings); + this.groupBox5.Location = new System.Drawing.Point(305, 3); + this.groupBox5.Name = "groupBox5"; + this.groupBox5.Size = new System.Drawing.Size(200, 44); + this.groupBox5.TabIndex = 10; + this.groupBox5.TabStop = false; + this.groupBox5.Text = "Singleplayer-Settings"; // - // btAllLdToZero + // cbSingleplayerSettings // - this.btAllLdToZero.Location = new System.Drawing.Point(607, 3); - this.btAllLdToZero.Name = "btAllLdToZero"; - this.btAllLdToZero.Size = new System.Drawing.Size(90, 38); - this.btAllLdToZero.TabIndex = 2; - this.btAllLdToZero.Text = "set all Ld to…"; - this.btAllLdToZero.UseVisualStyleBackColor = true; - this.btAllLdToZero.Click += new System.EventHandler(this.btAllLdToZero_Click); + this.cbSingleplayerSettings.AutoSize = true; + this.cbSingleplayerSettings.Location = new System.Drawing.Point(6, 19); + this.cbSingleplayerSettings.Name = "cbSingleplayerSettings"; + this.cbSingleplayerSettings.Size = new System.Drawing.Size(124, 17); + this.cbSingleplayerSettings.TabIndex = 0; + this.cbSingleplayerSettings.Text = "Singleplayer-Settings"; + this.cbSingleplayerSettings.UseVisualStyleBackColor = true; + this.cbSingleplayerSettings.CheckedChanged += new System.EventHandler(this.cbSingleplayerSettings_CheckedChanged); // // llStatCalculation // this.llStatCalculation.AutoSize = true; this.flowLayoutPanel1.SetFlowBreak(this.llStatCalculation, true); - this.llStatCalculation.Location = new System.Drawing.Point(703, 16); + this.llStatCalculation.Location = new System.Drawing.Point(511, 16); this.llStatCalculation.Margin = new System.Windows.Forms.Padding(3, 16, 3, 0); this.llStatCalculation.Name = "llStatCalculation"; this.llStatCalculation.Size = new System.Drawing.Size(160, 13); @@ -251,8 +253,14 @@ private void InitializeComponent() // nudTE // this.nudTE.DecimalPlaces = 3; + this.nudTE.ForeColor = System.Drawing.SystemColors.GrayText; this.nudTE.Location = new System.Drawing.Point(6, 19); this.nudTE.Name = "nudTE"; + this.nudTE.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.nudTE.Size = new System.Drawing.Size(71, 20); this.nudTE.TabIndex = 1; this.nudTE.ValueChanged += new System.EventHandler(this.nudTE_ValueChanged); @@ -289,6 +297,11 @@ private void InitializeComponent() 65536}); this.nudIBM.Location = new System.Drawing.Point(135, 19); this.nudIBM.Name = "nudIBM"; + this.nudIBM.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.nudIBM.Size = new System.Drawing.Size(71, 20); this.nudIBM.TabIndex = 2; this.nudIBM.Value = new decimal(new int[] { @@ -301,6 +314,7 @@ private void InitializeComponent() // nudIB // this.nudIB.DecimalPlaces = 3; + this.nudIB.ForeColor = System.Drawing.SystemColors.GrayText; this.nudIB.Location = new System.Drawing.Point(6, 19); this.nudIB.Maximum = new decimal(new int[] { 200, @@ -308,6 +322,11 @@ private void InitializeComponent() 0, 0}); this.nudIB.Name = "nudIB"; + this.nudIB.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.nudIB.Size = new System.Drawing.Size(71, 20); this.nudIB.TabIndex = 1; this.nudIB.ValueChanged += new System.EventHandler(this.nudIB_ValueChanged); @@ -334,6 +353,15 @@ private void InitializeComponent() this.tbFineAdjustments.Value = 5; this.tbFineAdjustments.Scroll += new System.EventHandler(this.tbFineAdjustments_Scroll); // + // lBDummyEmptyFlowBreak + // + this.lBDummyEmptyFlowBreak.AutoSize = true; + this.flowLayoutPanel1.SetFlowBreak(this.lBDummyEmptyFlowBreak, true); + this.lBDummyEmptyFlowBreak.Location = new System.Drawing.Point(904, 50); + this.lBDummyEmptyFlowBreak.Name = "lBDummyEmptyFlowBreak"; + this.lBDummyEmptyFlowBreak.Size = new System.Drawing.Size(0, 13); + this.lBDummyEmptyFlowBreak.TabIndex = 11; + // // panel1 // this.panel1.Controls.Add(this.label15); @@ -527,6 +555,7 @@ private void InitializeComponent() // // nudCreatureLevel // + this.nudCreatureLevel.ForeColor = System.Drawing.SystemColors.GrayText; this.nudCreatureLevel.Location = new System.Drawing.Point(87, 19); this.nudCreatureLevel.Maximum = new decimal(new int[] { 100000, @@ -534,6 +563,11 @@ private void InitializeComponent() 0, 0}); this.nudCreatureLevel.Name = "nudCreatureLevel"; + this.nudCreatureLevel.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.nudCreatureLevel.Size = new System.Drawing.Size(107, 20); this.nudCreatureLevel.TabIndex = 13; this.nudCreatureLevel.ValueChanged += new System.EventHandler(this.nudCreatureLevel_ValueChanged); @@ -542,7 +576,8 @@ private void InitializeComponent() // this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.statMultipliersToolStripMenuItem, - this.calculateToolStripMenuItem}); + this.calculateToolStripMenuItem, + this.setAllLvlToToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Size = new System.Drawing.Size(1011, 24); @@ -625,26 +660,28 @@ private void InitializeComponent() this.tmMToolStripMenuItem.Text = "all TmM"; this.tmMToolStripMenuItem.Click += new System.EventHandler(this.tmMToolStripMenuItem_Click); // - // groupBox5 + // setAllLvlToToolStripMenuItem // - this.groupBox5.Controls.Add(this.cbSingleplayerSettings); - this.groupBox5.Location = new System.Drawing.Point(305, 3); - this.groupBox5.Name = "groupBox5"; - this.groupBox5.Size = new System.Drawing.Size(200, 44); - this.groupBox5.TabIndex = 10; - this.groupBox5.TabStop = false; - this.groupBox5.Text = "Singleplayer-Settings"; + this.setAllLvlToToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.allWildLvlToToolStripMenuItem, + this.allDomLvlToToolStripMenuItem}); + this.setAllLvlToToolStripMenuItem.Name = "setAllLvlToToolStripMenuItem"; + this.setAllLvlToToolStripMenuItem.Size = new System.Drawing.Size(81, 20); + this.setAllLvlToToolStripMenuItem.Text = "Set all Lvl to"; // - // cbSingleplayerSettings + // allWildLvlToToolStripMenuItem // - this.cbSingleplayerSettings.AutoSize = true; - this.cbSingleplayerSettings.Location = new System.Drawing.Point(6, 19); - this.cbSingleplayerSettings.Name = "cbSingleplayerSettings"; - this.cbSingleplayerSettings.Size = new System.Drawing.Size(124, 17); - this.cbSingleplayerSettings.TabIndex = 0; - this.cbSingleplayerSettings.Text = "Singleplayer-Settings"; - this.cbSingleplayerSettings.UseVisualStyleBackColor = true; - this.cbSingleplayerSettings.CheckedChanged += new System.EventHandler(this.cbSingleplayerSettings_CheckedChanged); + this.allWildLvlToToolStripMenuItem.Name = "allWildLvlToToolStripMenuItem"; + this.allWildLvlToToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.allWildLvlToToolStripMenuItem.Text = "all wild Lvl to…"; + this.allWildLvlToToolStripMenuItem.Click += new System.EventHandler(this.allWildLvlToToolStripMenuItem_Click); + // + // allDomLvlToToolStripMenuItem + // + this.allDomLvlToToolStripMenuItem.Name = "allDomLvlToToolStripMenuItem"; + this.allDomLvlToToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.allDomLvlToToolStripMenuItem.Text = "all dom Lvl to…"; + this.allDomLvlToToolStripMenuItem.Click += new System.EventHandler(this.allDomLvlToToolStripMenuItem_Click); // // StatsMultiplierTesting // @@ -658,6 +695,8 @@ private void InitializeComponent() this.flowLayoutPanel1.PerformLayout(); this.groupBox4.ResumeLayout(false); this.groupBox4.PerformLayout(); + this.groupBox5.ResumeLayout(false); + this.groupBox5.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); @@ -675,8 +714,6 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.nudCreatureLevel)).EndInit(); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); - this.groupBox5.ResumeLayout(false); - this.groupBox5.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -709,8 +746,6 @@ private void InitializeComponent() private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label3; - private System.Windows.Forms.Button btAllWildZero; - private System.Windows.Forms.Button btAllLdToZero; private System.Windows.Forms.LinkLabel llStatCalculation; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.RadioButton rbBred; @@ -736,5 +771,9 @@ private void InitializeComponent() private System.Windows.Forms.TrackBar tbFineAdjustments; private System.Windows.Forms.GroupBox groupBox5; private System.Windows.Forms.CheckBox cbSingleplayerSettings; + private System.Windows.Forms.Label lBDummyEmptyFlowBreak; + private System.Windows.Forms.ToolStripMenuItem setAllLvlToToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem allWildLvlToToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem allDomLvlToToolStripMenuItem; } } diff --git a/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.cs b/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.cs index 191b8c78..2452a3f4 100644 --- a/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.cs +++ b/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.cs @@ -57,8 +57,7 @@ private void Sc_OnLevelChanged() private void setTE(double TE) { - decimal te = (decimal)TE * 100; - nudTE.Value = te > nudTE.Maximum ? nudTE.Maximum : te; + nudTE.ValueSave = (decimal)TE * 100; gbFineAdjustment.Hide(); } @@ -70,8 +69,7 @@ private void setTE(MinMaxDouble TE) private void setIB(double IB) { - decimal ib = (decimal)IB * 100; - nudIB.Value = ib > nudIB.Maximum ? nudIB.Maximum : ib; + nudIB.ValueSave = (decimal)IB * 100; } private void setIB(MinMaxDouble IB) @@ -82,8 +80,7 @@ private void setIB(MinMaxDouble IB) private void setIBM(double IBM) { - decimal ibm = (decimal)IBM; - nudIBM.Value = ibm > nudIBM.Maximum ? nudIBM.Maximum : ibm; + nudIBM.ValueSave = (decimal)IBM; } private void setIBM(MinMaxDouble IBM) @@ -188,10 +185,6 @@ private void rbBred_CheckedChanged(object sender, EventArgs e) } } - private void btSetStatMultipliersFromSettings_Click(object sender, EventArgs e) - { - // TODO ????? remove??? - } private void setStatMultipliersFromCC() { if (cc != null && cc.multipliers != null) @@ -261,24 +254,6 @@ public void setCreatureValues(double[] statValues, int[] levelsWild, int[] level nudCreatureLevel.Value = level; } - private void btAllWildZero_Click(object sender, EventArgs e) - { - if (Utils.ShowTextInput("Wild Level", out string nr, "", "0") && int.TryParse(nr, out int lv)) - { - for (int s = 0; s < 8; s++) - statControls[s].levelWild = lv; - } - } - - private void btAllLdToZero_Click(object sender, EventArgs e) - { - if (Utils.ShowTextInput("Dom Level", out string nr, "", "0") && int.TryParse(nr, out int lv)) - { - for (int s = 0; s < 8; s++) - statControls[s].levelDom = lv; - } - } - private void llStatCalculation_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { System.Diagnostics.Process.Start("https://ark.gamepedia.com/Creature_Stats_Calculation"); @@ -382,5 +357,23 @@ private void cbSingleplayerSettings_CheckedChanged(object sender, EventArgs e) statControls[s].SetSinglePlayerSettings(); } } + + private void allWildLvlToToolStripMenuItem_Click(object sender, EventArgs e) + { + if (Utils.ShowTextInput("Wild Level", out string nr, "", "0") && int.TryParse(nr, out int lv)) + { + for (int s = 0; s < 8; s++) + statControls[s].levelWild = lv; + } + } + + private void allDomLvlToToolStripMenuItem_Click(object sender, EventArgs e) + { + if (Utils.ShowTextInput("Dom Level", out string nr, "", "0") && int.TryParse(nr, out int lv)) + { + for (int s = 0; s < 8; s++) + statControls[s].levelDom = lv; + } + } } } diff --git a/ARKBreedingStats/settings/MultiplierSetting.cs b/ARKBreedingStats/settings/MultiplierSetting.cs index 21df2c2f..b2e1c5ad 100644 --- a/ARKBreedingStats/settings/MultiplierSetting.cs +++ b/ARKBreedingStats/settings/MultiplierSetting.cs @@ -18,10 +18,10 @@ public double[] Multipliers { if (value.Length > 3) { - nudTameAdd.Value = (decimal)value[0] > nudTameAdd.Maximum ? nudTameAdd.Maximum : (decimal)value[0]; - nudTameMult.Value = (decimal)value[1] > nudTameMult.Maximum ? nudTameMult.Maximum : (decimal)value[1]; - nudWildLevel.Value = (decimal)value[3] > nudWildLevel.Maximum ? nudWildLevel.Maximum : (decimal)value[3]; - nudDomLevel.Value = (decimal)value[2] > nudDomLevel.Maximum ? nudDomLevel.Maximum : (decimal)value[2]; + nudTameAdd.ValueSave = (decimal)value[0]; + nudTameMult.ValueSave = (decimal)value[1]; + nudWildLevel.ValueSave = (decimal)value[3]; + nudDomLevel.ValueSave = (decimal)value[2]; } } } diff --git a/ARKBreedingStats/settings/Settings.Designer.cs b/ARKBreedingStats/settings/Settings.Designer.cs index 3c8e638c..e3ea14d9 100644 --- a/ARKBreedingStats/settings/Settings.Designer.cs +++ b/ARKBreedingStats/settings/Settings.Designer.cs @@ -163,6 +163,7 @@ private void InitializeComponent() this.tabPageImportExported = new System.Windows.Forms.TabPage(); this.fileSelectorImportExported = new ARKBreedingStats.uiControls.FileSelector(); this.label25 = new System.Windows.Forms.Label(); + this.label27 = new System.Windows.Forms.Label(); this.groupBoxMultiplier.SuspendLayout(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudWaitBeforeScreenCapture)).BeginInit(); @@ -479,6 +480,11 @@ private void InitializeComponent() 0, 0}); this.nudWaitBeforeScreenCapture.Name = "nudWaitBeforeScreenCapture"; + this.nudWaitBeforeScreenCapture.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.nudWaitBeforeScreenCapture.Size = new System.Drawing.Size(72, 20); this.nudWaitBeforeScreenCapture.TabIndex = 14; // @@ -499,6 +505,11 @@ private void InitializeComponent() 0, 0}); this.nudWhiteThreshold.Name = "nudWhiteThreshold"; + this.nudWhiteThreshold.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.nudWhiteThreshold.Size = new System.Drawing.Size(72, 20); this.nudWhiteThreshold.TabIndex = 12; // @@ -607,6 +618,11 @@ private void InitializeComponent() 0, 0}); this.nudBabyFoodConsumptionEvent.Name = "nudBabyFoodConsumptionEvent"; + this.nudBabyFoodConsumptionEvent.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.nudBabyFoodConsumptionEvent.Size = new System.Drawing.Size(57, 20); this.nudBabyFoodConsumptionEvent.TabIndex = 16; this.nudBabyFoodConsumptionEvent.Value = new decimal(new int[] { @@ -626,6 +642,11 @@ private void InitializeComponent() 0, 0}); this.nudMatingIntervalEvent.Name = "nudMatingIntervalEvent"; + this.nudMatingIntervalEvent.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.nudMatingIntervalEvent.Size = new System.Drawing.Size(57, 20); this.nudMatingIntervalEvent.TabIndex = 11; this.nudMatingIntervalEvent.Value = new decimal(new int[] { @@ -645,6 +666,11 @@ private void InitializeComponent() 0, 0}); this.nudCuddleIntervalEvent.Name = "nudCuddleIntervalEvent"; + this.nudCuddleIntervalEvent.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.nudCuddleIntervalEvent.Size = new System.Drawing.Size(57, 20); this.nudCuddleIntervalEvent.TabIndex = 14; this.nudCuddleIntervalEvent.Value = new decimal(new int[] { @@ -664,6 +690,11 @@ private void InitializeComponent() 0, 0}); this.nudMaturationSpeedEvent.Name = "nudMaturationSpeedEvent"; + this.nudMaturationSpeedEvent.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.nudMaturationSpeedEvent.Size = new System.Drawing.Size(57, 20); this.nudMaturationSpeedEvent.TabIndex = 13; this.nudMaturationSpeedEvent.Value = new decimal(new int[] { @@ -683,6 +714,11 @@ private void InitializeComponent() 0, 0}); this.nudHatchingSpeedEvent.Name = "nudHatchingSpeedEvent"; + this.nudHatchingSpeedEvent.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.nudHatchingSpeedEvent.Size = new System.Drawing.Size(57, 20); this.nudHatchingSpeedEvent.TabIndex = 12; this.nudHatchingSpeedEvent.Value = new decimal(new int[] { @@ -711,6 +747,11 @@ private void InitializeComponent() 0, 0}); this.nudBabyFoodConsumptionSpeed.Name = "nudBabyFoodConsumptionSpeed"; + this.nudBabyFoodConsumptionSpeed.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.nudBabyFoodConsumptionSpeed.Size = new System.Drawing.Size(57, 20); this.nudBabyFoodConsumptionSpeed.TabIndex = 5; this.nudBabyFoodConsumptionSpeed.Value = new decimal(new int[] { @@ -739,6 +780,11 @@ private void InitializeComponent() 0, 0}); this.nudMatingInterval.Name = "nudMatingInterval"; + this.nudMatingInterval.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.nudMatingInterval.Size = new System.Drawing.Size(57, 20); this.nudMatingInterval.TabIndex = 0; this.nudMatingInterval.Value = new decimal(new int[] { @@ -767,6 +813,11 @@ private void InitializeComponent() 0, 0}); this.numericUpDownBabyCuddleIntervalMultiplier.Name = "numericUpDownBabyCuddleIntervalMultiplier"; + this.numericUpDownBabyCuddleIntervalMultiplier.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.numericUpDownBabyCuddleIntervalMultiplier.Size = new System.Drawing.Size(57, 20); this.numericUpDownBabyCuddleIntervalMultiplier.TabIndex = 3; this.numericUpDownBabyCuddleIntervalMultiplier.Value = new decimal(new int[] { @@ -804,6 +855,11 @@ private void InitializeComponent() 0, 0}); this.numericUpDownMaturation.Name = "numericUpDownMaturation"; + this.numericUpDownMaturation.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.numericUpDownMaturation.Size = new System.Drawing.Size(57, 20); this.numericUpDownMaturation.TabIndex = 2; this.numericUpDownMaturation.Value = new decimal(new int[] { @@ -823,6 +879,11 @@ private void InitializeComponent() 0, 0}); this.numericUpDownImprintingM.Name = "numericUpDownImprintingM"; + this.numericUpDownImprintingM.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.numericUpDownImprintingM.Size = new System.Drawing.Size(57, 20); this.numericUpDownImprintingM.TabIndex = 4; this.numericUpDownImprintingM.Value = new decimal(new int[] { @@ -851,6 +912,11 @@ private void InitializeComponent() 0, 0}); this.numericUpDownHatching.Name = "numericUpDownHatching"; + this.numericUpDownHatching.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.numericUpDownHatching.Size = new System.Drawing.Size(57, 20); this.numericUpDownHatching.TabIndex = 1; this.numericUpDownHatching.Value = new decimal(new int[] { @@ -885,6 +951,11 @@ private void InitializeComponent() 0, 0}); this.nudMaxServerLevel.Name = "nudMaxServerLevel"; + this.nudMaxServerLevel.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.nudMaxServerLevel.Size = new System.Drawing.Size(57, 20); this.nudMaxServerLevel.TabIndex = 11; // @@ -906,6 +977,11 @@ private void InitializeComponent() 0, 0}); this.numericUpDownMaxChartLevel.Name = "numericUpDownMaxChartLevel"; + this.numericUpDownMaxChartLevel.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.numericUpDownMaxChartLevel.Size = new System.Drawing.Size(57, 20); this.numericUpDownMaxChartLevel.TabIndex = 2; // @@ -936,6 +1012,11 @@ private void InitializeComponent() 0, 0}); this.numericUpDownMaxWildLevel.Name = "numericUpDownMaxWildLevel"; + this.numericUpDownMaxWildLevel.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.numericUpDownMaxWildLevel.Size = new System.Drawing.Size(57, 20); this.numericUpDownMaxWildLevel.TabIndex = 0; // @@ -957,6 +1038,11 @@ private void InitializeComponent() 0, 0}); this.numericUpDownDomLevelNr.Name = "numericUpDownDomLevelNr"; + this.numericUpDownDomLevelNr.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.numericUpDownDomLevelNr.Size = new System.Drawing.Size(57, 20); this.numericUpDownDomLevelNr.TabIndex = 1; // @@ -1034,6 +1120,11 @@ private void InitializeComponent() 0, 0}); this.numericUpDownMaxBreedingSug.Name = "numericUpDownMaxBreedingSug"; + this.numericUpDownMaxBreedingSug.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.numericUpDownMaxBreedingSug.Size = new System.Drawing.Size(57, 20); this.numericUpDownMaxBreedingSug.TabIndex = 1; // @@ -1063,6 +1154,11 @@ private void InitializeComponent() 0, 0}); this.nudTamingFoodRateEvent.Name = "nudTamingFoodRateEvent"; + this.nudTamingFoodRateEvent.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.nudTamingFoodRateEvent.Size = new System.Drawing.Size(57, 20); this.nudTamingFoodRateEvent.TabIndex = 4; this.nudTamingFoodRateEvent.Value = new decimal(new int[] { @@ -1082,6 +1178,11 @@ private void InitializeComponent() 0, 0}); this.nudTamingSpeedEvent.Name = "nudTamingSpeedEvent"; + this.nudTamingSpeedEvent.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.nudTamingSpeedEvent.Size = new System.Drawing.Size(57, 20); this.nudTamingSpeedEvent.TabIndex = 3; this.nudTamingSpeedEvent.Value = new decimal(new int[] { @@ -1119,6 +1220,11 @@ private void InitializeComponent() 0, 0}); this.numericUpDownTamingFoodRate.Name = "numericUpDownTamingFoodRate"; + this.numericUpDownTamingFoodRate.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.numericUpDownTamingFoodRate.Size = new System.Drawing.Size(57, 20); this.numericUpDownTamingFoodRate.TabIndex = 1; this.numericUpDownTamingFoodRate.Value = new decimal(new int[] { @@ -1138,6 +1244,11 @@ private void InitializeComponent() 0, 0}); this.numericUpDownTamingSpeed.Name = "numericUpDownTamingSpeed"; + this.numericUpDownTamingSpeed.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.numericUpDownTamingSpeed.Size = new System.Drawing.Size(57, 20); this.numericUpDownTamingSpeed.TabIndex = 0; this.numericUpDownTamingSpeed.Value = new decimal(new int[] { @@ -1148,9 +1259,9 @@ private void InitializeComponent() // // label15 // - this.label15.Location = new System.Drawing.Point(5, 449); + this.label15.Location = new System.Drawing.Point(39, 494); this.label15.Name = "label15"; - this.label15.Size = new System.Drawing.Size(321, 54); + this.label15.Size = new System.Drawing.Size(289, 48); this.label15.TabIndex = 8; this.label15.Text = "If you have the files Game.ini or GameUserSettings.ini from your server, you can " + "drag&&drop them on this window to insert their values."; @@ -1184,6 +1295,11 @@ private void InitializeComponent() this.numericUpDownAutosaveMinutes.Enabled = false; this.numericUpDownAutosaveMinutes.Location = new System.Drawing.Point(145, 42); this.numericUpDownAutosaveMinutes.Name = "numericUpDownAutosaveMinutes"; + this.numericUpDownAutosaveMinutes.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.numericUpDownAutosaveMinutes.Size = new System.Drawing.Size(43, 20); this.numericUpDownAutosaveMinutes.TabIndex = 2; // @@ -1222,6 +1338,7 @@ private void InitializeComponent() // tabPage2 // this.tabPage2.AllowDrop = true; + this.tabPage2.Controls.Add(this.label27); this.tabPage2.Controls.Add(this.cbSingleplayerSettings); this.tabPage2.Controls.Add(this.groupBox11); this.tabPage2.Controls.Add(this.buttonEventToDefault); @@ -1289,6 +1406,11 @@ private void InitializeComponent() 0, 0}); this.nudWildLevelStep.Name = "nudWildLevelStep"; + this.nudWildLevelStep.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.nudWildLevelStep.Size = new System.Drawing.Size(57, 20); this.nudWildLevelStep.TabIndex = 1; this.nudWildLevelStep.Value = new decimal(new int[] { @@ -1455,6 +1577,11 @@ private void InitializeComponent() 0, 0}); this.nudOverlayInfoDuration.Name = "nudOverlayInfoDuration"; + this.nudOverlayInfoDuration.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); this.nudOverlayInfoDuration.Size = new System.Drawing.Size(57, 20); this.nudOverlayInfoDuration.TabIndex = 1; this.nudOverlayInfoDuration.Value = new decimal(new int[] { @@ -1510,7 +1637,7 @@ private void InitializeComponent() this.customSCCustom.Location = new System.Drawing.Point(6, 139); this.customSCCustom.Name = "customSCCustom"; this.customSCCustom.Size = new System.Drawing.Size(401, 23); - this.customSCCustom.SoundFile = null; + this.customSCCustom.SoundFile = ""; this.customSCCustom.TabIndex = 7; // // customSCWakeup @@ -1518,7 +1645,7 @@ private void InitializeComponent() this.customSCWakeup.Location = new System.Drawing.Point(6, 81); this.customSCWakeup.Name = "customSCWakeup"; this.customSCWakeup.Size = new System.Drawing.Size(401, 23); - this.customSCWakeup.SoundFile = ""; + this.customSCWakeup.SoundFile = null; this.customSCWakeup.TabIndex = 6; // // customSCBirth @@ -1526,7 +1653,7 @@ private void InitializeComponent() this.customSCBirth.Location = new System.Drawing.Point(6, 110); this.customSCBirth.Name = "customSCBirth"; this.customSCBirth.Size = new System.Drawing.Size(401, 23); - this.customSCBirth.SoundFile = ""; + this.customSCBirth.SoundFile = null; this.customSCBirth.TabIndex = 5; // // customSCStarving @@ -1534,7 +1661,7 @@ private void InitializeComponent() this.customSCStarving.Location = new System.Drawing.Point(6, 52); this.customSCStarving.Name = "customSCStarving"; this.customSCStarving.Size = new System.Drawing.Size(401, 23); - this.customSCStarving.SoundFile = null; + this.customSCStarving.SoundFile = ""; this.customSCStarving.TabIndex = 4; // // label20 @@ -1782,6 +1909,16 @@ private void InitializeComponent() this.label25.TabIndex = 0; this.label25.Text = resources.GetString("label25.Text"); // + // label27 + // + this.label27.AutoSize = true; + this.label27.Font = new System.Drawing.Font("Microsoft Sans Serif", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label27.Location = new System.Drawing.Point(3, 494); + this.label27.Name = "label27"; + this.label27.Size = new System.Drawing.Size(30, 26); + this.label27.TabIndex = 12; + this.label27.Text = "💡"; + // // Settings // this.AcceptButton = this.buttonOK; @@ -2001,5 +2138,6 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox cbShowOCRButton; private System.Windows.Forms.GroupBox groupBox17; private System.Windows.Forms.ComboBox cbbLanguage; + private System.Windows.Forms.Label label27; } } \ No newline at end of file diff --git a/ARKBreedingStats/settings/Settings.cs b/ARKBreedingStats/settings/Settings.cs index ab62d1ac..61ce2ce0 100644 --- a/ARKBreedingStats/settings/Settings.cs +++ b/ARKBreedingStats/settings/Settings.cs @@ -105,39 +105,39 @@ private void loadSettings(CreatureCollection cc) } cbSingleplayerSettings.Checked = cc.singlePlayerSettings; - numericUpDownHatching.Value = (decimal)cc.EggHatchSpeedMultiplier; - numericUpDownMaturation.Value = (decimal)cc.BabyMatureSpeedMultiplier; - numericUpDownDomLevelNr.Value = cc.maxDomLevel; - numericUpDownMaxBreedingSug.Value = cc.maxBreedingSuggestions; - numericUpDownMaxWildLevel.Value = cc.maxWildLevel; - nudMaxServerLevel.Value = cc.maxServerLevel; - numericUpDownMaxChartLevel.Value = cc.maxChartLevel; - numericUpDownImprintingM.Value = (decimal)cc.imprintingMultiplier; - numericUpDownBabyCuddleIntervalMultiplier.Value = (decimal)cc.babyCuddleIntervalMultiplier; - numericUpDownTamingSpeed.Value = (decimal)cc.tamingSpeedMultiplier; - numericUpDownTamingFoodRate.Value = (decimal)cc.tamingFoodRateMultiplier; - nudMatingInterval.Value = (decimal)cc.MatingIntervalMultiplier; - nudBabyFoodConsumptionSpeed.Value = (decimal)cc.BabyFoodConsumptionSpeedMultiplier; + numericUpDownHatching.ValueSave = (decimal)cc.EggHatchSpeedMultiplier; + numericUpDownMaturation.ValueSave = (decimal)cc.BabyMatureSpeedMultiplier; + numericUpDownDomLevelNr.ValueSave = cc.maxDomLevel; + numericUpDownMaxBreedingSug.ValueSave = cc.maxBreedingSuggestions; + numericUpDownMaxWildLevel.ValueSave = cc.maxWildLevel; + nudMaxServerLevel.ValueSave = cc.maxServerLevel > 0 ? cc.maxServerLevel : 0; + numericUpDownMaxChartLevel.ValueSave = cc.maxChartLevel; + numericUpDownImprintingM.ValueSave = (decimal)cc.imprintingMultiplier; + numericUpDownBabyCuddleIntervalMultiplier.ValueSave = (decimal)cc.babyCuddleIntervalMultiplier; + numericUpDownTamingSpeed.ValueSave = (decimal)cc.tamingSpeedMultiplier; + numericUpDownTamingFoodRate.ValueSave = (decimal)cc.tamingFoodRateMultiplier; + nudMatingInterval.ValueSave = (decimal)cc.MatingIntervalMultiplier; + nudBabyFoodConsumptionSpeed.ValueSave = (decimal)cc.BabyFoodConsumptionSpeedMultiplier; // event-multiplier - nudCuddleIntervalEvent.Value = (decimal)cc.babyCuddleIntervalMultiplierEvent; - nudTamingSpeedEvent.Value = (decimal)cc.tamingSpeedMultiplierEvent; - nudTamingFoodRateEvent.Value = (decimal)cc.tamingFoodRateMultiplierEvent; - nudMatingIntervalEvent.Value = (decimal)cc.MatingIntervalMultiplierEvent; - nudHatchingSpeedEvent.Value = (decimal)cc.EggHatchSpeedMultiplierEvent; - nudMaturationSpeedEvent.Value = (decimal)cc.BabyMatureSpeedMultiplierEvent; - nudBabyFoodConsumptionEvent.Value = (decimal)cc.BabyFoodConsumptionSpeedMultiplierEvent; + nudCuddleIntervalEvent.ValueSave = (decimal)cc.babyCuddleIntervalMultiplierEvent; + nudTamingSpeedEvent.ValueSave = (decimal)cc.tamingSpeedMultiplierEvent; + nudTamingFoodRateEvent.ValueSave = (decimal)cc.tamingFoodRateMultiplierEvent; + nudMatingIntervalEvent.ValueSave = (decimal)cc.MatingIntervalMultiplierEvent; + nudHatchingSpeedEvent.ValueSave = (decimal)cc.EggHatchSpeedMultiplierEvent; + nudMaturationSpeedEvent.ValueSave = (decimal)cc.BabyMatureSpeedMultiplierEvent; + nudBabyFoodConsumptionEvent.ValueSave = (decimal)cc.BabyFoodConsumptionSpeedMultiplierEvent; checkBoxAutoSave.Checked = Properties.Settings.Default.autosave; - numericUpDownAutosaveMinutes.Value = Properties.Settings.Default.autosaveMinutes; - nudWhiteThreshold.Value = Properties.Settings.Default.OCRWhiteThreshold; + numericUpDownAutosaveMinutes.ValueSave = Properties.Settings.Default.autosaveMinutes; + nudWhiteThreshold.ValueSave = Properties.Settings.Default.OCRWhiteThreshold; chkbSpeechRecognition.Checked = Properties.Settings.Default.SpeechRecognition; - nudOverlayInfoDuration.Value = Properties.Settings.Default.OverlayInfoDuration; + nudOverlayInfoDuration.ValueSave = Properties.Settings.Default.OverlayInfoDuration; chkCollectionSync.Checked = Properties.Settings.Default.syncCollection; if (Properties.Settings.Default.celsius) radioButtonCelsius.Checked = true; else radioButtonFahrenheit.Checked = true; cbIgnoreSexInBreedingPlan.Checked = Properties.Settings.Default.IgnoreSexInBreedingPlan; checkBoxOxygenForAll.Checked = Properties.Settings.Default.oxygenForAll; - nudWaitBeforeScreenCapture.Value = Properties.Settings.Default.waitBeforeScreenCapture; + nudWaitBeforeScreenCapture.ValueSave = Properties.Settings.Default.waitBeforeScreenCapture; cbShowOCRButton.Checked = Properties.Settings.Default.showOCRButton; string ocrApp = Properties.Settings.Default.OCRApp; @@ -158,7 +158,7 @@ private void loadSettings(CreatureCollection cc) tbPlayAlarmsSeconds.Text = Properties.Settings.Default.playAlarmTimes; cbConsiderWildLevelSteps.Checked = cc.considerWildLevelSteps; - nudWildLevelStep.Value = cc.wildLevelStep; + nudWildLevelStep.ValueSave = cc.wildLevelStep; cbInventoryCheck.Checked = Properties.Settings.Default.inventoryCheckTimer; cbAllowMoreThanHundredImprinting.Checked = cc.allowMoreThanHundredImprinting; cbCreatureColorsLibrary.Checked = Properties.Settings.Default.showColorsInLibrary; @@ -380,33 +380,33 @@ private void extractSettingsFromFile(string file) m = Regex.Match(text, @"MatingIntervalMultiplier ?= ?(\d*\.?\d+)"); if (m.Success && double.TryParse(m.Groups[1].Value, System.Globalization.NumberStyles.AllowDecimalPoint, System.Globalization.CultureInfo.GetCultureInfo("en-US"), out d)) { - nudMatingInterval.Value = (decimal)d; + nudMatingInterval.ValueSave = (decimal)d; } m = Regex.Match(text, @"EggHatchSpeedMultiplier ?= ?(\d*\.?\d+)"); if (m.Success && double.TryParse(m.Groups[1].Value, System.Globalization.NumberStyles.AllowDecimalPoint, System.Globalization.CultureInfo.GetCultureInfo("en-US"), out d)) { - numericUpDownHatching.Value = (decimal)d; + numericUpDownHatching.ValueSave = (decimal)d; } m = Regex.Match(text, @"BabyMatureSpeedMultiplier ?= ?(\d*\.?\d+)"); if (m.Success && double.TryParse(m.Groups[1].Value, System.Globalization.NumberStyles.AllowDecimalPoint, System.Globalization.CultureInfo.GetCultureInfo("en-US"), out d)) { - numericUpDownMaturation.Value = (decimal)d; + numericUpDownMaturation.ValueSave = (decimal)d; } m = Regex.Match(text, @"BabyImprintingStatScaleMultiplier ?= ?(\d*\.?\d+)"); if (m.Success && double.TryParse(m.Groups[1].Value, System.Globalization.NumberStyles.AllowDecimalPoint, System.Globalization.CultureInfo.GetCultureInfo("en-US"), out d)) { - numericUpDownImprintingM.Value = (decimal)d; + numericUpDownImprintingM.ValueSave = (decimal)d; } m = Regex.Match(text, @"BabyCuddleIntervalMultiplier ?= ?(\d*\.?\d+)"); if (m.Success && double.TryParse(m.Groups[1].Value, System.Globalization.NumberStyles.AllowDecimalPoint, System.Globalization.CultureInfo.GetCultureInfo("en-US"), out d)) { - numericUpDownBabyCuddleIntervalMultiplier.Value = (decimal)d; + numericUpDownBabyCuddleIntervalMultiplier.ValueSave = (decimal)d; } m = Regex.Match(text, @"BabyFoodConsumptionSpeedMultiplier ?= ?(\d*\.?\d+)"); if (m.Success && double.TryParse(m.Groups[1].Value, System.Globalization.NumberStyles.AllowDecimalPoint, System.Globalization.CultureInfo.GetCultureInfo("en-US"), out d)) { - nudBabyFoodConsumptionSpeed.Value = (decimal)d; + nudBabyFoodConsumptionSpeed.ValueSave = (decimal)d; } m = Regex.Match(text, @"bUseSingleplayerSettings ?= ?(true|false)", RegexOptions.IgnoreCase); if (m.Success) @@ -419,12 +419,12 @@ private void extractSettingsFromFile(string file) m = Regex.Match(text, @"TamingSpeedMultiplier ?= ?(\d*\.?\d+)"); if (m.Success && double.TryParse(m.Groups[1].Value, System.Globalization.NumberStyles.AllowDecimalPoint, System.Globalization.CultureInfo.GetCultureInfo("en-US"), out d)) { - numericUpDownTamingSpeed.Value = (decimal)d; + numericUpDownTamingSpeed.ValueSave = (decimal)d; } m = Regex.Match(text, @"DinoCharacterFoodDrainMultiplier ?= ?(\d*\.?\d+)"); if (m.Success && double.TryParse(m.Groups[1].Value, System.Globalization.NumberStyles.AllowDecimalPoint, System.Globalization.CultureInfo.GetCultureInfo("en-US"), out d)) { - numericUpDownTamingFoodRate.Value = (decimal)d; + numericUpDownTamingFoodRate.ValueSave = (decimal)d; } } } @@ -441,25 +441,25 @@ private void Settings_Disposed(object sender, EventArgs e) private void buttonAllTBMultipliersOne_Click(object sender, EventArgs e) { - numericUpDownTamingSpeed.Value = 1; - numericUpDownTamingFoodRate.Value = 1; - nudMatingInterval.Value = 1; - numericUpDownHatching.Value = 1; - numericUpDownMaturation.Value = 1; - numericUpDownImprintingM.Value = 1; - numericUpDownBabyCuddleIntervalMultiplier.Value = 1; - nudBabyFoodConsumptionSpeed.Value = 1; + numericUpDownTamingSpeed.ValueSave = 1; + numericUpDownTamingFoodRate.ValueSave = 1; + nudMatingInterval.ValueSave = 1; + numericUpDownHatching.ValueSave = 1; + numericUpDownMaturation.ValueSave = 1; + numericUpDownImprintingM.ValueSave = 1; + numericUpDownBabyCuddleIntervalMultiplier.ValueSave = 1; + nudBabyFoodConsumptionSpeed.ValueSave = 1; } private void buttonEventToDefault_Click(object sender, EventArgs e) { - nudTamingSpeedEvent.Value = numericUpDownTamingSpeed.Value; - nudTamingFoodRateEvent.Value = numericUpDownTamingFoodRate.Value; - nudMatingIntervalEvent.Value = nudMatingInterval.Value; - nudHatchingSpeedEvent.Value = numericUpDownHatching.Value; - nudMaturationSpeedEvent.Value = numericUpDownMaturation.Value; - nudCuddleIntervalEvent.Value = numericUpDownBabyCuddleIntervalMultiplier.Value; - nudBabyFoodConsumptionEvent.Value = nudBabyFoodConsumptionSpeed.Value; + nudTamingSpeedEvent.ValueSave = numericUpDownTamingSpeed.Value; + nudTamingFoodRateEvent.ValueSave = numericUpDownTamingFoodRate.Value; + nudMatingIntervalEvent.ValueSave = nudMatingInterval.Value; + nudHatchingSpeedEvent.ValueSave = numericUpDownHatching.Value; + nudMaturationSpeedEvent.ValueSave = numericUpDownMaturation.Value; + nudCuddleIntervalEvent.ValueSave = numericUpDownBabyCuddleIntervalMultiplier.Value; + nudBabyFoodConsumptionEvent.ValueSave = nudBabyFoodConsumptionSpeed.Value; } private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) diff --git a/ARKBreedingStats/settings/Settings.resx b/ARKBreedingStats/settings/Settings.resx index 4e46f2b7..4043de50 100644 --- a/ARKBreedingStats/settings/Settings.resx +++ b/ARKBreedingStats/settings/Settings.resx @@ -140,6 +140,24 @@ It works with the window-mode "Fullscreen-Windowed" and sometimes does not work 17, 17 + + True + + + True + + + True + + + True + + + True + + + 17, 17 + The creature data can be imported from the save-game, if it is available. The data has to be extracted first with the ark-tools. If you set the according files below, you can start the process automatically from the file-menu. Make sure the folders are correct. diff --git a/ARKBreedingStats/uiControls/RegionColorChooser.cs b/ARKBreedingStats/uiControls/RegionColorChooser.cs index 56fbb4b0..1ff6932a 100644 --- a/ARKBreedingStats/uiControls/RegionColorChooser.cs +++ b/ARKBreedingStats/uiControls/RegionColorChooser.cs @@ -15,7 +15,7 @@ public partial class RegionColorChooser : UserControl { public delegate void RegionColorChosenEventHandler(); public event RegionColorChosenEventHandler RegionColorChosen; - private Button[] buttons; + private Button[] buttonColors; private int[] colorIDs; public bool[] ColorRegionsUseds; private MyColorPicker colorPicker; @@ -25,7 +25,7 @@ public partial class RegionColorChooser : UserControl public RegionColorChooser() { InitializeComponent(); - buttons = new Button[] { buttonColor0, buttonColor1, buttonColor2, buttonColor3, buttonColor4, buttonColor5 }; + buttonColors = new Button[] { buttonColor0, buttonColor1, buttonColor2, buttonColor3, buttonColor4, buttonColor5 }; colorIDs = new int[6]; ColorRegionsUseds = new bool[6]; colorPicker = new MyColorPicker(); @@ -50,25 +50,25 @@ public void setCreature(string species, int[] colorIDs) colorRegions[i].name = "n/a"; } } - for (int r = 0; r < buttons.Length; r++) + for (int r = 0; r < buttonColors.Length; r++) { ColorRegionsUseds[r] = colorRegions[r].name != null; - buttons[r].Visible = ColorRegionsUseds[r]; + buttonColors[r].Visible = ColorRegionsUseds[r]; - if (buttons[r].Visible) + if (buttonColors[r].Visible) { - setColorButton(buttons[r], CreatureColors.creatureColor(colorIDs[r])); - tt.SetToolTip(buttons[r], colorRegions[r].name); + setColorButton(buttonColors[r], CreatureColors.creatureColor(colorIDs[r])); + tt.SetToolTip(buttonColors[r], colorRegions[r].name); } } } public void Clear() { - for (int r = 0; r < buttons.Length; r++) + for (int r = 0; r < buttonColors.Length; r++) { - colorIDs[r] = 0; - setColorButton(buttons[r], species.CreatureColors.creatureColor(0)); + buttonColors[r].Hide(); + setColorButton(buttonColors[r], CreatureColors.creatureColor(0)); } } diff --git a/ARKBreedingStats/uiControls/nud.cs b/ARKBreedingStats/uiControls/nud.cs index e9745abd..548b2b47 100644 --- a/ARKBreedingStats/uiControls/nud.cs +++ b/ARKBreedingStats/uiControls/nud.cs @@ -15,6 +15,19 @@ protected override void OnEnter(EventArgs e) Select(0, Text.Length); } + /// + /// Sets the value after checking it's < Maximum and > Minimum. If it's out of range, the closes possible value is set + /// + public decimal ValueSave + { + set + { + if (value > Maximum) value = Maximum; + if (value < Minimum) value = Minimum; + Value = value; + } + } + protected override void OnValueChanged(EventArgs e) { base.OnValueChanged(e); diff --git a/ARKBreedingStats/ver.txt b/ARKBreedingStats/ver.txt index a042993a..d38823e1 100644 --- a/ARKBreedingStats/ver.txt +++ b/ARKBreedingStats/ver.txt @@ -1 +1 @@ -279.261,0.28.0 +279.261,0.28.1