From cb86e8a7930465dd32de9f6712b5834472560ded Mon Sep 17 00:00:00 2001 From: cadaei Date: Tue, 28 Nov 2017 21:17:26 +0100 Subject: [PATCH] fix for custom timer creation. added checkbox to disable guessing of species after ocr. --- ARKBreedingStats/Form1.Designer.cs | 49 ++++++++------ ARKBreedingStats/Form1.cs | 72 +++++++++++---------- ARKBreedingStats/Properties/AssemblyInfo.cs | 2 +- ARKBreedingStats/TimerControl.Designer.cs | 2 +- ARKBreedingStats/TimerControl.cs | 5 +- ARKBreedingStats/ver.txt | 2 +- README.md | 2 + 7 files changed, 77 insertions(+), 57 deletions(-) diff --git a/ARKBreedingStats/Form1.Designer.cs b/ARKBreedingStats/Form1.Designer.cs index 7903f336..b5c08b93 100644 --- a/ARKBreedingStats/Form1.Designer.cs +++ b/ARKBreedingStats/Form1.Designer.cs @@ -208,6 +208,8 @@ private void InitializeComponent() this.columnHeaderTo = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.contextMenuStripLibrary = new System.Windows.Forms.ContextMenuStrip(this.components); this.toolStripMenuItemEdit = new System.Windows.Forms.ToolStripMenuItem(); + this.editAllSelectedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); this.copyValuesToExtractorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.currentValuesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.wildValuesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -224,7 +226,6 @@ private void InitializeComponent() this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem(); this.obeliskToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.editAllSelectedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripMenuItemRemove = new System.Windows.Forms.ToolStripMenuItem(); this.creatureBoxListView = new ARKBreedingStats.CreatureBox(); @@ -275,7 +276,7 @@ private void InitializeComponent() this.labelListening = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); this.comboBoxSpeciesGlobal = new System.Windows.Forms.ComboBox(); - this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); + this.cbGuessSpecies = new System.Windows.Forms.CheckBox(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownImprintingBonusTester)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NumericUpDownTestingTE)).BeginInit(); @@ -1482,7 +1483,7 @@ private void InitializeComponent() // // creatureInfoInputTester // - this.creatureInfoInputTester.Cooldown = new System.DateTime(2017, 11, 26, 21, 51, 44, 750); + this.creatureInfoInputTester.Cooldown = new System.DateTime(2017, 11, 27, 23, 50, 2, 350); this.creatureInfoInputTester.CreatureName = ""; this.creatureInfoInputTester.CreatureNote = ""; this.creatureInfoInputTester.CreatureOwner = ""; @@ -1491,7 +1492,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(2017, 11, 26, 21, 51, 44, 752); + this.creatureInfoInputTester.Grown = new System.DateTime(2017, 11, 27, 23, 50, 2, 351); this.creatureInfoInputTester.Location = new System.Drawing.Point(321, 184); this.creatureInfoInputTester.mother = null; this.creatureInfoInputTester.MutationCounter = 0; @@ -1823,7 +1824,7 @@ private void InitializeComponent() // // creatureInfoInputExtractor // - this.creatureInfoInputExtractor.Cooldown = new System.DateTime(2017, 11, 26, 21, 51, 44, 783); + this.creatureInfoInputExtractor.Cooldown = new System.DateTime(2017, 11, 27, 23, 50, 2, 386); this.creatureInfoInputExtractor.CreatureName = ""; this.creatureInfoInputExtractor.CreatureNote = ""; this.creatureInfoInputExtractor.CreatureOwner = ""; @@ -1832,7 +1833,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(2017, 11, 26, 21, 51, 44, 783); + this.creatureInfoInputExtractor.Grown = new System.DateTime(2017, 11, 27, 23, 50, 2, 387); this.creatureInfoInputExtractor.Location = new System.Drawing.Point(321, 184); this.creatureInfoInputExtractor.mother = null; this.creatureInfoInputExtractor.MutationCounter = 0; @@ -2284,7 +2285,7 @@ private void InitializeComponent() this.toolStripSeparator6, this.toolStripMenuItemRemove}); this.contextMenuStripLibrary.Name = "contextMenuStripLibrary"; - this.contextMenuStripLibrary.Size = new System.Drawing.Size(230, 214); + this.contextMenuStripLibrary.Size = new System.Drawing.Size(230, 192); // // toolStripMenuItemEdit // @@ -2294,6 +2295,19 @@ private void InitializeComponent() this.toolStripMenuItemEdit.Text = "Edit"; this.toolStripMenuItemEdit.Click += new System.EventHandler(this.toolStripMenuItemEdit_Click); // + // editAllSelectedToolStripMenuItem + // + this.editAllSelectedToolStripMenuItem.Name = "editAllSelectedToolStripMenuItem"; + this.editAllSelectedToolStripMenuItem.ShortcutKeyDisplayString = "F3"; + this.editAllSelectedToolStripMenuItem.Size = new System.Drawing.Size(229, 22); + this.editAllSelectedToolStripMenuItem.Text = "Edit all Selected..."; + this.editAllSelectedToolStripMenuItem.Click += new System.EventHandler(this.editAllSelectedToolStripMenuItem_Click); + // + // toolStripSeparator9 + // + this.toolStripSeparator9.Name = "toolStripSeparator9"; + this.toolStripSeparator9.Size = new System.Drawing.Size(226, 6); + // // copyValuesToExtractorToolStripMenuItem // this.copyValuesToExtractorToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -2417,14 +2431,6 @@ private void InitializeComponent() this.obeliskToolStripMenuItem.Text = "Obelisk"; this.obeliskToolStripMenuItem.Click += new System.EventHandler(this.obeliskToolStripMenuItem_Click); // - // editAllSelectedToolStripMenuItem - // - this.editAllSelectedToolStripMenuItem.Name = "editAllSelectedToolStripMenuItem"; - this.editAllSelectedToolStripMenuItem.ShortcutKeyDisplayString = "F3"; - this.editAllSelectedToolStripMenuItem.Size = new System.Drawing.Size(229, 22); - this.editAllSelectedToolStripMenuItem.Text = "Edit all Selected..."; - this.editAllSelectedToolStripMenuItem.Click += new System.EventHandler(this.editAllSelectedToolStripMenuItem_Click); - // // toolStripSeparator6 // this.toolStripSeparator6.Name = "toolStripSeparator6"; @@ -2872,6 +2878,7 @@ private void InitializeComponent() // // panelToolBar // + this.panelToolBar.Controls.Add(this.cbGuessSpecies); this.panelToolBar.Controls.Add(this.lbLibrarySelectionInfo); this.panelToolBar.Controls.Add(this.chkbToggleOverlay); this.panelToolBar.Controls.Add(this.labelListening); @@ -2939,10 +2946,15 @@ private void InitializeComponent() this.comboBoxSpeciesGlobal.TabIndex = 1; this.comboBoxSpeciesGlobal.SelectedIndexChanged += new System.EventHandler(this.comboBoxSpeciesGlobal_SelectedIndexChanged); // - // toolStripSeparator9 + // cbGuessSpecies // - this.toolStripSeparator9.Name = "toolStripSeparator9"; - this.toolStripSeparator9.Size = new System.Drawing.Size(226, 6); + this.cbGuessSpecies.AutoSize = true; + this.cbGuessSpecies.Location = new System.Drawing.Point(109, 30); + this.cbGuessSpecies.Name = "cbGuessSpecies"; + this.cbGuessSpecies.Size = new System.Drawing.Size(97, 17); + this.cbGuessSpecies.TabIndex = 55; + this.cbGuessSpecies.Text = "Guess Species"; + this.cbGuessSpecies.UseVisualStyleBackColor = true; // // Form1 // @@ -3278,5 +3290,6 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem neuteredCreaturesToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem mutatedCreaturesToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator9; + private System.Windows.Forms.CheckBox cbGuessSpecies; } } diff --git a/ARKBreedingStats/Form1.cs b/ARKBreedingStats/Form1.cs index ae09422e..cc22e0c5 100644 --- a/ARKBreedingStats/Form1.cs +++ b/ARKBreedingStats/Form1.cs @@ -256,6 +256,7 @@ private void Form1_Load(object sender, EventArgs e) tt.SetToolTip(lblTesterDomLevel, "Levels assigned manually to this stat after the creature was domesticated"); tt.SetToolTip(lblExtractorWildLevel, "Wild levels, which are considered for breeding"); tt.SetToolTip(lblTesterWildLevel, "Wild levels, which are considered for breeding"); + tt.SetToolTip(cbGuessSpecies, "If checked, the tool will try to guess the species after reading the values from ARK.\nIf the tool recognizes the species-name it will take that, otherwise it will check if the stat-values match a certain species.\n\nUncheck this if the tool repeatedly selects the wrong species after OCR (you have to choose it manually then)."); // was used to calculate the growing-progress. TODO: remove? (UI doesn't show the current weight anymore) creatureInfoInputExtractor.weightStat = statIOs[4]; @@ -3467,47 +3468,50 @@ public void doOCR(string imageFilePath = "", bool manuallyTriggered = true) default: break; } - List possibleDinos = determineSpeciesFromStats(OCRvalues, species); - - if (possibleDinos.Count == 1) + if (!manuallyTriggered || cbGuessSpecies.Checked) { - if (possibleDinos[0] >= 0 && possibleDinos[0] < comboBoxSpeciesGlobal.Items.Count) - comboBoxSpeciesGlobal.SelectedIndex = possibleDinos[0]; - extractLevels(true); // only one possible dino, use that one - } - else - { - bool sameValues = true; + List possibleDinos = determineSpeciesFromStats(OCRvalues, species); - if (lastOCRValues != null) - for (int i = 0; i < 10; i++) - if (OCRvalues[i] != lastOCRValues[i]) - { - sameValues = false; - break; - } - - // if there's more than one option, on manual we cycle through the options if we're trying multiple times - // on automated, we take the first one that yields an error-free level extraction - if (manuallyTriggered && sameValues) + if (possibleDinos.Count == 1) { - int newindex = (possibleDinos.IndexOf(lastOCRSpecies) + 1) % possibleDinos.Count; - comboBoxSpeciesGlobal.SelectedIndex = possibleDinos[newindex]; - lastOCRSpecies = possibleDinos[newindex]; - lastOCRValues = OCRvalues; - extractLevels(true); + if (possibleDinos[0] >= 0 && possibleDinos[0] < comboBoxSpeciesGlobal.Items.Count) + comboBoxSpeciesGlobal.SelectedIndex = possibleDinos[0]; + extractLevels(true); // only one possible dino, use that one } else - { // automated, or first manual attempt at new values - bool foundPossiblyGood = false; - for (int dinooption = 0; dinooption < possibleDinos.Count() && foundPossiblyGood == false; dinooption++) + { + bool sameValues = true; + + if (lastOCRValues != null) + for (int i = 0; i < 10; i++) + if (OCRvalues[i] != lastOCRValues[i]) + { + sameValues = false; + break; + } + + // if there's more than one option, on manual we cycle through the options if we're trying multiple times + // on automated, we take the first one that yields an error-free level extraction + if (manuallyTriggered && sameValues) { - // if the last OCR'ed values are the same as this one, the user may not be happy with the dino species selection and want another one - // so we'll cycle to the next one, but only if the OCR is manually triggered, on autotrigger (ie, overlay), don't change - comboBoxSpeciesGlobal.SelectedIndex = possibleDinos[dinooption]; - lastOCRSpecies = possibleDinos[dinooption]; + int newindex = (possibleDinos.IndexOf(lastOCRSpecies) + 1) % possibleDinos.Count; + comboBoxSpeciesGlobal.SelectedIndex = possibleDinos[newindex]; + lastOCRSpecies = possibleDinos[newindex]; lastOCRValues = OCRvalues; - foundPossiblyGood = extractLevels(); + extractLevels(true); + } + else + { // automated, or first manual attempt at new values + bool foundPossiblyGood = false; + for (int dinooption = 0; dinooption < possibleDinos.Count() && foundPossiblyGood == false; dinooption++) + { + // if the last OCR'ed values are the same as this one, the user may not be happy with the dino species selection and want another one + // so we'll cycle to the next one, but only if the OCR is manually triggered, on autotrigger (ie, overlay), don't change + comboBoxSpeciesGlobal.SelectedIndex = possibleDinos[dinooption]; + lastOCRSpecies = possibleDinos[dinooption]; + lastOCRValues = OCRvalues; + foundPossiblyGood = extractLevels(); + } } } } diff --git a/ARKBreedingStats/Properties/AssemblyInfo.cs b/ARKBreedingStats/Properties/AssemblyInfo.cs index caf9a28e..139a1d2e 100644 --- a/ARKBreedingStats/Properties/AssemblyInfo.cs +++ b/ARKBreedingStats/Properties/AssemblyInfo.cs @@ -33,4 +33,4 @@ // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("0.24.0")] +[assembly: AssemblyFileVersion("0.24.1")] diff --git a/ARKBreedingStats/TimerControl.Designer.cs b/ARKBreedingStats/TimerControl.Designer.cs index f62d804f..940236de 100644 --- a/ARKBreedingStats/TimerControl.Designer.cs +++ b/ARKBreedingStats/TimerControl.Designer.cs @@ -184,7 +184,7 @@ private void InitializeComponent() this.dhmsInputTimer.Size = new System.Drawing.Size(136, 26); this.dhmsInputTimer.TabIndex = 13; this.dhmsInputTimer.Timespan = System.TimeSpan.Parse("00:00:00"); - this.dhmsInputTimer.TextChanged += new System.EventHandler(this.dhmsInputTimer_TextChanged); + this.dhmsInputTimer.ValueChanged += new ARKBreedingStats.uiControls.dhmsInput.ValueChangedEventHandler(this.dhmsInputTimer_ValueChanged); // // label3 // diff --git a/ARKBreedingStats/TimerControl.cs b/ARKBreedingStats/TimerControl.cs index 3cde657a..97627a8e 100644 --- a/ARKBreedingStats/TimerControl.cs +++ b/ARKBreedingStats/TimerControl.cs @@ -274,11 +274,12 @@ private void bSetTimerNow_Click(object sender, EventArgs e) private void buttonAddTime_addTimer(TimeSpan timeSpan) { dhmsInputTimer.Timespan = dhmsInputTimer.Timespan.Add(timeSpan); + dateTimePickerTimerFinish.Value = DateTime.Now.Add(dhmsInputTimer.Timespan); } - private void dhmsInputTimer_TextChanged(object sender, EventArgs e) + private void dhmsInputTimer_ValueChanged(uiControls.dhmsInput sender, TimeSpan timespan) { - dateTimePickerTimerFinish.Value = DateTime.Now.Add(dhmsInputTimer.Timespan); + dateTimePickerTimerFinish.Value = DateTime.Now.Add(timespan); } private void addToOverlayToolStripMenuItem_Click(object sender, EventArgs e) diff --git a/ARKBreedingStats/ver.txt b/ARKBreedingStats/ver.txt index 01787a4d..5560d291 100644 --- a/ARKBreedingStats/ver.txt +++ b/ARKBreedingStats/ver.txt @@ -1 +1 @@ -273.85,0.24.0 \ No newline at end of file +273.85,0.24.1 \ No newline at end of file diff --git a/README.md b/README.md index 027d63db..16251313 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ [**Download** the latest release](https://github.com/cadon/ARKStatsExtractor/releases/latest). Support the development of this tool: [Buy me a Coffee](https://ko-fi.com/826WMCII3B24) +**Discord**: https://discord.gg/qCYYbQK + # ARK Smart Breeding For the game ARK Survival Evolved. Extracts possible levelups of creatures to get the values for breeding. Save your creatures in a library, sort and compare their stats, view their pedigree, use the breeding-plan to get the best possible creatures and keep track of the growing babies with timers.