diff --git a/ARKBreedingStats/CreatureInfoInput.cs b/ARKBreedingStats/CreatureInfoInput.cs index 501cbed7..83b94967 100644 --- a/ARKBreedingStats/CreatureInfoInput.cs +++ b/ARKBreedingStats/CreatureInfoInput.cs @@ -19,6 +19,8 @@ public partial class CreatureInfoInput : UserControl public event Save2LibraryClickedEventHandler Save2Library_Clicked; public delegate void RequestParentListEventHandler(CreatureInfoInput sender); public event RequestParentListEventHandler ParentListRequested; + public delegate void RequestCreatureDataEventHandler(CreatureInfoInput sender); + public event RequestCreatureDataEventHandler CreatureDataRequested; public bool extractor; private Sex sex; private CreatureStatus status; @@ -320,45 +322,178 @@ private void numericUpDownMutations_ValueChanged(object sender, EventArgs e) private void btnGenerateUniqueName_Click(object sender, EventArgs e) { - if (speciesIndex < 0 || speciesIndex > Values.V.species.Count - 1) return; + if (speciesIndex >= 0 && speciesIndex < Values.V.species.Count) + { + CreatureDataRequested?.Invoke(this); + } + } + + /// + /// Generates a creature name with a given pattern + /// + public void generateCreatureName(Creature creature) + { + try + { + // collect creatures of the same species + var sameSpecies = (_females ?? new List { }).Concat((_males ?? new List { })).ToList(); + var names = sameSpecies.Select(x => x.name).ToArray(); + + var tokenDictionary = createTokenDictionary(creature, names); + var name = assemblePatternedName(tokenDictionary); + + if (name.Contains("{n}")) + { + // find the sequence token, and if not, return because the configurated pattern string is invalid without it + var index = name.IndexOf("{n}", StringComparison.OrdinalIgnoreCase); + var patternStart = name.Substring(0, index); + var patternEnd = name.Substring(index + 3); + + // loop until we find a unique name in the sequence which is not taken + + var n = 1; + do + { + name = string.Concat(patternStart, n, patternEnd); + n++; + } while (names.Contains(name, StringComparer.OrdinalIgnoreCase)); + } - // collect creatures of the same species - var sameSpecies = (_females ?? new List { }).Concat((_males ?? new List { })).ToList(); - var names = sameSpecies.Select(x => x.name).ToArray(); + //TODO SkyDotNET: Add the following notices to the UI instead of showing a messagebox + if (names.Contains(name, StringComparer.OrdinalIgnoreCase)) + { + MessageBox.Show("WARNING: The generated name for the creature already exists in the database."); + } + else if (name.Length > 24) + { + MessageBox.Show("WARNING: The generated name is longer than 24 characters, ingame-preview:" + name.Substring(0, 24)); + } + + CreatureName = name; + } + catch + { + MessageBox.Show("There was an error while generating the creature name."); + } + } + + /// + /// This method creates the token dictionary for the dynamic creature name generation. + /// + /// Creature with the data + /// A list of all name of the currently stored creatures + /// A dictionary containing all tokens and their replacements + private Dictionary createTokenDictionary(Creature creature, string[] creatureNames) + { + var date_short = DateTime.Now.ToString("yy-MM-dd"); + var date_compressed = date_short.Replace("-", ""); + var time_short = DateTime.Now.ToString("hh:mm:ss"); + var time_compressed = time_short.Replace(":", ""); + + string hp = creature.levelsWild[0].ToString().PadLeft(2, '0'); + string stam = creature.levelsWild[1].ToString().PadLeft(2, '0'); + string oxy = creature.levelsWild[2].ToString().PadLeft(2, '0'); + string food = creature.levelsWild[3].ToString().PadLeft(2, '0'); + string weight = creature.levelsWild[4].ToString().PadLeft(2, '0'); + string dmg = creature.levelsWild[5].ToString().PadLeft(2, '0'); + string spd = creature.levelsWild[6].ToString().PadLeft(2, '0'); + string trp = creature.levelsWild[7].ToString().PadLeft(2, '0'); + + double imp = creature.imprintingBonus * 100; + double eff = creature.tamingEff * 100; + + var rand = new Random(DateTime.Now.Millisecond); + var randStr = rand.Next(100000, 999999).ToString(); + + string effImp = "Z"; + string prefix = ""; + if (imp > 0) + { + prefix = "I"; + effImp = Math.Round(imp).ToString(); + } + else if (eff > 1) + { + prefix = "E"; + effImp = Math.Round(eff).ToString(); + } + + while (effImp.Length < 3 && effImp != "Z") + { + effImp = "0" + effImp; + } + + effImp = prefix + effImp; + + var precompressed = + CreatureSex.ToString().Substring(0, 1) + + date_compressed + + hp + + stam + + oxy + + food + + weight + + dmg + + effImp; + + var spcShort = Values.V.species[speciesIndex].name.Replace(" ", ""); + var speciesShort = spcShort; + var vowels = new string[] { "a", "e", "i", "o", "u" }; + while (spcShort.Length > 4 && spcShort.LastIndexOfAny(new char[] { 'a', 'e', 'i', 'o', 'u' }) > 0) + spcShort = spcShort.Remove(spcShort.LastIndexOfAny(new char[] { 'a', 'e', 'i', 'o', 'u' }), 1); // remove last vowel (not the first letter) + spcShort = spcShort.Substring(0, Math.Min(4, spcShort.Length)); + + speciesShort = speciesShort.Substring(0, Math.Min(4, speciesShort.Length)); // replace tokens in user configurated pattern string - var tokendict = new Dictionary(StringComparer.OrdinalIgnoreCase) + return new Dictionary(StringComparer.OrdinalIgnoreCase) { { "species", Values.V.species[speciesIndex].name }, + { "spcs_short", spcShort }, + { "spcs_shortu", spcShort.ToUpper() }, + { "species_short", speciesShort }, + { "species_shortu", speciesShort.ToUpper() }, { "sex", CreatureSex.ToString() }, - { "sex_short", CreatureSex.ToString().Substring(0, 1) } + { "sex_short", CreatureSex.ToString().Substring(0, 1) }, + { "cpr" , precompressed }, + { "date_short" , date_short }, + { "date_compressed" , date_compressed }, + { "times_short" , time_short }, + { "times_compressed" , time_compressed }, + { "time_short",time_short.Substring(0,5)}, + { "time_compressed",time_compressed.Substring(0,4)}, + { "hp" , hp }, + { "stam" ,stam }, + { "oxy" , oxy }, + { "food" , food }, + { "weight" , weight }, + { "dmg" ,dmg }, + { "spd" , spd }, + { "trp" , trp }, + { "effImp" , effImp }, + { "rnd", randStr }, + { "tn", (creatureNames.Length + 1).ToString() } }; - var r = new Regex("\\{(?" + string.Join("|", tokendict.Keys.Select(x => Regex.Escape(x))) + ")\\}", - RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.ExplicitCapture); - var pattern = r.Replace(Properties.Settings.Default.sequentialUniqueNamePattern, (m) => - { - string replacement = null; - return tokendict.TryGetValue(m.Groups["key"].Value, out replacement) ? replacement : m.Value; - }); + } - // find the sequence token, and if not, return because the configurated pattern string is invalid without it - var index = pattern.IndexOf("{n}", StringComparison.OrdinalIgnoreCase); - if (index == -1) return; + /// + /// Assembles a string representing the desired creature name with the set token + /// + /// a collection of token and their replacements + /// The patterned name + private string assemblePatternedName(Dictionary tokenDictionary) + { + var regularExpression = "\\{(?" + string.Join("|", tokenDictionary.Keys.Select(x => Regex.Escape(x))) + ")\\}"; + var regularExpressionOptions = RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.ExplicitCapture; + var r = new Regex(regularExpression, regularExpressionOptions); - var patternStart = pattern.Substring(0, index); - var patternEnd = pattern.Substring(index + 3); + string savedPattern = Properties.Settings.Default.sequentialUniqueNamePattern; - // loop until we find a unique name in the sequence which is not taken - string name = null; - var n = 1; - do + return r.Replace(savedPattern, (m) => { - name = string.Concat(patternStart, n, patternEnd); - n++; - } while (names.Contains(name, StringComparer.OrdinalIgnoreCase)); - - // set the creature name - CreatureName = name; + string replacement = null; + return tokenDictionary.TryGetValue(m.Groups["key"].Value, out replacement) ? replacement : m.Value; + }); } } } diff --git a/ARKBreedingStats/Form1.Designer.cs b/ARKBreedingStats/Form1.Designer.cs index 5d1d97b4..e332d594 100644 --- a/ARKBreedingStats/Form1.Designer.cs +++ b/ARKBreedingStats/Form1.Designer.cs @@ -70,13 +70,13 @@ private void InitializeComponent() this.numericUpDownLowerTEffBound = new System.Windows.Forms.NumericUpDown(); this.label4 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); - this.label8 = new System.Windows.Forms.Label(); + this.lblTesterWildLevel = new System.Windows.Forms.Label(); + this.lblTesterDomLevel = new System.Windows.Forms.Label(); this.labelDoc = new System.Windows.Forms.Label(); this.labelFootnote = new System.Windows.Forms.Label(); this.labelHBV = new System.Windows.Forms.Label(); - this.labelHeaderD = new System.Windows.Forms.Label(); - this.labelHeaderW = new System.Windows.Forms.Label(); + this.lblExtractorDomLevel = new System.Windows.Forms.Label(); + this.lblExtractorWildLevel = new System.Windows.Forms.Label(); this.labelSum = new System.Windows.Forms.Label(); this.labelSumDom = new System.Windows.Forms.Label(); this.labelSumWild = new System.Windows.Forms.Label(); @@ -143,7 +143,8 @@ private void InitializeComponent() this.groupBoxTamingInfo = new System.Windows.Forms.GroupBox(); this.labelTamingInfo = new System.Windows.Forms.Label(); this.button2TamingCalc = new System.Windows.Forms.Button(); - this.groupBox7 = new System.Windows.Forms.GroupBox(); + this.gbStats = new System.Windows.Forms.GroupBox(); + this.label7 = new System.Windows.Forms.Label(); this.statIOHealth = new ARKBreedingStats.StatIO(); this.statIODamage = new ARKBreedingStats.StatIO(); this.statIOTorpor = new ARKBreedingStats.StatIO(); @@ -180,6 +181,7 @@ private void InitializeComponent() this.listViewLibrary = new System.Windows.Forms.ListView(); this.columnHeaderName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeaderOwner = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeaderNotes = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeaderSex = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeaderAdded = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeaderTopness = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); @@ -238,7 +240,6 @@ private void InitializeComponent() this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.toolStripProgressBar1 = new System.Windows.Forms.ToolStripProgressBar(); this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); - this.statTestingTamingEffectiveness = new System.Windows.Forms.NumericUpDown(); this.toolStrip2 = new System.Windows.Forms.ToolStrip(); this.newToolStripButton1 = new System.Windows.Forms.ToolStripButton(); this.openToolStripButton1 = new System.Windows.Forms.ToolStripButton(); @@ -289,7 +290,7 @@ private void InitializeComponent() this.groupBoxRadarChartExtractor.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.radarChartExtractor)).BeginInit(); this.groupBoxTamingInfo.SuspendLayout(); - this.groupBox7.SuspendLayout(); + this.gbStats.SuspendLayout(); this.tabPageLibrary.SuspendLayout(); this.tableLayoutPanelLibrary.SuspendLayout(); this.tabControlLibFilter.SuspendLayout(); @@ -310,7 +311,6 @@ private void InitializeComponent() this.tabPageNotes.SuspendLayout(); this.TabPageOCR.SuspendLayout(); this.statusStrip1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.statTestingTamingEffectiveness)).BeginInit(); this.toolStrip2.SuspendLayout(); this.panelToolBar.SuspendLayout(); this.SuspendLayout(); @@ -693,23 +693,23 @@ private void InitializeComponent() this.label5.TabIndex = 33; this.label5.Text = "Breeding Value"; // - // label7 + // lblTesterWildLevel // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(18, 16); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(45, 13); - this.label7.TabIndex = 31; - this.label7.Text = "Wild-Lvl"; + this.lblTesterWildLevel.AutoSize = true; + this.lblTesterWildLevel.Location = new System.Drawing.Point(18, 16); + this.lblTesterWildLevel.Name = "lblTesterWildLevel"; + this.lblTesterWildLevel.Size = new System.Drawing.Size(45, 13); + this.lblTesterWildLevel.TabIndex = 31; + this.lblTesterWildLevel.Text = "Wild-Lvl"; // - // label8 + // lblTesterDomLevel // - this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(73, 16); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(46, 13); - this.label8.TabIndex = 32; - this.label8.Text = "Dom-Lvl"; + this.lblTesterDomLevel.AutoSize = true; + this.lblTesterDomLevel.Location = new System.Drawing.Point(73, 16); + this.lblTesterDomLevel.Name = "lblTesterDomLevel"; + this.lblTesterDomLevel.Size = new System.Drawing.Size(46, 13); + this.lblTesterDomLevel.TabIndex = 32; + this.lblTesterDomLevel.Text = "Dom-Lvl"; // // labelDoc // @@ -736,23 +736,23 @@ private void InitializeComponent() this.labelHBV.TabIndex = 27; this.labelHBV.Text = "Breeding Value"; // - // labelHeaderD + // lblExtractorDomLevel // - this.labelHeaderD.AutoSize = true; - this.labelHeaderD.Location = new System.Drawing.Point(178, 16); - this.labelHeaderD.Name = "labelHeaderD"; - this.labelHeaderD.Size = new System.Drawing.Size(29, 13); - this.labelHeaderD.TabIndex = 26; - this.labelHeaderD.Text = "Dom"; + this.lblExtractorDomLevel.AutoSize = true; + this.lblExtractorDomLevel.Location = new System.Drawing.Point(176, 16); + this.lblExtractorDomLevel.Name = "lblExtractorDomLevel"; + this.lblExtractorDomLevel.Size = new System.Drawing.Size(46, 13); + this.lblExtractorDomLevel.TabIndex = 26; + this.lblExtractorDomLevel.Text = "Dom-Lvl"; // - // labelHeaderW + // lblExtractorWildLevel // - this.labelHeaderW.AutoSize = true; - this.labelHeaderW.Location = new System.Drawing.Point(129, 16); - this.labelHeaderW.Name = "labelHeaderW"; - this.labelHeaderW.Size = new System.Drawing.Size(28, 13); - this.labelHeaderW.TabIndex = 25; - this.labelHeaderW.Text = "Wild"; + this.lblExtractorWildLevel.AutoSize = true; + this.lblExtractorWildLevel.Location = new System.Drawing.Point(127, 16); + this.lblExtractorWildLevel.Name = "lblExtractorWildLevel"; + this.lblExtractorWildLevel.Size = new System.Drawing.Size(45, 13); + this.lblExtractorWildLevel.TabIndex = 25; + this.lblExtractorWildLevel.Text = "Wild-Lvl"; // // labelSum // @@ -1162,7 +1162,7 @@ private void InitializeComponent() // // groupBox2 // - this.groupBox2.Controls.Add(this.label7); + this.groupBox2.Controls.Add(this.lblTesterWildLevel); this.groupBox2.Controls.Add(this.labelTesterTotalLevel); this.groupBox2.Controls.Add(this.statTestingHealth); this.groupBox2.Controls.Add(this.labelDomLevelSum); @@ -1176,7 +1176,7 @@ private void InitializeComponent() this.groupBox2.Controls.Add(this.statTestingSpeed); this.groupBox2.Controls.Add(this.label5); this.groupBox2.Controls.Add(this.statTestingTorpor); - this.groupBox2.Controls.Add(this.label8); + this.groupBox2.Controls.Add(this.lblTesterDomLevel); this.groupBox2.Location = new System.Drawing.Point(8, 37); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(307, 492); @@ -1394,7 +1394,7 @@ private void InitializeComponent() // // creatureInfoInputTester // - this.creatureInfoInputTester.Cooldown = new System.DateTime(2017, 7, 24, 0, 32, 42, 295); + this.creatureInfoInputTester.Cooldown = new System.DateTime(2017, 8, 6, 19, 12, 17, 228); this.creatureInfoInputTester.CreatureName = ""; this.creatureInfoInputTester.CreatureNote = ""; this.creatureInfoInputTester.CreatureOwner = ""; @@ -1403,7 +1403,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, 7, 24, 0, 32, 42, 296); + this.creatureInfoInputTester.Grown = new System.DateTime(2017, 8, 6, 19, 12, 17, 228); this.creatureInfoInputTester.Location = new System.Drawing.Point(321, 184); this.creatureInfoInputTester.mother = null; this.creatureInfoInputTester.MutationCounter = 0; @@ -1423,7 +1423,7 @@ private void InitializeComponent() this.tabPageExtractor.Controls.Add(this.labelImprintingFailInfo); this.tabPageExtractor.Controls.Add(this.groupBoxTamingInfo); this.tabPageExtractor.Controls.Add(this.button2TamingCalc); - this.tabPageExtractor.Controls.Add(this.groupBox7); + this.tabPageExtractor.Controls.Add(this.gbStats); this.tabPageExtractor.Controls.Add(this.buttonExtract); this.tabPageExtractor.Controls.Add(this.checkBoxQuickWildCheck); this.tabPageExtractor.Controls.Add(this.panelWildTamedBred); @@ -1510,27 +1510,37 @@ private void InitializeComponent() this.button2TamingCalc.Visible = false; this.button2TamingCalc.Click += new System.EventHandler(this.button2TamingCalc_Click); // - // groupBox7 - // - this.groupBox7.Controls.Add(this.statIOHealth); - this.groupBox7.Controls.Add(this.statIODamage); - this.groupBox7.Controls.Add(this.statIOTorpor); - this.groupBox7.Controls.Add(this.statIOWeight); - this.groupBox7.Controls.Add(this.statIOSpeed); - this.groupBox7.Controls.Add(this.statIOFood); - this.groupBox7.Controls.Add(this.labelHBV); - this.groupBox7.Controls.Add(this.statIOOxygen); - this.groupBox7.Controls.Add(this.panelSums); - this.groupBox7.Controls.Add(this.statIOStamina); - this.groupBox7.Controls.Add(this.labelFootnote); - this.groupBox7.Controls.Add(this.labelHeaderD); - this.groupBox7.Controls.Add(this.labelHeaderW); - this.groupBox7.Location = new System.Drawing.Point(8, 37); - this.groupBox7.Name = "groupBox7"; - this.groupBox7.Size = new System.Drawing.Size(307, 492); - this.groupBox7.TabIndex = 3; - this.groupBox7.TabStop = false; - this.groupBox7.Text = "Stats"; + // gbStats + // + this.gbStats.Controls.Add(this.label7); + this.gbStats.Controls.Add(this.statIOHealth); + this.gbStats.Controls.Add(this.statIODamage); + this.gbStats.Controls.Add(this.statIOTorpor); + this.gbStats.Controls.Add(this.statIOWeight); + this.gbStats.Controls.Add(this.statIOSpeed); + this.gbStats.Controls.Add(this.statIOFood); + this.gbStats.Controls.Add(this.labelHBV); + this.gbStats.Controls.Add(this.statIOOxygen); + this.gbStats.Controls.Add(this.panelSums); + this.gbStats.Controls.Add(this.statIOStamina); + this.gbStats.Controls.Add(this.labelFootnote); + this.gbStats.Controls.Add(this.lblExtractorDomLevel); + this.gbStats.Controls.Add(this.lblExtractorWildLevel); + this.gbStats.Location = new System.Drawing.Point(8, 37); + this.gbStats.Name = "gbStats"; + this.gbStats.Size = new System.Drawing.Size(307, 492); + this.gbStats.TabIndex = 3; + this.gbStats.TabStop = false; + this.gbStats.Text = "Stats"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(6, 16); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(90, 13); + this.label7.TabIndex = 50; + this.label7.Text = "Current stat-value"; // // statIOHealth // @@ -1725,7 +1735,7 @@ private void InitializeComponent() // // creatureInfoInputExtractor // - this.creatureInfoInputExtractor.Cooldown = new System.DateTime(2017, 7, 24, 0, 32, 42, 326); + this.creatureInfoInputExtractor.Cooldown = new System.DateTime(2017, 8, 6, 19, 12, 17, 261); this.creatureInfoInputExtractor.CreatureName = ""; this.creatureInfoInputExtractor.CreatureNote = ""; this.creatureInfoInputExtractor.CreatureOwner = ""; @@ -1734,7 +1744,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, 7, 24, 0, 32, 42, 327); + this.creatureInfoInputExtractor.Grown = new System.DateTime(2017, 8, 6, 19, 12, 17, 262); this.creatureInfoInputExtractor.Location = new System.Drawing.Point(321, 184); this.creatureInfoInputExtractor.mother = null; this.creatureInfoInputExtractor.MutationCounter = 0; @@ -1748,6 +1758,7 @@ private void InitializeComponent() // tabPageLibrary // this.tabPageLibrary.AutoScroll = true; + this.tabPageLibrary.AutoScrollMinSize = new System.Drawing.Size(0, 600); this.tabPageLibrary.Controls.Add(this.tableLayoutPanelLibrary); this.tabPageLibrary.Location = new System.Drawing.Point(4, 22); this.tabPageLibrary.Name = "tabPageLibrary"; @@ -1817,7 +1828,7 @@ private void InitializeComponent() this.tabPage2.Location = new System.Drawing.Point(4, 22); this.tabPage2.Name = "tabPage2"; this.tabPage2.Padding = new System.Windows.Forms.Padding(3); - this.tabPage2.Size = new System.Drawing.Size(187, 0); + this.tabPage2.Size = new System.Drawing.Size(187, 166); this.tabPage2.TabIndex = 1; this.tabPage2.Text = "Owner"; this.tabPage2.UseVisualStyleBackColor = true; @@ -1829,7 +1840,7 @@ private void InitializeComponent() this.checkedListBoxOwner.FormattingEnabled = true; this.checkedListBoxOwner.Location = new System.Drawing.Point(3, 3); this.checkedListBoxOwner.Name = "checkedListBoxOwner"; - this.checkedListBoxOwner.Size = new System.Drawing.Size(181, 0); + this.checkedListBoxOwner.Size = new System.Drawing.Size(181, 160); this.checkedListBoxOwner.TabIndex = 0; this.checkedListBoxOwner.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.checkedListBoxOwner_ItemCheck); // @@ -1839,7 +1850,7 @@ private void InitializeComponent() this.tabPage3.Location = new System.Drawing.Point(4, 22); this.tabPage3.Name = "tabPage3"; this.tabPage3.Padding = new System.Windows.Forms.Padding(3); - this.tabPage3.Size = new System.Drawing.Size(187, 0); + this.tabPage3.Size = new System.Drawing.Size(187, 166); this.tabPage3.TabIndex = 2; this.tabPage3.Text = "Stats"; this.tabPage3.UseVisualStyleBackColor = true; @@ -1858,7 +1869,7 @@ private void InitializeComponent() this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F)); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 29F)); - this.tableLayoutPanel2.Size = new System.Drawing.Size(181, 0); + this.tableLayoutPanel2.Size = new System.Drawing.Size(181, 160); this.tableLayoutPanel2.TabIndex = 0; // // checkedListBoxConsiderStatTop @@ -1877,13 +1888,13 @@ private void InitializeComponent() "Torpor"}); this.checkedListBoxConsiderStatTop.Location = new System.Drawing.Point(3, 35); this.checkedListBoxConsiderStatTop.Name = "checkedListBoxConsiderStatTop"; - this.checkedListBoxConsiderStatTop.Size = new System.Drawing.Size(175, 1); + this.checkedListBoxConsiderStatTop.Size = new System.Drawing.Size(175, 93); this.checkedListBoxConsiderStatTop.TabIndex = 3; // // buttonRecalculateTops // this.buttonRecalculateTops.Dock = System.Windows.Forms.DockStyle.Fill; - this.buttonRecalculateTops.Location = new System.Drawing.Point(3, -25); + this.buttonRecalculateTops.Location = new System.Drawing.Point(3, 134); this.buttonRecalculateTops.Name = "buttonRecalculateTops"; this.buttonRecalculateTops.Size = new System.Drawing.Size(175, 23); this.buttonRecalculateTops.TabIndex = 2; @@ -1910,7 +1921,7 @@ private void InitializeComponent() this.tabPage4.Location = new System.Drawing.Point(4, 22); this.tabPage4.Name = "tabPage4"; this.tabPage4.Padding = new System.Windows.Forms.Padding(3); - this.tabPage4.Size = new System.Drawing.Size(187, 0); + this.tabPage4.Size = new System.Drawing.Size(187, 166); this.tabPage4.TabIndex = 3; this.tabPage4.Text = "View"; this.tabPage4.UseVisualStyleBackColor = true; @@ -1929,6 +1940,8 @@ private void InitializeComponent() // checkBoxShowMutatedCreatures // this.checkBoxShowMutatedCreatures.AutoSize = true; + this.checkBoxShowMutatedCreatures.Checked = true; + this.checkBoxShowMutatedCreatures.CheckState = System.Windows.Forms.CheckState.Checked; this.checkBoxShowMutatedCreatures.Location = new System.Drawing.Point(6, 75); this.checkBoxShowMutatedCreatures.Name = "checkBoxShowMutatedCreatures"; this.checkBoxShowMutatedCreatures.Size = new System.Drawing.Size(143, 17); @@ -1940,6 +1953,8 @@ private void InitializeComponent() // checkBoxShowNeuteredCreatures // this.checkBoxShowNeuteredCreatures.AutoSize = true; + this.checkBoxShowNeuteredCreatures.Checked = true; + this.checkBoxShowNeuteredCreatures.CheckState = System.Windows.Forms.CheckState.Checked; this.checkBoxShowNeuteredCreatures.Location = new System.Drawing.Point(6, 52); this.checkBoxShowNeuteredCreatures.Name = "checkBoxShowNeuteredCreatures"; this.checkBoxShowNeuteredCreatures.Size = new System.Drawing.Size(148, 17); @@ -1951,6 +1966,8 @@ private void InitializeComponent() // checkBoxShowUnavailableCreatures // this.checkBoxShowUnavailableCreatures.AutoSize = true; + this.checkBoxShowUnavailableCreatures.Checked = true; + this.checkBoxShowUnavailableCreatures.CheckState = System.Windows.Forms.CheckState.Checked; this.checkBoxShowUnavailableCreatures.Location = new System.Drawing.Point(6, 29); this.checkBoxShowUnavailableCreatures.Name = "checkBoxShowUnavailableCreatures"; this.checkBoxShowUnavailableCreatures.Size = new System.Drawing.Size(160, 17); @@ -1962,6 +1979,8 @@ private void InitializeComponent() // checkBoxShowDead // this.checkBoxShowDead.AutoSize = true; + this.checkBoxShowDead.Checked = true; + this.checkBoxShowDead.CheckState = System.Windows.Forms.CheckState.Checked; this.checkBoxShowDead.Location = new System.Drawing.Point(6, 6); this.checkBoxShowDead.Name = "checkBoxShowDead"; this.checkBoxShowDead.Size = new System.Drawing.Size(130, 17); @@ -1976,7 +1995,7 @@ private void InitializeComponent() this.tabPageLibRadarChart.Location = new System.Drawing.Point(4, 22); this.tabPageLibRadarChart.Name = "tabPageLibRadarChart"; this.tabPageLibRadarChart.Padding = new System.Windows.Forms.Padding(3); - this.tabPageLibRadarChart.Size = new System.Drawing.Size(187, 0); + this.tabPageLibRadarChart.Size = new System.Drawing.Size(187, 166); this.tabPageLibRadarChart.TabIndex = 4; this.tabPageLibRadarChart.Text = "Chart"; this.tabPageLibRadarChart.UseVisualStyleBackColor = true; @@ -1987,7 +2006,7 @@ private void InitializeComponent() this.radarChartLibrary.Image = ((System.Drawing.Image)(resources.GetObject("radarChartLibrary.Image"))); this.radarChartLibrary.Location = new System.Drawing.Point(3, 3); this.radarChartLibrary.Name = "radarChartLibrary"; - this.radarChartLibrary.Size = new System.Drawing.Size(181, 0); + this.radarChartLibrary.Size = new System.Drawing.Size(181, 160); this.radarChartLibrary.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; this.radarChartLibrary.TabIndex = 0; this.radarChartLibrary.TabStop = false; @@ -1997,6 +2016,7 @@ private void InitializeComponent() this.listViewLibrary.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeaderName, this.columnHeaderOwner, + this.columnHeaderNotes, this.columnHeaderSex, this.columnHeaderAdded, this.columnHeaderTopness, @@ -2038,6 +2058,11 @@ private void InitializeComponent() this.columnHeaderOwner.Text = "Owner"; this.columnHeaderOwner.Width = 48; // + // columnHeaderNotes + // + this.columnHeaderNotes.Text = "Notes"; + this.columnHeaderNotes.Width = 48; + // // columnHeaderSex // this.columnHeaderSex.Text = "S"; @@ -2046,99 +2071,99 @@ private void InitializeComponent() // // columnHeaderAdded // - this.columnHeaderAdded.DisplayIndex = 16; + this.columnHeaderAdded.DisplayIndex = 17; this.columnHeaderAdded.Text = "Added"; // // columnHeaderTopness // - this.columnHeaderTopness.DisplayIndex = 12; + this.columnHeaderTopness.DisplayIndex = 13; this.columnHeaderTopness.Text = "Tp%"; this.columnHeaderTopness.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.columnHeaderTopness.Width = 33; // // columnHeaderTopStatsNr // - this.columnHeaderTopStatsNr.DisplayIndex = 11; + this.columnHeaderTopStatsNr.DisplayIndex = 12; this.columnHeaderTopStatsNr.Text = "Top"; this.columnHeaderTopStatsNr.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.columnHeaderTopStatsNr.Width = 31; // // columnHeaderGen // - this.columnHeaderGen.DisplayIndex = 13; + this.columnHeaderGen.DisplayIndex = 14; this.columnHeaderGen.Text = "Gen"; this.columnHeaderGen.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.columnHeaderGen.Width = 34; // // columnHeaderFound // - this.columnHeaderFound.DisplayIndex = 14; + this.columnHeaderFound.DisplayIndex = 15; this.columnHeaderFound.Text = "LW"; this.columnHeaderFound.Width = 30; // // columnHeaderMutations // - this.columnHeaderMutations.DisplayIndex = 15; + this.columnHeaderMutations.DisplayIndex = 16; this.columnHeaderMutations.Text = "Mu"; this.columnHeaderMutations.Width = 30; // // columnHeaderCooldown // - this.columnHeaderCooldown.DisplayIndex = 17; + this.columnHeaderCooldown.DisplayIndex = 18; this.columnHeaderCooldown.Text = "Cooldown/Growing"; // // columnHeaderHP // - this.columnHeaderHP.DisplayIndex = 3; + this.columnHeaderHP.DisplayIndex = 4; this.columnHeaderHP.Text = "HP"; this.columnHeaderHP.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.columnHeaderHP.Width = 30; // // columnHeaderSt // - this.columnHeaderSt.DisplayIndex = 4; + this.columnHeaderSt.DisplayIndex = 5; this.columnHeaderSt.Text = "St"; this.columnHeaderSt.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.columnHeaderSt.Width = 30; // // columnHeaderOx // - this.columnHeaderOx.DisplayIndex = 5; + this.columnHeaderOx.DisplayIndex = 6; this.columnHeaderOx.Text = "Ox"; this.columnHeaderOx.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.columnHeaderOx.Width = 30; // // columnHeaderFo // - this.columnHeaderFo.DisplayIndex = 6; + this.columnHeaderFo.DisplayIndex = 7; this.columnHeaderFo.Text = "Fo"; this.columnHeaderFo.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.columnHeaderFo.Width = 30; // // columnHeaderWe // - this.columnHeaderWe.DisplayIndex = 7; + this.columnHeaderWe.DisplayIndex = 8; this.columnHeaderWe.Text = "We"; this.columnHeaderWe.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.columnHeaderWe.Width = 30; // // columnHeaderDm // - this.columnHeaderDm.DisplayIndex = 8; + this.columnHeaderDm.DisplayIndex = 9; this.columnHeaderDm.Text = "Dm"; this.columnHeaderDm.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.columnHeaderDm.Width = 30; // // columnHeaderSp // - this.columnHeaderSp.DisplayIndex = 9; + this.columnHeaderSp.DisplayIndex = 10; this.columnHeaderSp.Text = "Sp"; this.columnHeaderSp.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.columnHeaderSp.Width = 30; // // columnHeaderTo // - this.columnHeaderTo.DisplayIndex = 10; + this.columnHeaderTo.DisplayIndex = 11; this.columnHeaderTo.Text = "To"; this.columnHeaderTo.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.columnHeaderTo.Width = 30; @@ -2518,19 +2543,6 @@ private void InitializeComponent() this.toolStripStatusLabel.Size = new System.Drawing.Size(120, 17); this.toolStripStatusLabel.Text = "ToolStripStatusLabel1"; // - // statTestingTamingEffectiveness - // - this.statTestingTamingEffectiveness.DecimalPlaces = 2; - this.statTestingTamingEffectiveness.Location = new System.Drawing.Point(103, 19); - this.statTestingTamingEffectiveness.Name = "statTestingTamingEffectiveness"; - this.statTestingTamingEffectiveness.Size = new System.Drawing.Size(60, 20); - this.statTestingTamingEffectiveness.TabIndex = 0; - this.statTestingTamingEffectiveness.Value = new decimal(new int[] { - 80, - 0, - 0, - 0}); - // // toolStrip2 // this.toolStrip2.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; @@ -2859,8 +2871,8 @@ private void InitializeComponent() this.groupBoxRadarChartExtractor.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.radarChartExtractor)).EndInit(); this.groupBoxTamingInfo.ResumeLayout(false); - this.groupBox7.ResumeLayout(false); - this.groupBox7.PerformLayout(); + this.gbStats.ResumeLayout(false); + this.gbStats.PerformLayout(); this.tabPageLibrary.ResumeLayout(false); this.tableLayoutPanelLibrary.ResumeLayout(false); this.tabControlLibFilter.ResumeLayout(false); @@ -2884,7 +2896,6 @@ private void InitializeComponent() this.TabPageOCR.ResumeLayout(false); this.statusStrip1.ResumeLayout(false); this.statusStrip1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.statTestingTamingEffectiveness)).EndInit(); this.toolStrip2.ResumeLayout(false); this.toolStrip2.PerformLayout(); this.panelToolBar.ResumeLayout(false); @@ -2895,8 +2906,8 @@ private void InitializeComponent() } #endregion - private System.Windows.Forms.Label labelHeaderW; - private System.Windows.Forms.Label labelHeaderD; + private System.Windows.Forms.Label lblExtractorWildLevel; + private System.Windows.Forms.Label lblExtractorDomLevel; private System.Windows.Forms.NumericUpDown numericUpDownLowerTEffBound; private System.Windows.Forms.GroupBox groupBoxDetailsExtractor; private System.Windows.Forms.Label label1; @@ -2934,8 +2945,8 @@ private void InitializeComponent() private StatIO statTestingOxygen; private StatIO statTestingStamina; private System.Windows.Forms.Label label5; - private System.Windows.Forms.Label label7; - private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label lblTesterWildLevel; + private System.Windows.Forms.Label lblTesterDomLevel; private StatIO statTestingHealth; private StatIO statTestingTorpor; private System.Windows.Forms.RadioButton radioButtonWild; @@ -2980,7 +2991,6 @@ private void InitializeComponent() private System.Windows.Forms.TableLayoutPanel tableLayoutPanelLibrary; private System.Windows.Forms.Label labelTestingInfo; private System.Windows.Forms.ColumnHeader columnHeaderGen; - private System.Windows.Forms.NumericUpDown statTestingTamingEffectiveness; private System.Windows.Forms.Label labelNotTamedNoteTesting; private System.Windows.Forms.CheckBox checkBoxQuickWildCheck; private System.Windows.Forms.ToolStripMenuItem onlinehelpToolStripMenuItem; @@ -3043,7 +3053,7 @@ private void InitializeComponent() private System.Windows.Forms.Button buttonExtract; private System.Windows.Forms.Button buttonHelp; private System.Windows.Forms.GroupBox groupBox2; - private System.Windows.Forms.GroupBox groupBox7; + private System.Windows.Forms.GroupBox gbStats; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label labelErrorHelp; private System.Windows.Forms.Button btnReadValuesFromArk; @@ -3129,5 +3139,7 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripButton toolStripButtonSaveCreatureValuesTemp; private System.Windows.Forms.ToolStripButton toolStripButtonDeleteTempCreature; private System.Windows.Forms.CheckBox cbExactlyImprinting; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.ColumnHeader columnHeaderNotes; } } diff --git a/ARKBreedingStats/Form1.cs b/ARKBreedingStats/Form1.cs index 3b37960b..313d281f 100644 --- a/ARKBreedingStats/Form1.cs +++ b/ARKBreedingStats/Form1.cs @@ -79,6 +79,8 @@ public Form1() raisingControl1.setSpeciesIndex += new setSpeciesIndexEventHandler(setSpeciesIndex); raisingControl1.timerControl = timerList1; notesControl1.changed += new collectionChangedEventHandler(setCollectionChanged); + creatureInfoInputExtractor.CreatureDataRequested += CreatureInfoInput_CreatureDataRequested; + creatureInfoInputTester.CreatureDataRequested += CreatureInfoInput_CreatureDataRequested; extractor = new Extraction(); @@ -241,8 +243,12 @@ private void Form1_Load(object sender, EventArgs e) tt.SetToolTip(labelSumDomSB, "This is the number that the sum of all manual levelups should be equal to."); tt.SetToolTip(labelListening, "red: listening, grey: deactivated\nSay \"[species] [level]\", e.g. \"Rex level 30\" or \"Brontosaurus 50\"\nto get taming-infos in the overlay"); tt.SetToolTip(cbExactlyImprinting, "Check this if you have exactly 100% imprinting."); + tt.SetToolTip(lblExtractorDomLevel, "Levels assigned manually to this stat after the creature was domesticated"); + 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"); - // was used to calculate the growing-progress + // was used to calculate the growing-progress. TODO: remove? (UI doesn't show the current weight anymore) creatureInfoInputExtractor.weightStat = statIOs[4]; creatureInfoInputTester.weightStat = testingIOs[4]; @@ -865,6 +871,7 @@ private void updateSpeciesComboboxes() } } + // global species changed private void comboBoxSpeciesGlobal_SelectedIndexChanged(object sender, EventArgs e) { if (comboBoxSpeciesGlobal.SelectedIndex >= 0) @@ -1185,6 +1192,21 @@ private void applySettingsToValues() File.Exists(Properties.Settings.Default.soundWakeup) ? new System.Media.SoundPlayer(Properties.Settings.Default.soundWakeup) : null, File.Exists(Properties.Settings.Default.soundBirth) ? new System.Media.SoundPlayer(Properties.Settings.Default.soundBirth) : null }; + + if (tabControlMain.SelectedTab == tabPageExtractor) + { + clearAll(); + // update enabled stats + for (int s = 0; s < 8; s++) + { + activeStats[s] = (Values.V.species[speciesIndex].stats[s].BaseValue > 0) && (s != 2 || !Values.V.species[speciesIndex].doesNotUseOxygen || oxygenForAll); + statIOs[s].Enabled = activeStats[s]; + } + } + else if (tabControlMain.SelectedTab == tabPageStatTesting) + { + updateAllTesterValues(); + } } private void aboutToolStripMenuItem_Click(object sender, EventArgs e) @@ -1528,6 +1550,7 @@ private ListViewItem createCreatureLVItem(Creature cr, ListViewGroup g) string[] subItems = (new string[] { cr.name + (cr.status != CreatureStatus.Available ? " (" + Utils.statusSymbol(cr.status) + ")" : ""), cr.owner + (cr.tribe.Length > 0 ? " (" + cr.tribe + ")" : ""), + cr.note, Utils.sexSymbol(cr.gender), cr.domesticatedAt.ToString("yyyy'-'MM'-'dd HH':'mm"), cr.topness.ToString(), @@ -1543,13 +1566,13 @@ private ListViewItem createCreatureLVItem(Creature cr, ListViewGroup g) // color unknown levels if (cr.levelsWild[s] < 0) { - lvi.SubItems[s + 10].ForeColor = Color.WhiteSmoke; - lvi.SubItems[s + 10].BackColor = Color.WhiteSmoke; + lvi.SubItems[s + 11].ForeColor = Color.WhiteSmoke; + lvi.SubItems[s + 11].BackColor = Color.WhiteSmoke; } else - lvi.SubItems[s + 10].BackColor = Utils.getColorFromPercent((int)(cr.levelsWild[s] * (s == 7 ? colorFactor / 7 : colorFactor)), (considerStatHighlight[s] ? (cr.topBreedingStats[s] ? 0.2 : 0.7) : 0.93)); + lvi.SubItems[s + 11].BackColor = Utils.getColorFromPercent((int)(cr.levelsWild[s] * (s == 7 ? colorFactor / 7 : colorFactor)), (considerStatHighlight[s] ? (cr.topBreedingStats[s] ? 0.2 : 0.7) : 0.93)); } - lvi.SubItems[2].BackColor = cr.neutered ? SystemColors.GrayText : (cr.gender == Sex.Female ? Color.FromArgb(255, 230, 255) : (cr.gender == Sex.Male ? Color.FromArgb(220, 235, 255) : SystemColors.Window)); + lvi.SubItems[3].BackColor = cr.neutered ? SystemColors.GrayText : (cr.gender == Sex.Female ? Color.FromArgb(255, 230, 255) : (cr.gender == Sex.Male ? Color.FromArgb(220, 235, 255) : SystemColors.Window)); if (cr.status == CreatureStatus.Dead) { lvi.SubItems[0].ForeColor = SystemColors.GrayText; @@ -1567,42 +1590,42 @@ private ListViewItem createCreatureLVItem(Creature cr, ListViewGroup g) { if (cr.topBreedingCreature) lvi.BackColor = Color.LightGreen; - lvi.SubItems[5].BackColor = Utils.getColorFromPercent(cr.topStatsCount * 8 + 44, 0.7); + lvi.SubItems[6].BackColor = Utils.getColorFromPercent(cr.topStatsCount * 8 + 44, 0.7); } else { - lvi.SubItems[5].ForeColor = Color.LightGray; + lvi.SubItems[6].ForeColor = Color.LightGray; } // color for timestamp added if (cr.domesticatedAt.Year < 2015) { - lvi.SubItems[3].Text = "n/a"; - lvi.SubItems[3].ForeColor = Color.LightGray; + lvi.SubItems[4].Text = "n/a"; + lvi.SubItems[4].ForeColor = Color.LightGray; } // color for topness - lvi.SubItems[4].BackColor = Utils.getColorFromPercent(cr.topness * 2 - 100, 0.8); // topness is in percent. gradient from 50-100 + lvi.SubItems[5].BackColor = Utils.getColorFromPercent(cr.topness * 2 - 100, 0.8); // topness is in percent. gradient from 50-100 // color for generation if (cr.generation == 0) - lvi.SubItems[6].ForeColor = Color.LightGray; + lvi.SubItems[7].ForeColor = Color.LightGray; // color of WildLevelColumn if (cr.levelFound == 0) - lvi.SubItems[7].ForeColor = Color.LightGray; + lvi.SubItems[8].ForeColor = Color.LightGray; // color for mutation if (cr.mutationCounter > 0) - lvi.SubItems[8].BackColor = Color.FromArgb(225, 192, 255); + lvi.SubItems[9].BackColor = Color.FromArgb(225, 192, 255); else - lvi.SubItems[8].ForeColor = Color.LightGray; + lvi.SubItems[9].ForeColor = Color.LightGray; // color for cooldown Color forecolor, backcolor; cooldownColors(cr, out forecolor, out backcolor); - lvi.SubItems[9].ForeColor = forecolor; - lvi.SubItems[9].BackColor = backcolor; + lvi.SubItems[10].ForeColor = forecolor; + lvi.SubItems[10].BackColor = backcolor; lvi.Tag = cr; return lvi; @@ -3859,6 +3882,24 @@ private void updateTempCreatureDropDown() toolStripCBTempCreatures.Items.Add(cv.name + " (" + cv.species + ")"); } + private void CreatureInfoInput_CreatureDataRequested(CreatureInfoInput sender) + { + Creature cr = new Creature(); + if (sender == creatureInfoInputExtractor) + { + cr.levelsWild = statIOs.Select(s => s.LevelWild).ToArray(); + cr.imprintingBonus = extractor.imprintingBonus / 100; + cr.tamingEff = extractor.uniqueTE(); + } + else + { + cr.levelsWild = testingIOs.Select(s => s.LevelWild).ToArray(); + cr.imprintingBonus = (double)numericUpDownImprintingBonusTester.Value / 100; + cr.tamingEff = (double)NumericUpDownTestingTE.Value / 100; + } + sender.generateCreatureName(cr); + } + /// /// fixes typos saved in earlier versions. is called right after loading a library /// diff --git a/ARKBreedingStats/settings/Settings.Designer.cs b/ARKBreedingStats/settings/Settings.Designer.cs index 07649fa3..c8f348ad 100644 --- a/ARKBreedingStats/settings/Settings.Designer.cs +++ b/ARKBreedingStats/settings/Settings.Designer.cs @@ -127,6 +127,7 @@ private void InitializeComponent() this.customSCBirth = new ARKBreedingStats.settings.customSoundChooser(); this.customSCStarving = new ARKBreedingStats.settings.customSoundChooser(); this.label20 = new System.Windows.Forms.Label(); + this.linkLabel1 = new System.Windows.Forms.LinkLabel(); this.groupBoxMultiplier.SuspendLayout(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudWaitBeforeScreenCapture)).BeginInit(); @@ -1118,7 +1119,7 @@ private void InitializeComponent() this.tabControl1.Location = new System.Drawing.Point(3, 3); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(685, 497); + this.tabControl1.Size = new System.Drawing.Size(685, 534); this.tabControl1.TabIndex = 11; // // tabPage2 @@ -1137,7 +1138,7 @@ private void InitializeComponent() this.tabPage2.Location = new System.Drawing.Point(4, 22); this.tabPage2.Name = "tabPage2"; this.tabPage2.Padding = new System.Windows.Forms.Padding(3); - this.tabPage2.Size = new System.Drawing.Size(677, 471); + this.tabPage2.Size = new System.Drawing.Size(677, 508); this.tabPage2.TabIndex = 1; this.tabPage2.Text = "Multipliers"; this.tabPage2.UseVisualStyleBackColor = true; @@ -1238,37 +1239,36 @@ private void InitializeComponent() this.tabPage1.Location = new System.Drawing.Point(4, 22); this.tabPage1.Name = "tabPage1"; this.tabPage1.Padding = new System.Windows.Forms.Padding(3); - this.tabPage1.Size = new System.Drawing.Size(677, 471); + this.tabPage1.Size = new System.Drawing.Size(677, 508); this.tabPage1.TabIndex = 0; this.tabPage1.Text = "General"; this.tabPage1.UseVisualStyleBackColor = true; // // groupBox9 // - this.groupBox9.Controls.Add(this.label24); + this.groupBox9.Controls.Add(this.linkLabel1); this.groupBox9.Controls.Add(this.tbNameGenerationPattern); - this.groupBox9.Location = new System.Drawing.Point(258, 398); + this.groupBox9.Controls.Add(this.label24); + this.groupBox9.Location = new System.Drawing.Point(6, 398); this.groupBox9.Name = "groupBox9"; - this.groupBox9.Size = new System.Drawing.Size(413, 67); + this.groupBox9.Size = new System.Drawing.Size(665, 104); this.groupBox9.TabIndex = 7; this.groupBox9.TabStop = false; this.groupBox9.Text = "Name Generation Pattern"; // // label24 // - this.label24.AutoSize = true; this.label24.Location = new System.Drawing.Point(6, 16); this.label24.Name = "label24"; - this.label24.Size = new System.Drawing.Size(399, 13); + this.label24.Size = new System.Drawing.Size(653, 44); this.label24.TabIndex = 1; - this.label24.Text = "Used by the Generate-button near the name-input. default: {species} {sex_short}{n" + - "}"; + this.label24.Text = resources.GetString("label24.Text"); // // tbNameGenerationPattern // - this.tbNameGenerationPattern.Location = new System.Drawing.Point(9, 41); + this.tbNameGenerationPattern.Location = new System.Drawing.Point(6, 78); this.tbNameGenerationPattern.Name = "tbNameGenerationPattern"; - this.tbNameGenerationPattern.Size = new System.Drawing.Size(398, 20); + this.tbNameGenerationPattern.Size = new System.Drawing.Size(653, 20); this.tbNameGenerationPattern.TabIndex = 0; // // groupBox10 @@ -1337,7 +1337,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 = null; + this.customSCWakeup.SoundFile = ""; this.customSCWakeup.TabIndex = 6; // // customSCBirth @@ -1345,7 +1345,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 = null; + this.customSCBirth.SoundFile = ""; this.customSCBirth.TabIndex = 5; // // customSCStarving @@ -1353,7 +1353,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 = ""; + this.customSCStarving.SoundFile = null; this.customSCStarving.TabIndex = 4; // // label20 @@ -1364,6 +1364,17 @@ private void InitializeComponent() this.label20.TabIndex = 3; this.label20.Text = "Only PCM-WAV-files are supported. The sound will play 1 min before the timer runs" + " out."; + // + // linkLabel1 + // + this.linkLabel1.AutoSize = true; + this.linkLabel1.Location = new System.Drawing.Point(6, 60); + this.linkLabel1.Name = "linkLabel1"; + this.linkLabel1.Size = new System.Drawing.Size(185, 13); + this.linkLabel1.TabIndex = 2; + this.linkLabel1.TabStop = true; + this.linkLabel1.Text = "More infos about the Name-Generator"; + this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); // // Settings // @@ -1535,5 +1546,6 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox cbConsiderWildLevelSteps; private System.Windows.Forms.Button btnSetToDefaultSP; private System.Windows.Forms.Button buttonSetTamBreedToSP; + private System.Windows.Forms.LinkLabel linkLabel1; } } \ No newline at end of file diff --git a/ARKBreedingStats/settings/Settings.cs b/ARKBreedingStats/settings/Settings.cs index acbf25ae..23344bd8 100644 --- a/ARKBreedingStats/settings/Settings.cs +++ b/ARKBreedingStats/settings/Settings.cs @@ -370,5 +370,10 @@ private void buttonEventToDefault_Click(object sender, EventArgs e) nudCuddleIntervalEvent.Value = numericUpDownBabyCuddleIntervalMultiplier.Value; nudBabyFoodConsumptionEvent.Value = nudBabyFoodConsumptionSpeed.Value; } + + private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + System.Diagnostics.Process.Start("https://github.com/cadon/ARKStatsExtractor/wiki/Name-Generator"); + } } } diff --git a/ARKBreedingStats/settings/Settings.resx b/ARKBreedingStats/settings/Settings.resx index 0bc43b05..3d187c60 100644 --- a/ARKBreedingStats/settings/Settings.resx +++ b/ARKBreedingStats/settings/Settings.resx @@ -122,4 +122,7 @@ It does only work with the resolutions 1920×1080 and 1680×1050, and sometimes does make mistakes. It works with the window-mode "Fullscreen-Windowed" and sometimes does not work when multiple screens are used. + + Used by the Generate-button near the name-input. e.g.: {species} {sex_short}{n}. Other Options: {species_short}, {species_shortu}, {spcs_short}, {spcs_shortu}, {date_short}, {date_compressed}, {time_short}, {time_compressed}, {hp}, {stam}, {oxy}, {food}, {weight}, {dmg}, {spd}, {trp}, {effImp}, {rnd}, {cpr} (= {sex_short}{date_short}{hp}{stam}{oxy}{food}{weight}{dmg}{effImp}) + \ No newline at end of file