From 00bb9e9df1d9ed24e12921a3441eadd1277b0887 Mon Sep 17 00:00:00 2001 From: cadaei Date: Thu, 23 Aug 2018 22:34:32 +0200 Subject: [PATCH] fixed tab-order in the creature-info-input. fixed check for existing Guid. fixed not saving ARK-ID. --- ARKBreedingStats/CreatureCollection.cs | 14 +---- .../CreatureInfoInput.Designer.cs | 62 +++++++++---------- ARKBreedingStats/Form1.cs | 7 ++- ARKBreedingStats/Properties/AssemblyInfo.cs | 2 +- ARKBreedingStats/ver.txt | 2 +- 5 files changed, 40 insertions(+), 47 deletions(-) diff --git a/ARKBreedingStats/CreatureCollection.cs b/ARKBreedingStats/CreatureCollection.cs index f35a095c..f1eb60fd 100644 --- a/ARKBreedingStats/CreatureCollection.cs +++ b/ARKBreedingStats/CreatureCollection.cs @@ -186,13 +186,13 @@ public bool mergeCreatureList(List creaturesToMerge, bool update = fal /// /// Guid to check /// True if there is a creature with the given Guid - public bool GUIDAlreadyExist(Guid guid, out Creature creature) + public bool GUIDAlreadyExist(Guid guid, Creature concerningCreature, out Creature creature) { creature = null; bool exists = false; foreach (var c in creatures) { - if (c.guid == guid) + if (c.guid == guid && c != concerningCreature) { creature = c; exists = true; @@ -201,15 +201,5 @@ public bool GUIDAlreadyExist(Guid guid, out Creature creature) } return exists; } - - /// - /// Checks if a creature with the Guid created from an ARKID exists - /// - /// ARKID to check - /// - public bool GuidOfARKIDExists(long arkId, out Creature creature) - { - return GUIDAlreadyExist(Utils.ConvertIdToGuid(arkId), out creature); - } } } diff --git a/ARKBreedingStats/CreatureInfoInput.Designer.cs b/ARKBreedingStats/CreatureInfoInput.Designer.cs index 48dffe34..9611993d 100644 --- a/ARKBreedingStats/CreatureInfoInput.Designer.cs +++ b/ARKBreedingStats/CreatureInfoInput.Designer.cs @@ -29,6 +29,8 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { this.gbCreatureInfo = new System.Windows.Forms.GroupBox(); + this.label1 = new System.Windows.Forms.Label(); + this.tbARKID = new System.Windows.Forms.TextBox(); this.btClearColors = new System.Windows.Forms.Button(); this.regionColorChooser1 = new ARKBreedingStats.uiControls.RegionColorChooser(); this.nudMutationsFather = new ARKBreedingStats.uiControls.Nud(); @@ -66,8 +68,6 @@ private void InitializeComponent() this.lbName = new System.Windows.Forms.Label(); this.textBoxName = new System.Windows.Forms.TextBox(); this.btAdd2Library = new System.Windows.Forms.Button(); - this.label1 = new System.Windows.Forms.Label(); - this.tbARKID = new System.Windows.Forms.TextBox(); this.gbCreatureInfo.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudMutationsFather)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nudMutationsMother)).BeginInit(); @@ -124,6 +124,22 @@ private void InitializeComponent() this.gbCreatureInfo.Text = "Creature-info"; this.gbCreatureInfo.Enter += new System.EventHandler(this.groupBox1_Enter); // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(6, 207); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(43, 13); + this.label1.TabIndex = 39; + this.label1.Text = "ARK-ID"; + // + // tbARKID + // + this.tbARKID.Location = new System.Drawing.Point(50, 204); + this.tbARKID.Name = "tbARKID"; + this.tbARKID.Size = new System.Drawing.Size(172, 20); + this.tbARKID.TabIndex = 8; + // // btClearColors // this.btClearColors.Location = new System.Drawing.Point(0, 393); @@ -140,7 +156,7 @@ private void InitializeComponent() this.regionColorChooser1.Margin = new System.Windows.Forms.Padding(0); this.regionColorChooser1.Name = "regionColorChooser1"; this.regionColorChooser1.Size = new System.Drawing.Size(174, 29); - this.regionColorChooser1.TabIndex = 18; + this.regionColorChooser1.TabIndex = 19; // // nudMutationsFather // @@ -163,7 +179,7 @@ private void InitializeComponent() 0, 0}); this.nudMutationsFather.Size = new System.Drawing.Size(60, 20); - this.nudMutationsFather.TabIndex = 12; + this.nudMutationsFather.TabIndex = 13; // // nudMutationsMother // @@ -186,7 +202,7 @@ private void InitializeComponent() 0, 0}); this.nudMutationsMother.Size = new System.Drawing.Size(60, 20); - this.nudMutationsMother.TabIndex = 11; + this.nudMutationsMother.TabIndex = 12; // // label12 // @@ -289,7 +305,7 @@ private void InitializeComponent() this.dhmsInputGrown.Location = new System.Drawing.Point(86, 254); this.dhmsInputGrown.Name = "dhmsInputGrown"; this.dhmsInputGrown.Size = new System.Drawing.Size(136, 26); - this.dhmsInputGrown.TabIndex = 9; + this.dhmsInputGrown.TabIndex = 10; this.dhmsInputGrown.Timespan = System.TimeSpan.Parse("00:00:00"); this.dhmsInputGrown.ValueChanged += new ARKBreedingStats.uiControls.dhmsInput.ValueChangedEventHandler(this.dhmsInputGrown_ValueChanged); // @@ -298,7 +314,7 @@ private void InitializeComponent() this.dhmsInputCooldown.Location = new System.Drawing.Point(86, 227); this.dhmsInputCooldown.Name = "dhmsInputCooldown"; this.dhmsInputCooldown.Size = new System.Drawing.Size(136, 26); - this.dhmsInputCooldown.TabIndex = 8; + this.dhmsInputCooldown.TabIndex = 9; this.dhmsInputCooldown.Timespan = System.TimeSpan.Parse("00:00:00"); // // nudMaturation @@ -313,7 +329,7 @@ private void InitializeComponent() 0, 0}); this.nudMaturation.Size = new System.Drawing.Size(76, 20); - this.nudMaturation.TabIndex = 10; + this.nudMaturation.TabIndex = 11; this.nudMaturation.Value = new decimal(new int[] { 100, 0, @@ -327,7 +343,7 @@ private void InitializeComponent() this.label7.Location = new System.Drawing.Point(105, 369); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(38, 13); - this.label7.TabIndex = 16; + this.label7.TabIndex = 17; this.label7.Text = "Added"; // // lbMaturationPerc @@ -346,7 +362,7 @@ private void InitializeComponent() this.cbNeutered.Location = new System.Drawing.Point(146, 335); this.cbNeutered.Name = "cbNeutered"; this.cbNeutered.Size = new System.Drawing.Size(61, 23); - this.cbNeutered.TabIndex = 14; + this.cbNeutered.TabIndex = 15; this.cbNeutered.Text = "Neutered"; this.cbNeutered.UseVisualStyleBackColor = true; // @@ -358,7 +374,7 @@ private void InitializeComponent() this.dateTimePickerAdded.MinDate = new System.DateTime(2014, 12, 31, 0, 0, 0, 0); this.dateTimePickerAdded.Name = "dateTimePickerAdded"; this.dateTimePickerAdded.Size = new System.Drawing.Size(76, 20); - this.dateTimePickerAdded.TabIndex = 17; + this.dateTimePickerAdded.TabIndex = 18; // // lbCooldown // @@ -383,7 +399,7 @@ private void InitializeComponent() this.btSaveChanges.Location = new System.Drawing.Point(89, 422); this.btSaveChanges.Name = "btSaveChanges"; this.btSaveChanges.Size = new System.Drawing.Size(60, 37); - this.btSaveChanges.TabIndex = 19; + this.btSaveChanges.TabIndex = 20; this.btSaveChanges.Text = "Save Changes"; this.btSaveChanges.UseVisualStyleBackColor = true; this.btSaveChanges.Visible = false; @@ -410,7 +426,7 @@ private void InitializeComponent() this.buttonStatus.Location = new System.Drawing.Point(49, 364); this.buttonStatus.Name = "buttonStatus"; this.buttonStatus.Size = new System.Drawing.Size(35, 23); - this.buttonStatus.TabIndex = 15; + this.buttonStatus.TabIndex = 16; this.buttonStatus.UseVisualStyleBackColor = true; this.buttonStatus.Click += new System.EventHandler(this.buttonStatus_Click); // @@ -459,7 +475,7 @@ private void InitializeComponent() this.buttonSex.Location = new System.Drawing.Point(80, 335); this.buttonSex.Name = "buttonSex"; this.buttonSex.Size = new System.Drawing.Size(35, 23); - this.buttonSex.TabIndex = 13; + this.buttonSex.TabIndex = 14; this.buttonSex.Text = "?"; this.buttonSex.UseVisualStyleBackColor = true; this.buttonSex.Click += new System.EventHandler(this.buttonSex_Click); @@ -508,27 +524,11 @@ private void InitializeComponent() this.btAdd2Library.Location = new System.Drawing.Point(89, 422); this.btAdd2Library.Name = "btAdd2Library"; this.btAdd2Library.Size = new System.Drawing.Size(134, 37); - this.btAdd2Library.TabIndex = 20; + this.btAdd2Library.TabIndex = 21; this.btAdd2Library.Text = "Add new to Library"; this.btAdd2Library.UseVisualStyleBackColor = true; this.btAdd2Library.Click += new System.EventHandler(this.buttonAdd2Library_Click); // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(6, 207); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(43, 13); - this.label1.TabIndex = 39; - this.label1.Text = "ARK-ID"; - // - // tbARKID - // - this.tbARKID.Location = new System.Drawing.Point(50, 204); - this.tbARKID.Name = "tbARKID"; - this.tbARKID.Size = new System.Drawing.Size(172, 20); - this.tbARKID.TabIndex = 38; - // // CreatureInfoInput // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff --git a/ARKBreedingStats/Form1.cs b/ARKBreedingStats/Form1.cs index 86dce09c..6d6ea88f 100644 --- a/ARKBreedingStats/Form1.cs +++ b/ARKBreedingStats/Form1.cs @@ -1224,7 +1224,7 @@ private void add2Lib(bool fromExtractor = true) }; Guid newGuid = Utils.ConvertIdToGuid(input.ARKID); - if (input.ARKID != 0 && creatureCollection.GUIDAlreadyExist(newGuid, out Creature guidCreature)) + if (input.ARKID != 0 && creatureCollection.GUIDAlreadyExist(newGuid, creature, out Creature guidCreature)) { MessageBox.Show("The entered ARK-ID results in a Guid that is already existing in this library (" + guidCreature.species + " (lvl " + guidCreature.level.ToString() + ")" + ": " + guidCreature.name + ").\nUsually that means there is already a creature in this library with this ARK-ID.\nYou have to choose a different ARK-ID or delete the other creature first.", "ARK-ID already existing", MessageBoxButtons.OK, @@ -1240,6 +1240,9 @@ private void add2Lib(bool fromExtractor = true) creature.guid = input.CreatureGuid; else creature.guid = Guid.NewGuid(); + + creature.ARKID = input.ARKID; + // if parent creatures don't exist in the library but they have a known id, save these for if they are imported later if (creature.Mother == null && input.motherId != Guid.Empty) creature.motherGuid = input.motherId; if (creature.Father == null && input.fatherId != Guid.Empty) creature.fatherGuid = input.fatherId; @@ -3973,7 +3976,7 @@ private void creatureInfoInputTester_Save2Library_Clicked(CreatureInfoInput send // check if the ARKID was changed to an id that results in a Guid that is already existing Guid newGuid = Utils.ConvertIdToGuid(creatureInfoInputTester.ARKID); - if (creatureInfoInputTester.ARKID != 0 && creatureCollection.GUIDAlreadyExist(newGuid, out Creature guidCreature)) + if (creatureInfoInputTester.ARKID != 0 && creatureCollection.GUIDAlreadyExist(newGuid, creatureTesterEdit, out Creature guidCreature)) { MessageBox.Show("The entered ARK-ID results in a Guid that is already existing in this library (" + guidCreature.species + " (lvl " + guidCreature.level.ToString() + ")" + ": " + guidCreature.name + ").\nUsually that means there is already a creature in this library with this ARK-ID.\nYou have to choose a different ARK-ID or delete the other creature first.", "ARK-ID already existing", MessageBoxButtons.OK, diff --git a/ARKBreedingStats/Properties/AssemblyInfo.cs b/ARKBreedingStats/Properties/AssemblyInfo.cs index b734b4d5..13d1d18b 100644 --- a/ARKBreedingStats/Properties/AssemblyInfo.cs +++ b/ARKBreedingStats/Properties/AssemblyInfo.cs @@ -34,6 +34,6 @@ // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("0.28.9")] +[assembly: AssemblyFileVersion("0.28.9.1")] [assembly: NeutralResourcesLanguage("en")] diff --git a/ARKBreedingStats/ver.txt b/ARKBreedingStats/ver.txt index 48a485f7..a8a5e4e1 100644 --- a/ARKBreedingStats/ver.txt +++ b/ARKBreedingStats/ver.txt @@ -1 +1 @@ -282.102.1,0.28.9 +282.102.1,0.28.9.1