From fac92189d593d3fccd598a2b21aee2e7c7b82d28 Mon Sep 17 00:00:00 2001 From: cadaei Date: Sun, 8 Jan 2017 13:41:16 +0100 Subject: [PATCH] fix for level-bar-maxWidth. fix for setting multipliers to official values. fix of too many decimals of imprintingBonus. fix for cuddleIntervall-Setting, also increase decimals to 3. --- ARKBreedingStats/Extraction.cs | 6 +- ARKBreedingStats/Form1.cs | 19 ++++-- ARKBreedingStats/Properties/AssemblyInfo.cs | 2 +- ARKBreedingStats/Settings.Designer.cs | 72 ++++++++++----------- ARKBreedingStats/Settings.cs | 11 ++-- ARKBreedingStats/StatIO.cs | 6 +- ARKBreedingStats/Values.cs | 12 ++++ ARKBreedingStats/ver.txt | 2 +- 8 files changed, 74 insertions(+), 56 deletions(-) diff --git a/ARKBreedingStats/Extraction.cs b/ARKBreedingStats/Extraction.cs index 81757caf..3ae9d81c 100644 --- a/ARKBreedingStats/Extraction.cs +++ b/ARKBreedingStats/Extraction.cs @@ -182,7 +182,11 @@ public void extractLevels(int speciesI, int level, List statIOs, double if (imprintingBonusRounded == 1) imprintingBonus = 1; else if (Values.V.species[speciesI].breeding != null && Values.V.species[speciesI].breeding.maturationTimeAdjusted > 0) - imprintingBonus = Math.Round(imprintingBonusRounded * Values.V.species[speciesI].breeding.maturationTimeAdjusted * cuddleIntervalMultiplier / 14400) * 14400 / (Values.V.species[speciesI].breeding.maturationTimeAdjusted * cuddleIntervalMultiplier); + { + imprintingBonus = Math.Round(Math.Round(imprintingBonusRounded * Values.V.species[speciesI].breeding.maturationTimeAdjusted / (14400 * cuddleIntervalMultiplier)) * 14400 * cuddleIntervalMultiplier / (Values.V.species[speciesI].breeding.maturationTimeAdjusted), 4); + if (imprintingBonus > 1) + imprintingBonus = 1; + } else imprintingBonus = 0; double imprintingMultiplier = (1 + imprintingBonus * imprintingBonusMultiplier * .2); diff --git a/ARKBreedingStats/Form1.cs b/ARKBreedingStats/Form1.cs index 61eb9dce..51851fcd 100644 --- a/ARKBreedingStats/Form1.cs +++ b/ARKBreedingStats/Form1.cs @@ -209,7 +209,7 @@ private void Form1_Load(object sender, EventArgs e) // check for updates DateTime lastUpdateCheck = Properties.Settings.Default.lastUpdateCheck; - if (DateTime.Now.AddDays(-7) > lastUpdateCheck) + if (DateTime.Now.AddDays(-3) > lastUpdateCheck) checkForUpdates(true); //// TODO: debug-numbers @@ -479,7 +479,7 @@ private void extractionFailed() labelErrorHelp.Visible = true; groupBoxPossibilities.Visible = false; labelDoc.Visible = false; - if (numericUpDownImprintingBonusExtractor.Value > 0) + if (checkBoxAlreadyBred.Checked && numericUpDownImprintingBonusExtractor.Value > 0) labelImprintingFailInfo.Visible = true; } @@ -1085,7 +1085,7 @@ private void loadCollectionFile(string fileName, bool keepCurrentCreatures = fal { creatureCollection.multipliers = oldMultipliers; if (creatureCollection.multipliers == null) - creatureCollection.multipliers = Values.V.statMultipliers; + creatureCollection.multipliers = Values.V.getOfficialMultipliers(); } applyMultipliersToValues(); @@ -1111,8 +1111,8 @@ private void loadCollectionFile(string fileName, bool keepCurrentCreatures = fal creatureBoxListView.CreatureCollection = creatureCollection; for (int s = 0; s < 8; s++) { - statIOs[s].cc = creatureCollection; - testingIOs[s].cc = creatureCollection; + statIOs[s].barMaxLevel = creatureCollection.maxWildLevel / 3; + testingIOs[s].barMaxLevel = creatureCollection.maxWildLevel / 3; } lastAutoSaveBackup = DateTime.Now.AddMinutes(-10); @@ -1493,12 +1493,12 @@ private void newCollection() { if (collectionDirty) { - if (MessageBox.Show("Your Creature Collection has been modified since it was last saved, are you sure you want to discard your changes and quit without saving?", "Discard Changes?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.No) + if (MessageBox.Show("Your Creature Collection has been modified since it was last saved, are you sure you want to discard your changes and create a new Library without saving?", "Discard Changes?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.No) return; } if (creatureCollection.multipliers == null) - creatureCollection.multipliers = Values.V.statMultipliers; + creatureCollection.multipliers = Values.V.getOfficialMultipliers(); // use previously used multipliers again in the new file double[][] oldMultipliers = creatureCollection.multipliers; @@ -2630,6 +2630,11 @@ private void settingsToolStripMenuItem_Click(object sender, EventArgs e) creatureBoxListView.maxDomLevel = creatureCollection.maxDomLevel; breedingPlan1.maxSuggestions = creatureCollection.maxBreedingSuggestions; fileSync.changeFile(currentFileName); + for (int s = 0; s < 8; s++) + { + statIOs[s].barMaxLevel = creatureCollection.maxWildLevel / 3; + testingIOs[s].barMaxLevel = creatureCollection.maxWildLevel / 3; + } setCollectionChanged(true); } } diff --git a/ARKBreedingStats/Properties/AssemblyInfo.cs b/ARKBreedingStats/Properties/AssemblyInfo.cs index 0090408b..4895dff3 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.20.8.2")] +[assembly: AssemblyFileVersion("0.20.8.3")] diff --git a/ARKBreedingStats/Settings.Designer.cs b/ARKBreedingStats/Settings.Designer.cs index 2e31dd24..fb6e27db 100644 --- a/ARKBreedingStats/Settings.Designer.cs +++ b/ARKBreedingStats/Settings.Designer.cs @@ -46,6 +46,8 @@ private void InitializeComponent() this.label5 = new System.Windows.Forms.Label(); this.numericUpDownAutosaveMinutes = new System.Windows.Forms.NumericUpDown(); this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.label17 = new System.Windows.Forms.Label(); + this.numericUpDownBabyCuddleIntervalMultiplier = new System.Windows.Forms.NumericUpDown(); this.label13 = new System.Windows.Forms.Label(); this.numericUpDownImprintingM = new System.Windows.Forms.NumericUpDown(); this.label9 = new System.Windows.Forms.Label(); @@ -69,8 +71,6 @@ private void InitializeComponent() this.numericUpDownTamingFoodRate = new System.Windows.Forms.NumericUpDown(); this.numericUpDownTamingSpeed = new System.Windows.Forms.NumericUpDown(); this.label15 = new System.Windows.Forms.Label(); - this.label17 = new System.Windows.Forms.Label(); - this.numericUpDownBabyCuddleIntervalMultiplier = new System.Windows.Forms.NumericUpDown(); this.multiplierSettingTo = new ARKBreedingStats.MultiplierSetting(); this.multiplierSettingSp = new ARKBreedingStats.MultiplierSetting(); this.multiplierSettingDm = new ARKBreedingStats.MultiplierSetting(); @@ -83,6 +83,7 @@ private void InitializeComponent() this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownAutosaveMinutes)).BeginInit(); this.groupBox2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownBabyCuddleIntervalMultiplier)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownImprintingM)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMaturation)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownHatching)).BeginInit(); @@ -94,7 +95,6 @@ private void InitializeComponent() this.groupBox5.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTamingFoodRate)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTamingSpeed)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownBabyCuddleIntervalMultiplier)).BeginInit(); this.SuspendLayout(); // // groupBoxMultiplier @@ -299,6 +299,33 @@ private void InitializeComponent() this.groupBox2.TabStop = false; this.groupBox2.Text = "Breeding-Multiplier"; // + // label17 + // + this.label17.AutoSize = true; + this.label17.Location = new System.Drawing.Point(5, 99); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(80, 13); + this.label17.TabIndex = 6; + this.label17.Text = "Cuddle Intervall"; + // + // numericUpDownBabyCuddleIntervalMultiplier + // + this.numericUpDownBabyCuddleIntervalMultiplier.DecimalPlaces = 3; + this.numericUpDownBabyCuddleIntervalMultiplier.Location = new System.Drawing.Point(166, 97); + this.numericUpDownBabyCuddleIntervalMultiplier.Maximum = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.numericUpDownBabyCuddleIntervalMultiplier.Name = "numericUpDownBabyCuddleIntervalMultiplier"; + this.numericUpDownBabyCuddleIntervalMultiplier.Size = new System.Drawing.Size(57, 20); + this.numericUpDownBabyCuddleIntervalMultiplier.TabIndex = 7; + this.numericUpDownBabyCuddleIntervalMultiplier.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + // // label13 // this.label13.AutoSize = true; @@ -310,7 +337,7 @@ private void InitializeComponent() // // numericUpDownImprintingM // - this.numericUpDownImprintingM.DecimalPlaces = 2; + this.numericUpDownImprintingM.DecimalPlaces = 3; this.numericUpDownImprintingM.Location = new System.Drawing.Point(167, 71); this.numericUpDownImprintingM.Maximum = new decimal(new int[] { 1000, @@ -338,7 +365,7 @@ private void InitializeComponent() // // numericUpDownMaturation // - this.numericUpDownMaturation.DecimalPlaces = 2; + this.numericUpDownMaturation.DecimalPlaces = 3; this.numericUpDownMaturation.Location = new System.Drawing.Point(167, 45); this.numericUpDownMaturation.Maximum = new decimal(new int[] { 1000, @@ -366,7 +393,7 @@ private void InitializeComponent() // // numericUpDownHatching // - this.numericUpDownHatching.DecimalPlaces = 2; + this.numericUpDownHatching.DecimalPlaces = 3; this.numericUpDownHatching.Location = new System.Drawing.Point(167, 19); this.numericUpDownHatching.Maximum = new decimal(new int[] { 1000, @@ -540,7 +567,7 @@ private void InitializeComponent() // // numericUpDownTamingFoodRate // - this.numericUpDownTamingFoodRate.DecimalPlaces = 2; + this.numericUpDownTamingFoodRate.DecimalPlaces = 3; this.numericUpDownTamingFoodRate.Location = new System.Drawing.Point(167, 45); this.numericUpDownTamingFoodRate.Maximum = new decimal(new int[] { 1000, @@ -559,7 +586,7 @@ private void InitializeComponent() // // numericUpDownTamingSpeed // - this.numericUpDownTamingSpeed.DecimalPlaces = 2; + this.numericUpDownTamingSpeed.DecimalPlaces = 3; this.numericUpDownTamingSpeed.Location = new System.Drawing.Point(167, 19); this.numericUpDownTamingSpeed.Maximum = new decimal(new int[] { 1000, @@ -584,33 +611,6 @@ private void InitializeComponent() 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 read their values."; - // - // label17 - // - this.label17.AutoSize = true; - this.label17.Location = new System.Drawing.Point(5, 99); - this.label17.Name = "label17"; - this.label17.Size = new System.Drawing.Size(80, 13); - this.label17.TabIndex = 6; - this.label17.Text = "Cuddle Intervall"; - // - // numericUpDownBabyCuddleIntervalMultiplier - // - this.numericUpDownBabyCuddleIntervalMultiplier.DecimalPlaces = 2; - this.numericUpDownBabyCuddleIntervalMultiplier.Location = new System.Drawing.Point(166, 97); - this.numericUpDownBabyCuddleIntervalMultiplier.Maximum = new decimal(new int[] { - 1000, - 0, - 0, - 0}); - this.numericUpDownBabyCuddleIntervalMultiplier.Name = "numericUpDownBabyCuddleIntervalMultiplier"; - this.numericUpDownBabyCuddleIntervalMultiplier.Size = new System.Drawing.Size(57, 20); - this.numericUpDownBabyCuddleIntervalMultiplier.TabIndex = 7; - this.numericUpDownBabyCuddleIntervalMultiplier.Value = new decimal(new int[] { - 1, - 0, - 0, - 0}); // // multiplierSettingTo // @@ -738,6 +738,7 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.numericUpDownAutosaveMinutes)).EndInit(); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownBabyCuddleIntervalMultiplier)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownImprintingM)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMaturation)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownHatching)).EndInit(); @@ -752,7 +753,6 @@ private void InitializeComponent() this.groupBox5.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTamingFoodRate)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTamingSpeed)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownBabyCuddleIntervalMultiplier)).EndInit(); this.ResumeLayout(false); } diff --git a/ARKBreedingStats/Settings.cs b/ARKBreedingStats/Settings.cs index 96f95037..49a4e09d 100644 --- a/ARKBreedingStats/Settings.cs +++ b/ARKBreedingStats/Settings.cs @@ -79,7 +79,8 @@ private void saveSettings() { for (int s = 0; s < 8; s++) { - cc.multipliers[s] = multSetter[s].Multipliers; + for (int sm = 0; sm < 4; sm++) + cc.multipliers[s][sm] = multSetter[s].Multipliers[sm]; } cc.breedingMultipliers[0] = (double)numericUpDownHatching.Value; cc.breedingMultipliers[1] = (double)numericUpDownMaturation.Value; @@ -113,15 +114,11 @@ private void buttonAllToOne_Click(object sender, EventArgs e) private void buttonSetToOfficial_Click(object sender, EventArgs e) { - cc.multipliers = Values.V.statMultipliers; - if (cc.multipliers.Length > 7) + if (Values.V.statMultipliers.Length > 7) { for (int s = 0; s < 8; s++) { - if (cc.multipliers[s].Length > 3) - { - multSetter[s].Multipliers = cc.multipliers[s]; - } + multSetter[s].Multipliers = Values.V.statMultipliers[s]; } } } diff --git a/ARKBreedingStats/StatIO.cs b/ARKBreedingStats/StatIO.cs index e47b61ce..542e6601 100644 --- a/ARKBreedingStats/StatIO.cs +++ b/ARKBreedingStats/StatIO.cs @@ -25,7 +25,7 @@ public partial class StatIO : UserControl public int statIndex; private bool domZeroFixed; ToolTip tt = new ToolTip(); - public CreatureCollection cc; + public int barMaxLevel = 45; public StatIO() { @@ -206,7 +206,7 @@ public void Clear() private void numLvW_ValueChanged(object sender, EventArgs e) { - int lengthPercentage = (int)((int)numLvW.Value * (300.0f / (cc!=null? cc.maxWildLevel:40))); // in percentage of the max-barwidth + int lengthPercentage = 100 * (int)numLvW.Value / barMaxLevel; // in percentage of the max-barwidth if (lengthPercentage > 100) { lengthPercentage = 100; } if (lengthPercentage < 0) { lengthPercentage = 0; } @@ -220,7 +220,7 @@ private void numLvW_ValueChanged(object sender, EventArgs e) private void numLvD_ValueChanged(object sender, EventArgs e) { - int lengthPercentage = (int)((int)numLvD.Value * (300.0f / (cc!=null? cc.maxWildLevel:40))); // in percentage of the max-barwidth + int lengthPercentage = 100 * (int)numLvD.Value / barMaxLevel; // in percentage of the max-barwidth if (lengthPercentage > 100) { lengthPercentage = 100; } if (lengthPercentage < 0) { lengthPercentage = 0; } diff --git a/ARKBreedingStats/Values.cs b/ARKBreedingStats/Values.cs index 78ce72c3..53faf696 100644 --- a/ARKBreedingStats/Values.cs +++ b/ARKBreedingStats/Values.cs @@ -124,5 +124,17 @@ public void applyMultipliersToBreedingTimes(double[] multipliers) } } + public double[][] getOfficialMultipliers() + { + double[][] offMultipliers = new double[8][]; + for (int s = 0; s < 8; s++) + { + offMultipliers[s] = new double[4]; + for (int sm = 0; sm < 4; sm++) + offMultipliers[s][sm] = statMultipliers[s][sm]; + } + return offMultipliers; + } + } } diff --git a/ARKBreedingStats/ver.txt b/ARKBreedingStats/ver.txt index 4e893d63..6565605b 100644 --- a/ARKBreedingStats/ver.txt +++ b/ARKBreedingStats/ver.txt @@ -1 +1 @@ -2530000,0.20.8.2 \ No newline at end of file +2530000,0.20.8.3 \ No newline at end of file