From 98d8a71eba66ad27c6437e43fb4a19a4d0847e87 Mon Sep 17 00:00:00 2001 From: cadaei Date: Sun, 26 Nov 2017 23:06:36 +0100 Subject: [PATCH] added tags. improved dhmsInput. --- ARKBreedingStats/ARKBreedingStats.csproj | 30 +++- ARKBreedingStats/BreedingPlan.Designer.cs | 88 +++++++++--- ARKBreedingStats/BreedingPlan.cs | 100 ++++++++++---- ARKBreedingStats/Creature.cs | 2 + ARKBreedingStats/CreatureCollection.cs | 5 + .../CreatureInfoInput.Designer.cs | 8 +- ARKBreedingStats/Form1.Designer.cs | 21 ++- ARKBreedingStats/Form1.cs | 95 +++++++------ ARKBreedingStats/Properties/AssemblyInfo.cs | 2 +- ARKBreedingStats/RaisingControl.Designer.cs | 122 ++++++++--------- ARKBreedingStats/RaisingControl.cs | 14 +- ARKBreedingStats/TimerControl.Designer.cs | 28 ++-- ARKBreedingStats/TimerControl.cs | 10 +- .../uiControls/MultiSetter.Designer.cs | 57 +++++++- ARKBreedingStats/uiControls/MultiSetter.cs | 128 ++++++++++++------ .../uiControls/MultiSetterTag.Designer.cs | 73 ++++++++++ ARKBreedingStats/uiControls/MultiSetterTag.cs | 55 ++++++++ .../uiControls/MultiSetterTag.resx | 120 ++++++++++++++++ .../uiControls/TagSelector.Designer.cs | 72 ++++++++++ ARKBreedingStats/uiControls/TagSelector.cs | 84 ++++++++++++ ARKBreedingStats/uiControls/TagSelector.resx | 120 ++++++++++++++++ .../uiControls/TagSelectorList.Designer.cs | 46 +++++++ .../uiControls/TagSelectorList.cs | 88 ++++++++++++ .../uiControls/TagSelectorList.resx | 120 ++++++++++++++++ ARKBreedingStats/uiControls/dhmInput.cs | 52 ------- .../uiControls/dhmsInput.Designer.cs | 44 +++--- ARKBreedingStats/uiControls/dhmsInput.cs | 14 +- ARKBreedingStats/ver.txt | 2 +- 28 files changed, 1285 insertions(+), 315 deletions(-) create mode 100644 ARKBreedingStats/uiControls/MultiSetterTag.Designer.cs create mode 100644 ARKBreedingStats/uiControls/MultiSetterTag.cs create mode 100644 ARKBreedingStats/uiControls/MultiSetterTag.resx create mode 100644 ARKBreedingStats/uiControls/TagSelector.Designer.cs create mode 100644 ARKBreedingStats/uiControls/TagSelector.cs create mode 100644 ARKBreedingStats/uiControls/TagSelector.resx create mode 100644 ARKBreedingStats/uiControls/TagSelectorList.Designer.cs create mode 100644 ARKBreedingStats/uiControls/TagSelectorList.cs create mode 100644 ARKBreedingStats/uiControls/TagSelectorList.resx delete mode 100644 ARKBreedingStats/uiControls/dhmInput.cs diff --git a/ARKBreedingStats/ARKBreedingStats.csproj b/ARKBreedingStats/ARKBreedingStats.csproj index 7fb99d50..36f96ed1 100644 --- a/ARKBreedingStats/ARKBreedingStats.csproj +++ b/ARKBreedingStats/ARKBreedingStats.csproj @@ -169,6 +169,12 @@ dhmsInput.cs + + UserControl + + + MultiSetterTag.cs + Component @@ -292,15 +298,24 @@ TribesControl.cs - - Component - UserControl StatPotentials.cs + + UserControl + + + TagSelector.cs + + + UserControl + + + TagSelectorList.cs + UserControl @@ -341,6 +356,9 @@ dhmsInput.cs + + MultiSetterTag.cs + PatternEditor.cs @@ -365,6 +383,12 @@ StatPotentials.cs + + TagSelector.cs + + + TagSelectorList.cs + PreserveNewest diff --git a/ARKBreedingStats/BreedingPlan.Designer.cs b/ARKBreedingStats/BreedingPlan.Designer.cs index 534374f7..51fbde6b 100644 --- a/ARKBreedingStats/BreedingPlan.Designer.cs +++ b/ARKBreedingStats/BreedingPlan.Designer.cs @@ -52,9 +52,13 @@ private void InitializeComponent() this.pedigreeCreature2 = new ARKBreedingStats.PedigreeCreature(); this.pedigreeCreature1 = new ARKBreedingStats.PedigreeCreature(); this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); - this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.tabPageBreedableSpecies = new System.Windows.Forms.TabPage(); this.listViewSpeciesBP = new System.Windows.Forms.ListView(); this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.tabPageTags = new System.Windows.Forms.TabPage(); + this.tagSelectorList1 = new ARKBreedingStats.uiControls.TagSelectorList(); + this.label1 = new System.Windows.Forms.Label(); this.buttonApplyNewWeights = new System.Windows.Forms.Button(); this.groupBox4 = new System.Windows.Forms.GroupBox(); this.checkBoxIncludeCooldowneds = new System.Windows.Forms.CheckBox(); @@ -67,7 +71,9 @@ private void InitializeComponent() this.groupBox1.SuspendLayout(); this.panelHeader.SuspendLayout(); this.tableLayoutPanel3.SuspendLayout(); - this.groupBox3.SuspendLayout(); + this.tabControl1.SuspendLayout(); + this.tabPageBreedableSpecies.SuspendLayout(); + this.tabPageTags.SuspendLayout(); this.groupBox4.SuspendLayout(); this.SuspendLayout(); // @@ -283,7 +289,7 @@ private void InitializeComponent() this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel3.Controls.Add(this.groupBox3, 0, 0); + this.tableLayoutPanel3.Controls.Add(this.tabControl1, 0, 0); this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel1, 2, 0); this.tableLayoutPanel3.Controls.Add(this.buttonApplyNewWeights, 0, 2); this.tableLayoutPanel3.Controls.Add(this.groupBox4, 1, 1); @@ -298,17 +304,28 @@ private void InitializeComponent() this.tableLayoutPanel3.Size = new System.Drawing.Size(1127, 682); this.tableLayoutPanel3.TabIndex = 5; // - // groupBox3 - // - this.tableLayoutPanel3.SetColumnSpan(this.groupBox3, 2); - this.groupBox3.Controls.Add(this.listViewSpeciesBP); - this.groupBox3.Dock = System.Windows.Forms.DockStyle.Fill; - this.groupBox3.Location = new System.Drawing.Point(3, 3); - this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(194, 439); - this.groupBox3.TabIndex = 1; - this.groupBox3.TabStop = false; - this.groupBox3.Text = "Breedable Species"; + // tabControl1 + // + this.tableLayoutPanel3.SetColumnSpan(this.tabControl1, 2); + this.tabControl1.Controls.Add(this.tabPageBreedableSpecies); + this.tabControl1.Controls.Add(this.tabPageTags); + this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl1.Location = new System.Drawing.Point(3, 3); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(194, 439); + this.tabControl1.TabIndex = 8; + // + // tabPageBreedableSpecies + // + this.tabPageBreedableSpecies.Controls.Add(this.listViewSpeciesBP); + this.tabPageBreedableSpecies.Location = new System.Drawing.Point(4, 22); + this.tabPageBreedableSpecies.Name = "tabPageBreedableSpecies"; + this.tabPageBreedableSpecies.Padding = new System.Windows.Forms.Padding(3); + this.tabPageBreedableSpecies.Size = new System.Drawing.Size(186, 413); + this.tabPageBreedableSpecies.TabIndex = 0; + this.tabPageBreedableSpecies.Text = "Breedable Species"; + this.tabPageBreedableSpecies.UseVisualStyleBackColor = true; // // listViewSpeciesBP // @@ -318,10 +335,10 @@ private void InitializeComponent() this.listViewSpeciesBP.FullRowSelect = true; this.listViewSpeciesBP.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; this.listViewSpeciesBP.HideSelection = false; - this.listViewSpeciesBP.Location = new System.Drawing.Point(3, 16); + this.listViewSpeciesBP.Location = new System.Drawing.Point(3, 3); this.listViewSpeciesBP.MultiSelect = false; this.listViewSpeciesBP.Name = "listViewSpeciesBP"; - this.listViewSpeciesBP.Size = new System.Drawing.Size(188, 420); + this.listViewSpeciesBP.Size = new System.Drawing.Size(180, 407); this.listViewSpeciesBP.TabIndex = 3; this.listViewSpeciesBP.UseCompatibleStateImageBehavior = false; this.listViewSpeciesBP.View = System.Windows.Forms.View.Details; @@ -331,6 +348,35 @@ private void InitializeComponent() // this.columnHeader5.Text = "Species"; this.columnHeader5.Width = 178; + // + // tabPageTags + // + this.tabPageTags.Controls.Add(this.tagSelectorList1); + this.tabPageTags.Controls.Add(this.label1); + this.tabPageTags.Location = new System.Drawing.Point(4, 22); + this.tabPageTags.Name = "tabPageTags"; + this.tabPageTags.Padding = new System.Windows.Forms.Padding(3); + this.tabPageTags.Size = new System.Drawing.Size(186, 413); + this.tabPageTags.TabIndex = 1; + this.tabPageTags.Text = "Tags"; + this.tabPageTags.UseVisualStyleBackColor = true; + // + // tagSelectorList1 + // + this.tagSelectorList1.AutoScroll = true; + this.tagSelectorList1.Location = new System.Drawing.Point(6, 66); + this.tagSelectorList1.Name = "tagSelectorList1"; + this.tagSelectorList1.Size = new System.Drawing.Size(174, 341); + this.tagSelectorList1.TabIndex = 3; + // + // label1 + // + this.label1.Location = new System.Drawing.Point(6, 3); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(174, 60); + this.label1.TabIndex = 2; + this.label1.Text = "Consider creatures by tag. \r\n✕ excludes creatures, ✓ includes creatures (even if " + + "they have an exclusive tag)."; // // buttonApplyNewWeights // @@ -434,7 +480,9 @@ private void InitializeComponent() this.panelHeader.ResumeLayout(false); this.panelHeader.PerformLayout(); this.tableLayoutPanel3.ResumeLayout(false); - this.groupBox3.ResumeLayout(false); + this.tabControl1.ResumeLayout(false); + this.tabPageBreedableSpecies.ResumeLayout(false); + this.tabPageTags.ResumeLayout(false); this.groupBox4.ResumeLayout(false); this.groupBox4.PerformLayout(); this.ResumeLayout(false); @@ -464,7 +512,6 @@ private void InitializeComponent() private System.Windows.Forms.Label labelBreedingInfos; private OffspringPossibilities offspringPossibilities1; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; - private System.Windows.Forms.GroupBox groupBox3; private System.Windows.Forms.ListView listViewSpeciesBP; private System.Windows.Forms.ColumnHeader columnHeader5; private System.Windows.Forms.Button buttonApplyNewWeights; @@ -474,5 +521,10 @@ private void InitializeComponent() private System.Windows.Forms.RadioButton radioButtonBPHighStats; private System.Windows.Forms.RadioButton radioButtonBPTopStats; private StatWeighting statWeighting1; + private System.Windows.Forms.TabControl tabControl1; + private System.Windows.Forms.TabPage tabPageBreedableSpecies; + private System.Windows.Forms.TabPage tabPageTags; + private System.Windows.Forms.Label label1; + private uiControls.TagSelectorList tagSelectorList1; } } diff --git a/ARKBreedingStats/BreedingPlan.cs b/ARKBreedingStats/BreedingPlan.cs index e3cc4f9d..02f63835 100644 --- a/ARKBreedingStats/BreedingPlan.cs +++ b/ARKBreedingStats/BreedingPlan.cs @@ -61,7 +61,7 @@ public BreedingPlan() statWeighting = statWeighting1; breedingPlanNeedsUpdate = false; - /* // TODO REMOVE + /* // TODO fix for different display-scalings. doesn't work right now. float dpiX, dpiY; Graphics graphics = this.CreateGraphics(); dpiX = graphics.DpiX; @@ -112,6 +112,46 @@ public void determineBestBreeding(Creature chosenCreature = null, bool forceUpda breedingPlanNeedsUpdate = false; } + public List filterByTags(List cl) + { + List excludingTagList = tagSelectorList1.excludingTags; + List includingTagList = tagSelectorList1.includingTags; + + List filteredList = new List(); + + if (excludingTagList.Count > 0) + { + foreach (Creature c in cl) + { + bool exclude = false; + foreach (string t in c.tags) + if (excludingTagList.IndexOf(t) != -1) + { + exclude = true; + break; + } + if (exclude) + { + foreach (string t in c.tags) + { + if (includingTagList.IndexOf(t) != -1) + { + exclude = false; + break; + } + } + } + if (!exclude) + filteredList.Add(c); + } + return filteredList; + } + else + { + return cl; + } + } + public void drawBestParents(BreedingMode breedingMode, bool updateBreedingData = false) { SuspendLayout(); @@ -125,7 +165,12 @@ public void drawBestParents(BreedingMode breedingMode, bool updateBreedingData = labelTitle.Text = currentSpecies + (considerChosenCreature ? " (only pairings with \"" + chosenCreature.name + "\")" : ""); if (considerChosenCreature && (chosenCreature.neutered || chosenCreature.status != CreatureStatus.Available)) labelTitle.Text += "! Breeding not possible ! (" + (chosenCreature.neutered ? "neutered" : "not available") + ")"; - if (females != null && males != null && females.Count > 0 && males.Count > 0) + + // filter by tags + List choosenF = filterByTags(females); + List choosenM = filterByTags(males); + + if (choosenF != null && choosenM != null && choosenF.Count > 0 && choosenM.Count > 0) { pedigreeCreature1.Show(); pedigreeCreature2.Show(); @@ -139,13 +184,13 @@ public void drawBestParents(BreedingMode breedingMode, bool updateBreedingData = int o = 0, nrTS; Int16[] bestPossLevels = new Int16[7]; // best possible levels - for (int f = 0; f < females.Count; f++) + for (int f = 0; f < choosenF.Count; f++) { - if (considerChosenCreature && chosenCS == Sex.Female && females[f] != chosenCreature) + if (considerChosenCreature && chosenCS == Sex.Female && choosenF[f] != chosenCreature) continue; - for (int m = 0; m < males.Count; m++) + for (int m = 0; m < choosenM.Count; m++) { - if (considerChosenCreature && chosenCS == Sex.Male && males[m] != chosenCreature) + if (considerChosenCreature && chosenCS == Sex.Male && choosenM[m] != chosenCreature) continue; combinedTops[0].Add(f); @@ -157,8 +202,8 @@ public void drawBestParents(BreedingMode breedingMode, bool updateBreedingData = for (int s = 0; s < 7; s++) { bestPossLevels[s] = 0; - int higherLevel = Math.Max(females[f].levelsWild[s], males[m].levelsWild[s]); - int lowerlevel = Math.Min(females[f].levelsWild[s], males[m].levelsWild[s]); + int higherLevel = Math.Max(choosenF[f].levelsWild[s], choosenM[m].levelsWild[s]); + int lowerlevel = Math.Min(choosenF[f].levelsWild[s], choosenM[m].levelsWild[s]); if (higherLevel < 0) higherLevel = 0; if (lowerlevel < 0) lowerlevel = 0; @@ -167,9 +212,9 @@ public void drawBestParents(BreedingMode breedingMode, bool updateBreedingData = { if (breedingMode == BreedingMode.TopStatsLucky) { - if (females[f].topBreedingStats[s] || males[m].topBreedingStats[s]) + if (choosenF[f].topBreedingStats[s] || choosenM[m].topBreedingStats[s]) { - if (females[f].topBreedingStats[s] && males[m].topBreedingStats[s]) + if (choosenF[f].topBreedingStats[s] && choosenM[m].topBreedingStats[s]) tt *= 1.142; } else if (bestLevels[s] > 0) @@ -177,12 +222,12 @@ public void drawBestParents(BreedingMode breedingMode, bool updateBreedingData = } else if (breedingMode == BreedingMode.TopStatsConservative && bestLevels[s] > 0) { - bestPossLevels[s] = (Int16)Math.Max(females[f].levelsWild[s], males[m].levelsWild[s]); + bestPossLevels[s] = (Int16)Math.Max(choosenF[f].levelsWild[s], choosenM[m].levelsWild[s]); tt *= .01; - if (females[f].topBreedingStats[s] || males[m].topBreedingStats[s]) + if (choosenF[f].topBreedingStats[s] || choosenM[m].topBreedingStats[s]) { nrTS++; - eTS += ((females[f].topBreedingStats[s] && males[m].topBreedingStats[s]) ? 1 : 0.7); + eTS += ((choosenF[f].topBreedingStats[s] && choosenM[m].topBreedingStats[s]) ? 1 : 0.7); } } } @@ -191,14 +236,14 @@ public void drawBestParents(BreedingMode breedingMode, bool updateBreedingData = if (breedingMode == BreedingMode.TopStatsConservative) { - if (females[f].topStatsCountBP < nrTS && males[m].topStatsCountBP < nrTS) + if (choosenF[f].topStatsCountBP < nrTS && choosenM[m].topStatsCountBP < nrTS) t += eTS; else t += .1 * eTS; // check if the best possible stat outcome already exists in a male bool maleExists = false; - foreach (Creature cr in males) + foreach (Creature cr in choosenM) { maleExists = true; for (int s = 0; s < 7; s++) @@ -218,7 +263,7 @@ public void drawBestParents(BreedingMode breedingMode, bool updateBreedingData = { // check if the best possible stat outcome already exists in a female bool femaleExists = false; - foreach (Creature cr in females) + foreach (Creature cr in choosenF) { femaleExists = true; for (int s = 0; s < 7; s++) @@ -264,14 +309,14 @@ public void drawBestParents(BreedingMode breedingMode, bool updateBreedingData = { if (2 * i < pcs.Count) { - pcs[2 * i].Creature = females[combinedTops[0][comboOrder[i]]]; + pcs[2 * i].Creature = choosenF[combinedTops[0][comboOrder[i]]]; pcs[2 * i].enabledColorRegions = enabledColorRegions; pcs[2 * i].comboId = comboOrder[i]; pcs[2 * i].Show(); } else { - pc = new PedigreeCreature(females[combinedTops[0][comboOrder[i]]], enabledColorRegions, comboOrder[i]); + pc = new PedigreeCreature(choosenF[combinedTops[0][comboOrder[i]]], enabledColorRegions, comboOrder[i]); pc.Location = new Point(10 + xS, 5 + 35 * row + yS); pc.CreatureClicked += new PedigreeCreature.CreatureChangedEventHandler(CreatureClicked); pc.CreatureEdit += new PedigreeCreature.CreatureEditEventHandler(CreatureEdit); @@ -283,14 +328,14 @@ public void drawBestParents(BreedingMode breedingMode, bool updateBreedingData = } if (2 * i + 1 < pcs.Count) { - pcs[2 * i + 1].Creature = males[combinedTops[1][comboOrder[i]]]; + pcs[2 * i + 1].Creature = choosenM[combinedTops[1][comboOrder[i]]]; pcs[2 * i + 1].enabledColorRegions = enabledColorRegions; pcs[2 * i + 1].comboId = comboOrder[i]; pcs[2 * i + 1].Show(); } else { - pc = new PedigreeCreature(males[combinedTops[1][comboOrder[i]]], enabledColorRegions, comboOrder[i]); + pc = new PedigreeCreature(choosenM[combinedTops[1][comboOrder[i]]], enabledColorRegions, comboOrder[i]); pc.Location = new Point(397 + xS, 5 + 35 * row + yS); pc.CreatureClicked += new PedigreeCreature.CreatureChangedEventHandler(CreatureClicked); pc.CreatureEdit += new PedigreeCreature.CreatureEditEventHandler(CreatureEdit); @@ -349,9 +394,9 @@ public void drawBestParents(BreedingMode breedingMode, bool updateBreedingData = { bool bestCreatureAlreadyAvailable = true; Creature bestCreature = null; - List femalesAndMales = females.Concat(males).ToList(); + List choosenFemalesAndMales = choosenF.Concat(choosenM).ToList(); bool noWildSpeedLevels = Values.V.species[speciesIndex].NoImprintingForSpeed == true; - foreach (Creature cr in femalesAndMales) + foreach (Creature cr in choosenFemalesAndMales) { bestCreatureAlreadyAvailable = true; for (int s = 0; s < 7; s++) @@ -392,7 +437,7 @@ public void drawBestParents(BreedingMode breedingMode, bool updateBreedingData = pcs[2 * i + 1].Hide(); pbs[i].Hide(); } - labelInfo.Text = "No possible pairings found for " + currentSpecies + ". Make sure at least one female and male are available in your library."; + labelInfo.Text = "No possible pairings found for " + currentSpecies + ". Make sure at least one female and male are available in your library and that you didn't exclude all possible creatures via the tag-selector."; labelInfo.Visible = true; if (updateBreedingData) setBreedingData(currentSpecies); @@ -489,6 +534,15 @@ private void setBreedingData(string species = "") } } + public void createTagList() + { + tagSelectorList1.tags = creatureCollection.tags; + foreach (string t in creatureCollection.tagsInclude) + tagSelectorList1.setTagStatus(t, uiControls.TagSelector.tagStatus.include); + foreach (string t in creatureCollection.tagsExclude) + tagSelectorList1.setTagStatus(t, uiControls.TagSelector.tagStatus.exclude); + } + public List Creatures { set diff --git a/ARKBreedingStats/Creature.cs b/ARKBreedingStats/Creature.cs index c3e98ee6..41cd0b3c 100644 --- a/ARKBreedingStats/Creature.cs +++ b/ARKBreedingStats/Creature.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Linq; using System.Xml.Serialization; @@ -50,6 +51,7 @@ public class Creature : IEquatable public DateTime domesticatedAt = new DateTime(0); public bool neutered = false; public int mutationCounter; + public List tags = new List(); public Creature() { diff --git a/ARKBreedingStats/CreatureCollection.cs b/ARKBreedingStats/CreatureCollection.cs index 83675e5c..7deb3221 100644 --- a/ARKBreedingStats/CreatureCollection.cs +++ b/ARKBreedingStats/CreatureCollection.cs @@ -62,6 +62,11 @@ namespace ARKBreedingStats public string additionalValues = ""; [XmlArray] public List noteList = new List(); + [XmlIgnore] + public List tags = new List(); + [XmlArray] + public List tagsInclude = new List(); // which tags are checked for including in the breedingplan + public List tagsExclude = new List(); // which tags are checked for excluding in the breedingplan public bool mergeCreatureList(List creaturesToMerge) { diff --git a/ARKBreedingStats/CreatureInfoInput.Designer.cs b/ARKBreedingStats/CreatureInfoInput.Designer.cs index fb13e75a..26c54f39 100644 --- a/ARKBreedingStats/CreatureInfoInput.Designer.cs +++ b/ARKBreedingStats/CreatureInfoInput.Designer.cs @@ -190,18 +190,18 @@ private void InitializeComponent() // // dhmsInputGrown // - this.dhmsInputGrown.Location = new System.Drawing.Point(63, 200); + this.dhmsInputGrown.Location = new System.Drawing.Point(86, 200); this.dhmsInputGrown.Name = "dhmsInputGrown"; - this.dhmsInputGrown.Size = new System.Drawing.Size(159, 26); + this.dhmsInputGrown.Size = new System.Drawing.Size(136, 26); this.dhmsInputGrown.TabIndex = 8; this.dhmsInputGrown.Timespan = System.TimeSpan.Parse("00:00:00"); this.dhmsInputGrown.TextChanged += new System.EventHandler(this.dhmsInputGrown_TextChanged); // // dhmsInputCooldown // - this.dhmsInputCooldown.Location = new System.Drawing.Point(63, 174); + this.dhmsInputCooldown.Location = new System.Drawing.Point(86, 173); this.dhmsInputCooldown.Name = "dhmsInputCooldown"; - this.dhmsInputCooldown.Size = new System.Drawing.Size(159, 26); + this.dhmsInputCooldown.Size = new System.Drawing.Size(136, 26); this.dhmsInputCooldown.TabIndex = 7; this.dhmsInputCooldown.Timespan = System.TimeSpan.Parse("00:00:00"); // diff --git a/ARKBreedingStats/Form1.Designer.cs b/ARKBreedingStats/Form1.Designer.cs index c89999ea..7903f336 100644 --- a/ARKBreedingStats/Form1.Designer.cs +++ b/ARKBreedingStats/Form1.Designer.cs @@ -275,6 +275,7 @@ private void InitializeComponent() this.labelListening = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); this.comboBoxSpeciesGlobal = new System.Windows.Forms.ComboBox(); + this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownImprintingBonusTester)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NumericUpDownTestingTE)).BeginInit(); @@ -1481,7 +1482,7 @@ private void InitializeComponent() // // creatureInfoInputTester // - this.creatureInfoInputTester.Cooldown = new System.DateTime(2017, 11, 12, 20, 3, 58, 455); + this.creatureInfoInputTester.Cooldown = new System.DateTime(2017, 11, 26, 21, 51, 44, 750); this.creatureInfoInputTester.CreatureName = ""; this.creatureInfoInputTester.CreatureNote = ""; this.creatureInfoInputTester.CreatureOwner = ""; @@ -1490,7 +1491,7 @@ private void InitializeComponent() this.creatureInfoInputTester.CreatureTribe = ""; this.creatureInfoInputTester.domesticatedAt = new System.DateTime(2016, 7, 5, 13, 11, 41, 997); this.creatureInfoInputTester.father = null; - this.creatureInfoInputTester.Grown = new System.DateTime(2017, 11, 12, 20, 3, 58, 456); + this.creatureInfoInputTester.Grown = new System.DateTime(2017, 11, 26, 21, 51, 44, 752); this.creatureInfoInputTester.Location = new System.Drawing.Point(321, 184); this.creatureInfoInputTester.mother = null; this.creatureInfoInputTester.MutationCounter = 0; @@ -1822,7 +1823,7 @@ private void InitializeComponent() // // creatureInfoInputExtractor // - this.creatureInfoInputExtractor.Cooldown = new System.DateTime(2017, 11, 12, 20, 3, 58, 501); + this.creatureInfoInputExtractor.Cooldown = new System.DateTime(2017, 11, 26, 21, 51, 44, 783); this.creatureInfoInputExtractor.CreatureName = ""; this.creatureInfoInputExtractor.CreatureNote = ""; this.creatureInfoInputExtractor.CreatureOwner = ""; @@ -1831,7 +1832,7 @@ private void InitializeComponent() this.creatureInfoInputExtractor.CreatureTribe = ""; this.creatureInfoInputExtractor.domesticatedAt = new System.DateTime(2016, 7, 5, 13, 12, 15, 968); this.creatureInfoInputExtractor.father = null; - this.creatureInfoInputExtractor.Grown = new System.DateTime(2017, 11, 12, 20, 3, 58, 501); + this.creatureInfoInputExtractor.Grown = new System.DateTime(2017, 11, 26, 21, 51, 44, 783); this.creatureInfoInputExtractor.Location = new System.Drawing.Point(321, 184); this.creatureInfoInputExtractor.mother = null; this.creatureInfoInputExtractor.MutationCounter = 0; @@ -2273,16 +2274,17 @@ private void InitializeComponent() // this.contextMenuStripLibrary.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripMenuItemEdit, + this.editAllSelectedToolStripMenuItem, + this.toolStripSeparator9, this.copyValuesToExtractorToolStripMenuItem, this.exportToClipboardToolStripMenuItem1, this.removeCooldownGrowingToolStripMenuItem, this.bestBreedingPartnersToolStripMenuItem, this.toolStripMenuItemStatus, - this.editAllSelectedToolStripMenuItem, this.toolStripSeparator6, this.toolStripMenuItemRemove}); this.contextMenuStripLibrary.Name = "contextMenuStripLibrary"; - this.contextMenuStripLibrary.Size = new System.Drawing.Size(230, 186); + this.contextMenuStripLibrary.Size = new System.Drawing.Size(230, 214); // // toolStripMenuItemEdit // @@ -2418,6 +2420,7 @@ private void InitializeComponent() // editAllSelectedToolStripMenuItem // this.editAllSelectedToolStripMenuItem.Name = "editAllSelectedToolStripMenuItem"; + this.editAllSelectedToolStripMenuItem.ShortcutKeyDisplayString = "F3"; this.editAllSelectedToolStripMenuItem.Size = new System.Drawing.Size(229, 22); this.editAllSelectedToolStripMenuItem.Text = "Edit all Selected..."; this.editAllSelectedToolStripMenuItem.Click += new System.EventHandler(this.editAllSelectedToolStripMenuItem_Click); @@ -2936,6 +2939,11 @@ private void InitializeComponent() this.comboBoxSpeciesGlobal.TabIndex = 1; this.comboBoxSpeciesGlobal.SelectedIndexChanged += new System.EventHandler(this.comboBoxSpeciesGlobal_SelectedIndexChanged); // + // toolStripSeparator9 + // + this.toolStripSeparator9.Name = "toolStripSeparator9"; + this.toolStripSeparator9.Size = new System.Drawing.Size(226, 6); + // // Form1 // this.AcceptButton = this.buttonExtract; @@ -3269,5 +3277,6 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem obeliskCreaturesToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem neuteredCreaturesToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem mutatedCreaturesToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator9; } } diff --git a/ARKBreedingStats/Form1.cs b/ARKBreedingStats/Form1.cs index 32f267d2..ae09422e 100644 --- a/ARKBreedingStats/Form1.cs +++ b/ARKBreedingStats/Form1.cs @@ -1172,6 +1172,8 @@ private void initializeCollection() notesControl1.NoteList = creatureCollection.noteList; raisingControl1.creatureCollection = creatureCollection; + createCreatureTagList(); + pedigree1.Clear(); breedingPlan1.Clear(); } @@ -1237,6 +1239,22 @@ private void applySettingsToValues() } } + private void createCreatureTagList() + { + creatureCollection.tags.Clear(); + foreach (Creature c in creatureCollection.creatures) + { + foreach (string t in c.tags) + { + if (creatureCollection.tags.IndexOf(t) == -1) + creatureCollection.tags.Add(t); + } + } + creatureCollection.tags.Sort(); + + breedingPlan1.createTagList(); + } + private void aboutToolStripMenuItem_Click(object sender, EventArgs e) { AboutBox1 aboutBox = new AboutBox1(); @@ -1776,7 +1794,7 @@ private void checkForUpdates(bool silentCheck = false) { newValuesAvailable = true; if (MessageBox.Show("There is a new version of the values-file \"" + filename + "\".\nYou have " + localVersion.ToString() + ", available is " + remoteVersion.ToString() + ".\n\n" - +"Do you want to update it?\n\nIf you play on a console (Xbox or PS4) make a backup of the current file before you click on Yes, as the updated values may not work with the console-version for some time.\nUsually it takes up to some days or weeks until the patch is released for the consoles as well and the changes are valid on there, too.", "Update Values-File?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + + "Do you want to update it?\n\nIf you play on a console (Xbox or PS4) make a backup of the current file before you click on Yes, as the updated values may not work with the console-version for some time.\nUsually it takes up to some days or weeks until the patch is released for the consoles as well and the changes are valid on there, too.", "Update Values-File?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { // System.IO.File.Copy(filename, filename + "_backup_" + DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".json"); // Download the Web resource and save it into the current filesystem folder. @@ -1944,23 +1962,31 @@ private void listViewLibrary_SelectedIndexChanged(object sender, EventArgs e) int cnt = listViewLibrary.SelectedItems.Count; if (cnt > 0) { - if (cnt == 1) - { - Creature c = (Creature)listViewLibrary.SelectedItems[0].Tag; - creatureBoxListView.setCreature(c); - if (tabControlLibFilter.SelectedTab == tabPageLibRadarChart) - radarChartLibrary.setLevels(c.levelsWild); - pedigreeNeedsUpdate = true; - } + Creature c = (Creature)listViewLibrary.SelectedItems[0].Tag; + creatureBoxListView.setCreature(c); + if (tabControlLibFilter.SelectedTab == tabPageLibRadarChart) + radarChartLibrary.setLevels(c.levelsWild); + pedigreeNeedsUpdate = true; // display infos about the selected creatures List selCrs = new List(); for (int i = 0; i < cnt; i++) selCrs.Add((Creature)listViewLibrary.SelectedItems[i].Tag); + + List tagList = new List(); + foreach (Creature cr in selCrs) + { + foreach (string t in cr.tags) + if (tagList.IndexOf(t) == -1) + tagList.Add(t); + } + tagList.Sort(); + lbLibrarySelectionInfo.Text = cnt.ToString() + " creatures selected, " + selCrs.Count(cr => cr.gender == Sex.Female).ToString() + " females, " + selCrs.Count(cr => cr.gender == Sex.Male).ToString() + " males\n" - + "level-range: " + selCrs.Min(cr => cr.level).ToString() + " - " + selCrs.Max(cr => cr.level).ToString(); + + "level-range: " + selCrs.Min(cr => cr.level).ToString() + " - " + selCrs.Max(cr => cr.level).ToString() + + "\nTags: " + String.Join(", ", tagList); } else lbLibrarySelectionInfo.Text = ""; } @@ -2797,8 +2823,15 @@ private void listViewLibrary_KeyUp(object sender, KeyEventArgs e) deleteSelectedCreatures(); } else if (e.KeyCode == Keys.F2) + { if (listViewLibrary.SelectedIndices.Count > 0) editCreatureInTester((Creature)listViewLibrary.Items[listViewLibrary.SelectedIndices[0]].Tag); + } + else if (e.KeyCode == Keys.F3) + { + if (listViewLibrary.SelectedIndices.Count > 0) + showMultiSetter(); + } } private void exportForSpreadsheet() @@ -3093,10 +3126,13 @@ private void setStatus(List cs, CreatureStatus s) private void editAllSelectedToolStripMenuItem_Click(object sender, EventArgs e) { - multiSetterToolStripMenuItem_Click(sender, e); + showMultiSetter(); } - private void multiSetterToolStripMenuItem_Click(object sender, EventArgs e) + { + showMultiSetter(); + } + private void showMultiSetter() { // shows a dialog to set multiple settings to all selected creatures if (listViewLibrary.SelectedIndices.Count > 0) @@ -3122,41 +3158,14 @@ private void multiSetterToolStripMenuItem_Click(object sender, EventArgs e) List[] parents = null; if (!multipleSpecies) parents = findPossibleParents(c); - MultiSetter ms = new MultiSetter(c, appliedSettings, parents); + MultiSetter ms = new MultiSetter(selectedCreatures, appliedSettings, parents, creatureCollection.tags); if (ms.ShowDialog() == DialogResult.OK) { - foreach (Creature sc in selectedCreatures) - { - if (appliedSettings[0]) - sc.owner = c.owner; - if (appliedSettings[1]) - sc.status = c.status; - if (appliedSettings[2]) - sc.gender = c.gender; - if (appliedSettings[3]) - sc.isBred = c.isBred; - if (appliedSettings[4]) - sc.motherGuid = c.motherGuid; - if (appliedSettings[5]) - sc.fatherGuid = c.fatherGuid; - if (appliedSettings[6]) - sc.note = c.note; - if (appliedSettings[7]) - sc.colors[0] = c.colors[0]; - if (appliedSettings[8]) - sc.colors[1] = c.colors[1]; - if (appliedSettings[9]) - sc.colors[2] = c.colors[2]; - if (appliedSettings[10]) - sc.colors[3] = c.colors[3]; - if (appliedSettings[11]) - sc.colors[4] = c.colors[4]; - if (appliedSettings[12]) - sc.colors[5] = c.colors[5]; - } - if (appliedSettings[4] || appliedSettings[5]) + if (ms.ParentsChanged) updateParents(selectedCreatures); + if (ms.TagsChanged) + createCreatureTagList(); createOwnerList(); setCollectionChanged(true, (!multipleSpecies ? sp : null)); recalculateTopStatsIfNeeded(); diff --git a/ARKBreedingStats/Properties/AssemblyInfo.cs b/ARKBreedingStats/Properties/AssemblyInfo.cs index 046a37a9..caf9a28e 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.23.21")] +[assembly: AssemblyFileVersion("0.24.0")] diff --git a/ARKBreedingStats/RaisingControl.Designer.cs b/ARKBreedingStats/RaisingControl.Designer.cs index e664027f..71298c6d 100644 --- a/ARKBreedingStats/RaisingControl.Designer.cs +++ b/ARKBreedingStats/RaisingControl.Designer.cs @@ -62,26 +62,26 @@ private void InitializeComponent() this.removeAllExpiredTimersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.panel1 = new System.Windows.Forms.Panel(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPageMaturationProgress = new System.Windows.Forms.TabPage(); this.tabPageEditTimer = new System.Windows.Forms.TabPage(); - this.dateTimePickerEditTimerFinish = new System.Windows.Forms.DateTimePicker(); - this.label7 = new System.Windows.Forms.Label(); - this.lEditTimerName = new System.Windows.Forms.Label(); - this.label9 = new System.Windows.Forms.Label(); this.bSaveTimerEdit = new System.Windows.Forms.Button(); - this.dhmInputTimerEditTimer = new ARKBreedingStats.uiControls.dhmInput(); + this.label9 = new System.Windows.Forms.Label(); + this.lEditTimerName = new System.Windows.Forms.Label(); + this.dhmsInputTimerEditTimer = new ARKBreedingStats.uiControls.dhmsInput(); + this.label7 = new System.Windows.Forms.Label(); + this.dateTimePickerEditTimerFinish = new System.Windows.Forms.DateTimePicker(); this.parentStats1 = new ARKBreedingStats.raising.ParentStats(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); ((System.ComponentModel.ISupportInitialize)(this.nudCurrentWeight)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nudTotalWeight)).BeginInit(); this.contextMenuStripBabyList.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); this.panel1.SuspendLayout(); - this.groupBox2.SuspendLayout(); this.tabControl1.SuspendLayout(); this.tabPageMaturationProgress.SuspendLayout(); this.tabPageEditTimer.SuspendLayout(); + this.groupBox2.SuspendLayout(); this.SuspendLayout(); // // labelRaisingInfos @@ -386,17 +386,6 @@ private void InitializeComponent() this.panel1.Size = new System.Drawing.Size(338, 543); this.panel1.TabIndex = 0; // - // groupBox2 - // - this.groupBox2.Controls.Add(this.labelRaisingInfos); - this.groupBox2.Controls.Add(this.listViewRaisingTimes); - this.groupBox2.Location = new System.Drawing.Point(6, 3); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(329, 220); - this.groupBox2.TabIndex = 6; - this.groupBox2.TabStop = false; - this.groupBox2.Text = "General Infos"; - // // tabControl1 // this.tabControl1.Controls.Add(this.tabPageMaturationProgress); @@ -436,7 +425,7 @@ private void InitializeComponent() this.tabPageEditTimer.Controls.Add(this.bSaveTimerEdit); this.tabPageEditTimer.Controls.Add(this.label9); this.tabPageEditTimer.Controls.Add(this.lEditTimerName); - this.tabPageEditTimer.Controls.Add(this.dhmInputTimerEditTimer); + this.tabPageEditTimer.Controls.Add(this.dhmsInputTimerEditTimer); this.tabPageEditTimer.Controls.Add(this.label7); this.tabPageEditTimer.Controls.Add(this.dateTimePickerEditTimerFinish); this.tabPageEditTimer.Location = new System.Drawing.Point(4, 22); @@ -447,24 +436,24 @@ private void InitializeComponent() this.tabPageEditTimer.Text = "Edit Timer"; this.tabPageEditTimer.UseVisualStyleBackColor = true; // - // dateTimePickerEditTimerFinish + // bSaveTimerEdit // - this.dateTimePickerEditTimerFinish.CustomFormat = ""; - this.dateTimePickerEditTimerFinish.Format = System.Windows.Forms.DateTimePickerFormat.Time; - this.dateTimePickerEditTimerFinish.Location = new System.Drawing.Point(96, 32); - this.dateTimePickerEditTimerFinish.Name = "dateTimePickerEditTimerFinish"; - this.dateTimePickerEditTimerFinish.Size = new System.Drawing.Size(156, 20); - this.dateTimePickerEditTimerFinish.TabIndex = 4; - this.dateTimePickerEditTimerFinish.ValueChanged += new System.EventHandler(this.dateTimePickerEditTimerFinish_ValueChanged); + this.bSaveTimerEdit.Location = new System.Drawing.Point(9, 90); + this.bSaveTimerEdit.Name = "bSaveTimerEdit"; + this.bSaveTimerEdit.Size = new System.Drawing.Size(158, 23); + this.bSaveTimerEdit.TabIndex = 18; + this.bSaveTimerEdit.Text = "Save Changes"; + this.bSaveTimerEdit.UseVisualStyleBackColor = true; + this.bSaveTimerEdit.Click += new System.EventHandler(this.bSaveTimerEdit_Click); // - // label7 + // label9 // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(8, 61); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(82, 13); - this.label7.TabIndex = 14; - this.label7.Text = "Duration [d:h:m]"; + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(6, 38); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(58, 13); + this.label9.TabIndex = 17; + this.label9.Text = "Finished at"; // // lEditTimerName // @@ -475,37 +464,33 @@ private void InitializeComponent() this.lEditTimerName.TabIndex = 16; this.lEditTimerName.Text = "EditTimerName"; // - // label9 + // dhmsInputTimerEditTimer // - this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(6, 38); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(58, 13); - this.label9.TabIndex = 17; - this.label9.Text = "Finished at"; + this.dhmsInputTimerEditTimer.Location = new System.Drawing.Point(93, 58); + this.dhmsInputTimerEditTimer.Name = "dhmsInputTimerEditTimer"; + this.dhmsInputTimerEditTimer.Size = new System.Drawing.Size(136, 26); + this.dhmsInputTimerEditTimer.TabIndex = 15; + this.dhmsInputTimerEditTimer.Timespan = System.TimeSpan.Parse("00:00:00"); + this.dhmsInputTimerEditTimer.TextChanged += new System.EventHandler(this.dhmsInputTimerEditTimer_TextChanged); // - // bSaveTimerEdit + // label7 // - this.bSaveTimerEdit.Location = new System.Drawing.Point(11, 84); - this.bSaveTimerEdit.Name = "bSaveTimerEdit"; - this.bSaveTimerEdit.Size = new System.Drawing.Size(158, 23); - this.bSaveTimerEdit.TabIndex = 18; - this.bSaveTimerEdit.Text = "Save Changes"; - this.bSaveTimerEdit.UseVisualStyleBackColor = true; - this.bSaveTimerEdit.Click += new System.EventHandler(this.bSaveTimerEdit_Click); + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(6, 64); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(47, 13); + this.label7.TabIndex = 14; + this.label7.Text = "Duration"; // - // dhmInputTimerEditTimer + // dateTimePickerEditTimerFinish // - this.dhmInputTimerEditTimer.BackColor = System.Drawing.SystemColors.Window; - this.dhmInputTimerEditTimer.ForeColor = System.Drawing.SystemColors.GrayText; - this.dhmInputTimerEditTimer.Location = new System.Drawing.Point(96, 58); - this.dhmInputTimerEditTimer.Mask = "00\\:00\\:00"; - this.dhmInputTimerEditTimer.Name = "dhmInputTimerEditTimer"; - this.dhmInputTimerEditTimer.Size = new System.Drawing.Size(73, 20); - this.dhmInputTimerEditTimer.TabIndex = 15; - this.dhmInputTimerEditTimer.Text = "000000"; - this.dhmInputTimerEditTimer.Timespan = System.TimeSpan.Parse("00:00:00"); - this.dhmInputTimerEditTimer.TextChanged += new System.EventHandler(this.dhmInputTimerEditTimer_TextChanged); + this.dateTimePickerEditTimerFinish.CustomFormat = ""; + this.dateTimePickerEditTimerFinish.Format = System.Windows.Forms.DateTimePickerFormat.Time; + this.dateTimePickerEditTimerFinish.Location = new System.Drawing.Point(96, 32); + this.dateTimePickerEditTimerFinish.Name = "dateTimePickerEditTimerFinish"; + this.dateTimePickerEditTimerFinish.Size = new System.Drawing.Size(156, 20); + this.dateTimePickerEditTimerFinish.TabIndex = 4; + this.dateTimePickerEditTimerFinish.ValueChanged += new System.EventHandler(this.dateTimePickerEditTimerFinish_ValueChanged); // // parentStats1 // @@ -514,6 +499,17 @@ private void InitializeComponent() this.parentStats1.Size = new System.Drawing.Size(329, 245); this.parentStats1.TabIndex = 7; // + // groupBox2 + // + this.groupBox2.Controls.Add(this.labelRaisingInfos); + this.groupBox2.Controls.Add(this.listViewRaisingTimes); + this.groupBox2.Location = new System.Drawing.Point(6, 3); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(329, 220); + this.groupBox2.TabIndex = 6; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "General Infos"; + // // RaisingControl // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -527,13 +523,13 @@ private void InitializeComponent() this.contextMenuStripBabyList.ResumeLayout(false); this.tableLayoutPanel1.ResumeLayout(false); this.panel1.ResumeLayout(false); - this.groupBox2.ResumeLayout(false); - this.groupBox2.PerformLayout(); this.tabControl1.ResumeLayout(false); this.tabPageMaturationProgress.ResumeLayout(false); this.tabPageMaturationProgress.PerformLayout(); this.tabPageEditTimer.ResumeLayout(false); this.tabPageEditTimer.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); this.ResumeLayout(false); } @@ -581,7 +577,7 @@ private void InitializeComponent() private System.Windows.Forms.Button bSaveTimerEdit; private System.Windows.Forms.Label label9; private System.Windows.Forms.Label lEditTimerName; - private uiControls.dhmInput dhmInputTimerEditTimer; + private uiControls.dhmsInput dhmsInputTimerEditTimer; private System.Windows.Forms.Label label7; } } diff --git a/ARKBreedingStats/RaisingControl.cs b/ARKBreedingStats/RaisingControl.cs index c0406876..49087a25 100644 --- a/ARKBreedingStats/RaisingControl.cs +++ b/ARKBreedingStats/RaisingControl.cs @@ -420,7 +420,7 @@ private void setEditTimer() lEditTimerName.Text = "Incubation" + (iteEdit.mother != null ? " (" + iteEdit.mother.species + ")" : ""); dateTimePickerEditTimerFinish.Value = iteEdit.incubationEnd; TimeSpan ts = iteEdit.incubationEnd.Subtract(DateTime.Now); - dhmInputTimerEditTimer.Timespan = (ts.TotalSeconds > 0 ? ts : TimeSpan.Zero); + dhmsInputTimerEditTimer.Timespan = (ts.TotalSeconds > 0 ? ts : TimeSpan.Zero); } else if (creatureMaturationEdit != null) @@ -428,26 +428,26 @@ private void setEditTimer() lEditTimerName.Text = creatureMaturationEdit.name + " (" + creatureMaturationEdit.species + ")"; dateTimePickerEditTimerFinish.Value = creatureMaturationEdit.growingUntil; TimeSpan ts = creatureMaturationEdit.growingUntil.Subtract(DateTime.Now); - dhmInputTimerEditTimer.Timespan = (ts.TotalSeconds > 0 ? ts : TimeSpan.Zero); + dhmsInputTimerEditTimer.Timespan = (ts.TotalSeconds > 0 ? ts : TimeSpan.Zero); } else { lEditTimerName.Text = "no timer selected"; dateTimePickerEditTimerFinish.Value = DateTime.Now; - dhmInputTimerEditTimer.Timespan = TimeSpan.Zero; + dhmsInputTimerEditTimer.Timespan = TimeSpan.Zero; } } - private void dhmInputTimerEditTimer_TextChanged(object sender, EventArgs e) + private void dhmsInputTimerEditTimer_TextChanged(object sender, EventArgs e) { - if (dhmInputTimerEditTimer.Focused) - dateTimePickerEditTimerFinish.Value = DateTime.Now.Add(dhmInputTimerEditTimer.Timespan); + if (dhmsInputTimerEditTimer.Focused) + dateTimePickerEditTimerFinish.Value = DateTime.Now.Add(dhmsInputTimerEditTimer.Timespan); } private void dateTimePickerEditTimerFinish_ValueChanged(object sender, EventArgs e) { if (dateTimePickerEditTimerFinish.Focused) - dhmInputTimerEditTimer.Timespan = dateTimePickerEditTimerFinish.Value.Subtract(DateTime.Now); + dhmsInputTimerEditTimer.Timespan = dateTimePickerEditTimerFinish.Value.Subtract(DateTime.Now); } private void bSaveTimerEdit_Click(object sender, EventArgs e) diff --git a/ARKBreedingStats/TimerControl.Designer.cs b/ARKBreedingStats/TimerControl.Designer.cs index 659d370c..f62d804f 100644 --- a/ARKBreedingStats/TimerControl.Designer.cs +++ b/ARKBreedingStats/TimerControl.Designer.cs @@ -42,7 +42,7 @@ private void InitializeComponent() this.groupBoxAddTimer = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.bSetTimerNow = new System.Windows.Forms.Button(); - this.dhmInputTimer = new ARKBreedingStats.uiControls.dhmInput(); + this.dhmsInputTimer = new ARKBreedingStats.uiControls.dhmsInput(); this.label3 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); @@ -158,7 +158,7 @@ private void InitializeComponent() // groupBox1 // this.groupBox1.Controls.Add(this.bSetTimerNow); - this.groupBox1.Controls.Add(this.dhmInputTimer); + this.groupBox1.Controls.Add(this.dhmsInputTimer); this.groupBox1.Controls.Add(this.label3); this.groupBox1.Location = new System.Drawing.Point(6, 100); this.groupBox1.Name = "groupBox1"; @@ -177,27 +177,23 @@ private void InitializeComponent() this.bSetTimerNow.UseVisualStyleBackColor = true; this.bSetTimerNow.Click += new System.EventHandler(this.bSetTimerNow_Click); // - // dhmInputTimer + // dhmsInputTimer // - this.dhmInputTimer.BackColor = System.Drawing.SystemColors.Window; - this.dhmInputTimer.ForeColor = System.Drawing.SystemColors.GrayText; - this.dhmInputTimer.Location = new System.Drawing.Point(87, 116); - this.dhmInputTimer.Mask = "00\\:00\\:00"; - this.dhmInputTimer.Name = "dhmInputTimer"; - this.dhmInputTimer.Size = new System.Drawing.Size(73, 20); - this.dhmInputTimer.TabIndex = 13; - this.dhmInputTimer.Text = "000000"; - this.dhmInputTimer.Timespan = System.TimeSpan.Parse("00:00:00"); - this.dhmInputTimer.TextChanged += new System.EventHandler(this.dhmInputTimer_TextChanged); + this.dhmsInputTimer.Location = new System.Drawing.Point(53, 111); + this.dhmsInputTimer.Name = "dhmsInputTimer"; + this.dhmsInputTimer.Size = new System.Drawing.Size(136, 26); + this.dhmsInputTimer.TabIndex = 13; + this.dhmsInputTimer.Timespan = System.TimeSpan.Parse("00:00:00"); + this.dhmsInputTimer.TextChanged += new System.EventHandler(this.dhmsInputTimer_TextChanged); // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(5, 119); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(77, 13); + this.label3.Size = new System.Drawing.Size(42, 13); this.label3.TabIndex = 12; - this.label3.Text = "Custom [d:h:m]"; + this.label3.Text = "Custom"; // // label2 // @@ -278,7 +274,7 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem addToOverlayToolStripMenuItem; private System.Windows.Forms.Label label3; private System.Windows.Forms.GroupBox groupBox1; - private uiControls.dhmInput dhmInputTimer; + private uiControls.dhmsInput dhmsInputTimer; private System.Windows.Forms.Button bSetTimerNow; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; private System.Windows.Forms.ToolStripMenuItem removeAllExpiredTimersToolStripMenuItem; diff --git a/ARKBreedingStats/TimerControl.cs b/ARKBreedingStats/TimerControl.cs index 4d852eac..3cde657a 100644 --- a/ARKBreedingStats/TimerControl.cs +++ b/ARKBreedingStats/TimerControl.cs @@ -265,20 +265,20 @@ private void buttonAddTimer_Click(object sender, EventArgs e) private void bSetTimerNow_Click(object sender, EventArgs e) { - if (dhmInputTimer.Timespan == TimeSpan.Zero) // if already zero, update finishTimer manually + if (dhmsInputTimer.Timespan == TimeSpan.Zero) // if already zero, update finishTimer manually dateTimePickerTimerFinish.Value = DateTime.Now; - dhmInputTimer.Timespan = TimeSpan.Zero; + dhmsInputTimer.Timespan = TimeSpan.Zero; } private void buttonAddTime_addTimer(TimeSpan timeSpan) { - dhmInputTimer.Timespan = dhmInputTimer.Timespan.Add(timeSpan); + dhmsInputTimer.Timespan = dhmsInputTimer.Timespan.Add(timeSpan); } - private void dhmInputTimer_TextChanged(object sender, EventArgs e) + private void dhmsInputTimer_TextChanged(object sender, EventArgs e) { - dateTimePickerTimerFinish.Value = DateTime.Now.Add(dhmInputTimer.Timespan); + dateTimePickerTimerFinish.Value = DateTime.Now.Add(dhmsInputTimer.Timespan); } private void addToOverlayToolStripMenuItem_Click(object sender, EventArgs e) diff --git a/ARKBreedingStats/uiControls/MultiSetter.Designer.cs b/ARKBreedingStats/uiControls/MultiSetter.Designer.cs index 675cb6c6..56ce77db 100644 --- a/ARKBreedingStats/uiControls/MultiSetter.Designer.cs +++ b/ARKBreedingStats/uiControls/MultiSetter.Designer.cs @@ -58,7 +58,12 @@ private void InitializeComponent() this.checkBoxColor6 = new System.Windows.Forms.CheckBox(); this.parentComboBoxFather = new ARKBreedingStats.ParentComboBox(); this.parentComboBoxMother = new ARKBreedingStats.ParentComboBox(); + this.groupBoxTags = new System.Windows.Forms.GroupBox(); + this.panelTags = new System.Windows.Forms.Panel(); + this.tbNewTag = new System.Windows.Forms.TextBox(); + this.bAddTag = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.groupBoxTags.SuspendLayout(); this.SuspendLayout(); // // label1 @@ -67,7 +72,7 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Right))); this.label1.Location = new System.Drawing.Point(12, 9); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(396, 39); + this.label1.Size = new System.Drawing.Size(652, 39); this.label1.TabIndex = 28; this.label1.Text = "Checked properties will overwrite the current ones of all selected Creatures."; // @@ -173,7 +178,7 @@ private void InitializeComponent() // this.buttonApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonApply.DialogResult = System.Windows.Forms.DialogResult.OK; - this.buttonApply.Location = new System.Drawing.Point(333, 240); + this.buttonApply.Location = new System.Drawing.Point(589, 276); this.buttonApply.Name = "buttonApply"; this.buttonApply.Size = new System.Drawing.Size(75, 23); this.buttonApply.TabIndex = 13; @@ -185,7 +190,7 @@ private void InitializeComponent() // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(252, 240); + this.buttonCancel.Location = new System.Drawing.Point(508, 276); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(75, 23); this.buttonCancel.TabIndex = 14; @@ -355,13 +360,52 @@ private void InitializeComponent() this.parentComboBoxMother.TabIndex = 4; this.parentComboBoxMother.SelectedIndexChanged += new System.EventHandler(this.parentComboBoxMother_SelectedIndexChanged); // + // groupBoxTags + // + this.groupBoxTags.Controls.Add(this.panelTags); + this.groupBoxTags.Location = new System.Drawing.Point(428, 12); + this.groupBoxTags.Name = "groupBoxTags"; + this.groupBoxTags.Size = new System.Drawing.Size(236, 209); + this.groupBoxTags.TabIndex = 29; + this.groupBoxTags.TabStop = false; + this.groupBoxTags.Text = "Tags"; + // + // panelTags + // + this.panelTags.AutoScroll = true; + this.panelTags.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelTags.Location = new System.Drawing.Point(3, 16); + this.panelTags.Name = "panelTags"; + this.panelTags.Size = new System.Drawing.Size(230, 190); + this.panelTags.TabIndex = 0; + // + // tbNewTag + // + this.tbNewTag.Location = new System.Drawing.Point(428, 227); + this.tbNewTag.Name = "tbNewTag"; + this.tbNewTag.Size = new System.Drawing.Size(199, 20); + this.tbNewTag.TabIndex = 30; + // + // bAddTag + // + this.bAddTag.Location = new System.Drawing.Point(633, 225); + this.bAddTag.Name = "bAddTag"; + this.bAddTag.Size = new System.Drawing.Size(31, 23); + this.bAddTag.TabIndex = 31; + this.bAddTag.Text = "+"; + this.bAddTag.UseVisualStyleBackColor = true; + this.bAddTag.Click += new System.EventHandler(this.bAddTag_Click); + // // MultiSetter // this.AcceptButton = this.buttonApply; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.buttonCancel; - this.ClientSize = new System.Drawing.Size(420, 275); + this.ClientSize = new System.Drawing.Size(676, 311); + this.Controls.Add(this.bAddTag); + this.Controls.Add(this.tbNewTag); + this.Controls.Add(this.groupBoxTags); this.Controls.Add(this.checkBoxColor6); this.Controls.Add(this.checkBoxColor5); this.Controls.Add(this.checkBoxColor4); @@ -397,6 +441,7 @@ private void InitializeComponent() this.ShowInTaskbar = false; this.Text = "MultiSetter"; ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.groupBoxTags.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -434,5 +479,9 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox checkBoxColor4; private System.Windows.Forms.CheckBox checkBoxColor5; private System.Windows.Forms.CheckBox checkBoxColor6; + private System.Windows.Forms.GroupBox groupBoxTags; + private System.Windows.Forms.Panel panelTags; + private System.Windows.Forms.TextBox tbNewTag; + private System.Windows.Forms.Button bAddTag; } } \ No newline at end of file diff --git a/ARKBreedingStats/uiControls/MultiSetter.cs b/ARKBreedingStats/uiControls/MultiSetter.cs index 2ffd8080..bde8b0df 100644 --- a/ARKBreedingStats/uiControls/MultiSetter.cs +++ b/ARKBreedingStats/uiControls/MultiSetter.cs @@ -1,4 +1,5 @@ -using System; +using ARKBreedingStats.uiControls; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; @@ -13,25 +14,29 @@ namespace ARKBreedingStats public partial class MultiSetter : Form { - private Creature c; - private List appliedSettings; // {owner, status, gender, bred, mother, father, note, color1,...,color6} + private List creatureList; private MyColorPicker cp = new MyColorPicker(); private bool uniqueSpecies; private ToolTip tt = new ToolTip(); + public bool ParentsChanged, TagsChanged; + private CreatureStatus creatureStatus; + private Sex creatureSex; + private int[] colors; + private List tagControls; public MultiSetter() { InitializeComponent(); } - public MultiSetter(Creature creatureSettings, List appliedSettings, List[] parents) + + public MultiSetter(List creatureList, List appliedSettings, List[] parents, List tagList) { InitializeComponent(); - if (appliedSettings.Count != 13) - { - DialogResult = DialogResult.Cancel; // invalid parameters - } - this.c = creatureSettings; - this.appliedSettings = appliedSettings; + + colors = new int[6]; + tagControls = new List(); + + this.creatureList = creatureList; parentComboBoxMother.naLabel = " - Mother n/a"; parentComboBoxFather.naLabel = " - Father n/a"; if (parents == null) @@ -41,6 +46,7 @@ public MultiSetter(Creature creatureSettings, List appliedSettings, List appliedSettings, List + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Komponenten-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.cbConsider = new System.Windows.Forms.CheckBox(); + this.cbTagChecked = new System.Windows.Forms.CheckBox(); + this.SuspendLayout(); + // + // cbConsider + // + this.cbConsider.AutoSize = true; + this.cbConsider.Location = new System.Drawing.Point(3, 4); + this.cbConsider.Name = "cbConsider"; + this.cbConsider.Size = new System.Drawing.Size(15, 14); + this.cbConsider.TabIndex = 0; + this.cbConsider.UseVisualStyleBackColor = true; + this.cbConsider.CheckedChanged += new System.EventHandler(this.cbConsider_CheckedChanged); + // + // cbTagChecked + // + this.cbTagChecked.AutoSize = true; + this.cbTagChecked.Location = new System.Drawing.Point(24, 3); + this.cbTagChecked.Name = "cbTagChecked"; + this.cbTagChecked.Size = new System.Drawing.Size(15, 14); + this.cbTagChecked.TabIndex = 1; + this.cbTagChecked.UseVisualStyleBackColor = true; + this.cbTagChecked.CheckedChanged += new System.EventHandler(this.cbTagChecked_CheckedChanged); + // + // MultiSetterTag + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.cbTagChecked); + this.Controls.Add(this.cbConsider); + this.Name = "MultiSetterTag"; + this.Size = new System.Drawing.Size(202, 19); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.CheckBox cbConsider; + private System.Windows.Forms.CheckBox cbTagChecked; + } +} diff --git a/ARKBreedingStats/uiControls/MultiSetterTag.cs b/ARKBreedingStats/uiControls/MultiSetterTag.cs new file mode 100644 index 00000000..2d41f13d --- /dev/null +++ b/ARKBreedingStats/uiControls/MultiSetterTag.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ARKBreedingStats.uiControls +{ + public partial class MultiSetterTag : UserControl + { + public MultiSetterTag() + { + InitializeComponent(); + } + + public MultiSetterTag(string tag) + { + InitializeComponent(); + cbTagChecked.Text = tag; + cbTagChecked.ForeColor = SystemColors.GrayText; + } + + public bool Considered + { + get { return cbConsider.Checked; } + set { cbConsider.Checked = value; } + } + + public bool TagChecked + { + get { return cbTagChecked.Checked; } + set { cbTagChecked.Checked = value; } + } + + public string TagName + { + get { return cbTagChecked.Text; } + set { cbTagChecked.Text = value; } + } + + private void cbConsider_CheckedChanged(object sender, EventArgs e) + { + cbTagChecked.ForeColor = Considered ? SystemColors.ControlText : SystemColors.GrayText; + } + + private void cbTagChecked_CheckedChanged(object sender, EventArgs e) + { + cbConsider.Checked = true; + } + } +} diff --git a/ARKBreedingStats/uiControls/MultiSetterTag.resx b/ARKBreedingStats/uiControls/MultiSetterTag.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/ARKBreedingStats/uiControls/MultiSetterTag.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ARKBreedingStats/uiControls/TagSelector.Designer.cs b/ARKBreedingStats/uiControls/TagSelector.Designer.cs new file mode 100644 index 00000000..ca975bda --- /dev/null +++ b/ARKBreedingStats/uiControls/TagSelector.Designer.cs @@ -0,0 +1,72 @@ +namespace ARKBreedingStats.uiControls +{ + partial class TagSelector + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Komponenten-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // label1 + // + this.label1.Dock = System.Windows.Forms.DockStyle.Fill; + this.label1.Location = new System.Drawing.Point(0, 0); + this.label1.Name = "label1"; + this.label1.Padding = new System.Windows.Forms.Padding(0, 3, 28, 0); + this.label1.Size = new System.Drawing.Size(187, 29); + this.label1.TabIndex = 0; + // + // button1 + // + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.button1.Location = new System.Drawing.Point(161, 3); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(23, 23); + this.button1.TabIndex = 1; + this.button1.Text = "×"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // TagSelector + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.button1); + this.Controls.Add(this.label1); + this.Name = "TagSelector"; + this.Size = new System.Drawing.Size(187, 29); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button button1; + } +} diff --git a/ARKBreedingStats/uiControls/TagSelector.cs b/ARKBreedingStats/uiControls/TagSelector.cs new file mode 100644 index 00000000..313ea6ca --- /dev/null +++ b/ARKBreedingStats/uiControls/TagSelector.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ARKBreedingStats.uiControls +{ + public partial class TagSelector : UserControl + { + private string tagName; + private tagStatus status; + private ToolTip tt; + + public TagSelector() + { + InitializeComponent(); + status = tagStatus.indifferent; + button1.Text = "○"; + button1.BackColor = SystemColors.Control; + tt = new ToolTip(); + Disposed += TagSelector_Disposed; + } + + private void TagSelector_Disposed(object sender, EventArgs e) + { + tt.RemoveAll(); + } + + private void button1_Click(object sender, EventArgs e) + { + if (status == tagStatus.indifferent) + setStatus(tagStatus.include); + else if (status == tagStatus.include) + setStatus(tagStatus.exclude); + else + setStatus(tagStatus.indifferent); + } + + public void setStatus(tagStatus s) + { + if (s == tagStatus.include) + { + status = tagStatus.include; + button1.Text = "✓"; + button1.BackColor = Color.LightGreen; + } + else if (s == tagStatus.exclude) + { + status = tagStatus.exclude; + button1.Text = "✕"; + button1.BackColor = Color.LightSalmon; + } + else + { + status = tagStatus.indifferent; + button1.Text = "○"; + button1.BackColor = SystemColors.Control; + } + } + + public tagStatus Status { get { return status; } set { setStatus(value); } } + public string TagName + { + get { return label1.Text; } + set + { + label1.Text = value; + tt.SetToolTip(label1, value); + } + } + + public enum tagStatus + { + indifferent, + include, + exclude + } + } +} diff --git a/ARKBreedingStats/uiControls/TagSelector.resx b/ARKBreedingStats/uiControls/TagSelector.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/ARKBreedingStats/uiControls/TagSelector.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ARKBreedingStats/uiControls/TagSelectorList.Designer.cs b/ARKBreedingStats/uiControls/TagSelectorList.Designer.cs new file mode 100644 index 00000000..4e0161cb --- /dev/null +++ b/ARKBreedingStats/uiControls/TagSelectorList.Designer.cs @@ -0,0 +1,46 @@ +namespace ARKBreedingStats.uiControls +{ + partial class TagSelectorList + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Komponenten-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.SuspendLayout(); + // + // TagSelectorList + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoScroll = true; + this.Name = "TagSelectorList"; + this.Size = new System.Drawing.Size(261, 382); + this.ResumeLayout(false); + + } + + #endregion + } +} diff --git a/ARKBreedingStats/uiControls/TagSelectorList.cs b/ARKBreedingStats/uiControls/TagSelectorList.cs new file mode 100644 index 00000000..c1387156 --- /dev/null +++ b/ARKBreedingStats/uiControls/TagSelectorList.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ARKBreedingStats.uiControls +{ + public partial class TagSelectorList : UserControl + { + private List tagSelectors; + private List tagStrings; + + public TagSelectorList() + { + InitializeComponent(); + tagSelectors = new List(); + tagStrings = new List(); + } + + public List tags + { + set + { + foreach (Control c in Controls) + c.Dispose(); + Controls.Clear(); + tagSelectors.Clear(); + TagSelector ts; + int i = 0; + foreach (string t in value) + { + ts = new TagSelector(); + ts.TagName = t; + ts.Location = new Point(3, 3 + i * 29); + ts.Width = Width - 6; + Controls.Add(ts); + tagSelectors.Add(ts); + tagStrings.Add(t); + i++; + } + } + } + + public TagSelector.tagStatus TagStatus(string tag) + { + int i = tagStrings.IndexOf(tag); + if (i >= 0) + return tagSelectors[i].Status; + return TagSelector.tagStatus.indifferent; + } + + public void setTagStatus(string tag, TagSelector.tagStatus status) + { + int i = tagStrings.IndexOf(tag); + if (i >= 0) + tagSelectors[i].Status = status; + } + + public List excludingTags + { + get + { + List l = new List(); + foreach (TagSelector ts in tagSelectors) + if (ts.Status == TagSelector.tagStatus.exclude) + l.Add(ts.TagName); + return l; + } + } + + public List includingTags + { + get + { + List l = new List(); + foreach (TagSelector ts in tagSelectors) + if (ts.Status == TagSelector.tagStatus.include) + l.Add(ts.TagName); + return l; + } + } + } +} diff --git a/ARKBreedingStats/uiControls/TagSelectorList.resx b/ARKBreedingStats/uiControls/TagSelectorList.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/ARKBreedingStats/uiControls/TagSelectorList.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ARKBreedingStats/uiControls/dhmInput.cs b/ARKBreedingStats/uiControls/dhmInput.cs deleted file mode 100644 index a07487ac..00000000 --- a/ARKBreedingStats/uiControls/dhmInput.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Drawing; -using System.Text.RegularExpressions; -using System.Windows.Forms; - -namespace ARKBreedingStats.uiControls -{ - class dhmInput : MaskedTextBox - { - private TimeSpan ts; - public bool changed; - - public dhmInput() - { - ts = new TimeSpan(); - Mask = @"00\:00\:00"; - TextChanged += new EventHandler(textBox_TextChanged); - - Timespan = ts; - } - - private void textBox_TextChanged(object sender, EventArgs e) - { - Match m = Regex.Match(Text, @"(\d+):(\d+):(\d+)"); - if (m.Groups.Count > 3) - { - ts = new TimeSpan(int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value), int.Parse(m.Groups[3].Value), 0); - if (ts.TotalMinutes < 1) - ForeColor = SystemColors.GrayText; - else ForeColor = SystemColors.ControlText; - BackColor = SystemColors.Window; - changed = true; - } - else - { - BackColor = Color.LightSalmon; - ForeColor = SystemColors.ControlText; - } - } - - public TimeSpan Timespan - { - get { return ts; } - set - { - ts = value.TotalMinutes >= 0 ? value : TimeSpan.Zero; - changed = false; - Text = ((int)Math.Floor(ts.TotalDays)).ToString("D2") + ":" + ts.Hours.ToString("D2") + ":" + ts.Minutes.ToString("D2"); - } - } - } -} diff --git a/ARKBreedingStats/uiControls/dhmsInput.Designer.cs b/ARKBreedingStats/uiControls/dhmsInput.Designer.cs index 36b7493b..f00c464f 100644 --- a/ARKBreedingStats/uiControls/dhmsInput.Designer.cs +++ b/ARKBreedingStats/uiControls/dhmsInput.Designer.cs @@ -28,10 +28,10 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.mTBD = new System.Windows.Forms.MaskedTextBox(); - this.mTBH = new System.Windows.Forms.MaskedTextBox(); - this.mTBM = new System.Windows.Forms.MaskedTextBox(); - this.mTBS = new System.Windows.Forms.MaskedTextBox(); + this.mTBD = new System.Windows.Forms.TextBox(); + this.mTBH = new System.Windows.Forms.TextBox(); + this.mTBM = new System.Windows.Forms.TextBox(); + this.mTBS = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); @@ -41,7 +41,6 @@ private void InitializeComponent() // mTBD // this.mTBD.Location = new System.Drawing.Point(3, 3); - this.mTBD.Mask = "9990"; this.mTBD.Name = "mTBD"; this.mTBD.Size = new System.Drawing.Size(31, 20); this.mTBD.TabIndex = 0; @@ -53,8 +52,7 @@ private void InitializeComponent() // // mTBH // - this.mTBH.Location = new System.Drawing.Point(49, 3); - this.mTBH.Mask = "90"; + this.mTBH.Location = new System.Drawing.Point(43, 3); this.mTBH.Name = "mTBH"; this.mTBH.Size = new System.Drawing.Size(21, 20); this.mTBH.TabIndex = 1; @@ -66,8 +64,7 @@ private void InitializeComponent() // // mTBM // - this.mTBM.Location = new System.Drawing.Point(85, 3); - this.mTBM.Mask = "90"; + this.mTBM.Location = new System.Drawing.Point(73, 3); this.mTBM.Name = "mTBM"; this.mTBM.Size = new System.Drawing.Size(21, 20); this.mTBM.TabIndex = 2; @@ -79,8 +76,7 @@ private void InitializeComponent() // // mTBS // - this.mTBS.Location = new System.Drawing.Point(123, 3); - this.mTBS.Mask = "90"; + this.mTBS.Location = new System.Drawing.Point(105, 3); this.mTBS.Name = "mTBS"; this.mTBS.Size = new System.Drawing.Size(21, 20); this.mTBS.TabIndex = 3; @@ -93,7 +89,7 @@ private void InitializeComponent() // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(35, 6); + this.label1.Location = new System.Drawing.Point(33, 6); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(13, 13); this.label1.TabIndex = 4; @@ -102,7 +98,7 @@ private void InitializeComponent() // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(71, 6); + this.label2.Location = new System.Drawing.Point(63, 6); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(13, 13); this.label2.TabIndex = 5; @@ -111,7 +107,7 @@ private void InitializeComponent() // label3 // this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(107, 6); + this.label3.Location = new System.Drawing.Point(93, 6); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(15, 13); this.label3.TabIndex = 6; @@ -120,7 +116,7 @@ private void InitializeComponent() // label4 // this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(145, 6); + this.label4.Location = new System.Drawing.Point(124, 6); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(12, 13); this.label4.TabIndex = 7; @@ -130,16 +126,16 @@ private void InitializeComponent() // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.label4); - this.Controls.Add(this.label3); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); this.Controls.Add(this.mTBS); this.Controls.Add(this.mTBM); this.Controls.Add(this.mTBH); this.Controls.Add(this.mTBD); + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); this.Name = "dhmsInput"; - this.Size = new System.Drawing.Size(159, 26); + this.Size = new System.Drawing.Size(136, 26); this.ResumeLayout(false); this.PerformLayout(); @@ -147,10 +143,10 @@ private void InitializeComponent() #endregion - private System.Windows.Forms.MaskedTextBox mTBD; - private System.Windows.Forms.MaskedTextBox mTBH; - private System.Windows.Forms.MaskedTextBox mTBM; - private System.Windows.Forms.MaskedTextBox mTBS; + private System.Windows.Forms.TextBox mTBD; + private System.Windows.Forms.TextBox mTBH; + private System.Windows.Forms.TextBox mTBM; + private System.Windows.Forms.TextBox mTBS; private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label3; diff --git a/ARKBreedingStats/uiControls/dhmsInput.cs b/ARKBreedingStats/uiControls/dhmsInput.cs index 4f4e3575..7a880e49 100644 --- a/ARKBreedingStats/uiControls/dhmsInput.cs +++ b/ARKBreedingStats/uiControls/dhmsInput.cs @@ -7,6 +7,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using System.Text.RegularExpressions; namespace ARKBreedingStats.uiControls { @@ -28,7 +29,7 @@ public dhmsInput() private void mTB_KeyUp(object sender, KeyEventArgs e) { - MaskedTextBox input = (MaskedTextBox)sender; + TextBox input = (TextBox)sender; if (e.KeyCode == Keys.Left || e.KeyCode == Keys.Right) { int i = 0; @@ -36,7 +37,7 @@ private void mTB_KeyUp(object sender, KeyEventArgs e) else if (input == mTBM) { i = 2; } else if (input == mTBS) { i = 3; } - List inputs = new List { mTBD, mTBH, mTBM, mTBS }; + List inputs = new List { mTBD, mTBH, mTBM, mTBS }; if (e.KeyCode == Keys.Left) i--; else i++; @@ -45,13 +46,13 @@ private void mTB_KeyUp(object sender, KeyEventArgs e) else if (i > 3) i = 0; inputs[i].Focus(); - inputs[i].SelectAll(); } else if (e.KeyCode == Keys.Up) { int i; int.TryParse(input.Text, out i); input.Text = (++i).ToString("D2"); + input.SelectAll(); } else if (e.KeyCode == Keys.Down) { @@ -60,6 +61,11 @@ private void mTB_KeyUp(object sender, KeyEventArgs e) i--; if (i < 0) i = 0; input.Text = i.ToString("D2"); + input.SelectAll(); + } + else + { + input.Text = Regex.Replace(input.Text, @"\D", ""); } } @@ -96,7 +102,7 @@ public TimeSpan Timespan private void mTB_Enter(object sender, EventArgs e) { - ((MaskedTextBox)sender).SelectAll(); + ((TextBox)sender).SelectAll(); } } } diff --git a/ARKBreedingStats/ver.txt b/ARKBreedingStats/ver.txt index 30009b71..01787a4d 100644 --- a/ARKBreedingStats/ver.txt +++ b/ARKBreedingStats/ver.txt @@ -1 +1 @@ -273.85,0.23.21 \ No newline at end of file +273.85,0.24.0 \ No newline at end of file