From 0d3388a21e3ef22417d22c4f0ee28ea91532d8cf Mon Sep 17 00:00:00 2001 From: cadon Date: Thu, 23 Mar 2023 00:30:24 +0100 Subject: [PATCH 1/8] ignore creatures with status dead in color availability --- ARKBreedingStats/Form1.cs | 21 ++++++++++++------- .../library/CreatureCollection.cs | 6 ++++-- ARKBreedingStats/uiControls/LibraryInfo.cs | 1 + 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/ARKBreedingStats/Form1.cs b/ARKBreedingStats/Form1.cs index 38d3a5af..97b012e4 100644 --- a/ARKBreedingStats/Form1.cs +++ b/ARKBreedingStats/Form1.cs @@ -1816,16 +1816,18 @@ private void SetStatusOfSelectedCreatures(CreatureStatus s) private void SetCreatureStatus(IEnumerable cs, CreatureStatus s) { - bool changed = false; - List speciesBlueprints = new List(); + var changed = false; + var deadStatusWasSet = false; + var changedSpecies = new List(); foreach (Creature c in cs) { if (c.Status != s) { changed = true; + deadStatusWasSet = deadStatusWasSet || c.Status.HasFlag(CreatureStatus.Dead); c.Status = s; - if (!speciesBlueprints.Contains(c.speciesBlueprint)) - speciesBlueprints.Add(c.speciesBlueprint); + if (!changedSpecies.Contains(c.Species)) + changedSpecies.Add(c.Species); } } @@ -1833,11 +1835,16 @@ private void SetCreatureStatus(IEnumerable cs, CreatureStatus s) { // update list / recalculate topStats CalculateTopStats(_creatureCollection.creatures - .Where(c => speciesBlueprints.Contains(c.speciesBlueprint)).ToList()); + .Where(c => changedSpecies.Contains(c.Species)).ToList()); + Species speciesIfOnlyOne = changedSpecies.Count == 1 ? changedSpecies[0] : null; + if (s.HasFlag(CreatureStatus.Dead) ^ deadStatusWasSet) + { + LibraryInfo.ClearInfo(); + _creatureCollection.ResetExistingColors(speciesIfOnlyOne); + } FilterLibRecalculate(); UpdateStatusBar(); - SetCollectionChanged(true, - speciesBlueprints.Count == 1 ? Values.V.SpeciesByBlueprint(speciesBlueprints[0]) : null); + SetCollectionChanged(true, speciesIfOnlyOne); } } diff --git a/ARKBreedingStats/library/CreatureCollection.cs b/ARKBreedingStats/library/CreatureCollection.cs index 1c9a7f45..79b0cc6a 100644 --- a/ARKBreedingStats/library/CreatureCollection.cs +++ b/ARKBreedingStats/library/CreatureCollection.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; -using System.Text; using ARKBreedingStats.mods; namespace ARKBreedingStats.Library @@ -484,7 +483,10 @@ internal ColorExisting[] ColorAlreadyAvailable(Species species, byte[] colorIds, for (int i = 0; i < usedColorCount + 1; i++) speciesExistingColors[i] = new List(); foreach (Creature c in creatures) { - if (c.flags.HasFlag(CreatureFlags.Placeholder) || c.Species == null || c.speciesBlueprint != species.blueprintPath) + if (c.flags.HasFlag(CreatureFlags.Placeholder) + || c.flags.HasFlag(CreatureFlags.Dead) + || c.Species == null + || c.speciesBlueprint != species.blueprintPath) continue; for (int i = 0; i < usedColorCount; i++) diff --git a/ARKBreedingStats/uiControls/LibraryInfo.cs b/ARKBreedingStats/uiControls/LibraryInfo.cs index c36505df..2ae2159e 100644 --- a/ARKBreedingStats/uiControls/LibraryInfo.cs +++ b/ARKBreedingStats/uiControls/LibraryInfo.cs @@ -66,6 +66,7 @@ internal static bool SetColorInfo(Species species, IList creatures, bo { if (cr.speciesBlueprint != species.blueprintPath || cr.flags.HasFlag(CreatureFlags.Placeholder) + || cr.flags.HasFlag(CreatureFlags.Dead) || cr.colors == null) continue; From 6e7c272289c6b8790eec15084051a7ae062caf48 Mon Sep 17 00:00:00 2001 From: cadon Date: Sat, 25 Mar 2023 00:16:23 +0100 Subject: [PATCH 2/8] increased max value in stat multiplier --- .../StatMultiplierTestingControl.Designer.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ARKBreedingStats/multiplierTesting/StatMultiplierTestingControl.Designer.cs b/ARKBreedingStats/multiplierTesting/StatMultiplierTestingControl.Designer.cs index 229c29d4..9322a01f 100644 --- a/ARKBreedingStats/multiplierTesting/StatMultiplierTestingControl.Designer.cs +++ b/ARKBreedingStats/multiplierTesting/StatMultiplierTestingControl.Designer.cs @@ -703,9 +703,9 @@ private void InitializeComponent() this.nudStatValue.ForeColor = System.Drawing.SystemColors.GrayText; this.nudStatValue.Location = new System.Drawing.Point(897, 3); this.nudStatValue.Maximum = new decimal(new int[] { - 100000000, - 0, - 0, + 1661992959, + 1808227885, + 5, 0}); this.nudStatValue.Name = "nudStatValue"; this.nudStatValue.NeutralNumber = new decimal(new int[] { From c9c7d674a61f7fb9895c463d85f5fe8701948eb7 Mon Sep 17 00:00:00 2001 From: cadon Date: Sat, 25 Mar 2023 12:14:18 +0100 Subject: [PATCH 3/8] added calculated wild level for tamed --- .../StatsMultiplierTesting.Designer.cs | 40 ++++++++++++------- .../StatsMultiplierTesting.cs | 11 +++-- 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.Designer.cs b/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.Designer.cs index aa629532..ba254021 100644 --- a/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.Designer.cs +++ b/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.Designer.cs @@ -33,6 +33,7 @@ private void InitializeComponent() this.button1 = new System.Windows.Forms.Button(); this.cbUpdateOnSpeciesChange = new System.Windows.Forms.CheckBox(); this.groupBox5 = new System.Windows.Forms.GroupBox(); + this.CbAllowFlyerSpeedLeveling = new System.Windows.Forms.CheckBox(); this.cbSingleplayerSettings = new System.Windows.Forms.CheckBox(); this.btUseMultipliersFromSettings = new System.Windows.Forms.Button(); this.llStatCalculation = new System.Windows.Forms.LinkLabel(); @@ -88,7 +89,7 @@ private void InitializeComponent() this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.setAllWildLevelsToTheClosestValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.setAllDomLevelsToTheClosestValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.CbAllowFlyerSpeedLeveling = new System.Windows.Forms.CheckBox(); + this.LbCalculatedWildLevel = new System.Windows.Forms.Label(); this.flowLayoutPanel1.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox5.SuspendLayout(); @@ -172,6 +173,17 @@ private void InitializeComponent() this.groupBox5.TabStop = false; this.groupBox5.Text = "Settings"; // + // CbAllowFlyerSpeedLeveling + // + this.CbAllowFlyerSpeedLeveling.AutoSize = true; + this.CbAllowFlyerSpeedLeveling.Location = new System.Drawing.Point(6, 42); + this.CbAllowFlyerSpeedLeveling.Name = "CbAllowFlyerSpeedLeveling"; + this.CbAllowFlyerSpeedLeveling.Size = new System.Drawing.Size(144, 17); + this.CbAllowFlyerSpeedLeveling.TabIndex = 1; + this.CbAllowFlyerSpeedLeveling.Text = "AllowFlyerSpeedLeveling"; + this.CbAllowFlyerSpeedLeveling.UseVisualStyleBackColor = true; + this.CbAllowFlyerSpeedLeveling.CheckedChanged += new System.EventHandler(this.CbAllowFlyerSpeedLeveling_CheckedChanged); + // // cbSingleplayerSettings // this.cbSingleplayerSettings.AutoSize = true; @@ -265,11 +277,12 @@ private void InitializeComponent() // // groupBox2 // + this.groupBox2.Controls.Add(this.LbCalculatedWildLevel); this.groupBox2.Controls.Add(this.label1); this.groupBox2.Controls.Add(this.nudTE); this.groupBox2.Location = new System.Drawing.Point(176, 101); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(121, 49); + this.groupBox2.Size = new System.Drawing.Size(163, 49); this.groupBox2.TabIndex = 5; this.groupBox2.TabStop = false; this.groupBox2.Text = "TamingEffectiveness"; @@ -303,7 +316,7 @@ private void InitializeComponent() this.groupBox3.Controls.Add(this.label2); this.groupBox3.Controls.Add(this.nudIBM); this.groupBox3.Controls.Add(this.nudIB); - this.groupBox3.Location = new System.Drawing.Point(303, 101); + this.groupBox3.Location = new System.Drawing.Point(345, 101); this.groupBox3.Name = "groupBox3"; this.groupBox3.Size = new System.Drawing.Size(213, 49); this.groupBox3.TabIndex = 6; @@ -367,7 +380,7 @@ private void InitializeComponent() // gbFineAdjustment // this.gbFineAdjustment.Controls.Add(this.tbFineAdjustments); - this.gbFineAdjustment.Location = new System.Drawing.Point(522, 101); + this.gbFineAdjustment.Location = new System.Drawing.Point(564, 101); this.gbFineAdjustment.Name = "gbFineAdjustment"; this.gbFineAdjustment.Size = new System.Drawing.Size(376, 49); this.gbFineAdjustment.TabIndex = 7; @@ -390,7 +403,7 @@ private void InitializeComponent() // this.lBDummyEmptyFlowBreak.AutoSize = true; this.flowLayoutPanel1.SetFlowBreak(this.lBDummyEmptyFlowBreak, true); - this.lBDummyEmptyFlowBreak.Location = new System.Drawing.Point(904, 98); + this.lBDummyEmptyFlowBreak.Location = new System.Drawing.Point(946, 98); this.lBDummyEmptyFlowBreak.Name = "lBDummyEmptyFlowBreak"; this.lBDummyEmptyFlowBreak.Size = new System.Drawing.Size(0, 13); this.lBDummyEmptyFlowBreak.TabIndex = 11; @@ -748,16 +761,14 @@ private void InitializeComponent() this.setAllDomLevelsToTheClosestValueToolStripMenuItem.Text = "Set all Dom levels to the closest value"; this.setAllDomLevelsToTheClosestValueToolStripMenuItem.Click += new System.EventHandler(this.setAllDomLevelsToTheClosestValueToolStripMenuItem_Click); // - // CbAllowFlyerSpeedLeveling + // LbCalculatedWildLevel // - this.CbAllowFlyerSpeedLeveling.AutoSize = true; - this.CbAllowFlyerSpeedLeveling.Location = new System.Drawing.Point(6, 42); - this.CbAllowFlyerSpeedLeveling.Name = "CbAllowFlyerSpeedLeveling"; - this.CbAllowFlyerSpeedLeveling.Size = new System.Drawing.Size(144, 17); - this.CbAllowFlyerSpeedLeveling.TabIndex = 1; - this.CbAllowFlyerSpeedLeveling.Text = "AllowFlyerSpeedLeveling"; - this.CbAllowFlyerSpeedLeveling.UseVisualStyleBackColor = true; - this.CbAllowFlyerSpeedLeveling.CheckedChanged += new System.EventHandler(this.CbAllowFlyerSpeedLeveling_CheckedChanged); + this.LbCalculatedWildLevel.AutoSize = true; + this.LbCalculatedWildLevel.Location = new System.Drawing.Point(104, 21); + this.LbCalculatedWildLevel.Name = "LbCalculatedWildLevel"; + this.LbCalculatedWildLevel.Size = new System.Drawing.Size(13, 13); + this.LbCalculatedWildLevel.TabIndex = 3; + this.LbCalculatedWildLevel.Text = "0"; // // StatsMultiplierTesting // @@ -858,5 +869,6 @@ private void InitializeComponent() private System.Windows.Forms.Label LbAbbreviations; private System.Windows.Forms.Label LbBlueprintPath; private System.Windows.Forms.CheckBox CbAllowFlyerSpeedLeveling; + private System.Windows.Forms.Label LbCalculatedWildLevel; } } diff --git a/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.cs b/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.cs index b3fe7ed3..6513da84 100644 --- a/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.cs +++ b/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.cs @@ -138,6 +138,8 @@ private void nudTE_ValueChanged(object sender, EventArgs e) { for (int s = 0; s < Stats.StatsCount; s++) _statControls[s].TE = (double)nudTE.Value / 100; + if (rbTamed.Checked) + LbCalculatedWildLevel.Text = $"LW: {Creature.CalculatePreTameWildLevel(_statControls[Stats.Torpidity].LevelWild + 1, (double)nudTE.Value / 100)}"; } private void nudIB_ValueChanged(object sender, EventArgs e) @@ -157,10 +159,11 @@ private void rbWild_CheckedChanged(object sender, EventArgs e) if (rbWild.Checked) { for (int s = 0; s < Stats.StatsCount; s++) - _statControls[s].Wild = rbWild.Checked; + _statControls[s].Wild = true; nudTE.BackColor = SystemColors.Window; nudIB.BackColor = SystemColors.Window; nudIBM.BackColor = SystemColors.Window; + LbCalculatedWildLevel.Visible = false; } } @@ -169,10 +172,11 @@ private void rbTamed_CheckedChanged(object sender, EventArgs e) if (rbTamed.Checked) { for (int s = 0; s < Stats.StatsCount; s++) - _statControls[s].Tamed = rbTamed.Checked; + _statControls[s].Tamed = true; nudTE.BackColor = Color.FromArgb(215, 186, 255); nudIB.BackColor = SystemColors.Window; nudIBM.BackColor = SystemColors.Window; + LbCalculatedWildLevel.Visible = true; } } @@ -181,10 +185,11 @@ private void rbBred_CheckedChanged(object sender, EventArgs e) if (rbBred.Checked) { for (int s = 0; s < Stats.StatsCount; s++) - _statControls[s].Bred = rbBred.Checked; + _statControls[s].Bred = true; nudTE.BackColor = SystemColors.Window; nudIB.BackColor = Color.FromArgb(255, 186, 242); nudIBM.BackColor = Color.FromArgb(255, 153, 236); + LbCalculatedWildLevel.Visible = false; } } From 97440e36153237912aca1a9447a15f69ef706a19 Mon Sep 17 00:00:00 2001 From: cadon Date: Sat, 25 Mar 2023 12:14:39 +0100 Subject: [PATCH 4/8] fixes for saving wild creatures in library --- ARKBreedingStats/CreatureBox.cs | 10 +++++++--- ARKBreedingStats/Form1.extractor.cs | 1 - ARKBreedingStats/Form1.library.cs | 2 +- ARKBreedingStats/Form1.tester.cs | 8 ++++---- ARKBreedingStats/library/Creature.cs | 7 +++++++ 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/ARKBreedingStats/CreatureBox.cs b/ARKBreedingStats/CreatureBox.cs index 1ac6414b..6f21d96e 100644 --- a/ARKBreedingStats/CreatureBox.cs +++ b/ARKBreedingStats/CreatureBox.cs @@ -126,6 +126,8 @@ void SetParentLabel(Label l, string lbText = null, bool clickable = false) _tt.SetToolTip(l, clickable ? lbText : null); } + SetParentLabel(LbFather); + if (_creature.Mother != null || _creature.Father != null) { SetParentLabel(LbMotherAndWildInfo, _creature.Mother != null ? $"{Loc.S("Mother")}: {_creature.Mother.name}" : null, _creature.Mother != null); @@ -134,12 +136,14 @@ void SetParentLabel(Label l, string lbText = null, bool clickable = false) else if (_creature.isBred) { SetParentLabel(LbMotherAndWildInfo, "bred, click 'edit' to add parents"); - SetParentLabel(LbFather); } - else + else if (_creature.isDomesticated) { SetParentLabel(LbMotherAndWildInfo, "found wild " + _creature.levelFound + (_creature.tamingEff >= 0 ? ", tamed with TE: " + (_creature.tamingEff * 100).ToString("N1") + "%" : ", TE unknown.")); - SetParentLabel(LbFather); + } + else + { + SetParentLabel(LbMotherAndWildInfo, "found wild " + _creature.levelFound); } statsDisplay1.SetCreatureValues(_creature); labelNotes.Text = _creature.note; diff --git a/ARKBreedingStats/Form1.extractor.cs b/ARKBreedingStats/Form1.extractor.cs index 194b661c..f1c41c24 100644 --- a/ARKBreedingStats/Form1.extractor.cs +++ b/ARKBreedingStats/Form1.extractor.cs @@ -114,7 +114,6 @@ private void ShowSumOfChosenLevels() if (allValid) { radarChartExtractor.SetLevels(_statIOs.Select(s => s.LevelWild).ToArray()); - toolStripButtonSaveCreatureValuesTemp.Visible = false; cbExactlyImprinting.BackColor = Color.Transparent; var species = speciesSelector1.SelectedSpecies; var checkTopLevels = _topLevels.TryGetValue(species, out int[] topSpeciesLevels); diff --git a/ARKBreedingStats/Form1.library.cs b/ARKBreedingStats/Form1.library.cs index f7ee6230..2935e224 100644 --- a/ARKBreedingStats/Form1.library.cs +++ b/ARKBreedingStats/Form1.library.cs @@ -44,7 +44,7 @@ private Creature AddCreatureToCollection(bool fromExtractor = true, long motherA { input = creatureInfoInputExtractor; bred = rbBredExtractor.Checked; - te = _extractor.UniqueTamingEffectiveness(); + te = rbWildExtractor.Checked ? -3 : _extractor.UniqueTamingEffectiveness(); imprinting = _extractor.ImprintingBonus; } else diff --git a/ARKBreedingStats/Form1.tester.cs b/ARKBreedingStats/Form1.tester.cs index dfb61d61..7176330d 100644 --- a/ARKBreedingStats/Form1.tester.cs +++ b/ARKBreedingStats/Form1.tester.cs @@ -365,12 +365,12 @@ private void PbCreatureColorsExtractor_Click(object sender, EventArgs e) { Species = speciesSelector1.SelectedSpecies, levelsWild = GetCurrentWildLevels(true), - levelsDom = GetCurrentDomLevels(true) + levelsDom = GetCurrentDomLevels(true), + tamingEff = _extractor.UniqueTamingEffectiveness(), + isBred = rbBredExtractor.Checked, + imprintingBonus = _extractor.ImprintingBonus }; - creature.tamingEff = _extractor.UniqueTamingEffectiveness(); - creature.isBred = rbBredExtractor.Checked; - creature.imprintingBonus = _extractor.ImprintingBonus; creatureInfoInputExtractor.SetCreatureData(creature); creature.RecalculateAncestorGenerations(); creature.RecalculateNewMutations(); diff --git a/ARKBreedingStats/library/Creature.cs b/ARKBreedingStats/library/Creature.cs index 85bd7c13..d96017cc 100644 --- a/ARKBreedingStats/library/Creature.cs +++ b/ARKBreedingStats/library/Creature.cs @@ -299,6 +299,13 @@ public override int GetHashCode() public void CalculateLevelFound(int? levelStep) { levelFound = 0; + + if (!isDomesticated) + { + levelFound = LevelHatched; + return; + } + if (isBred || tamingEff < 0) return; if (levelStep.HasValue) From c706a0353aa4f4eb231091ba20b236314fec86be Mon Sep 17 00:00:00 2001 From: cadon Date: Sat, 25 Mar 2023 12:19:36 +0100 Subject: [PATCH 5/8] order temp creature values --- ARKBreedingStats/Form1.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ARKBreedingStats/Form1.cs b/ARKBreedingStats/Form1.cs index 97b012e4..81141477 100644 --- a/ARKBreedingStats/Form1.cs +++ b/ARKBreedingStats/Form1.cs @@ -2862,7 +2862,8 @@ private void SetCreatureValuesToInfoInput(CreatureValues cv, CreatureInfoInput i private void toolStripButtonSaveCreatureValuesTemp_Click(object sender, EventArgs e) { - _creatureCollection.creaturesValues.Add(GetCreatureValuesFromExtractor()); + _creatureCollection.creaturesValues = _creatureCollection.creaturesValues.Append(GetCreatureValuesFromExtractor()) + .OrderBy(c => c.Species?.DescriptiveNameAndMod).ThenBy(c => c.name).ToList(); SetCollectionChanged(true); UpdateTempCreatureDropDown(); } From 1c0ac1608eddc9713bf0d7791c8647861932ec23 Mon Sep 17 00:00:00 2001 From: cadon Date: Sat, 25 Mar 2023 13:26:26 +0100 Subject: [PATCH 6/8] option to reset multiplier to game default by holding control --- ARKBreedingStats/ARKBreedingStats.csproj | 1 + ARKBreedingStats/Form1.cs | 2 + .../StatMultiplierTestingControl.cs | 59 +++++++++++++++---- .../StatsMultiplierTesting.Designer.cs | 27 +++++---- .../StatsMultiplierTesting.cs | 10 ++++ 5 files changed, 73 insertions(+), 26 deletions(-) diff --git a/ARKBreedingStats/ARKBreedingStats.csproj b/ARKBreedingStats/ARKBreedingStats.csproj index 4f62cf4f..630ee8ff 100644 --- a/ARKBreedingStats/ARKBreedingStats.csproj +++ b/ARKBreedingStats/ARKBreedingStats.csproj @@ -56,6 +56,7 @@ ARKSmartBreeding.ico + diff --git a/ARKBreedingStats/Form1.cs b/ARKBreedingStats/Form1.cs index 81141477..d12b77b3 100644 --- a/ARKBreedingStats/Form1.cs +++ b/ARKBreedingStats/Form1.cs @@ -315,6 +315,8 @@ private void Form1_Load(object sender, EventArgs e) Environment.Exit(1); } + statsMultiplierTesting1.SetGameDefaultMultiplier(); + for (int s = 0; s < Stats.StatsCount; s++) { _statIOs[s].Input = 0; diff --git a/ARKBreedingStats/multiplierTesting/StatMultiplierTestingControl.cs b/ARKBreedingStats/multiplierTesting/StatMultiplierTestingControl.cs index d28c067f..35f2e1ef 100644 --- a/ARKBreedingStats/multiplierTesting/StatMultiplierTestingControl.cs +++ b/ARKBreedingStats/multiplierTesting/StatMultiplierTestingControl.cs @@ -1,9 +1,9 @@ using ARKBreedingStats.miscClasses; using ARKBreedingStats.uiControls; using System; -using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; +using System.Windows.Input; namespace ARKBreedingStats.multiplierTesting { @@ -68,7 +68,14 @@ public partial class StatMultiplierTestingControl : UserControl /// Singleplayer extra multiplier for taming multiplier. /// private double _spTm; + /// + /// Values of currently saved settings. + /// private double[] _multipliersOfSettings; + /// + /// Values of default game values. + /// + public double[] StatMultipliersGameDefault; /// /// The values of this stat. 0: Base, 1: Iw, 2: Id, 3: Ta, 4: Tm @@ -490,30 +497,56 @@ private void calculateIBMToolStripMenuItem_Click(object sender, EventArgs e) private void resetIwMToolStripMenuItem_Click(object sender, EventArgs e) { - nudIwM.Value = (decimal)_multipliersOfSettings[3]; + ResetMultiplier(3, Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Control)); } private void resetTaMToolStripMenuItem_Click(object sender, EventArgs e) { - nudTaM.Value = (decimal)_multipliersOfSettings[0]; + ResetMultiplier(0, Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Control)); } private void resetTmMToolStripMenuItem_Click(object sender, EventArgs e) { - nudTmM.Value = (decimal)_multipliersOfSettings[1]; + ResetMultiplier(1, Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Control)); } private void resetIdMToolStripMenuItem_Click(object sender, EventArgs e) { - nudIdM.Value = (decimal)_multipliersOfSettings[2]; + ResetMultiplier(2, Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Control)); } private void resetAllMultiplierOfThisStatToolStripMenuItem_Click(object sender, EventArgs e) { - nudTaM.Value = (decimal)_multipliersOfSettings[0]; - nudTmM.Value = (decimal)_multipliersOfSettings[1]; - nudIdM.Value = (decimal)_multipliersOfSettings[2]; - nudIwM.Value = (decimal)_multipliersOfSettings[3]; + ResetMultiplier(-1, Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Control)); + } + + /// + /// Reset multiplier value to the current value in the settings, if gameDefault is true, the game default values are used. + /// + private void ResetMultiplier(int index, bool gameDefault = false) + { + switch (index) + { + case 0: + nudTaM.Value = (decimal)(gameDefault ? StatMultipliersGameDefault[0] : _multipliersOfSettings[0]); + return; + case 1: + nudTmM.Value = (decimal)(gameDefault ? StatMultipliersGameDefault[1] : _multipliersOfSettings[1]); + return; + case 2: + nudIdM.Value = (decimal)(gameDefault ? StatMultipliersGameDefault[2] : _multipliersOfSettings[2]); + return; + case 3: + nudIwM.Value = (decimal)(gameDefault ? StatMultipliersGameDefault[3] : _multipliersOfSettings[3]); + return; + case -1: + // set all + nudTaM.Value = (decimal)(gameDefault ? StatMultipliersGameDefault[0] : _multipliersOfSettings[0]); + nudTmM.Value = (decimal)(gameDefault ? StatMultipliersGameDefault[1] : _multipliersOfSettings[1]); + nudIdM.Value = (decimal)(gameDefault ? StatMultipliersGameDefault[2] : _multipliersOfSettings[2]); + nudIwM.Value = (decimal)(gameDefault ? StatMultipliersGameDefault[3] : _multipliersOfSettings[3]); + return; + } } private void setWildLevelToClosestValueToolStripMenuItem_Click(object sender, EventArgs e) @@ -711,7 +744,7 @@ private void btCalculateIwM_Click(object sender, EventArgs e) private void btResetIwM_Click(object sender, EventArgs e) { - nudIwM.Value = (decimal)_multipliersOfSettings[3]; + ResetMultiplier(3, Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Control)); } private void btCalculateTaM_Click(object sender, EventArgs e) @@ -721,7 +754,7 @@ private void btCalculateTaM_Click(object sender, EventArgs e) private void btResetTaM_Click(object sender, EventArgs e) { - nudTaM.Value = (decimal)_multipliersOfSettings[0]; + ResetMultiplier(0, Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Control)); } private void btCalculateTmM_Click(object sender, EventArgs e) @@ -731,7 +764,7 @@ private void btCalculateTmM_Click(object sender, EventArgs e) private void btResetTmM_Click(object sender, EventArgs e) { - nudTmM.Value = (decimal)_multipliersOfSettings[1]; + ResetMultiplier(1, Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Control)); } private void btCalculateDomLevel_Click(object sender, EventArgs e) @@ -746,7 +779,7 @@ private void btCalculateIdM_Click(object sender, EventArgs e) private void btResetIdM_Click(object sender, EventArgs e) { - nudIdM.Value = (decimal)_multipliersOfSettings[2]; + ResetMultiplier(2, Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Control)); } private void btCalculateTE_Click(object sender, EventArgs e) diff --git a/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.Designer.cs b/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.Designer.cs index ba254021..317d9b11 100644 --- a/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.Designer.cs +++ b/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.Designer.cs @@ -43,6 +43,7 @@ private void InitializeComponent() this.rbTamed = new System.Windows.Forms.RadioButton(); this.rbWild = new System.Windows.Forms.RadioButton(); this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.LbCalculatedWildLevel = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.nudTE = new ARKBreedingStats.uiControls.Nud(); this.groupBox3 = new System.Windows.Forms.GroupBox(); @@ -89,7 +90,6 @@ private void InitializeComponent() this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.setAllWildLevelsToTheClosestValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.setAllDomLevelsToTheClosestValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.LbCalculatedWildLevel = new System.Windows.Forms.Label(); this.flowLayoutPanel1.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox5.SuspendLayout(); @@ -287,6 +287,15 @@ private void InitializeComponent() this.groupBox2.TabStop = false; this.groupBox2.Text = "TamingEffectiveness"; // + // LbCalculatedWildLevel + // + this.LbCalculatedWildLevel.AutoSize = true; + this.LbCalculatedWildLevel.Location = new System.Drawing.Point(104, 21); + this.LbCalculatedWildLevel.Name = "LbCalculatedWildLevel"; + this.LbCalculatedWildLevel.Size = new System.Drawing.Size(13, 13); + this.LbCalculatedWildLevel.TabIndex = 3; + this.LbCalculatedWildLevel.Text = "0"; + // // label1 // this.label1.AutoSize = true; @@ -623,10 +632,11 @@ private void InitializeComponent() this.LbAbbreviations.AutoSize = true; this.LbAbbreviations.Location = new System.Drawing.Point(209, 188); this.LbAbbreviations.Name = "LbAbbreviations"; - this.LbAbbreviations.Size = new System.Drawing.Size(619, 13); + this.LbAbbreviations.Size = new System.Drawing.Size(780, 13); this.LbAbbreviations.TabIndex = 13; - this.LbAbbreviations.Text = "C: Calculate best value; R: Reset value; TE: Taming Effectivenes; IB: Imprinting " + - "Bonus; IBM: ~Multiplier; Trod: Troodonism-variant"; + this.LbAbbreviations.Text = "C: Calculate best value; R: Reset value (hold Ctrl to reset to game default); TE:" + + " Taming Effectivenes; IB: Imprinting Bonus; IBM: ~Multiplier; Trod: Troodonism-v" + + "ariant"; // // menuStrip1 // @@ -761,15 +771,6 @@ private void InitializeComponent() this.setAllDomLevelsToTheClosestValueToolStripMenuItem.Text = "Set all Dom levels to the closest value"; this.setAllDomLevelsToTheClosestValueToolStripMenuItem.Click += new System.EventHandler(this.setAllDomLevelsToTheClosestValueToolStripMenuItem_Click); // - // LbCalculatedWildLevel - // - this.LbCalculatedWildLevel.AutoSize = true; - this.LbCalculatedWildLevel.Location = new System.Drawing.Point(104, 21); - this.LbCalculatedWildLevel.Name = "LbCalculatedWildLevel"; - this.LbCalculatedWildLevel.Size = new System.Drawing.Size(13, 13); - this.LbCalculatedWildLevel.TabIndex = 3; - this.LbCalculatedWildLevel.Text = "0"; - // // StatsMultiplierTesting // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff --git a/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.cs b/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.cs index 6513da84..eaac235d 100644 --- a/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.cs +++ b/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.cs @@ -53,6 +53,16 @@ public StatsMultiplierTesting() gbFineAdjustment.Hide(); } + internal void SetGameDefaultMultiplier() + { + var officialSm = Values.V.serverMultipliersPresets?.GetPreset(ServerMultipliersPresets.Official); + if (officialSm != null) + { + for (int s = 0; s < Stats.StatsCount; s++) + _statControls[s].StatMultipliersGameDefault = officialSm.statMultipliers[s]; + } + } + private void Sc_OnLevelChanged() { UpdateLevelSums(); From bed0475d04beabd6fcd210befc2d2a50918c6489 Mon Sep 17 00:00:00 2001 From: cadon Date: Sun, 26 Mar 2023 16:10:52 +0200 Subject: [PATCH 7/8] style --- .../StatMultiplierTestingControl.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/ARKBreedingStats/multiplierTesting/StatMultiplierTestingControl.cs b/ARKBreedingStats/multiplierTesting/StatMultiplierTestingControl.cs index 35f2e1ef..d256364c 100644 --- a/ARKBreedingStats/multiplierTesting/StatMultiplierTestingControl.cs +++ b/ARKBreedingStats/multiplierTesting/StatMultiplierTestingControl.cs @@ -525,26 +525,27 @@ private void resetAllMultiplierOfThisStatToolStripMenuItem_Click(object sender, /// private void ResetMultiplier(int index, bool gameDefault = false) { + var multipliersToUse = gameDefault ? StatMultipliersGameDefault : _multipliersOfSettings; switch (index) { case 0: - nudTaM.Value = (decimal)(gameDefault ? StatMultipliersGameDefault[0] : _multipliersOfSettings[0]); + nudTaM.Value = (decimal)multipliersToUse[0]; return; case 1: - nudTmM.Value = (decimal)(gameDefault ? StatMultipliersGameDefault[1] : _multipliersOfSettings[1]); + nudTmM.Value = (decimal)multipliersToUse[1]; return; case 2: - nudIdM.Value = (decimal)(gameDefault ? StatMultipliersGameDefault[2] : _multipliersOfSettings[2]); + nudIdM.Value = (decimal)multipliersToUse[2]; return; case 3: - nudIwM.Value = (decimal)(gameDefault ? StatMultipliersGameDefault[3] : _multipliersOfSettings[3]); + nudIwM.Value = (decimal)multipliersToUse[3]; return; case -1: // set all - nudTaM.Value = (decimal)(gameDefault ? StatMultipliersGameDefault[0] : _multipliersOfSettings[0]); - nudTmM.Value = (decimal)(gameDefault ? StatMultipliersGameDefault[1] : _multipliersOfSettings[1]); - nudIdM.Value = (decimal)(gameDefault ? StatMultipliersGameDefault[2] : _multipliersOfSettings[2]); - nudIwM.Value = (decimal)(gameDefault ? StatMultipliersGameDefault[3] : _multipliersOfSettings[3]); + nudTaM.Value = (decimal)multipliersToUse[0]; + nudTmM.Value = (decimal)multipliersToUse[1]; + nudIdM.Value = (decimal)multipliersToUse[2]; + nudIwM.Value = (decimal)multipliersToUse[3]; return; } } From febae287d0598244860b9175d3bf6b82fe8d7e9c Mon Sep 17 00:00:00 2001 From: cadon Date: Sun, 26 Mar 2023 16:12:08 +0200 Subject: [PATCH 8/8] ver --- ARKBreedingStats/Properties/AssemblyInfo.cs | 2 +- ARKBreedingStats/_manifest.json | 2 +- ARKBreedingStats/json/values/_manifest.json | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ARKBreedingStats/Properties/AssemblyInfo.cs b/ARKBreedingStats/Properties/AssemblyInfo.cs index 2ae2d0c3..db5fe5b1 100644 --- a/ARKBreedingStats/Properties/AssemblyInfo.cs +++ b/ARKBreedingStats/Properties/AssemblyInfo.cs @@ -30,6 +30,6 @@ // Revision // [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("0.51.0.0")] +[assembly: AssemblyFileVersion("0.51.1.0")] [assembly: NeutralResourcesLanguage("en")] diff --git a/ARKBreedingStats/_manifest.json b/ARKBreedingStats/_manifest.json index 5baa1965..da78a9de 100644 --- a/ARKBreedingStats/_manifest.json +++ b/ARKBreedingStats/_manifest.json @@ -4,7 +4,7 @@ "ARK Smart Breeding": { "Id": "ARK Smart Breeding", "Category": "main", - "version": "0.51.0.0" + "version": "0.51.1.0" }, "SpeciesColorImages": { "Id": "SpeciesColorImages", diff --git a/ARKBreedingStats/json/values/_manifest.json b/ARKBreedingStats/json/values/_manifest.json index c597b73c..439e455e 100644 --- a/ARKBreedingStats/json/values/_manifest.json +++ b/ARKBreedingStats/json/values/_manifest.json @@ -35,7 +35,7 @@ "mod": { "id": "1139775728", "tag": "Confuciusornis", "title": "Confuciusornis" } }, "1169020368-Trex.json": { - "version": "357.3.1678038097", + "version": "357.4.1679236349", "mod": { "id": "1169020368", "tag": "Trex", "title": "Ark Creature Rebalance (AG Reborn)" } }, "1178308359-ShadDragon.json": { @@ -72,7 +72,7 @@ "mod": { "id": "1356703358", "tag": "Primal_Fear_Noxious_Creatures", "title": "Primal Fear Noxious Creatures" } }, "1373744537-AC2.json": { - "version": "356.11.1676323618", + "version": "357.4.1679590122", "mod": { "id": "1373744537", "tag": "AC2", "title": "Additional Creatures 2: Wild Ark" } }, "1379111008-RealismPlus.json": { @@ -104,7 +104,7 @@ "mod": { "id": "1522327484", "tag": "Additions_Pack", "title": "ARK Additions!" } }, "1523045986-Paranoia.json": { - "version": "356.5.1668722824", + "version": "357.4.1679444826", "mod": { "id": "1523045986", "tag": "Paranoia", "title": "Additional Creatures 2: Paranoia!" } }, "1565015734-BetterDinosTest.json": { @@ -145,7 +145,7 @@ "mod": { "id": "1662691167", "tag": "Senior", "title": "Additional Creatures: Senior Class" } }, "1675895024-NoUntameables.json": { - "version": "356.5.1675695969", + "version": "357.4.1678903474", "mod": { "id": "1675895024", "tag": "NoUntameables", "title": "No Untameables" } }, "1676159020-Aquaria.json": { @@ -243,7 +243,7 @@ "mod": { "id": "2000326197", "tag": "ExtraResources", "title": "Event Assets" } }, "2003934830-Beasts.json": { - "version": "356.12.1677099299", + "version": "357.4.1678923214", "mod": { "id": "2003934830", "tag": "Beasts", "title": "Prehistoric Beasts" } }, "2019846325-ApexMod.json": { @@ -331,7 +331,7 @@ "mod": { "id": "883957187", "tag": "WyvernWorld", "title": "Wyvern World" } }, "893735676-AE.json": { - "version": "356.5.1675949309", + "version": "357.5.1679775865", "mod": { "id": "893735676", "tag": "AE", "title": "Ark Eternal" } }, "895711211-ClassicFlyers.json": {