diff --git a/ARKBreedingStats/ARKBreedingStats.csproj b/ARKBreedingStats/ARKBreedingStats.csproj
index a2c52f5f..8d16439d 100644
--- a/ARKBreedingStats/ARKBreedingStats.csproj
+++ b/ARKBreedingStats/ARKBreedingStats.csproj
@@ -55,6 +55,8 @@
+
+
@@ -154,6 +156,7 @@
+
@@ -342,6 +345,12 @@
ModValuesManager.cs
+
+ Form
+
+
+ LibraryFilter.cs
+
UserControl
@@ -597,6 +606,7 @@
ResXFileCodeGenerator
strings.Designer.cs
+ Designer
@@ -668,6 +678,9 @@
ModValuesManager.cs
+
+ LibraryFilter.cs
+
MultiSetterTag.cs
diff --git a/ARKBreedingStats/App.config b/ARKBreedingStats/App.config
index d87a2ace..07102781 100644
--- a/ARKBreedingStats/App.config
+++ b/ARKBreedingStats/App.config
@@ -16,11 +16,8 @@
387
-
- 1400, 1000
-
-
- 100, 100
+
+ 100, 100, 1400, 1000
False
@@ -43,7 +40,7 @@
True
-
+
False
@@ -121,6 +118,9 @@
False
+
+
+
False
@@ -154,6 +154,9 @@
False
+
+ False
+
50
@@ -233,6 +236,67 @@
True
+
+ False
+
+
+ False
+
+
+ False
+
+
+ True
+
+
+ True
+
+
+ False
+
+
+ 0, 0
+
+
+ False
+
+
+ 0
+
+
+ False
+
+
+ 0
+
+
+ True
+
+
+ 50, 50, 800, 600
+
+
+ 0
+
+
+ 0
+
+
+
+
+
+ 50, 50, 800, 600
+
+
+ 20
+
+
+ False
+
+
+ False
+
diff --git a/ARKBreedingStats/BreedingPlan.Designer.cs b/ARKBreedingStats/BreedingPlan.Designer.cs
index 492ef401..1d494134 100644
--- a/ARKBreedingStats/BreedingPlan.Designer.cs
+++ b/ARKBreedingStats/BreedingPlan.Designer.cs
@@ -83,6 +83,8 @@ private void InitializeComponent()
this.rbBPHighStats = new System.Windows.Forms.RadioButton();
this.rbBPTopStats = new System.Windows.Forms.RadioButton();
this.statWeighting1 = new ARKBreedingStats.uiControls.StatWeighting();
+ this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
+ this.cbTribeFilterLibrary = new System.Windows.Forms.CheckBox();
this.tableLayoutMain.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPageBreedableSpecies.SuspendLayout();
@@ -96,6 +98,7 @@ private void InitializeComponent()
this.panelCombinations.SuspendLayout();
this.gbBPBreedingMode.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudBPMutationLimit)).BeginInit();
+ this.tableLayoutPanel3.SuspendLayout();
this.SuspendLayout();
//
// tableLayoutMain
@@ -163,45 +166,41 @@ private void InitializeComponent()
//
// tabPageTags
//
- this.tabPageTags.Controls.Add(this.cbOwnerFilterLibrary);
- this.tabPageTags.Controls.Add(this.cbServerFilterLibrary);
- this.tabPageTags.Controls.Add(this.cbBPTagExcludeDefault);
- this.tabPageTags.Controls.Add(this.label1);
- this.tabPageTags.Controls.Add(this.tagSelectorList1);
+ this.tabPageTags.Controls.Add(this.tableLayoutPanel3);
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(236, 516);
this.tabPageTags.TabIndex = 1;
- this.tabPageTags.Text = "Tags";
+ this.tabPageTags.Text = "Filters / Tags";
this.tabPageTags.UseVisualStyleBackColor = true;
//
// cbOwnerFilterLibrary
//
this.cbOwnerFilterLibrary.AutoSize = true;
- this.cbOwnerFilterLibrary.Location = new System.Drawing.Point(3, 29);
+ this.cbOwnerFilterLibrary.Location = new System.Drawing.Point(3, 3);
this.cbOwnerFilterLibrary.Name = "cbOwnerFilterLibrary";
- this.cbOwnerFilterLibrary.Size = new System.Drawing.Size(139, 17);
+ this.cbOwnerFilterLibrary.Size = new System.Drawing.Size(136, 17);
this.cbOwnerFilterLibrary.TabIndex = 6;
- this.cbOwnerFilterLibrary.Text = "Owner Filter from Library";
+ this.cbOwnerFilterLibrary.Text = "Owner filter from Library";
this.cbOwnerFilterLibrary.UseVisualStyleBackColor = true;
this.cbOwnerFilterLibrary.CheckedChanged += new System.EventHandler(this.cbOwnerFilterLibrary_CheckedChanged);
//
// cbServerFilterLibrary
//
this.cbServerFilterLibrary.AutoSize = true;
- this.cbServerFilterLibrary.Location = new System.Drawing.Point(3, 6);
+ this.cbServerFilterLibrary.Location = new System.Drawing.Point(3, 49);
this.cbServerFilterLibrary.Name = "cbServerFilterLibrary";
- this.cbServerFilterLibrary.Size = new System.Drawing.Size(139, 17);
+ this.cbServerFilterLibrary.Size = new System.Drawing.Size(136, 17);
this.cbServerFilterLibrary.TabIndex = 5;
- this.cbServerFilterLibrary.Text = "Server Filter from Library";
+ this.cbServerFilterLibrary.Text = "Server filter from Library";
this.cbServerFilterLibrary.UseVisualStyleBackColor = true;
this.cbServerFilterLibrary.CheckedChanged += new System.EventHandler(this.cbServerFilterLibrary_CheckedChanged);
//
// cbBPTagExcludeDefault
//
this.cbBPTagExcludeDefault.AutoSize = true;
- this.cbBPTagExcludeDefault.Location = new System.Drawing.Point(6, 121);
+ this.cbBPTagExcludeDefault.Location = new System.Drawing.Point(3, 141);
this.cbBPTagExcludeDefault.Name = "cbBPTagExcludeDefault";
this.cbBPTagExcludeDefault.Size = new System.Drawing.Size(160, 17);
this.cbBPTagExcludeDefault.TabIndex = 4;
@@ -211,7 +210,7 @@ private void InitializeComponent()
//
// label1
//
- this.label1.Location = new System.Drawing.Point(6, 49);
+ this.label1.Location = new System.Drawing.Point(3, 69);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(174, 69);
this.label1.TabIndex = 2;
@@ -221,9 +220,10 @@ private void InitializeComponent()
// tagSelectorList1
//
this.tagSelectorList1.AutoScroll = true;
- this.tagSelectorList1.Location = new System.Drawing.Point(6, 144);
+ this.tagSelectorList1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tagSelectorList1.Location = new System.Drawing.Point(3, 164);
this.tagSelectorList1.Name = "tagSelectorList1";
- this.tagSelectorList1.Size = new System.Drawing.Size(174, 263);
+ this.tagSelectorList1.Size = new System.Drawing.Size(224, 343);
this.tagSelectorList1.TabIndex = 3;
//
// tableLayoutPanel1
@@ -692,6 +692,39 @@ private void InitializeComponent()
1D,
1D,
1D};
+ //
+ // tableLayoutPanel3
+ //
+ this.tableLayoutPanel3.ColumnCount = 1;
+ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Controls.Add(this.cbTribeFilterLibrary, 0, 1);
+ this.tableLayoutPanel3.Controls.Add(this.cbOwnerFilterLibrary, 0, 0);
+ this.tableLayoutPanel3.Controls.Add(this.tagSelectorList1, 0, 5);
+ this.tableLayoutPanel3.Controls.Add(this.cbBPTagExcludeDefault, 0, 4);
+ this.tableLayoutPanel3.Controls.Add(this.cbServerFilterLibrary, 0, 2);
+ this.tableLayoutPanel3.Controls.Add(this.label1, 0, 3);
+ this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel3.Location = new System.Drawing.Point(3, 3);
+ this.tableLayoutPanel3.Name = "tableLayoutPanel3";
+ this.tableLayoutPanel3.RowCount = 6;
+ this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel3.Size = new System.Drawing.Size(230, 510);
+ this.tableLayoutPanel3.TabIndex = 7;
+ //
+ // cbTribeFilterLibrary
+ //
+ this.cbTribeFilterLibrary.AutoSize = true;
+ this.cbTribeFilterLibrary.Location = new System.Drawing.Point(3, 26);
+ this.cbTribeFilterLibrary.Name = "cbTribeFilterLibrary";
+ this.cbTribeFilterLibrary.Size = new System.Drawing.Size(129, 17);
+ this.cbTribeFilterLibrary.TabIndex = 7;
+ this.cbTribeFilterLibrary.Text = "Tribe filter from Library";
+ this.cbTribeFilterLibrary.UseVisualStyleBackColor = true;
//
// BreedingPlan
//
@@ -705,7 +738,6 @@ private void InitializeComponent()
this.tabControl1.ResumeLayout(false);
this.tabPageBreedableSpecies.ResumeLayout(false);
this.tabPageTags.ResumeLayout(false);
- this.tabPageTags.PerformLayout();
this.tableLayoutPanel1.ResumeLayout(false);
this.flowLayoutPanel1.ResumeLayout(false);
this.gbBPOffspring.ResumeLayout(false);
@@ -718,6 +750,8 @@ private void InitializeComponent()
this.gbBPBreedingMode.ResumeLayout(false);
this.gbBPBreedingMode.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudBPMutationLimit)).EndInit();
+ this.tableLayoutPanel3.ResumeLayout(false);
+ this.tableLayoutPanel3.PerformLayout();
this.ResumeLayout(false);
}
@@ -774,5 +808,7 @@ private void InitializeComponent()
private System.Windows.Forms.CheckBox cbBPOnlyOneSuggestionForFemales;
private System.Windows.Forms.CheckBox cbBPMutationLimitOnlyOnePartner;
private System.Windows.Forms.Label lbMutationProbability;
+ private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
+ private System.Windows.Forms.CheckBox cbTribeFilterLibrary;
}
}
diff --git a/ARKBreedingStats/BreedingPlan.cs b/ARKBreedingStats/BreedingPlan.cs
index 10558b80..38f74c9c 100644
--- a/ARKBreedingStats/BreedingPlan.cs
+++ b/ARKBreedingStats/BreedingPlan.cs
@@ -20,7 +20,7 @@ public partial class BreedingPlan : UserControl
public event PedigreeCreature.ExportToClipboardEventHandler ExportToClipboard;
public event Raising.createIncubationEventHandler CreateIncubationTimer;
public event Form1.SetMessageLabelTextEventHandler SetMessageLabelText;
- public event Form1.SetSpeciesEventHandler SetGlobalSpecies;
+ public event Action SetGlobalSpecies;
private List females = new List();
private List males = new List();
private List breedingPairs;
@@ -168,8 +168,8 @@ public void DetermineBestBreeding(Creature chosenCreature = null, bool forceUpda
if (forceUpdate || breedingPlanNeedsUpdate)
Creatures = creatureCollection.creatures
.Where(c => c.speciesBlueprint == currentSpecies.blueprintPath
- && (c.status == CreatureStatus.Available
- || (c.status == CreatureStatus.Cryopod && cbBPIncludeCryoCreatures.Checked))
+ && (c.Status == CreatureStatus.Available
+ || (c.Status == CreatureStatus.Cryopod && cbBPIncludeCryoCreatures.Checked))
&& !c.flags.HasFlag(CreatureFlags.Neutered)
&& (cbBPIncludeCooldowneds.Checked
|| !(c.cooldownUntil > DateTime.Now
@@ -184,7 +184,7 @@ public void DetermineBestBreeding(Creature chosenCreature = null, bool forceUpda
breedingPlanNeedsUpdate = false;
}
- private List FilterByTags(IEnumerable cl)
+ private IEnumerable FilterByTags(IEnumerable cl)
{
List excludingTagList = tagSelectorList1.excludingTags;
List includingTagList = tagSelectorList1.includingTags;
@@ -223,7 +223,7 @@ private List FilterByTags(IEnumerable cl)
}
return filteredList;
}
- return cl.ToList();
+ return cl;
}
///
@@ -269,45 +269,51 @@ private void CalculateBreedingScoresAndDisplayPairs(BreedingMode breedingMode, b
// filter by tags
int crCountF = females.Count;
int crCountM = males.Count;
- List chosenF, chosenM;
+ IEnumerable selectFemales;
+ IEnumerable selectMales;
if (considerChosenCreature && chosenCreature.sex == Sex.Female)
- chosenF = new List();
- else if (!cbBPMutationLimitOnlyOnePartner.Checked && considerMutationLimit) chosenF = FilterByTags(females.Where(c => c.Mutations <= nudBPMutationLimit.Value));
- else chosenF = FilterByTags(females);
+ selectFemales = new List();
+ else if (!cbBPMutationLimitOnlyOnePartner.Checked && considerMutationLimit) selectFemales = FilterByTags(females.Where(c => c.Mutations <= nudBPMutationLimit.Value));
+ else selectFemales = FilterByTags(females);
if (considerChosenCreature && chosenCreature.sex == Sex.Male)
- chosenM = new List();
- else if (!cbBPMutationLimitOnlyOnePartner.Checked && considerMutationLimit) chosenM = FilterByTags(males.Where(c => c.Mutations <= nudBPMutationLimit.Value));
- else chosenM = FilterByTags(males);
+ selectMales = new List();
+ else if (!cbBPMutationLimitOnlyOnePartner.Checked && considerMutationLimit) selectMales = FilterByTags(males.Where(c => c.Mutations <= nudBPMutationLimit.Value));
+ else selectMales = FilterByTags(males);
// filter by servers
if (cbServerFilterLibrary.Checked)
{
- chosenF = chosenF.Where(c => (string.IsNullOrEmpty(c.server) && !creatureCollection.hiddenServers.Contains("n/a"))
- || (!string.IsNullOrEmpty(c.server) && !creatureCollection.hiddenServers.Contains(c.server))).ToList();
- chosenM = chosenM.Where(c => (string.IsNullOrEmpty(c.server) && !creatureCollection.hiddenServers.Contains("n/a"))
- || (!string.IsNullOrEmpty(c.server) && !creatureCollection.hiddenServers.Contains(c.server))).ToList();
+ selectFemales = selectFemales.Where(c => !Properties.Settings.Default.FilterHideServers.Contains(c.server));
+ selectMales = selectMales.Where(c => !Properties.Settings.Default.FilterHideServers.Contains(c.server));
}
// filter by owner
if (cbOwnerFilterLibrary.Checked)
{
- chosenF = chosenF.Where(c => (string.IsNullOrEmpty(c.owner) && !creatureCollection.hiddenOwners.Contains("n/a"))
- || (!string.IsNullOrEmpty(c.owner) && !creatureCollection.hiddenOwners.Contains(c.owner))).ToList();
- chosenM = chosenM.Where(c => (string.IsNullOrEmpty(c.owner) && !creatureCollection.hiddenOwners.Contains("n/a"))
- || (!string.IsNullOrEmpty(c.owner) && !creatureCollection.hiddenOwners.Contains(c.owner))).ToList();
+ selectFemales = selectFemales.Where(c => !Properties.Settings.Default.FilterHideOwners.Contains(c.owner));
+ selectMales = selectMales.Where(c => !Properties.Settings.Default.FilterHideOwners.Contains(c.owner));
}
+ // filter by tribe
+ if (cbTribeFilterLibrary.Checked)
+ {
+ selectFemales = selectFemales.Where(c => !Properties.Settings.Default.FilterHideTribes.Contains(c.tribe));
+ selectMales = selectMales.Where(c => !Properties.Settings.Default.FilterHideTribes.Contains(c.tribe));
+ }
+
+ Creature[] selectedFemales = selectFemales.ToArray();
+ Creature[] selectedMales = selectMales.ToArray();
- bool creaturesTagFilteredOut = (crCountF != chosenF.Count)
- || (crCountM != chosenM.Count);
+ bool creaturesTagFilteredOut = (crCountF != selectedFemales.Length)
+ || (crCountM != selectedMales.Length);
bool creaturesMutationsFilteredOut = false;
bool displayFilterWarning = true;
- lbBreedingPlanHeader.Text = currentSpecies.DescriptiveNameAndMod + (considerChosenCreature ? " (" + string.Format(Loc.s("onlyPairingsWith"), chosenCreature.name) + ")" : string.Empty);
- if (considerChosenCreature && (chosenCreature.flags.HasFlag(CreatureFlags.Neutered) || chosenCreature.status != CreatureStatus.Available))
- lbBreedingPlanHeader.Text += $"{Loc.s("BreedingNotPossible")} ! ({(chosenCreature.flags.HasFlag(CreatureFlags.Neutered) ? Loc.s("Neutered") : Loc.s("notAvailable"))})";
+ lbBreedingPlanHeader.Text = currentSpecies.DescriptiveNameAndMod + (considerChosenCreature ? " (" + string.Format(Loc.S("onlyPairingsWith"), chosenCreature.name) + ")" : string.Empty);
+ if (considerChosenCreature && (chosenCreature.flags.HasFlag(CreatureFlags.Neutered) || chosenCreature.Status != CreatureStatus.Available))
+ lbBreedingPlanHeader.Text += $"{Loc.S("BreedingNotPossible")} ! ({(chosenCreature.flags.HasFlag(CreatureFlags.Neutered) ? Loc.S("Neutered") : Loc.S("notAvailable"))})";
- var combinedCreatures = new List(chosenF);
- combinedCreatures.AddRange(chosenM);
+ var combinedCreatures = new List(selectedFemales);
+ combinedCreatures.AddRange(selectedMales);
// determine top-stats for choosen creatures.
int[] topStats = new int[Values.STATS_COUNT];
foreach (Creature c in combinedCreatures)
@@ -321,20 +327,20 @@ private void CalculateBreedingScoresAndDisplayPairs(BreedingMode breedingMode, b
if (Properties.Settings.Default.IgnoreSexInBreedingPlan)
{
- chosenF = new List(combinedCreatures);
- chosenM = new List(combinedCreatures);
+ selectedFemales = combinedCreatures.ToArray();
+ selectedMales = combinedCreatures.ToArray();
}
// if only pairings for one specific creatures are shown, add the creature after the filtering
if (considerChosenCreature)
{
if (chosenCreature.sex == Sex.Female)
- chosenF = new List { chosenCreature };
+ selectedFemales = new Creature[] { chosenCreature };
if (chosenCreature.sex == Sex.Male)
- chosenM = new List { chosenCreature };
+ selectedMales = new Creature[] { chosenCreature };
}
- if (chosenF.Any() && chosenM.Any())
+ if (selectedFemales.Any() && selectedMales.Any())
{
pedigreeCreature1.Show();
pedigreeCreature2.Show();
@@ -343,12 +349,12 @@ private void CalculateBreedingScoresAndDisplayPairs(BreedingMode breedingMode, b
breedingPairs.Clear();
short[] bestPossLevels = new short[Values.STATS_COUNT]; // best possible levels
- for (int fi = 0; fi < chosenF.Count; fi++)
+ for (int fi = 0; fi < selectedFemales.Length; fi++)
{
- var female = chosenF[fi];
- for (int mi = 0; mi < chosenM.Count; mi++)
+ var female = selectedFemales[fi];
+ for (int mi = 0; mi < selectedMales.Length; mi++)
{
- var male = chosenM[mi];
+ var male = selectedMales[mi];
// if Properties.Settings.Default.IgnoreSexInBreedingPlan (useful when using S+ mutator), skip pair if
// creatures are the same, or pair has already been added
if (Properties.Settings.Default.IgnoreSexInBreedingPlan)
@@ -424,7 +430,7 @@ private void CalculateBreedingScoresAndDisplayPairs(BreedingMode breedingMode, b
// check if the best possible stat outcome already exists in a male
bool maleExists = false;
- foreach (Creature cr in chosenM)
+ foreach (Creature cr in selectMales)
{
maleExists = true;
for (int s = 0; s < Values.STATS_COUNT; s++)
@@ -445,7 +451,7 @@ private void CalculateBreedingScoresAndDisplayPairs(BreedingMode breedingMode, b
{
// check if the best possible stat outcome already exists in a female
bool femaleExists = false;
- foreach (Creature cr in chosenF)
+ foreach (Creature cr in selectFemales)
{
femaleExists = true;
for (int s = 0; s < Values.STATS_COUNT; s++)
@@ -605,7 +611,7 @@ private void CalculateBreedingScoresAndDisplayPairs(BreedingMode breedingMode, b
{
bool bestCreatureAlreadyAvailable = true;
Creature bestCreature = null;
- List choosenFemalesAndMales = chosenF.Concat(chosenM).ToList();
+ List choosenFemalesAndMales = selectFemales.Concat(selectMales).ToList();
foreach (Creature cr in choosenFemalesAndMales)
{
bestCreatureAlreadyAvailable = true;
@@ -628,7 +634,7 @@ private void CalculateBreedingScoresAndDisplayPairs(BreedingMode breedingMode, b
if (bestCreatureAlreadyAvailable)
{
displayFilterWarning = false;
- SetMessageLabelText(string.Format(Loc.s("AlreadyCreatureWithTopStats"), bestCreature.name, Utils.SexSymbol(bestCreature.sex)), MessageBoxIcon.Warning);
+ SetMessageLabelText(string.Format(Loc.S("AlreadyCreatureWithTopStats"), bestCreature.name, Utils.SexSymbol(bestCreature.sex)), MessageBoxIcon.Warning);
}
}
}
@@ -647,7 +653,7 @@ private void CalculateBreedingScoresAndDisplayPairs(BreedingMode breedingMode, b
pcs[2 * i + 1].Hide();
pbs[i].Hide();
}
- lbBreedingPlanInfo.Text = string.Format(Loc.s("NoPossiblePairingForSpeciesFound"), currentSpecies);
+ lbBreedingPlanInfo.Text = string.Format(Loc.S("NoPossiblePairingForSpeciesFound"), currentSpecies);
lbBreedingPlanInfo.Visible = true;
if (updateBreedingData)
SetBreedingData(currentSpecies);
@@ -657,8 +663,8 @@ private void CalculateBreedingScoresAndDisplayPairs(BreedingMode breedingMode, b
{
// display warning if breeding pairs are filtered out
string warningText = null;
- if (creaturesTagFilteredOut) warningText = Loc.s("BPsomeCreaturesAreFilteredOutTags") + ".\n" + Loc.s("BPTopStatsShownMightNotTotalTopStats");
- if (creaturesMutationsFilteredOut) warningText = (!string.IsNullOrEmpty(warningText) ? warningText + "\n" : string.Empty) + Loc.s("BPsomePairingsAreFilteredOutMutations");
+ if (creaturesTagFilteredOut) warningText = Loc.S("BPsomeCreaturesAreFilteredOutTags") + ".\n" + Loc.S("BPTopStatsShownMightNotTotalTopStats");
+ if (creaturesMutationsFilteredOut) warningText = (!string.IsNullOrEmpty(warningText) ? warningText + "\n" : string.Empty) + Loc.S("BPsomePairingsAreFilteredOutMutations");
if (!string.IsNullOrEmpty(warningText)) SetMessageLabelText(warningText, MessageBoxIcon.Warning);
}
@@ -721,7 +727,7 @@ public void Clear()
currentSpecies = null;
males.Clear();
females.Clear();
- lbBreedingPlanHeader.Text = Loc.s("SelectSpeciesBreedingPlanner");
+ lbBreedingPlanHeader.Text = Loc.S("SelectSpeciesBreedingPlanner");
}
private void SetBreedingData(Species species = null)
@@ -729,7 +735,7 @@ private void SetBreedingData(Species species = null)
listViewRaisingTimes.Items.Clear();
if (species?.breeding == null)
{
- listViewRaisingTimes.Items.Add(Loc.s("naYet"));
+ listViewRaisingTimes.Items.Add(Loc.S("naYet"));
labelBreedingInfos.Text = string.Empty;
}
else
@@ -740,7 +746,7 @@ private void SetBreedingData(Species species = null)
if (Raising.GetRaisingTimes(species, out TimeSpan matingTime, out string incubationMode, out incubationTime, out TimeSpan babyTime, out TimeSpan maturationTime, out TimeSpan nextMatingMin, out TimeSpan nextMatingMax))
{
if (matingTime != TimeSpan.Zero)
- listViewRaisingTimes.Items.Add(new ListViewItem(new[] { Loc.s("matingTime"), matingTime.ToString("d':'hh':'mm':'ss") }));
+ listViewRaisingTimes.Items.Add(new ListViewItem(new[] { Loc.S("matingTime"), matingTime.ToString("d':'hh':'mm':'ss") }));
TimeSpan totalTime = incubationTime;
DateTime until = DateTime.Now.Add(totalTime);
@@ -749,17 +755,17 @@ private void SetBreedingData(Species species = null)
totalTime += babyTime;
until = DateTime.Now.Add(totalTime);
- times = new[] { Loc.s("Baby"), babyTime.ToString("d':'hh':'mm':'ss"), totalTime.ToString("d':'hh':'mm':'ss"), Utils.ShortTimeDate(until) };
+ times = new[] { Loc.S("Baby"), babyTime.ToString("d':'hh':'mm':'ss"), totalTime.ToString("d':'hh':'mm':'ss"), Utils.ShortTimeDate(until) };
listViewRaisingTimes.Items.Add(new ListViewItem(times));
totalTime = incubationTime + maturationTime;
until = DateTime.Now.Add(totalTime);
- times = new[] { Loc.s("Maturation"), maturationTime.ToString("d':'hh':'mm':'ss"), totalTime.ToString("d':'hh':'mm':'ss"), Utils.ShortTimeDate(until) };
+ times = new[] { Loc.S("Maturation"), maturationTime.ToString("d':'hh':'mm':'ss"), totalTime.ToString("d':'hh':'mm':'ss"), Utils.ShortTimeDate(until) };
listViewRaisingTimes.Items.Add(new ListViewItem(times));
string eggInfo = Raising.EggTemperature(species);
- labelBreedingInfos.Text = (nextMatingMin != TimeSpan.Zero ? $"{Loc.s("TimeBetweenMating")}: {nextMatingMin:d':'hh':'mm':'ss} to {nextMatingMax:d':'hh':'mm':'ss}" : string.Empty)
+ labelBreedingInfos.Text = (nextMatingMin != TimeSpan.Zero ? $"{Loc.S("TimeBetweenMating")}: {nextMatingMin:d':'hh':'mm':'ss} to {nextMatingMax:d':'hh':'mm':'ss}" : string.Empty)
+ ((!string.IsNullOrEmpty(eggInfo) ? "\n" + eggInfo : string.Empty));
}
}
@@ -881,8 +887,8 @@ private void SetParents(int comboIndex)
}
crB.levelsWild[(int)StatNames.Torpidity] = crB.levelsWild.Sum();
crW.levelsWild[(int)StatNames.Torpidity] = crW.levelsWild.Sum();
- crB.name = Loc.s("BestPossible");
- crW.name = Loc.s("WorstPossible");
+ crB.name = Loc.S("BestPossible");
+ crW.name = Loc.S("WorstPossible");
crB.RecalculateCreatureValues(levelStep);
crW.RecalculateCreatureValues(levelStep);
pedigreeCreatureBest.TotalLevelUnknown = totalLevelUnknown;
@@ -895,8 +901,8 @@ private void SetParents(int comboIndex)
crW.mutationsPaternal = mutationCounterPaternal;
pedigreeCreatureBest.Creature = crB;
pedigreeCreatureWorst.Creature = crW;
- lbBPProbabilityBest.Text = $"{Loc.s("ProbabilityForBest")}: {Math.Round(100 * probabilityBest, 1)} %";
- lbMutationProbability.Text = $"{Loc.s("ProbabilityForOneMutation")}: {Math.Round(100 * breedingPairs[comboIndex].MutationProbability, 1)} %";
+ lbBPProbabilityBest.Text = $"{Loc.S("ProbabilityForBest")}: {Math.Round(100 * probabilityBest, 1)} %";
+ lbMutationProbability.Text = $"{Loc.S("ProbabilityForOneMutation")}: {Math.Round(100 * breedingPairs[comboIndex].MutationProbability, 1)} %";
// set probability barChart
offspringPossibilities1.Calculate(currentSpecies, mother.levelsWild, father.levelsWild);
@@ -1035,7 +1041,7 @@ public void SetSpeciesList(List species, List creatures)
{
ListViewItem lvi = new ListViewItem { Text = s.DescriptiveNameAndMod, Tag = s };
// check if species has both available males and females
- if (s == null || s.breeding == null || !creatures.Any(c => c.Species == s && c.status == CreatureStatus.Available && c.sex == Sex.Female) || !creatures.Any(c => c.Species == s && c.status == CreatureStatus.Available && c.sex == Sex.Male))
+ if (s == null || s.breeding == null || !creatures.Any(c => c.Species == s && c.Status == CreatureStatus.Available && c.sex == Sex.Female) || !creatures.Any(c => c.Species == s && c.Status == CreatureStatus.Available && c.sex == Sex.Male))
lvi.ForeColor = Color.LightGray;
listViewSpeciesBP.Items.Add(lvi);
}
@@ -1110,9 +1116,9 @@ public void SetLocalizations()
Loc.ControlText(btBPJustMated);
Loc.ControlText(cbBPOnlyOneSuggestionForFemales);
Loc.ControlText(cbBPMutationLimitOnlyOnePartner);
- columnHeader2.Text = Loc.s("Time");
- columnHeader3.Text = Loc.s("TotalTime");
- columnHeader4.Text = Loc.s("FinishedAt");
+ columnHeader2.Text = Loc.S("Time");
+ columnHeader3.Text = Loc.S("TotalTime");
+ columnHeader4.Text = Loc.S("FinishedAt");
// tooltips
Loc.ControlText(lbBPBreedingScore, tt);
@@ -1120,8 +1126,8 @@ public void SetLocalizations()
Loc.ControlText(rbBPTopStats, tt);
Loc.ControlText(rbBPHighStats, tt);
Loc.ControlText(btBPJustMated, tt);
- Loc.setToolTip(nudBPMutationLimit, tt);
- Loc.setToolTip(cbBPTagExcludeDefault, tt);
+ Loc.SetToolTip(nudBPMutationLimit, tt);
+ Loc.SetToolTip(cbBPTagExcludeDefault, tt);
}
private void cbServerFilterLibrary_CheckedChanged(object sender, EventArgs e)
diff --git a/ARKBreedingStats/CreatureBox.cs b/ARKBreedingStats/CreatureBox.cs
index 792b4e20..ebccdc9b 100644
--- a/ARKBreedingStats/CreatureBox.cs
+++ b/ARKBreedingStats/CreatureBox.cs
@@ -2,7 +2,6 @@
using ARKBreedingStats.Library;
using System;
using System.Collections.Generic;
-using System.Drawing;
using System.Windows.Forms;
namespace ARKBreedingStats
@@ -83,7 +82,7 @@ private void buttonEdit_Click(object sender, EventArgs e)
textBoxNote.Text = creature.note;
sex = creature.sex;
buttonSex.Text = Utils.SexSymbol(sex);
- creatureStatus = creature.status;
+ creatureStatus = creature.Status;
SetStatusButton(creatureStatus);
textBoxName.SelectAll();
textBoxName.Focus();
@@ -139,7 +138,7 @@ public void UpdateLabel()
statsDisplay1.SetCreatureValues(creature);
labelNotes.Text = creature.note;
labelSpecies.Text = creature.Species.name;
- pictureBox1.Image = CreatureColored.getColoredCreature(creature.colors, creature.Species, colorRegionUseds);
+ pictureBox1.Image = CreatureColored.GetColoredCreature(creature.colors, creature.Species, colorRegionUseds, creatureSex: creature.sex);
tt.SetToolTip(pictureBox1, CreatureColored.RegionColorInfo(creature.Species, creature.colors)
+ "\n\nClick to copy creature infos as image to the clipboard");
pictureBox1.Visible = true;
@@ -179,10 +178,10 @@ private void CloseSettings(bool save)
creature.isBred = checkBoxIsBred.Checked;
creature.note = textBoxNote.Text;
- bool creatureStatusChanged = (creature.status != creatureStatus);
- creature.status = creatureStatus;
+ bool creatureStatusChanged = (creature.Status != creatureStatus);
+ creature.Status = creatureStatus;
- Changed(creature, creatureStatusChanged, true);
+ Changed?.Invoke(creature, creatureStatusChanged, true);
UpdateLabel();
}
}
@@ -194,9 +193,9 @@ public void Clear()
parentComboBoxFather.Items.Clear();
parentList = new List[2];
CloseSettings(false);
- groupBox1.Text = "";
+ groupBox1.Text = string.Empty;
creature = null;
- labelParents.Text = "";
+ labelParents.Text = string.Empty;
statsDisplay1.Clear();
pictureBox1.Visible = false;
regionColorChooser1.Clear();
@@ -233,9 +232,11 @@ private void checkBoxIsBred_CheckedChanged(object sender, EventArgs e)
private void RegionColorChooser1_RegionColorChosen()
{
+ if (creature == null) return;
+
+ pictureBox1.Image = CreatureColored.GetColoredCreature(creature.colors, creature.Species, colorRegionUseds, creatureSex: creature.sex);
creature.colors = regionColorChooser1.ColorIDs;
- pictureBox1.Image = CreatureColored.getColoredCreature(creature.colors, creature.Species, colorRegionUseds);
- Changed(creature, false, false);
+ Changed?.Invoke(creature, false, false);
}
private void pictureBox1_Click(object sender, EventArgs e)
diff --git a/ARKBreedingStats/CreatureColored.cs b/ARKBreedingStats/CreatureColored.cs
index 472d07af..2a64871c 100644
--- a/ARKBreedingStats/CreatureColored.cs
+++ b/ARKBreedingStats/CreatureColored.cs
@@ -2,9 +2,11 @@
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
+using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
+using ARKBreedingStats.Library;
namespace ARKBreedingStats
{
@@ -15,59 +17,103 @@ static class CreatureColored
private const string extension = ".png";
///
- /// Returns a bitmap image that represents the given colors.
+ /// Returns a bitmap image that represents the given colors. If a species color file is available, that is used, else a pic-chart like representation.
///
///
///
///
///
///
- ///
- ///
+ /// Only return a pie-chart like color representation.
+ /// Only return an image of the colored creature. If that's not possible, return null.
///
- public static Bitmap getColoredCreature(int[] colorIds, Species species, bool[] enabledColorRegions, int size = 128, int pieSize = 64, bool onlyColors = false)
+ public static Bitmap GetColoredCreature(int[] colorIds, Species species, bool[] enabledColorRegions, int size = 128, int pieSize = 64, bool onlyColors = false, bool onlyImage = false, Library.Sex creatureSex = Sex.Unknown)
{
if (colorIds == null) return null;
- //float[][] hsl = new float[6][];
- int[][] rgb = new int[6][];
- for (int c = 0; c < 6; c++)
+ //float[][] hsl = new float[Species.ColorRegionCount][];
+ int[][] rgb = new int[Species.ColorRegionCount][];
+ for (int c = 0; c < Species.ColorRegionCount; c++)
{
- Color cl = CreatureColors.creatureColor(colorIds[c]);
+ Color cl = CreatureColors.CreatureColor(colorIds[c]);
rgb[c] = new int[] { cl.R, cl.G, cl.B };
}
- Bitmap bm = new Bitmap(size, size);
- using (Graphics graph = Graphics.FromImage(bm))
+
+ string imgFolder = Path.Combine(FileService.GetPath(), imageFolderName);
+ string cacheFolder = Path.Combine(FileService.GetPath(), imageFolderName, cacheFolderName);
+ string speciesName = species?.name ?? string.Empty;
+ // check if there are sex specific images
+ if (creatureSex != Sex.Unknown)
{
- graph.SmoothingMode = SmoothingMode.AntiAlias;
- string imgFolder = Path.Combine(FileService.GetPath(), imageFolderName);
- string cacheFolder = Path.Combine(FileService.GetPath(), imageFolderName, cacheFolderName);
- string speciesName = species?.name ?? string.Empty;
+ string speciesNameWithSex = null;
+ switch (creatureSex)
+ {
+ case Sex.Female:
+ speciesNameWithSex = speciesName + "F";
+ if (File.Exists(Path.Combine(imgFolder, speciesNameWithSex + extension)))
+ speciesName = speciesNameWithSex;
+ break;
+ case Sex.Male:
+ speciesNameWithSex = speciesName + "M";
+ if (File.Exists(Path.Combine(imgFolder, speciesNameWithSex + extension)))
+ speciesName = speciesNameWithSex;
+ break;
+ }
+ }
- string cacheFileName = Path.Combine(cacheFolder, speciesName.Substring(0, Math.Min(speciesName.Length, 5)) + "_" + (speciesName + string.Join("", colorIds.Select(i => i.ToString()).ToArray())).GetHashCode().ToString("X8") + extension);
- if (!onlyColors && File.Exists(Path.Combine(imgFolder, speciesName + extension)) && File.Exists(Path.Combine(imgFolder, speciesName + "_m" + extension)))
+ string speciesBackgroundFilePath = Path.Combine(imgFolder, speciesName + extension);
+ string cacheFileName = Path.Combine(cacheFolder, speciesName.Substring(0, Math.Min(speciesName.Length, 5)) + "_" + (speciesName + string.Join("", colorIds.Select(i => i.ToString()))).GetHashCode().ToString("X8") + extension);
+ string speciesColorMaskFilePath = Path.Combine(imgFolder, speciesName + "_m" + extension);
+ if (!onlyColors && File.Exists(speciesBackgroundFilePath) && File.Exists(speciesColorMaskFilePath) && !File.Exists(cacheFileName))
+ {
+ using (Bitmap bmpBackground = new Bitmap(speciesBackgroundFilePath))
+ using (Bitmap bmpCreature = new Bitmap(bmpBackground.Width, bmpBackground.Height, PixelFormat.Format32bppArgb))
+ using (Graphics graph = Graphics.FromImage(bmpCreature))
{
- if (!File.Exists(cacheFileName))
+ bool imageFine = false;
+ graph.SmoothingMode = SmoothingMode.AntiAlias;
+ const int defaultSizeOfTemplates = 256;
+
+ using (Bitmap bmpMask = new Bitmap(defaultSizeOfTemplates, defaultSizeOfTemplates))
{
- const int defaultSizeOfTemplates = 256;
- Bitmap bmC = new Bitmap(Path.Combine(imgFolder, speciesName + extension));
- graph.DrawImage(new Bitmap(Path.Combine(imgFolder, speciesName + extension)), 0, 0, defaultSizeOfTemplates, defaultSizeOfTemplates);
- Bitmap mask = new Bitmap(defaultSizeOfTemplates, defaultSizeOfTemplates);
- Graphics.FromImage(mask).DrawImage(new Bitmap(Path.Combine(imgFolder, speciesName + "_m" + extension)), 0, 0, defaultSizeOfTemplates, defaultSizeOfTemplates);
+ using (var g = Graphics.FromImage(bmpMask))
+ using (var bmpMaskOriginal = new Bitmap(speciesColorMaskFilePath))
+ g.DrawImage(bmpMaskOriginal, 0, 0,
+ defaultSizeOfTemplates, defaultSizeOfTemplates);
float o = 0;
- bool imageFine = false;
try
{
- for (int i = 0; i < bmC.Width; i++)
+ const int shadowValue = 220;
+ // background
+ using (var b = new SolidBrush(Color.FromArgb(100, shadowValue, shadowValue, shadowValue)))
{
- for (int j = 0; j < bmC.Height; j++)
+ int scx = defaultSizeOfTemplates / 2;
+ int scy = (int)(scx * 1.6);
+ int factor = 25;
+ int sr = scx - 2 * factor;
+ double heightFactor = 0.3;
+
+ for (int i = 2; i >= 0; i--)
+ {
+ int radius = sr + i * factor;
+ graph.FillEllipse(b, scx - radius, scy - (int)(heightFactor * .7 * radius), 2 * radius,
+ (int)(2 * heightFactor * radius));
+ }
+ }
+
+ graph.DrawImage(bmpBackground, 0, 0, defaultSizeOfTemplates, defaultSizeOfTemplates);
+
+ for (int i = 0; i < bmpBackground.Width; i++)
+ {
+ for (int j = 0; j < bmpBackground.Height; j++)
{
- Color bc = bmC.GetPixel(i, j);
+ Color bc = bmpBackground.GetPixel(i, j);
if (bc.A > 0)
{
- int r = mask.GetPixel(i, j).R;
- int g = mask.GetPixel(i, j).G;
- int b = mask.GetPixel(i, j).B;
- for (int m = 0; m < 6; m++)
+ var cl = bmpMask.GetPixel(i, j);
+ int r = cl.R;
+ int g = cl.G;
+ int b = cl.B;
+ for (int m = 0; m < Species.ColorRegionCount; m++)
{
if (!enabledColorRegions[m] || colorIds[m] == 0)
continue;
@@ -92,6 +138,7 @@ public static Bitmap getColoredCreature(int[] colorIds, Species species, bool[]
o = Math.Min(r, b) / 255f;
break;
}
+
if (o == 0)
continue;
// using "grain merge", e.g. see https://docs.gimp.org/en/gimp-concepts-layer-modes.html
@@ -105,27 +152,40 @@ public static Bitmap getColoredCreature(int[] colorIds, Species species, bool[]
if (bMix < 0) bMix = 0;
else if (bMix > 255) bMix = 255;
Color c = Color.FromArgb(rMix, gMix, bMix);
- bc = Color.FromArgb(bc.A, (int)(o * c.R + (1 - o) * bc.R), (int)(o * c.G + (1 - o) * bc.G), (int)(o * c.B + (1 - o) * bc.B));
+ bc = Color.FromArgb(bc.A, (int)(o * c.R + (1 - o) * bc.R),
+ (int)(o * c.G + (1 - o) * bc.G), (int)(o * c.B + (1 - o) * bc.B));
}
- bmC.SetPixel(i, j, bc);
+
+ bmpCreature.SetPixel(i, j, bc);
}
}
}
+
imageFine = true;
}
catch
{
// error during drawing, maybe mask is smaller than image
}
- if (imageFine)
- {
- if (!Directory.Exists(cacheFolder))
- Directory.CreateDirectory(cacheFolder);
- bmC.Save(cacheFileName); // safe in cache}
- }
+ }
+ if (imageFine)
+ {
+ if (!Directory.Exists(cacheFolder))
+ Directory.CreateDirectory(cacheFolder);
+ bmpCreature.Save(cacheFileName); // safe in cache}
}
}
- if (File.Exists(cacheFileName))
+ }
+
+ bool cacheFileExists = File.Exists(cacheFileName);
+
+ if (onlyImage && !cacheFileExists) return null;
+
+ Bitmap bm = new Bitmap(size, size);
+ using (Graphics graph = Graphics.FromImage(bm))
+ {
+ graph.SmoothingMode = SmoothingMode.AntiAlias;
+ if (cacheFileExists)
{
graph.CompositingMode = CompositingMode.SourceCopy;
graph.CompositingQuality = CompositingQuality.HighQuality;
@@ -140,23 +200,28 @@ public static Bitmap getColoredCreature(int[] colorIds, Species species, bool[]
int pieAngle = enabledColorRegions.Count(c => c);
pieAngle = 360 / (pieAngle > 0 ? pieAngle : 1);
int pieNr = 0;
- for (int c = 0; c < 6; c++)
+ for (int c = 0; c < Species.ColorRegionCount; c++)
{
if (enabledColorRegions[c])
{
if (colorIds[c] > 0)
{
- using (var b = new SolidBrush(CreatureColors.creatureColor(colorIds[c])))
+ using (var b = new SolidBrush(CreatureColors.CreatureColor(colorIds[c])))
{
- graph.FillPie(b, (size - pieSize) / 2, (size - pieSize) / 2, pieSize, pieSize, pieNr * pieAngle + 270, pieAngle);
+ graph.FillPie(b, (size - pieSize) / 2, (size - pieSize) / 2, pieSize, pieSize,
+ pieNr * pieAngle + 270, pieAngle);
}
}
+
pieNr++;
}
}
- graph.DrawEllipse(new Pen(Color.Gray), (size - pieSize) / 2, (size - pieSize) / 2, pieSize, pieSize);
+
+ using (var pen = new Pen(Color.Gray))
+ graph.DrawEllipse(pen, (size - pieSize) / 2, (size - pieSize) / 2, pieSize, pieSize);
}
}
+
return bm;
}
@@ -166,11 +231,11 @@ public static string RegionColorInfo(Species species, int[] colorIds)
var creatureRegionColors = new StringBuilder("Colors:");
var cs = species.colors;
- for (int r = 0; r < 6; r++)
+ for (int r = 0; r < Species.ColorRegionCount; r++)
{
if (!string.IsNullOrEmpty(cs[r]?.name))
{
- creatureRegionColors.Append($"\n{cs[r].name} ({r}): {CreatureColors.creatureColorName(colorIds[r])} ({colorIds[r]})");
+ creatureRegionColors.Append($"\n{cs[r].name} ({r}): {CreatureColors.CreatureColorName(colorIds[r])} ({colorIds[r]})");
}
}
return creatureRegionColors.ToString();
diff --git a/ARKBreedingStats/CreatureInfoInput.Designer.cs b/ARKBreedingStats/CreatureInfoInput.Designer.cs
index 45d89be8..0a605bc5 100644
--- a/ARKBreedingStats/CreatureInfoInput.Designer.cs
+++ b/ARKBreedingStats/CreatureInfoInput.Designer.cs
@@ -31,6 +31,8 @@ protected override void Dispose(bool disposing)
private void InitializeComponent()
{
this.gbCreatureInfo = new System.Windows.Forms.GroupBox();
+ this.BtApplyOTSPreset = new System.Windows.Forms.Button();
+ this.BtSaveOTSPreset = new System.Windows.Forms.Button();
this.btNamingPattern6 = new System.Windows.Forms.Button();
this.btNamingPattern5 = new System.Windows.Forms.Button();
this.btNamingPattern4 = new System.Windows.Forms.Button();
@@ -79,8 +81,6 @@ private void InitializeComponent()
this.lbOwner = new System.Windows.Forms.Label();
this.lbName = new System.Windows.Forms.Label();
this.btAdd2Library = new System.Windows.Forms.Button();
- this.BtSaveOTSPreset = new System.Windows.Forms.Button();
- this.BtApplyOTSPreset = new System.Windows.Forms.Button();
this.gbCreatureInfo.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudMutationsFather)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudMutationsMother)).BeginInit();
@@ -142,17 +142,37 @@ private void InitializeComponent()
this.gbCreatureInfo.Dock = System.Windows.Forms.DockStyle.Fill;
this.gbCreatureInfo.Location = new System.Drawing.Point(0, 0);
this.gbCreatureInfo.Name = "gbCreatureInfo";
- this.gbCreatureInfo.Size = new System.Drawing.Size(229, 542);
+ this.gbCreatureInfo.Size = new System.Drawing.Size(262, 542);
this.gbCreatureInfo.TabIndex = 0;
this.gbCreatureInfo.TabStop = false;
this.gbCreatureInfo.Text = "Creature-info";
this.gbCreatureInfo.Enter += new System.EventHandler(this.groupBox1_Enter);
//
+ // BtApplyOTSPreset
+ //
+ this.BtApplyOTSPreset.Location = new System.Drawing.Point(50, 70);
+ this.BtApplyOTSPreset.Name = "BtApplyOTSPreset";
+ this.BtApplyOTSPreset.Size = new System.Drawing.Size(101, 20);
+ this.BtApplyOTSPreset.TabIndex = 50;
+ this.BtApplyOTSPreset.Text = "Preset OTS";
+ this.BtApplyOTSPreset.UseVisualStyleBackColor = true;
+ this.BtApplyOTSPreset.Click += new System.EventHandler(this.BtApplyOTSPreset_Click);
+ //
+ // BtSaveOTSPreset
+ //
+ this.BtSaveOTSPreset.Location = new System.Drawing.Point(157, 70);
+ this.BtSaveOTSPreset.Name = "BtSaveOTSPreset";
+ this.BtSaveOTSPreset.Size = new System.Drawing.Size(99, 20);
+ this.BtSaveOTSPreset.TabIndex = 49;
+ this.BtSaveOTSPreset.Text = "Save Preset";
+ this.BtSaveOTSPreset.UseVisualStyleBackColor = true;
+ this.BtSaveOTSPreset.Click += new System.EventHandler(this.BtSaveOTSPreset_Click);
+ //
// btNamingPattern6
//
- this.btNamingPattern6.Location = new System.Drawing.Point(190, 44);
+ this.btNamingPattern6.Location = new System.Drawing.Point(220, 44);
this.btNamingPattern6.Name = "btNamingPattern6";
- this.btNamingPattern6.Size = new System.Drawing.Size(33, 20);
+ this.btNamingPattern6.Size = new System.Drawing.Size(36, 20);
this.btNamingPattern6.TabIndex = 48;
this.btNamingPattern6.TabStop = false;
this.btNamingPattern6.Text = "G6";
@@ -160,9 +180,9 @@ private void InitializeComponent()
//
// btNamingPattern5
//
- this.btNamingPattern5.Location = new System.Drawing.Point(155, 44);
+ this.btNamingPattern5.Location = new System.Drawing.Point(178, 44);
this.btNamingPattern5.Name = "btNamingPattern5";
- this.btNamingPattern5.Size = new System.Drawing.Size(30, 20);
+ this.btNamingPattern5.Size = new System.Drawing.Size(36, 20);
this.btNamingPattern5.TabIndex = 47;
this.btNamingPattern5.TabStop = false;
this.btNamingPattern5.Text = "G5";
@@ -170,9 +190,9 @@ private void InitializeComponent()
//
// btNamingPattern4
//
- this.btNamingPattern4.Location = new System.Drawing.Point(120, 44);
+ this.btNamingPattern4.Location = new System.Drawing.Point(136, 44);
this.btNamingPattern4.Name = "btNamingPattern4";
- this.btNamingPattern4.Size = new System.Drawing.Size(30, 20);
+ this.btNamingPattern4.Size = new System.Drawing.Size(36, 20);
this.btNamingPattern4.TabIndex = 46;
this.btNamingPattern4.TabStop = false;
this.btNamingPattern4.Text = "G4";
@@ -180,9 +200,9 @@ private void InitializeComponent()
//
// btNamingPattern3
//
- this.btNamingPattern3.Location = new System.Drawing.Point(85, 44);
+ this.btNamingPattern3.Location = new System.Drawing.Point(94, 44);
this.btNamingPattern3.Name = "btNamingPattern3";
- this.btNamingPattern3.Size = new System.Drawing.Size(30, 20);
+ this.btNamingPattern3.Size = new System.Drawing.Size(36, 20);
this.btNamingPattern3.TabIndex = 45;
this.btNamingPattern3.TabStop = false;
this.btNamingPattern3.Text = "G3";
@@ -190,9 +210,9 @@ private void InitializeComponent()
//
// btNamingPattern2
//
- this.btNamingPattern2.Location = new System.Drawing.Point(50, 44);
+ this.btNamingPattern2.Location = new System.Drawing.Point(52, 44);
this.btNamingPattern2.Name = "btNamingPattern2";
- this.btNamingPattern2.Size = new System.Drawing.Size(30, 20);
+ this.btNamingPattern2.Size = new System.Drawing.Size(36, 20);
this.btNamingPattern2.TabIndex = 44;
this.btNamingPattern2.TabStop = false;
this.btNamingPattern2.Text = "G2";
@@ -200,9 +220,9 @@ private void InitializeComponent()
//
// btNamingPatternEditor
//
- this.btNamingPatternEditor.Location = new System.Drawing.Point(201, 19);
+ this.btNamingPatternEditor.Location = new System.Drawing.Point(232, 19);
this.btNamingPatternEditor.Name = "btNamingPatternEditor";
- this.btNamingPatternEditor.Size = new System.Drawing.Size(22, 20);
+ this.btNamingPatternEditor.Size = new System.Drawing.Size(24, 20);
this.btNamingPatternEditor.TabIndex = 43;
this.btNamingPatternEditor.Text = "⚙";
this.btNamingPatternEditor.UseVisualStyleBackColor = true;
@@ -210,9 +230,9 @@ private void InitializeComponent()
//
// btnGenerateUniqueName
//
- this.btnGenerateUniqueName.Location = new System.Drawing.Point(177, 19);
+ this.btnGenerateUniqueName.Location = new System.Drawing.Point(202, 19);
this.btnGenerateUniqueName.Name = "btnGenerateUniqueName";
- this.btnGenerateUniqueName.Size = new System.Drawing.Size(22, 20);
+ this.btnGenerateUniqueName.Size = new System.Drawing.Size(24, 20);
this.btnGenerateUniqueName.TabIndex = 1;
this.btnGenerateUniqueName.TabStop = false;
this.btnGenerateUniqueName.Text = "Generate";
@@ -220,7 +240,7 @@ private void InitializeComponent()
//
// tbArkIdIngame
//
- this.tbArkIdIngame.Location = new System.Drawing.Point(83, 281);
+ this.tbArkIdIngame.Location = new System.Drawing.Point(118, 281);
this.tbArkIdIngame.Name = "tbArkIdIngame";
this.tbArkIdIngame.ReadOnly = true;
this.tbArkIdIngame.Size = new System.Drawing.Size(138, 20);
@@ -228,9 +248,9 @@ private void InitializeComponent()
//
// tbARKID
//
- this.tbARKID.Location = new System.Drawing.Point(50, 255);
+ this.tbARKID.Location = new System.Drawing.Point(68, 255);
this.tbARKID.Name = "tbARKID";
- this.tbARKID.Size = new System.Drawing.Size(172, 20);
+ this.tbARKID.Size = new System.Drawing.Size(188, 20);
this.tbARKID.TabIndex = 8;
//
// cbServer
@@ -238,25 +258,25 @@ private void InitializeComponent()
this.cbServer.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Append;
this.cbServer.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
this.cbServer.FormattingEnabled = true;
- this.cbServer.Location = new System.Drawing.Point(50, 148);
+ this.cbServer.Location = new System.Drawing.Point(68, 148);
this.cbServer.Name = "cbServer";
- this.cbServer.Size = new System.Drawing.Size(172, 21);
+ this.cbServer.Size = new System.Drawing.Size(188, 21);
this.cbServer.TabIndex = 4;
//
// textBoxTribe
//
this.textBoxTribe.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
this.textBoxTribe.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
- this.textBoxTribe.Location = new System.Drawing.Point(50, 122);
+ this.textBoxTribe.Location = new System.Drawing.Point(68, 122);
this.textBoxTribe.Name = "textBoxTribe";
- this.textBoxTribe.Size = new System.Drawing.Size(172, 20);
+ this.textBoxTribe.Size = new System.Drawing.Size(188, 20);
this.textBoxTribe.TabIndex = 3;
//
// textBoxNote
//
- this.textBoxNote.Location = new System.Drawing.Point(50, 229);
+ this.textBoxNote.Location = new System.Drawing.Point(68, 229);
this.textBoxNote.Name = "textBoxNote";
- this.textBoxNote.Size = new System.Drawing.Size(172, 20);
+ this.textBoxNote.Size = new System.Drawing.Size(188, 20);
this.textBoxNote.TabIndex = 7;
//
// parentComboBoxFather
@@ -264,10 +284,10 @@ private void InitializeComponent()
this.parentComboBoxFather.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
this.parentComboBoxFather.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.parentComboBoxFather.FormattingEnabled = true;
- this.parentComboBoxFather.Location = new System.Drawing.Point(50, 202);
+ this.parentComboBoxFather.Location = new System.Drawing.Point(68, 202);
this.parentComboBoxFather.Name = "parentComboBoxFather";
this.parentComboBoxFather.PreselectedCreatureGuid = new System.Guid("00000000-0000-0000-0000-000000000000");
- this.parentComboBoxFather.Size = new System.Drawing.Size(172, 21);
+ this.parentComboBoxFather.Size = new System.Drawing.Size(188, 21);
this.parentComboBoxFather.TabIndex = 6;
this.parentComboBoxFather.SelectedIndexChanged += new System.EventHandler(this.parentComboBox_SelectedIndexChanged);
//
@@ -276,10 +296,10 @@ private void InitializeComponent()
this.parentComboBoxMother.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
this.parentComboBoxMother.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.parentComboBoxMother.FormattingEnabled = true;
- this.parentComboBoxMother.Location = new System.Drawing.Point(50, 175);
+ this.parentComboBoxMother.Location = new System.Drawing.Point(68, 175);
this.parentComboBoxMother.Name = "parentComboBoxMother";
this.parentComboBoxMother.PreselectedCreatureGuid = new System.Guid("00000000-0000-0000-0000-000000000000");
- this.parentComboBoxMother.Size = new System.Drawing.Size(172, 21);
+ this.parentComboBoxMother.Size = new System.Drawing.Size(188, 21);
this.parentComboBoxMother.TabIndex = 5;
this.parentComboBoxMother.SelectedIndexChanged += new System.EventHandler(this.parentComboBox_SelectedIndexChanged);
//
@@ -287,9 +307,9 @@ private void InitializeComponent()
//
this.textBoxOwner.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
this.textBoxOwner.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
- this.textBoxOwner.Location = new System.Drawing.Point(50, 96);
+ this.textBoxOwner.Location = new System.Drawing.Point(68, 96);
this.textBoxOwner.Name = "textBoxOwner";
- this.textBoxOwner.Size = new System.Drawing.Size(172, 20);
+ this.textBoxOwner.Size = new System.Drawing.Size(188, 20);
this.textBoxOwner.TabIndex = 2;
this.textBoxOwner.Leave += new System.EventHandler(this.textBoxOwner_Leave);
//
@@ -297,14 +317,14 @@ private void InitializeComponent()
//
this.textBoxName.Location = new System.Drawing.Point(50, 19);
this.textBoxName.Name = "textBoxName";
- this.textBoxName.Size = new System.Drawing.Size(125, 20);
+ this.textBoxName.Size = new System.Drawing.Size(146, 20);
this.textBoxName.TabIndex = 0;
this.textBoxName.TextChanged += new System.EventHandler(this.textBoxName_TextChanged);
//
// nudMutationsFather
//
this.nudMutationsFather.ForeColor = System.Drawing.SystemColors.GrayText;
- this.nudMutationsFather.Location = new System.Drawing.Point(162, 386);
+ this.nudMutationsFather.Location = new System.Drawing.Point(196, 386);
this.nudMutationsFather.Maximum = new decimal(new int[] {
2147483647,
0,
@@ -328,7 +348,7 @@ private void InitializeComponent()
// nudMutationsMother
//
this.nudMutationsMother.ForeColor = System.Drawing.SystemColors.GrayText;
- this.nudMutationsMother.Location = new System.Drawing.Point(80, 386);
+ this.nudMutationsMother.Location = new System.Drawing.Point(107, 386);
this.nudMutationsMother.Maximum = new decimal(new int[] {
2147483647,
0,
@@ -352,7 +372,7 @@ private void InitializeComponent()
// label12
//
this.label12.AutoSize = true;
- this.label12.Location = new System.Drawing.Point(147, 388);
+ this.label12.Location = new System.Drawing.Point(173, 388);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(17, 13);
this.label12.TabIndex = 34;
@@ -361,7 +381,7 @@ private void InitializeComponent()
// label11
//
this.label11.AutoSize = true;
- this.label11.Location = new System.Drawing.Point(65, 388);
+ this.label11.Location = new System.Drawing.Point(85, 388);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(16, 13);
this.label11.TabIndex = 33;
@@ -369,7 +389,7 @@ private void InitializeComponent()
//
// dhmsInputGrown
//
- this.dhmsInputGrown.Location = new System.Drawing.Point(86, 331);
+ this.dhmsInputGrown.Location = new System.Drawing.Point(120, 331);
this.dhmsInputGrown.Name = "dhmsInputGrown";
this.dhmsInputGrown.Size = new System.Drawing.Size(136, 26);
this.dhmsInputGrown.TabIndex = 10;
@@ -378,7 +398,7 @@ private void InitializeComponent()
//
// dhmsInputCooldown
//
- this.dhmsInputCooldown.Location = new System.Drawing.Point(86, 304);
+ this.dhmsInputCooldown.Location = new System.Drawing.Point(120, 304);
this.dhmsInputCooldown.Name = "dhmsInputCooldown";
this.dhmsInputCooldown.Size = new System.Drawing.Size(136, 26);
this.dhmsInputCooldown.TabIndex = 9;
@@ -388,7 +408,7 @@ private void InitializeComponent()
//
this.nudMaturation.DecimalPlaces = 2;
this.nudMaturation.ForeColor = System.Drawing.SystemColors.WindowText;
- this.nudMaturation.Location = new System.Drawing.Point(89, 360);
+ this.nudMaturation.Location = new System.Drawing.Point(180, 360);
this.nudMaturation.Name = "nudMaturation";
this.nudMaturation.NeutralNumber = new decimal(new int[] {
0,
@@ -408,7 +428,7 @@ private void InitializeComponent()
//
this.cbNeutered.Appearance = System.Windows.Forms.Appearance.Button;
this.cbNeutered.AutoSize = true;
- this.cbNeutered.Location = new System.Drawing.Point(91, 412);
+ this.cbNeutered.Location = new System.Drawing.Point(109, 412);
this.cbNeutered.Name = "cbNeutered";
this.cbNeutered.Size = new System.Drawing.Size(61, 23);
this.cbNeutered.TabIndex = 15;
@@ -419,7 +439,7 @@ private void InitializeComponent()
//
this.dateTimePickerAdded.Checked = false;
this.dateTimePickerAdded.Format = System.Windows.Forms.DateTimePickerFormat.Time;
- this.dateTimePickerAdded.Location = new System.Drawing.Point(146, 440);
+ this.dateTimePickerAdded.Location = new System.Drawing.Point(180, 440);
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);
@@ -427,7 +447,7 @@ private void InitializeComponent()
//
// buttonStatus
//
- this.buttonStatus.Location = new System.Drawing.Point(49, 441);
+ this.buttonStatus.Location = new System.Drawing.Point(68, 441);
this.buttonStatus.Name = "buttonStatus";
this.buttonStatus.Size = new System.Drawing.Size(35, 23);
this.buttonStatus.TabIndex = 16;
@@ -436,7 +456,7 @@ private void InitializeComponent()
//
// buttonSex
//
- this.buttonSex.Location = new System.Drawing.Point(50, 412);
+ this.buttonSex.Location = new System.Drawing.Point(68, 412);
this.buttonSex.Name = "buttonSex";
this.buttonSex.Size = new System.Drawing.Size(35, 23);
this.buttonSex.TabIndex = 14;
@@ -446,10 +466,10 @@ private void InitializeComponent()
//
// lbNewMutations
//
- this.lbNewMutations.AutoSize = true;
- this.lbNewMutations.Location = new System.Drawing.Point(186, 417);
+ this.lbNewMutations.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.lbNewMutations.Location = new System.Drawing.Point(180, 417);
this.lbNewMutations.Name = "lbNewMutations";
- this.lbNewMutations.Size = new System.Drawing.Size(30, 13);
+ this.lbNewMutations.Size = new System.Drawing.Size(76, 13);
this.lbNewMutations.TabIndex = 42;
this.lbNewMutations.Text = "+mut";
this.lbNewMutations.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
@@ -474,21 +494,22 @@ private void InitializeComponent()
//
// btClearColors
//
- this.btClearColors.Location = new System.Drawing.Point(2, 470);
+ this.btClearColors.Location = new System.Drawing.Point(6, 470);
this.btClearColors.Name = "btClearColors";
- this.btClearColors.Size = new System.Drawing.Size(45, 23);
+ this.btClearColors.Size = new System.Drawing.Size(73, 23);
this.btClearColors.TabIndex = 37;
- this.btClearColors.Text = "Colors";
+ this.btClearColors.Text = "Clear colors";
this.btClearColors.UseVisualStyleBackColor = true;
this.btClearColors.Click += new System.EventHandler(this.btClearColors_Click);
//
// regionColorChooser1
//
- this.regionColorChooser1.Location = new System.Drawing.Point(48, 467);
+ this.regionColorChooser1.Location = new System.Drawing.Point(82, 467);
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 = 19;
+ this.regionColorChooser1.VerboseButtonTexts = false;
//
// lbServer
//
@@ -540,7 +561,7 @@ private void InitializeComponent()
// label7
//
this.label7.AutoSize = true;
- this.label7.Location = new System.Drawing.Point(105, 446);
+ this.label7.Location = new System.Drawing.Point(136, 446);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(38, 13);
this.label7.TabIndex = 17;
@@ -575,9 +596,10 @@ private void InitializeComponent()
//
// btSaveChanges
//
- this.btSaveChanges.Location = new System.Drawing.Point(89, 499);
+ this.btSaveChanges.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.btSaveChanges.Location = new System.Drawing.Point(6, 499);
this.btSaveChanges.Name = "btSaveChanges";
- this.btSaveChanges.Size = new System.Drawing.Size(60, 37);
+ this.btSaveChanges.Size = new System.Drawing.Size(124, 37);
this.btSaveChanges.TabIndex = 20;
this.btSaveChanges.Text = "Save Changes";
this.btSaveChanges.UseVisualStyleBackColor = true;
@@ -635,41 +657,22 @@ private void InitializeComponent()
//
// btAdd2Library
//
- this.btAdd2Library.Location = new System.Drawing.Point(89, 499);
+ this.btAdd2Library.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.btAdd2Library.Location = new System.Drawing.Point(6, 499);
this.btAdd2Library.Name = "btAdd2Library";
- this.btAdd2Library.Size = new System.Drawing.Size(134, 37);
+ this.btAdd2Library.Size = new System.Drawing.Size(250, 37);
this.btAdd2Library.TabIndex = 21;
this.btAdd2Library.Text = "Add new to Library";
this.btAdd2Library.UseVisualStyleBackColor = true;
this.btAdd2Library.Click += new System.EventHandler(this.buttonAdd2Library_Click);
//
- // BtSaveOTSPreset
- //
- this.BtSaveOTSPreset.Location = new System.Drawing.Point(139, 70);
- this.BtSaveOTSPreset.Name = "BtSaveOTSPreset";
- this.BtSaveOTSPreset.Size = new System.Drawing.Size(84, 20);
- this.BtSaveOTSPreset.TabIndex = 49;
- this.BtSaveOTSPreset.Text = "Save Preset";
- this.BtSaveOTSPreset.UseVisualStyleBackColor = true;
- this.BtSaveOTSPreset.Click += new System.EventHandler(this.BtSaveOTSPreset_Click);
- //
- // BtApplyOTSPreset
- //
- this.BtApplyOTSPreset.Location = new System.Drawing.Point(50, 70);
- this.BtApplyOTSPreset.Name = "BtApplyOTSPreset";
- this.BtApplyOTSPreset.Size = new System.Drawing.Size(83, 20);
- this.BtApplyOTSPreset.TabIndex = 50;
- this.BtApplyOTSPreset.Text = "Preset OTS";
- this.BtApplyOTSPreset.UseVisualStyleBackColor = true;
- this.BtApplyOTSPreset.Click += new System.EventHandler(this.BtApplyOTSPreset_Click);
- //
// CreatureInfoInput
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.gbCreatureInfo);
this.Name = "CreatureInfoInput";
- this.Size = new System.Drawing.Size(229, 542);
+ this.Size = new System.Drawing.Size(262, 542);
this.gbCreatureInfo.ResumeLayout(false);
this.gbCreatureInfo.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudMutationsFather)).EndInit();
diff --git a/ARKBreedingStats/CreatureInfoInput.cs b/ARKBreedingStats/CreatureInfoInput.cs
index 23c214a4..09b2c564 100644
--- a/ARKBreedingStats/CreatureInfoInput.cs
+++ b/ARKBreedingStats/CreatureInfoInput.cs
@@ -15,21 +15,20 @@ public partial class CreatureInfoInput : UserControl
public event Action ParentListRequested;
public delegate void RequestCreatureDataEventHandler(CreatureInfoInput sender, bool openPatternEditor, bool showDuplicateNameWarning, int namingPatternIndex);
public event RequestCreatureDataEventHandler CreatureDataRequested;
- public bool extractor;
- private Sex sex;
+ private Sex _sex;
private CreatureFlags _creatureFlags;
public Guid CreatureGuid;
public bool ArkIdImported;
- private CreatureStatus creatureStatus;
+ private CreatureStatus _creatureStatus;
public bool parentListValid; // TODO change to parameter, if set to false, show n/a in the comboboxes
- private Species selectedSpecies;
- private ToolTip tt = new ToolTip();
- private bool updateMaturation;
+ private Species _selectedSpecies;
+ private readonly ToolTip _tt;
+ private bool _updateMaturation;
private List _females;
private List _males;
public List NamesOfAllCreatures;
private string[] _ownersTribes;
- private int[] regionColorIDs;
+ private int[] _regionColorIDs;
private bool _tribeLock, _ownerLock;
public long MotherArkId, FatherArkId; // is only used when importing creatures with set parents. these ids are set externally after the creature data is set in the infoinput
///
@@ -37,19 +36,21 @@ public partial class CreatureInfoInput : UserControl
///
private bool isNewCreature;
+ public PictureBox pBcolorRegion;
+
public CreatureInfoInput()
{
InitializeComponent();
- selectedSpecies = null;
- textBoxName.Text = "";
- parentComboBoxMother.naLabel = " - " + Loc.s("Mother") + " n/a";
- parentComboBoxMother.Items.Add(" - " + Loc.s("Mother") + " n/a");
- parentComboBoxFather.naLabel = " - " + Loc.s("Father") + " n/a";
- parentComboBoxFather.Items.Add(" - " + Loc.s("Father") + " n/a");
+ _selectedSpecies = null;
+ textBoxName.Text = string.Empty;
+ parentComboBoxMother.naLabel = " - " + Loc.S("Mother") + " n/a";
+ parentComboBoxMother.Items.Add(" - " + Loc.S("Mother") + " n/a");
+ parentComboBoxFather.naLabel = " - " + Loc.S("Father") + " n/a";
+ parentComboBoxFather.Items.Add(" - " + Loc.S("Father") + " n/a");
parentComboBoxMother.SelectedIndex = 0;
parentComboBoxFather.SelectedIndex = 0;
- updateMaturation = true;
- regionColorIDs = new int[6];
+ _updateMaturation = true;
+ _regionColorIDs = new int[6];
CooldownUntil = new DateTime(2000, 1, 1);
GrowingUntil = new DateTime(2000, 1, 1);
NamesOfAllCreatures = new List();
@@ -61,7 +62,7 @@ public CreatureInfoInput()
// apply naming pattern
namingPatternButtons[bi].Click += (s, e) =>
{
- if (selectedSpecies != null)
+ if (_selectedSpecies != null)
{
CreatureDataRequested?.Invoke(this, false, true, localIndex);
}
@@ -75,6 +76,16 @@ public CreatureInfoInput()
}
};
}
+ _tt = new ToolTip();
+
+ regionColorChooser1.RegionColorChosen += UpdateRegionColorImage;
+ }
+
+ private void UpdateRegionColorImage()
+ {
+ if (pBcolorRegion == null) return;
+
+ pBcolorRegion.Image = CreatureColored.GetColoredCreature(RegionColors, _selectedSpecies, regionColorChooser1.ColorRegionsUseds, 256, onlyImage: true, creatureSex: CreatureSex);
}
private void buttonAdd2Library_Click(object sender, EventArgs e)
@@ -111,25 +122,25 @@ public string CreatureTribe
public Sex CreatureSex
{
- get => sex;
+ get => _sex;
set
{
- sex = value;
- buttonSex.Text = Utils.SexSymbol(sex);
- buttonSex.BackColor = Utils.SexColor(sex);
- tt.SetToolTip(buttonSex, Loc.s("Sex") + ": " + Loc.s(sex.ToString()));
- cbNeutered.Text = Loc.s(sex == Sex.Female ? "Spayed" : "Neutered");
+ _sex = value;
+ buttonSex.Text = Utils.SexSymbol(_sex);
+ buttonSex.BackColor = Utils.SexColor(_sex);
+ _tt.SetToolTip(buttonSex, $"{Loc.S("Sex")}: {Loc.S(_sex.ToString())}");
+ cbNeutered.Text = Loc.S(_sex == Sex.Female ? "Spayed" : "Neutered");
}
}
public CreatureStatus CreatureStatus
{
- get => creatureStatus;
+ get => _creatureStatus;
set
{
- creatureStatus = value;
- buttonStatus.Text = Utils.StatusSymbol(creatureStatus);
- tt.SetToolTip(buttonStatus, Loc.s("Status") + ": " + Utils.StatusText(creatureStatus));
+ _creatureStatus = value;
+ buttonStatus.Text = Utils.StatusSymbol(_creatureStatus);
+ _tt.SetToolTip(buttonStatus, $"{Loc.S("Status")}: {Utils.StatusText(_creatureStatus)}");
}
}
@@ -166,12 +177,12 @@ public string CreatureNote
private void buttonSex_Click(object sender, EventArgs e)
{
- CreatureSex = Utils.NextSex(sex);
+ CreatureSex = Utils.NextSex(_sex);
}
private void buttonStatus_Click(object sender, EventArgs e)
{
- CreatureStatus = Utils.NextStatus(creatureStatus);
+ CreatureStatus = Utils.NextStatus(_creatureStatus);
}
public List[] Parents
@@ -211,8 +222,8 @@ public bool ShowSaveButton
set
{
btSaveChanges.Visible = value;
- btAdd2Library.Location = new Point((value ? 154 : 88), btAdd2Library.Location.Y);
- btAdd2Library.Size = new Size((value ? 68 : 134), 37);
+ btAdd2Library.Size = new Size((value ? 120 : 250), 37);
+ btAdd2Library.Location = new Point(value ? 136 : 6, btAdd2Library.Location.Y);
}
}
@@ -224,35 +235,35 @@ private void groupBox1_Enter(object sender, EventArgs e)
private void dhmsInputGrown_ValueChanged(object sender, TimeSpan ts)
{
- if (updateMaturation && selectedSpecies != null)
+ if (_updateMaturation && _selectedSpecies != null)
{
- updateMaturation = false;
+ _updateMaturation = false;
double maturation = 0;
- if (selectedSpecies.breeding != null && selectedSpecies.breeding.maturationTimeAdjusted > 0)
+ if (_selectedSpecies.breeding != null && _selectedSpecies.breeding.maturationTimeAdjusted > 0)
{
- maturation = 1 - dhmsInputGrown.Timespan.TotalSeconds / selectedSpecies.breeding.maturationTimeAdjusted;
+ maturation = 1 - dhmsInputGrown.Timespan.TotalSeconds / _selectedSpecies.breeding.maturationTimeAdjusted;
if (maturation < 0) maturation = 0;
if (maturation > 1) maturation = 1;
}
nudMaturation.Value = (decimal)maturation * 100;
- updateMaturation = true;
+ _updateMaturation = true;
}
}
private void nudMaturation_ValueChanged(object sender, EventArgs e)
{
- if (updateMaturation)
+ if (_updateMaturation)
{
- updateMaturation = false;
- if (selectedSpecies.breeding != null)
+ _updateMaturation = false;
+ if (_selectedSpecies.breeding != null)
{
- dhmsInputGrown.Timespan = new TimeSpan(0, 0, (int)(selectedSpecies.breeding.maturationTimeAdjusted *
+ dhmsInputGrown.Timespan = new TimeSpan(0, 0, (int)(_selectedSpecies.breeding.maturationTimeAdjusted *
(1 - (double)nudMaturation.Value / 100)));
dhmsInputGrown.changed = true;
}
else dhmsInputGrown.Timespan = TimeSpan.Zero;
- updateMaturation = true;
+ _updateMaturation = true;
}
}
@@ -405,10 +416,11 @@ public int[] RegionColors
get => regionColorChooser1.ColorIDs;
set
{
- if (selectedSpecies != null)
+ if (_selectedSpecies != null)
{
- regionColorIDs = (int[])value?.Clone() ?? new int[6];
- regionColorChooser1.SetSpecies(selectedSpecies, regionColorIDs);
+ _regionColorIDs = (int[])value?.Clone() ?? new int[6];
+ regionColorChooser1.SetSpecies(_selectedSpecies, _regionColorIDs);
+ UpdateRegionColorImage();
}
}
}
@@ -417,8 +429,8 @@ public Species SelectedSpecies
{
set
{
- selectedSpecies = value;
- bool breedingPossible = selectedSpecies.breeding != null;
+ _selectedSpecies = value;
+ bool breedingPossible = _selectedSpecies.breeding != null;
dhmsInputCooldown.Visible = breedingPossible;
dhmsInputGrown.Visible = breedingPossible;
@@ -438,6 +450,7 @@ public Species SelectedSpecies
dhmsInputCooldown.Timespan = TimeSpan.Zero;
}
RegionColors = new int[6];
+ UpdateRegionColorImage();
}
}
@@ -510,7 +523,7 @@ private void SetCreatureData(Creature cr)
{
cr.Mother = Mother;
cr.Father = Father;
- cr.sex = sex;
+ cr.sex = _sex;
cr.mutationsMaternal = MutationCounterMother;
cr.mutationsPaternal = MutationCounterFather;
cr.owner = CreatureOwner;
@@ -567,8 +580,8 @@ public bool UpdateExistingCreature
set
{
btAdd2Library.Text = value ?
- Loc.s("btUpdateLibraryCreature") :
- Loc.s("btAdd2Library");
+ Loc.S("btUpdateLibraryCreature") :
+ Loc.S("btAdd2Library");
isNewCreature = !value;
SetAdd2LibColor(btAdd2Library.Enabled);
@@ -601,7 +614,10 @@ private void lblName_Click(object sender, EventArgs e)
private void btClearColors_Click(object sender, EventArgs e)
{
- clearColors();
+ if ((Control.ModifierKeys & Keys.Control) != 0)
+ regionColorChooser1.RandomColors();
+ else
+ clearColors();
}
private void clearColors()
@@ -664,6 +680,11 @@ private void BtApplyOTSPreset_Click(object sender, EventArgs e)
CreatureServer = Properties.Settings.Default.DefaultServerName;
}
+ private void dhmsInputGrown_ValueChanged(uiControls.dhmsInput sender, TimeSpan timespan)
+ {
+
+ }
+
internal void Clear()
{
textBoxName.Clear();
@@ -688,32 +709,35 @@ internal void Clear()
public void SetLocalizations()
{
Loc.ControlText(gbCreatureInfo);
- Loc.ControlText(lbName, "Name", tt);
- Loc.ControlText(lbOwner, "Owner", tt);
- Loc.ControlText(lbTribe, "Tribe", tt);
+ Loc.ControlText(lbName, "Name", _tt);
+ Loc.ControlText(lbOwner, "Owner", _tt);
+ Loc.ControlText(lbTribe, "Tribe", _tt);
Loc.ControlText(lbServer, "Server");
Loc.ControlText(lbMother, "Mother");
Loc.ControlText(lbFather, "Father");
Loc.ControlText(lbNote, "Note");
Loc.ControlText(lbCooldown, "cooldown");
Loc.ControlText(lbGrownIn, "grownIn");
- lbMaturationPerc.Text = Loc.s("Maturation") + " [%]";
+ lbMaturationPerc.Text = $"{Loc.S("Maturation")} [%]";
Loc.ControlText(lbMutations, "Mutations");
Loc.ControlText(lbSex, "Sex");
Loc.ControlText(lbStatus, "Status");
- Loc.ControlText(btClearColors, "Colors", tt);
+ Loc.ControlText(btClearColors, "clearColors");
+ _tt.SetToolTip(btClearColors, Loc.S("clearColors") + "\n" + Loc.S("holdCtrlForRandomColors"));
Loc.ControlText(btSaveChanges);
Loc.ControlText(btAdd2Library);
//tooltips
- Loc.setToolTip(buttonSex, "Sex", tt);
- Loc.setToolTip(buttonStatus, "Status", tt);
- Loc.setToolTip(dateTimePickerAdded, "addedAt", tt);
- Loc.setToolTip(nudMutationsMother, "mutationCounter", tt);
- Loc.setToolTip(nudMutationsFather, "mutationCounter", tt);
+ Loc.SetToolTip(buttonSex, "Sex", _tt);
+ Loc.SetToolTip(buttonStatus, "Status", _tt);
+ Loc.SetToolTip(dateTimePickerAdded, "addedAt", _tt);
+ Loc.SetToolTip(nudMutationsMother, "mutationCounter", _tt);
+ Loc.SetToolTip(nudMutationsFather, "mutationCounter", _tt);
+ Loc.ControlText(BtApplyOTSPreset, _tt);
+ Loc.ControlText(BtSaveOTSPreset, _tt);
var namingPatternButtons = new List
/// filePath
///
+ ///
public static bool LoadJSONFile(string filePath, out T data, out string errorMessage) where T : class
{
errorMessage = null;
data = null;
- if (!File.Exists(filePath))
- {
- errorMessage = $"File not found: {filePath}";
- return false;
- }
// load json-file of data
try
diff --git a/ARKBreedingStats/Form1.Designer.cs b/ARKBreedingStats/Form1.Designer.cs
index a95a82cf..6f627010 100644
--- a/ARKBreedingStats/Form1.Designer.cs
+++ b/ARKBreedingStats/Form1.Designer.cs
@@ -105,16 +105,7 @@ private void InitializeComponent()
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
this.copyCreatureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.pasteCreatureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.deadCreaturesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.unavailableCreaturesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.obeliskCreaturesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.neuteredCreaturesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.mutatedCreaturesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.cryopodCreaturesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.femalesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.malesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.speciesGroupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.libraryFilterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.openSettingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator18 = new System.Windows.Forms.ToolStripSeparator();
@@ -128,6 +119,7 @@ private void InitializeComponent()
this.BreedingPlanHelpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.extractionIssuesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator();
+ this.downloadSpeciesImagesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.checkForUpdatedStatsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.panelSums = new System.Windows.Forms.Panel();
this.lbShouldBe = new System.Windows.Forms.Label();
@@ -138,6 +130,7 @@ private void InitializeComponent()
this.rbWildExtractor = new System.Windows.Forms.RadioButton();
this.tabControlMain = new System.Windows.Forms.TabControl();
this.tabPageStatTesting = new System.Windows.Forms.TabPage();
+ this.pictureBoxColorRegionsTester = new System.Windows.Forms.PictureBox();
this.statPotentials1 = new ARKBreedingStats.uiControls.StatPotentials();
this.gbStatChart = new System.Windows.Forms.GroupBox();
this.radarChart1 = new ARKBreedingStats.RadarChart();
@@ -161,6 +154,7 @@ private void InitializeComponent()
this.creatureInfoInputTester = new ARKBreedingStats.CreatureInfoInput();
this.tabPageExtractor = new System.Windows.Forms.TabPage();
this.llOnlineHelpExtractionIssues = new System.Windows.Forms.LinkLabel();
+ this.PbCreatureColorsExtractor = new System.Windows.Forms.PictureBox();
this.groupBoxRadarChartExtractor = new System.Windows.Forms.GroupBox();
this.radarChartExtractor = new ARKBreedingStats.RadarChart();
this.lbImprintingFailInfo = new System.Windows.Forms.Label();
@@ -181,31 +175,11 @@ private void InitializeComponent()
this.tabControlLibFilter = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.listBoxSpeciesLib = new System.Windows.Forms.ListBox();
- this.tabPage2 = new System.Windows.Forms.TabPage();
- this.checkedListBoxOwner = new System.Windows.Forms.CheckedListBox();
- this.cbOwnerFilterAll = new System.Windows.Forms.CheckBox();
- this.tabPageServer = new System.Windows.Forms.TabPage();
- this.checkedListBoxFilterServers = new System.Windows.Forms.CheckedListBox();
- this.cbServerFilterAll = new System.Windows.Forms.CheckBox();
- this.tabPageTags = new System.Windows.Forms.TabPage();
- this.checkedListBoxFilterTags = new System.Windows.Forms.CheckedListBox();
- this.cbFilterTagsAll = new System.Windows.Forms.CheckBox();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.checkedListBoxConsiderStatTop = new System.Windows.Forms.CheckedListBox();
this.buttonRecalculateTops = new System.Windows.Forms.Button();
this.label17 = new System.Windows.Forms.Label();
- this.tabPage4 = new System.Windows.Forms.TabPage();
- this.checkBoxSpeciesGroups = new System.Windows.Forms.CheckBox();
- this.checkBoxShowCryopodCreatures = new System.Windows.Forms.CheckBox();
- this.cbLibraryShowMales = new System.Windows.Forms.CheckBox();
- this.cbLibraryShowFemales = new System.Windows.Forms.CheckBox();
- this.checkBoxShowObeliskCreatures = new System.Windows.Forms.CheckBox();
- this.checkBoxUseFiltersInTopStatCalculation = new System.Windows.Forms.CheckBox();
- this.checkBoxShowMutatedCreatures = new System.Windows.Forms.CheckBox();
- this.checkBoxShowNeuteredCreatures = new System.Windows.Forms.CheckBox();
- this.checkBoxShowUnavailableCreatures = new System.Windows.Forms.CheckBox();
- this.checkBoxShowDead = new System.Windows.Forms.CheckBox();
this.tabPageLibRadarChart = new System.Windows.Forms.TabPage();
this.radarChartLibrary = new ARKBreedingStats.RadarChart();
this.listViewLibrary = new System.Windows.Forms.ListView();
@@ -259,6 +233,9 @@ private void InitializeComponent()
this.forSpreadsheetToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.copyInfographicToClipboardToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.removeCooldownGrowingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.setToMatureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.clearMatingCooldownToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.justMatedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.bestBreedingPartnersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItemStatus = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
@@ -347,6 +324,7 @@ private void InitializeComponent()
this.panelWildTamedBred.SuspendLayout();
this.tabControlMain.SuspendLayout();
this.tabPageStatTesting.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBoxColorRegionsTester)).BeginInit();
this.gbStatChart.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.radarChart1)).BeginInit();
this.panelWildTamedBredTester.SuspendLayout();
@@ -356,6 +334,7 @@ private void InitializeComponent()
this.panelStatTesterFootnote.SuspendLayout();
this.gpPreviewEdit.SuspendLayout();
this.tabPageExtractor.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.PbCreatureColorsExtractor)).BeginInit();
this.groupBoxRadarChartExtractor.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.radarChartExtractor)).BeginInit();
this.groupBoxTamingInfo.SuspendLayout();
@@ -367,12 +346,8 @@ private void InitializeComponent()
this.tableLayoutPanelLibrary.SuspendLayout();
this.tabControlLibFilter.SuspendLayout();
this.tabPage1.SuspendLayout();
- this.tabPage2.SuspendLayout();
- this.tabPageServer.SuspendLayout();
- this.tabPageTags.SuspendLayout();
this.tabPage3.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
- this.tabPage4.SuspendLayout();
this.tabPageLibRadarChart.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.radarChartLibrary)).BeginInit();
this.contextMenuStripLibrary.SuspendLayout();
@@ -396,7 +371,7 @@ private void InitializeComponent()
// aboutToolStripMenuItem
//
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
- this.aboutToolStripMenuItem.Size = new System.Drawing.Size(171, 22);
+ this.aboutToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
this.aboutToolStripMenuItem.Text = "about…";
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
//
@@ -598,7 +573,7 @@ private void InitializeComponent()
// groupBoxPossibilities
//
this.groupBoxPossibilities.Controls.Add(this.listViewPossibilities);
- this.groupBoxPossibilities.Location = new System.Drawing.Point(556, 43);
+ this.groupBoxPossibilities.Location = new System.Drawing.Point(590, 43);
this.groupBoxPossibilities.Name = "groupBoxPossibilities";
this.groupBoxPossibilities.Size = new System.Drawing.Size(189, 295);
this.groupBoxPossibilities.TabIndex = 11;
@@ -842,7 +817,7 @@ private void InitializeComponent()
//
// lbInfoYellowStats
//
- this.lbInfoYellowStats.Location = new System.Drawing.Point(556, 341);
+ this.lbInfoYellowStats.Location = new System.Drawing.Point(590, 341);
this.lbInfoYellowStats.Name = "lbInfoYellowStats";
this.lbInfoYellowStats.Size = new System.Drawing.Size(177, 187);
this.lbInfoYellowStats.TabIndex = 15;
@@ -915,7 +890,7 @@ private void InitializeComponent()
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem,
this.editToolStripMenuItem,
- this.viewToolStripMenuItem,
+ this.libraryFilterToolStripMenuItem,
this.settingsToolStripMenuItem,
this.helpToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
@@ -1070,111 +1045,12 @@ private void InitializeComponent()
this.pasteCreatureToolStripMenuItem.Text = "Paste Creature";
this.pasteCreatureToolStripMenuItem.Click += new System.EventHandler(this.pasteCreatureToolStripMenuItem_Click);
//
- // viewToolStripMenuItem
- //
- this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.deadCreaturesToolStripMenuItem,
- this.unavailableCreaturesToolStripMenuItem,
- this.obeliskCreaturesToolStripMenuItem,
- this.neuteredCreaturesToolStripMenuItem,
- this.mutatedCreaturesToolStripMenuItem,
- this.cryopodCreaturesToolStripMenuItem,
- this.femalesToolStripMenuItem,
- this.malesToolStripMenuItem,
- this.speciesGroupToolStripMenuItem});
- this.viewToolStripMenuItem.Name = "viewToolStripMenuItem";
- this.viewToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
- this.viewToolStripMenuItem.Text = "View";
- //
- // deadCreaturesToolStripMenuItem
- //
- this.deadCreaturesToolStripMenuItem.Checked = true;
- this.deadCreaturesToolStripMenuItem.CheckOnClick = true;
- this.deadCreaturesToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
- this.deadCreaturesToolStripMenuItem.Name = "deadCreaturesToolStripMenuItem";
- this.deadCreaturesToolStripMenuItem.Size = new System.Drawing.Size(188, 22);
- this.deadCreaturesToolStripMenuItem.Text = "Dead Creatures";
- this.deadCreaturesToolStripMenuItem.Click += new System.EventHandler(this.deadCreaturesToolStripMenuItem_Click);
- //
- // unavailableCreaturesToolStripMenuItem
- //
- this.unavailableCreaturesToolStripMenuItem.Checked = true;
- this.unavailableCreaturesToolStripMenuItem.CheckOnClick = true;
- this.unavailableCreaturesToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
- this.unavailableCreaturesToolStripMenuItem.Name = "unavailableCreaturesToolStripMenuItem";
- this.unavailableCreaturesToolStripMenuItem.Size = new System.Drawing.Size(188, 22);
- this.unavailableCreaturesToolStripMenuItem.Text = "Unavailable Creatures";
- this.unavailableCreaturesToolStripMenuItem.Click += new System.EventHandler(this.unavailableCreaturesToolStripMenuItem_Click);
- //
- // obeliskCreaturesToolStripMenuItem
- //
- this.obeliskCreaturesToolStripMenuItem.Checked = true;
- this.obeliskCreaturesToolStripMenuItem.CheckOnClick = true;
- this.obeliskCreaturesToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
- this.obeliskCreaturesToolStripMenuItem.Name = "obeliskCreaturesToolStripMenuItem";
- this.obeliskCreaturesToolStripMenuItem.Size = new System.Drawing.Size(188, 22);
- this.obeliskCreaturesToolStripMenuItem.Text = "Obelisk Creatures";
- this.obeliskCreaturesToolStripMenuItem.Click += new System.EventHandler(this.obeliskCreaturesToolStripMenuItem_Click);
- //
- // neuteredCreaturesToolStripMenuItem
- //
- this.neuteredCreaturesToolStripMenuItem.Checked = true;
- this.neuteredCreaturesToolStripMenuItem.CheckOnClick = true;
- this.neuteredCreaturesToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
- this.neuteredCreaturesToolStripMenuItem.Name = "neuteredCreaturesToolStripMenuItem";
- this.neuteredCreaturesToolStripMenuItem.Size = new System.Drawing.Size(188, 22);
- this.neuteredCreaturesToolStripMenuItem.Text = "Neutered Creatures";
- this.neuteredCreaturesToolStripMenuItem.Click += new System.EventHandler(this.neuteredCreaturesToolStripMenuItem_Click);
- //
- // mutatedCreaturesToolStripMenuItem
- //
- this.mutatedCreaturesToolStripMenuItem.Checked = true;
- this.mutatedCreaturesToolStripMenuItem.CheckOnClick = true;
- this.mutatedCreaturesToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
- this.mutatedCreaturesToolStripMenuItem.Name = "mutatedCreaturesToolStripMenuItem";
- this.mutatedCreaturesToolStripMenuItem.Size = new System.Drawing.Size(188, 22);
- this.mutatedCreaturesToolStripMenuItem.Text = "Mutated Creatures";
- this.mutatedCreaturesToolStripMenuItem.Click += new System.EventHandler(this.mutatedCreaturesToolStripMenuItem_Click);
- //
- // cryopodCreaturesToolStripMenuItem
- //
- this.cryopodCreaturesToolStripMenuItem.Checked = true;
- this.cryopodCreaturesToolStripMenuItem.CheckOnClick = true;
- this.cryopodCreaturesToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
- this.cryopodCreaturesToolStripMenuItem.Name = "cryopodCreaturesToolStripMenuItem";
- this.cryopodCreaturesToolStripMenuItem.Size = new System.Drawing.Size(188, 22);
- this.cryopodCreaturesToolStripMenuItem.Text = "Cryopod Creatures";
- this.cryopodCreaturesToolStripMenuItem.Click += new System.EventHandler(this.cryopodCreaturesToolStripMenuItem_Click);
- //
- // femalesToolStripMenuItem
- //
- this.femalesToolStripMenuItem.Checked = true;
- this.femalesToolStripMenuItem.CheckOnClick = true;
- this.femalesToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
- this.femalesToolStripMenuItem.Name = "femalesToolStripMenuItem";
- this.femalesToolStripMenuItem.Size = new System.Drawing.Size(188, 22);
- this.femalesToolStripMenuItem.Text = "Females";
- this.femalesToolStripMenuItem.Click += new System.EventHandler(this.femalesToolStripMenuItem_Click);
- //
- // malesToolStripMenuItem
- //
- this.malesToolStripMenuItem.Checked = true;
- this.malesToolStripMenuItem.CheckOnClick = true;
- this.malesToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
- this.malesToolStripMenuItem.Name = "malesToolStripMenuItem";
- this.malesToolStripMenuItem.Size = new System.Drawing.Size(188, 22);
- this.malesToolStripMenuItem.Text = "Males";
- this.malesToolStripMenuItem.Click += new System.EventHandler(this.malesToolStripMenuItem_Click);
- //
- // speciesGroupToolStripMenuItem
- //
- this.speciesGroupToolStripMenuItem.Checked = true;
- this.speciesGroupToolStripMenuItem.CheckOnClick = true;
- this.speciesGroupToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
- this.speciesGroupToolStripMenuItem.Name = "speciesGroupToolStripMenuItem";
- this.speciesGroupToolStripMenuItem.Size = new System.Drawing.Size(188, 22);
- this.speciesGroupToolStripMenuItem.Text = "Species Group";
- this.speciesGroupToolStripMenuItem.Click += new System.EventHandler(this.speciesGroupToolStripMenuItem_Click);
+ // libraryFilterToolStripMenuItem
+ //
+ this.libraryFilterToolStripMenuItem.Name = "libraryFilterToolStripMenuItem";
+ this.libraryFilterToolStripMenuItem.Size = new System.Drawing.Size(91, 20);
+ this.libraryFilterToolStripMenuItem.Text = "Library filter…";
+ this.libraryFilterToolStripMenuItem.Click += new System.EventHandler(this.libraryFilterToolStripMenuItem_Click);
//
// settingsToolStripMenuItem
//
@@ -1237,6 +1113,7 @@ private void InitializeComponent()
this.BreedingPlanHelpToolStripMenuItem,
this.extractionIssuesToolStripMenuItem,
this.toolStripSeparator12,
+ this.downloadSpeciesImagesToolStripMenuItem,
this.checkForUpdatedStatsToolStripMenuItem});
this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
this.helpToolStripMenuItem.Size = new System.Drawing.Size(24, 20);
@@ -1245,38 +1122,45 @@ private void InitializeComponent()
// toolStripSeparator11
//
this.toolStripSeparator11.Name = "toolStripSeparator11";
- this.toolStripSeparator11.Size = new System.Drawing.Size(168, 6);
+ this.toolStripSeparator11.Size = new System.Drawing.Size(207, 6);
//
// onlinehelpToolStripMenuItem
//
this.onlinehelpToolStripMenuItem.Name = "onlinehelpToolStripMenuItem";
- this.onlinehelpToolStripMenuItem.Size = new System.Drawing.Size(171, 22);
+ this.onlinehelpToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
this.onlinehelpToolStripMenuItem.Text = "Online Manual…";
this.onlinehelpToolStripMenuItem.Click += new System.EventHandler(this.onlinehelpToolStripMenuItem_Click);
//
// BreedingPlanHelpToolStripMenuItem
//
this.BreedingPlanHelpToolStripMenuItem.Name = "BreedingPlanHelpToolStripMenuItem";
- this.BreedingPlanHelpToolStripMenuItem.Size = new System.Drawing.Size(171, 22);
+ this.BreedingPlanHelpToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
this.BreedingPlanHelpToolStripMenuItem.Text = "Breeding Plan…";
this.BreedingPlanHelpToolStripMenuItem.Click += new System.EventHandler(this.breedingPlanToolStripMenuItem_Click);
//
// extractionIssuesToolStripMenuItem
//
this.extractionIssuesToolStripMenuItem.Name = "extractionIssuesToolStripMenuItem";
- this.extractionIssuesToolStripMenuItem.Size = new System.Drawing.Size(171, 22);
+ this.extractionIssuesToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
this.extractionIssuesToolStripMenuItem.Text = "Extraction Issues…";
this.extractionIssuesToolStripMenuItem.Click += new System.EventHandler(this.extractionIssuesToolStripMenuItem_Click);
//
// toolStripSeparator12
//
this.toolStripSeparator12.Name = "toolStripSeparator12";
- this.toolStripSeparator12.Size = new System.Drawing.Size(168, 6);
+ this.toolStripSeparator12.Size = new System.Drawing.Size(207, 6);
+ //
+ // downloadSpeciesImagesToolStripMenuItem
+ //
+ this.downloadSpeciesImagesToolStripMenuItem.Name = "downloadSpeciesImagesToolStripMenuItem";
+ this.downloadSpeciesImagesToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
+ this.downloadSpeciesImagesToolStripMenuItem.Text = "Download species images";
+ this.downloadSpeciesImagesToolStripMenuItem.Click += new System.EventHandler(this.downloadSpeciesImagesToolStripMenuItem_Click);
//
// checkForUpdatedStatsToolStripMenuItem
//
this.checkForUpdatedStatsToolStripMenuItem.Name = "checkForUpdatedStatsToolStripMenuItem";
- this.checkForUpdatedStatsToolStripMenuItem.Size = new System.Drawing.Size(171, 22);
+ this.checkForUpdatedStatsToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
this.checkForUpdatedStatsToolStripMenuItem.Text = "Check for Updates";
this.checkForUpdatedStatsToolStripMenuItem.Click += new System.EventHandler(this.checkForUpdatedStatsToolStripMenuItem_Click);
//
@@ -1381,6 +1265,7 @@ private void InitializeComponent()
// tabPageStatTesting
//
this.tabPageStatTesting.AutoScroll = true;
+ this.tabPageStatTesting.Controls.Add(this.pictureBoxColorRegionsTester);
this.tabPageStatTesting.Controls.Add(this.statPotentials1);
this.tabPageStatTesting.Controls.Add(this.gbStatChart);
this.tabPageStatTesting.Controls.Add(this.panelWildTamedBredTester);
@@ -1396,9 +1281,17 @@ private void InitializeComponent()
this.tabPageStatTesting.Text = "Stat Testing";
this.tabPageStatTesting.UseVisualStyleBackColor = true;
//
+ // pictureBoxColorRegionsTester
+ //
+ this.pictureBoxColorRegionsTester.Location = new System.Drawing.Point(589, 470);
+ this.pictureBoxColorRegionsTester.Name = "pictureBoxColorRegionsTester";
+ this.pictureBoxColorRegionsTester.Size = new System.Drawing.Size(256, 256);
+ this.pictureBoxColorRegionsTester.TabIndex = 13;
+ this.pictureBoxColorRegionsTester.TabStop = false;
+ //
// statPotentials1
//
- this.statPotentials1.Location = new System.Drawing.Point(556, 243);
+ this.statPotentials1.Location = new System.Drawing.Point(808, 9);
this.statPotentials1.Name = "statPotentials1";
this.statPotentials1.Size = new System.Drawing.Size(293, 433);
this.statPotentials1.TabIndex = 12;
@@ -1406,7 +1299,7 @@ private void InitializeComponent()
// gbStatChart
//
this.gbStatChart.Controls.Add(this.radarChart1);
- this.gbStatChart.Location = new System.Drawing.Point(556, 9);
+ this.gbStatChart.Location = new System.Drawing.Point(589, 9);
this.gbStatChart.Name = "gbStatChart";
this.gbStatChart.Size = new System.Drawing.Size(213, 228);
this.gbStatChart.TabIndex = 11;
@@ -1623,7 +1516,7 @@ private void InitializeComponent()
0,
0,
0};
- this.creatureInfoInputTester.Size = new System.Drawing.Size(229, 542);
+ this.creatureInfoInputTester.Size = new System.Drawing.Size(262, 542);
this.creatureInfoInputTester.TabIndex = 4;
this.creatureInfoInputTester.TribeLock = false;
this.creatureInfoInputTester.Add2Library_Clicked += new System.Action(this.creatureInfoInputTester_Add2Library_Clicked);
@@ -1634,6 +1527,7 @@ private void InitializeComponent()
//
this.tabPageExtractor.AutoScroll = true;
this.tabPageExtractor.Controls.Add(this.llOnlineHelpExtractionIssues);
+ this.tabPageExtractor.Controls.Add(this.PbCreatureColorsExtractor);
this.tabPageExtractor.Controls.Add(this.groupBoxRadarChartExtractor);
this.tabPageExtractor.Controls.Add(this.lbImprintingFailInfo);
this.tabPageExtractor.Controls.Add(this.groupBoxTamingInfo);
@@ -1660,7 +1554,7 @@ private void InitializeComponent()
// llOnlineHelpExtractionIssues
//
this.llOnlineHelpExtractionIssues.AutoSize = true;
- this.llOnlineHelpExtractionIssues.Location = new System.Drawing.Point(559, 609);
+ this.llOnlineHelpExtractionIssues.Location = new System.Drawing.Point(593, 609);
this.llOnlineHelpExtractionIssues.Name = "llOnlineHelpExtractionIssues";
this.llOnlineHelpExtractionIssues.Size = new System.Drawing.Size(141, 13);
this.llOnlineHelpExtractionIssues.TabIndex = 50;
@@ -1668,10 +1562,18 @@ private void InitializeComponent()
this.llOnlineHelpExtractionIssues.Text = "Red Stat-boxes: Online-Help";
this.llOnlineHelpExtractionIssues.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llOnlineHelpExtractionIssues_LinkClicked);
//
+ // PbCreatureColorsExtractor
+ //
+ this.PbCreatureColorsExtractor.Location = new System.Drawing.Point(589, 470);
+ this.PbCreatureColorsExtractor.Name = "PbCreatureColorsExtractor";
+ this.PbCreatureColorsExtractor.Size = new System.Drawing.Size(256, 256);
+ this.PbCreatureColorsExtractor.TabIndex = 51;
+ this.PbCreatureColorsExtractor.TabStop = false;
+ //
// groupBoxRadarChartExtractor
//
this.groupBoxRadarChartExtractor.Controls.Add(this.radarChartExtractor);
- this.groupBoxRadarChartExtractor.Location = new System.Drawing.Point(751, 6);
+ this.groupBoxRadarChartExtractor.Location = new System.Drawing.Point(785, 6);
this.groupBoxRadarChartExtractor.Name = "groupBoxRadarChartExtractor";
this.groupBoxRadarChartExtractor.Size = new System.Drawing.Size(150, 163);
this.groupBoxRadarChartExtractor.TabIndex = 11;
@@ -1694,7 +1596,7 @@ private void InitializeComponent()
this.lbImprintingFailInfo.BackColor = System.Drawing.Color.MistyRose;
this.lbImprintingFailInfo.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lbImprintingFailInfo.ForeColor = System.Drawing.Color.Maroon;
- this.lbImprintingFailInfo.Location = new System.Drawing.Point(562, 622);
+ this.lbImprintingFailInfo.Location = new System.Drawing.Point(596, 622);
this.lbImprintingFailInfo.Name = "lbImprintingFailInfo";
this.lbImprintingFailInfo.Size = new System.Drawing.Size(322, 54);
this.lbImprintingFailInfo.TabIndex = 49;
@@ -1706,7 +1608,7 @@ private void InitializeComponent()
// groupBoxTamingInfo
//
this.groupBoxTamingInfo.Controls.Add(this.labelTamingInfo);
- this.groupBoxTamingInfo.Location = new System.Drawing.Point(556, 60);
+ this.groupBoxTamingInfo.Location = new System.Drawing.Point(590, 60);
this.groupBoxTamingInfo.Name = "groupBoxTamingInfo";
this.groupBoxTamingInfo.Size = new System.Drawing.Size(174, 532);
this.groupBoxTamingInfo.TabIndex = 48;
@@ -1723,7 +1625,7 @@ private void InitializeComponent()
//
// button2TamingCalc
//
- this.button2TamingCalc.Location = new System.Drawing.Point(556, 32);
+ this.button2TamingCalc.Location = new System.Drawing.Point(590, 32);
this.button2TamingCalc.Name = "button2TamingCalc";
this.button2TamingCalc.Size = new System.Drawing.Size(177, 23);
this.button2TamingCalc.TabIndex = 9;
@@ -1797,7 +1699,7 @@ private void InitializeComponent()
//
// labelErrorHelp
//
- this.labelErrorHelp.Location = new System.Drawing.Point(556, 43);
+ this.labelErrorHelp.Location = new System.Drawing.Point(590, 43);
this.labelErrorHelp.Name = "labelErrorHelp";
this.labelErrorHelp.Size = new System.Drawing.Size(239, 569);
this.labelErrorHelp.TabIndex = 40;
@@ -1854,7 +1756,7 @@ private void InitializeComponent()
0,
0,
0};
- this.creatureInfoInputExtractor.Size = new System.Drawing.Size(229, 542);
+ this.creatureInfoInputExtractor.Size = new System.Drawing.Size(262, 542);
this.creatureInfoInputExtractor.TabIndex = 7;
this.creatureInfoInputExtractor.TribeLock = false;
this.creatureInfoInputExtractor.Add2Library_Clicked += new System.Action(this.creatureInfoInputExtractor_Add2Library_Clicked);
@@ -1893,11 +1795,7 @@ private void InitializeComponent()
// tabControlLibFilter
//
this.tabControlLibFilter.Controls.Add(this.tabPage1);
- this.tabControlLibFilter.Controls.Add(this.tabPage2);
- this.tabControlLibFilter.Controls.Add(this.tabPageServer);
- this.tabControlLibFilter.Controls.Add(this.tabPageTags);
this.tabControlLibFilter.Controls.Add(this.tabPage3);
- this.tabControlLibFilter.Controls.Add(this.tabPage4);
this.tabControlLibFilter.Controls.Add(this.tabPageLibRadarChart);
this.tabControlLibFilter.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControlLibFilter.Location = new System.Drawing.Point(3, 399);
@@ -1927,115 +1825,13 @@ private void InitializeComponent()
this.listBoxSpeciesLib.TabIndex = 0;
this.listBoxSpeciesLib.SelectedIndexChanged += new System.EventHandler(this.listBoxSpeciesLib_SelectedIndexChanged);
//
- // tabPage2
- //
- this.tabPage2.Controls.Add(this.checkedListBoxOwner);
- this.tabPage2.Controls.Add(this.cbOwnerFilterAll);
- 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, 266);
- this.tabPage2.TabIndex = 1;
- this.tabPage2.Text = "Owner";
- this.tabPage2.UseVisualStyleBackColor = true;
- //
- // checkedListBoxOwner
- //
- this.checkedListBoxOwner.CheckOnClick = true;
- this.checkedListBoxOwner.Dock = System.Windows.Forms.DockStyle.Fill;
- this.checkedListBoxOwner.FormattingEnabled = true;
- this.checkedListBoxOwner.Location = new System.Drawing.Point(3, 27);
- this.checkedListBoxOwner.Name = "checkedListBoxOwner";
- this.checkedListBoxOwner.Size = new System.Drawing.Size(181, 236);
- this.checkedListBoxOwner.TabIndex = 0;
- this.checkedListBoxOwner.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.checkedListBoxOwner_ItemCheck);
- //
- // cbOwnerFilterAll
- //
- this.cbOwnerFilterAll.Dock = System.Windows.Forms.DockStyle.Top;
- this.cbOwnerFilterAll.Location = new System.Drawing.Point(3, 3);
- this.cbOwnerFilterAll.Name = "cbOwnerFilterAll";
- this.cbOwnerFilterAll.Size = new System.Drawing.Size(181, 24);
- this.cbOwnerFilterAll.TabIndex = 1;
- this.cbOwnerFilterAll.Text = "All";
- this.cbOwnerFilterAll.UseVisualStyleBackColor = true;
- this.cbOwnerFilterAll.CheckedChanged += new System.EventHandler(this.cbOwnerFilterAll_CheckedChanged);
- //
- // tabPageServer
- //
- this.tabPageServer.Controls.Add(this.checkedListBoxFilterServers);
- this.tabPageServer.Controls.Add(this.cbServerFilterAll);
- this.tabPageServer.Location = new System.Drawing.Point(4, 22);
- this.tabPageServer.Name = "tabPageServer";
- this.tabPageServer.Padding = new System.Windows.Forms.Padding(3);
- this.tabPageServer.Size = new System.Drawing.Size(187, 266);
- this.tabPageServer.TabIndex = 5;
- this.tabPageServer.Text = "Server";
- this.tabPageServer.UseVisualStyleBackColor = true;
- //
- // checkedListBoxFilterServers
- //
- this.checkedListBoxFilterServers.CheckOnClick = true;
- this.checkedListBoxFilterServers.Dock = System.Windows.Forms.DockStyle.Fill;
- this.checkedListBoxFilterServers.FormattingEnabled = true;
- this.checkedListBoxFilterServers.Location = new System.Drawing.Point(3, 27);
- this.checkedListBoxFilterServers.Name = "checkedListBoxFilterServers";
- this.checkedListBoxFilterServers.Size = new System.Drawing.Size(181, 236);
- this.checkedListBoxFilterServers.TabIndex = 2;
- this.checkedListBoxFilterServers.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.checkedListBoxFilterServers_ItemCheck);
- //
- // cbServerFilterAll
- //
- this.cbServerFilterAll.Dock = System.Windows.Forms.DockStyle.Top;
- this.cbServerFilterAll.Location = new System.Drawing.Point(3, 3);
- this.cbServerFilterAll.Name = "cbServerFilterAll";
- this.cbServerFilterAll.Size = new System.Drawing.Size(181, 24);
- this.cbServerFilterAll.TabIndex = 3;
- this.cbServerFilterAll.Text = "All";
- this.cbServerFilterAll.UseVisualStyleBackColor = true;
- this.cbServerFilterAll.CheckedChanged += new System.EventHandler(this.cbServerFilterAll_CheckedChanged);
- //
- // tabPageTags
- //
- this.tabPageTags.Controls.Add(this.checkedListBoxFilterTags);
- this.tabPageTags.Controls.Add(this.cbFilterTagsAll);
- 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(187, 266);
- this.tabPageTags.TabIndex = 6;
- this.tabPageTags.Text = "Tags";
- this.tabPageTags.UseVisualStyleBackColor = true;
- //
- // checkedListBoxFilterTags
- //
- this.checkedListBoxFilterTags.CheckOnClick = true;
- this.checkedListBoxFilterTags.Dock = System.Windows.Forms.DockStyle.Fill;
- this.checkedListBoxFilterTags.FormattingEnabled = true;
- this.checkedListBoxFilterTags.Location = new System.Drawing.Point(3, 27);
- this.checkedListBoxFilterTags.Name = "checkedListBoxFilterTags";
- this.checkedListBoxFilterTags.Size = new System.Drawing.Size(181, 236);
- this.checkedListBoxFilterTags.TabIndex = 4;
- this.checkedListBoxFilterTags.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.checkedListBoxFilterTags_ItemCheck);
- //
- // cbFilterTagsAll
- //
- this.cbFilterTagsAll.Dock = System.Windows.Forms.DockStyle.Top;
- this.cbFilterTagsAll.Location = new System.Drawing.Point(3, 3);
- this.cbFilterTagsAll.Name = "cbFilterTagsAll";
- this.cbFilterTagsAll.Size = new System.Drawing.Size(181, 24);
- this.cbFilterTagsAll.TabIndex = 5;
- this.cbFilterTagsAll.Text = "All";
- this.cbFilterTagsAll.UseVisualStyleBackColor = true;
- this.cbFilterTagsAll.CheckedChanged += new System.EventHandler(this.cbFilterTagsAll_CheckedChanged);
- //
// tabPage3
//
this.tabPage3.Controls.Add(this.tableLayoutPanel2);
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, 266);
+ this.tabPage3.Size = new System.Drawing.Size(187, 296);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "Stats";
this.tabPage3.UseVisualStyleBackColor = true;
@@ -2054,7 +1850,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, 260);
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(181, 290);
this.tableLayoutPanel2.TabIndex = 0;
//
// checkedListBoxConsiderStatTop
@@ -2064,13 +1860,13 @@ private void InitializeComponent()
this.checkedListBoxConsiderStatTop.FormattingEnabled = true;
this.checkedListBoxConsiderStatTop.Location = new System.Drawing.Point(3, 35);
this.checkedListBoxConsiderStatTop.Name = "checkedListBoxConsiderStatTop";
- this.checkedListBoxConsiderStatTop.Size = new System.Drawing.Size(175, 193);
+ this.checkedListBoxConsiderStatTop.Size = new System.Drawing.Size(175, 223);
this.checkedListBoxConsiderStatTop.TabIndex = 3;
//
// buttonRecalculateTops
//
this.buttonRecalculateTops.Dock = System.Windows.Forms.DockStyle.Fill;
- this.buttonRecalculateTops.Location = new System.Drawing.Point(3, 234);
+ this.buttonRecalculateTops.Location = new System.Drawing.Point(3, 264);
this.buttonRecalculateTops.Name = "buttonRecalculateTops";
this.buttonRecalculateTops.Size = new System.Drawing.Size(175, 23);
this.buttonRecalculateTops.TabIndex = 2;
@@ -2087,161 +1883,13 @@ private void InitializeComponent()
this.label17.TabIndex = 4;
this.label17.Text = "Select the stats considered for the TopStat-Calculation and Coloring";
//
- // tabPage4
- //
- this.tabPage4.Controls.Add(this.checkBoxSpeciesGroups);
- this.tabPage4.Controls.Add(this.checkBoxShowCryopodCreatures);
- this.tabPage4.Controls.Add(this.cbLibraryShowMales);
- this.tabPage4.Controls.Add(this.cbLibraryShowFemales);
- this.tabPage4.Controls.Add(this.checkBoxShowObeliskCreatures);
- this.tabPage4.Controls.Add(this.checkBoxUseFiltersInTopStatCalculation);
- this.tabPage4.Controls.Add(this.checkBoxShowMutatedCreatures);
- this.tabPage4.Controls.Add(this.checkBoxShowNeuteredCreatures);
- this.tabPage4.Controls.Add(this.checkBoxShowUnavailableCreatures);
- this.tabPage4.Controls.Add(this.checkBoxShowDead);
- 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, 266);
- this.tabPage4.TabIndex = 3;
- this.tabPage4.Text = "View";
- this.tabPage4.UseVisualStyleBackColor = true;
- //
- // checkBoxSpeciesGroups
- //
- this.checkBoxSpeciesGroups.AutoSize = true;
- this.checkBoxSpeciesGroups.Checked = true;
- this.checkBoxSpeciesGroups.CheckState = System.Windows.Forms.CheckState.Checked;
- this.checkBoxSpeciesGroups.Location = new System.Drawing.Point(6, 213);
- this.checkBoxSpeciesGroups.Name = "checkBoxSpeciesGroups";
- this.checkBoxSpeciesGroups.Size = new System.Drawing.Size(131, 17);
- this.checkBoxSpeciesGroups.TabIndex = 9;
- this.checkBoxSpeciesGroups.Text = "Show Species Groups";
- this.checkBoxSpeciesGroups.UseVisualStyleBackColor = true;
- this.checkBoxSpeciesGroups.CheckedChanged += new System.EventHandler(this.checkBoxSpeciesGroups_CheckedChanged);
- //
- // checkBoxShowCryopodCreatures
- //
- this.checkBoxShowCryopodCreatures.AutoSize = true;
- this.checkBoxShowCryopodCreatures.Checked = true;
- this.checkBoxShowCryopodCreatures.CheckState = System.Windows.Forms.CheckState.Checked;
- this.checkBoxShowCryopodCreatures.Location = new System.Drawing.Point(6, 121);
- this.checkBoxShowCryopodCreatures.Name = "checkBoxShowCryopodCreatures";
- this.checkBoxShowCryopodCreatures.Size = new System.Drawing.Size(143, 17);
- this.checkBoxShowCryopodCreatures.TabIndex = 8;
- this.checkBoxShowCryopodCreatures.Text = "Show Cryopod Creatures";
- this.checkBoxShowCryopodCreatures.UseVisualStyleBackColor = true;
- this.checkBoxShowCryopodCreatures.CheckedChanged += new System.EventHandler(this.checkBoxShowCryopodCreatures_CheckedChanged);
- //
- // cbLibraryShowMales
- //
- this.cbLibraryShowMales.AutoSize = true;
- this.cbLibraryShowMales.Checked = true;
- this.cbLibraryShowMales.CheckState = System.Windows.Forms.CheckState.Checked;
- this.cbLibraryShowMales.Location = new System.Drawing.Point(6, 167);
- this.cbLibraryShowMales.Name = "cbLibraryShowMales";
- this.cbLibraryShowMales.Size = new System.Drawing.Size(84, 17);
- this.cbLibraryShowMales.TabIndex = 7;
- this.cbLibraryShowMales.Text = "Show Males";
- this.cbLibraryShowMales.UseVisualStyleBackColor = true;
- this.cbLibraryShowMales.CheckedChanged += new System.EventHandler(this.cbLibraryShowMales_CheckedChanged);
- //
- // cbLibraryShowFemales
- //
- this.cbLibraryShowFemales.AutoSize = true;
- this.cbLibraryShowFemales.Checked = true;
- this.cbLibraryShowFemales.CheckState = System.Windows.Forms.CheckState.Checked;
- this.cbLibraryShowFemales.Location = new System.Drawing.Point(6, 144);
- this.cbLibraryShowFemales.Name = "cbLibraryShowFemales";
- this.cbLibraryShowFemales.Size = new System.Drawing.Size(95, 17);
- this.cbLibraryShowFemales.TabIndex = 6;
- this.cbLibraryShowFemales.Text = "Show Females";
- this.cbLibraryShowFemales.UseVisualStyleBackColor = true;
- this.cbLibraryShowFemales.CheckedChanged += new System.EventHandler(this.cbLibraryShowFemales_CheckedChanged);
- //
- // checkBoxShowObeliskCreatures
- //
- this.checkBoxShowObeliskCreatures.AutoSize = true;
- this.checkBoxShowObeliskCreatures.Checked = true;
- this.checkBoxShowObeliskCreatures.CheckState = System.Windows.Forms.CheckState.Checked;
- this.checkBoxShowObeliskCreatures.Location = new System.Drawing.Point(6, 52);
- this.checkBoxShowObeliskCreatures.Name = "checkBoxShowObeliskCreatures";
- this.checkBoxShowObeliskCreatures.Size = new System.Drawing.Size(139, 17);
- this.checkBoxShowObeliskCreatures.TabIndex = 5;
- this.checkBoxShowObeliskCreatures.Text = "Show Obelisk Creatures";
- this.checkBoxShowObeliskCreatures.UseVisualStyleBackColor = true;
- this.checkBoxShowObeliskCreatures.CheckedChanged += new System.EventHandler(this.checkBoxShowObeliskCreatures_CheckedChanged);
- //
- // checkBoxUseFiltersInTopStatCalculation
- //
- this.checkBoxUseFiltersInTopStatCalculation.AutoSize = true;
- this.checkBoxUseFiltersInTopStatCalculation.Location = new System.Drawing.Point(6, 190);
- this.checkBoxUseFiltersInTopStatCalculation.Name = "checkBoxUseFiltersInTopStatCalculation";
- this.checkBoxUseFiltersInTopStatCalculation.Size = new System.Drawing.Size(182, 17);
- this.checkBoxUseFiltersInTopStatCalculation.TabIndex = 4;
- this.checkBoxUseFiltersInTopStatCalculation.Text = "Use Filters in TopStat-Calculation";
- this.checkBoxUseFiltersInTopStatCalculation.UseVisualStyleBackColor = true;
- this.checkBoxUseFiltersInTopStatCalculation.CheckedChanged += new System.EventHandler(this.checkBoxUseFiltersInTopStatCalculation_CheckedChanged);
- //
- // 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, 98);
- this.checkBoxShowMutatedCreatures.Name = "checkBoxShowMutatedCreatures";
- this.checkBoxShowMutatedCreatures.Size = new System.Drawing.Size(143, 17);
- this.checkBoxShowMutatedCreatures.TabIndex = 3;
- this.checkBoxShowMutatedCreatures.Text = "Show Mutated Creatures";
- this.checkBoxShowMutatedCreatures.UseVisualStyleBackColor = true;
- this.checkBoxShowMutatedCreatures.CheckedChanged += new System.EventHandler(this.checkBoxShowMutatedCreatures_CheckedChanged);
- //
- // 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, 75);
- this.checkBoxShowNeuteredCreatures.Name = "checkBoxShowNeuteredCreatures";
- this.checkBoxShowNeuteredCreatures.Size = new System.Drawing.Size(148, 17);
- this.checkBoxShowNeuteredCreatures.TabIndex = 2;
- this.checkBoxShowNeuteredCreatures.Text = "Show Neutered Creatures";
- this.checkBoxShowNeuteredCreatures.UseVisualStyleBackColor = true;
- this.checkBoxShowNeuteredCreatures.CheckedChanged += new System.EventHandler(this.checkBoxShowNeuteredCreatures_CheckedChanged);
- //
- // 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);
- this.checkBoxShowUnavailableCreatures.TabIndex = 1;
- this.checkBoxShowUnavailableCreatures.Text = "Show Unavailable Creatures";
- this.checkBoxShowUnavailableCreatures.UseVisualStyleBackColor = true;
- this.checkBoxShowUnavailableCreatures.CheckedChanged += new System.EventHandler(this.checkBoxShowUnavailableCreatures_CheckedChanged);
- //
- // 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);
- this.checkBoxShowDead.TabIndex = 0;
- this.checkBoxShowDead.Text = "Show Dead Creatures";
- this.checkBoxShowDead.UseVisualStyleBackColor = true;
- this.checkBoxShowDead.CheckedChanged += new System.EventHandler(this.checkBoxShowDead_CheckedChanged);
- //
// tabPageLibRadarChart
//
this.tabPageLibRadarChart.Controls.Add(this.radarChartLibrary);
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, 266);
+ this.tabPageLibRadarChart.Size = new System.Drawing.Size(187, 296);
this.tabPageLibRadarChart.TabIndex = 4;
this.tabPageLibRadarChart.Text = "Chart";
this.tabPageLibRadarChart.UseVisualStyleBackColor = true;
@@ -2252,7 +1900,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, 260);
+ this.radarChartLibrary.Size = new System.Drawing.Size(181, 290);
this.radarChartLibrary.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.radarChartLibrary.TabIndex = 0;
this.radarChartLibrary.TabStop = false;
@@ -2303,7 +1951,7 @@ private void InitializeComponent()
this.listViewLibrary.Name = "listViewLibrary";
this.tableLayoutPanelLibrary.SetRowSpan(this.listViewLibrary, 2);
this.listViewLibrary.ShowItemToolTips = true;
- this.listViewLibrary.Size = new System.Drawing.Size(994, 688);
+ this.listViewLibrary.Size = new System.Drawing.Size(1011, 718);
this.listViewLibrary.TabIndex = 2;
this.listViewLibrary.UseCompatibleStateImageBehavior = false;
this.listViewLibrary.View = System.Windows.Forms.View.Details;
@@ -2657,10 +2305,34 @@ private void InitializeComponent()
//
// removeCooldownGrowingToolStripMenuItem
//
+ this.removeCooldownGrowingToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.setToMatureToolStripMenuItem,
+ this.clearMatingCooldownToolStripMenuItem,
+ this.justMatedToolStripMenuItem});
this.removeCooldownGrowingToolStripMenuItem.Name = "removeCooldownGrowingToolStripMenuItem";
this.removeCooldownGrowingToolStripMenuItem.Size = new System.Drawing.Size(258, 22);
- this.removeCooldownGrowingToolStripMenuItem.Text = "Set to mature / ready to mate";
- this.removeCooldownGrowingToolStripMenuItem.Click += new System.EventHandler(this.removeCooldownGrowingToolStripMenuItem_Click);
+ this.removeCooldownGrowingToolStripMenuItem.Text = "Set maturity / breeding state";
+ //
+ // setToMatureToolStripMenuItem
+ //
+ this.setToMatureToolStripMenuItem.Name = "setToMatureToolStripMenuItem";
+ this.setToMatureToolStripMenuItem.Size = new System.Drawing.Size(198, 22);
+ this.setToMatureToolStripMenuItem.Text = "Set to mature";
+ this.setToMatureToolStripMenuItem.Click += new System.EventHandler(this.setToMatureToolStripMenuItem_Click);
+ //
+ // clearMatingCooldownToolStripMenuItem
+ //
+ this.clearMatingCooldownToolStripMenuItem.Name = "clearMatingCooldownToolStripMenuItem";
+ this.clearMatingCooldownToolStripMenuItem.Size = new System.Drawing.Size(198, 22);
+ this.clearMatingCooldownToolStripMenuItem.Text = "Clear mating cooldown";
+ this.clearMatingCooldownToolStripMenuItem.Click += new System.EventHandler(this.clearMatingCooldownToolStripMenuItem_Click);
+ //
+ // justMatedToolStripMenuItem
+ //
+ this.justMatedToolStripMenuItem.Name = "justMatedToolStripMenuItem";
+ this.justMatedToolStripMenuItem.Size = new System.Drawing.Size(198, 22);
+ this.justMatedToolStripMenuItem.Text = "Just mated";
+ this.justMatedToolStripMenuItem.Click += new System.EventHandler(this.justMatedToolStripMenuItem_Click);
//
// bestBreedingPartnersToolStripMenuItem
//
@@ -3413,6 +3085,7 @@ private void InitializeComponent()
this.panelWildTamedBred.PerformLayout();
this.tabControlMain.ResumeLayout(false);
this.tabPageStatTesting.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBoxColorRegionsTester)).EndInit();
this.gbStatChart.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.radarChart1)).EndInit();
this.panelWildTamedBredTester.ResumeLayout(false);
@@ -3427,6 +3100,7 @@ private void InitializeComponent()
this.gpPreviewEdit.PerformLayout();
this.tabPageExtractor.ResumeLayout(false);
this.tabPageExtractor.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.PbCreatureColorsExtractor)).EndInit();
this.groupBoxRadarChartExtractor.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.radarChartExtractor)).EndInit();
this.groupBoxTamingInfo.ResumeLayout(false);
@@ -3439,14 +3113,9 @@ private void InitializeComponent()
this.tableLayoutPanelLibrary.ResumeLayout(false);
this.tabControlLibFilter.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
- this.tabPage2.ResumeLayout(false);
- this.tabPageServer.ResumeLayout(false);
- this.tabPageTags.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.tableLayoutPanel2.ResumeLayout(false);
this.tableLayoutPanel2.PerformLayout();
- this.tabPage4.ResumeLayout(false);
- this.tabPage4.PerformLayout();
this.tabPageLibRadarChart.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.radarChartLibrary)).EndInit();
this.contextMenuStripLibrary.ResumeLayout(false);
@@ -3550,24 +3219,19 @@ private void InitializeComponent()
private System.Windows.Forms.ToolStripMenuItem onlinehelpToolStripMenuItem;
private System.Windows.Forms.TabControl tabControlLibFilter;
private System.Windows.Forms.TabPage tabPage1;
- private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.ColumnHeader columnHeaderTopness;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
private System.Windows.Forms.CheckedListBox checkedListBoxConsiderStatTop;
private System.Windows.Forms.Button buttonRecalculateTops;
private System.Windows.Forms.Label label17;
- private System.Windows.Forms.CheckedListBox checkedListBoxOwner;
private CreatureInfoInput creatureInfoInputExtractor;
private CreatureInfoInput creatureInfoInputTester;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
- private System.Windows.Forms.TabPage tabPage4;
- private System.Windows.Forms.CheckBox checkBoxShowDead;
private System.Windows.Forms.ToolStripMenuItem setStatusToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem aliveToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem deadToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem unavailableToolStripMenuItem;
- private System.Windows.Forms.CheckBox checkBoxShowUnavailableCreatures;
private System.Windows.Forms.ColumnHeader columnHeaderFound;
private System.Windows.Forms.TabPage tabPageBreedingPlan;
private System.Windows.Forms.ToolStripMenuItem multiSetterToolStripMenuItem;
@@ -3633,7 +3297,6 @@ private void InitializeComponent()
private System.Windows.Forms.Label labelTamingInfo;
private System.Windows.Forms.GroupBox groupBoxTamingInfo;
private System.Windows.Forms.ColumnHeader columnHeaderAdded;
- private System.Windows.Forms.CheckBox checkBoxShowNeuteredCreatures;
private System.Windows.Forms.Label lbImprintingFailInfo;
private System.Windows.Forms.Label lbImprintedCount;
private System.Windows.Forms.Label lbImprintingCuddleCountExtractor;
@@ -3674,8 +3337,6 @@ private void InitializeComponent()
private System.Windows.Forms.Label lbListening;
private System.Windows.Forms.CheckBox cbToggleOverlay;
private System.Windows.Forms.ToolStripButton toolStripButtonDeleteExpiredIncubationTimers;
- private System.Windows.Forms.CheckBox checkBoxShowMutatedCreatures;
- private System.Windows.Forms.CheckBox checkBoxUseFiltersInTopStatCalculation;
private ocr.OCRControl ocrControl1;
private System.Windows.Forms.TabPage tabPageLibRadarChart;
private RadarChart radarChartLibrary;
@@ -3688,14 +3349,7 @@ private void InitializeComponent()
private System.Windows.Forms.ColumnHeader columnHeaderNote;
private System.Windows.Forms.ToolStripMenuItem obeliskToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem obeliskToolStripMenuItem1;
- private System.Windows.Forms.CheckBox checkBoxShowObeliskCreatures;
private System.Windows.Forms.Label lbLibrarySelectionInfo;
- private System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem;
- private System.Windows.Forms.ToolStripMenuItem deadCreaturesToolStripMenuItem;
- private System.Windows.Forms.ToolStripMenuItem unavailableCreaturesToolStripMenuItem;
- private System.Windows.Forms.ToolStripMenuItem obeliskCreaturesToolStripMenuItem;
- private System.Windows.Forms.ToolStripMenuItem neuteredCreaturesToolStripMenuItem;
- private System.Windows.Forms.ToolStripMenuItem mutatedCreaturesToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator9;
private System.Windows.Forms.CheckBox cbGuessSpecies;
private System.Windows.Forms.ColumnHeader columnHeaderColor0;
@@ -3706,10 +3360,6 @@ private void InitializeComponent()
private System.Windows.Forms.ColumnHeader columnHeaderColor5;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator10;
private System.Windows.Forms.ColumnHeader columnHeaderServer;
- private System.Windows.Forms.CheckBox cbOwnerFilterAll;
- private System.Windows.Forms.TabPage tabPageServer;
- private System.Windows.Forms.CheckedListBox checkedListBoxFilterServers;
- private System.Windows.Forms.CheckBox cbServerFilterAll;
private SpeciesSelector speciesSelector1;
private uiControls.TextBoxSuggest tbSpeciesGlobal;
private System.Windows.Forms.PictureBox pbSpecies;
@@ -3717,10 +3367,6 @@ private void InitializeComponent()
private System.Windows.Forms.TabPage tabPageMultiplierTesting;
private testCases.ExtractionTestControl extractionTestControl1;
private System.Windows.Forms.ToolStripButton tsBtAddAsExtractionTest;
- private System.Windows.Forms.CheckBox cbLibraryShowMales;
- private System.Windows.Forms.CheckBox cbLibraryShowFemales;
- private System.Windows.Forms.ToolStripMenuItem femalesToolStripMenuItem;
- private System.Windows.Forms.ToolStripMenuItem malesToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem importExportedCreaturesToolStripMenuItem;
private System.Windows.Forms.Button btImportLastExported;
private System.Windows.Forms.LinkLabel llOnlineHelpExtractionIssues;
@@ -3731,15 +3377,10 @@ private void InitializeComponent()
private StatsMultiplierTesting statsMultiplierTesting1;
private System.Windows.Forms.ToolStripButton copyToMultiplierTesterToolStripButton;
private System.Windows.Forms.Label lbWildLevelTester;
- private System.Windows.Forms.TabPage tabPageTags;
- private System.Windows.Forms.CheckedListBox checkedListBoxFilterTags;
- private System.Windows.Forms.CheckBox cbFilterTagsAll;
private System.Windows.Forms.ToolStripMenuItem importValuesFromClipboardToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator13;
private System.Windows.Forms.ToolStripMenuItem importingFromSavegameToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem importingFromSavegameEmptyToolStripMenuItem;
- private System.Windows.Forms.CheckBox checkBoxShowCryopodCreatures;
- private System.Windows.Forms.ToolStripMenuItem cryopodCreaturesToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem cryopodToolStripMenuItem;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanelStatIOsExtractor;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanelStatIOsTester;
@@ -3764,8 +3405,6 @@ private void InitializeComponent()
private System.Windows.Forms.ToolStripMenuItem customStatOverridesToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem openJsonDataFolderToolStripMenuItem;
- private System.Windows.Forms.ToolStripMenuItem speciesGroupToolStripMenuItem;
- private System.Windows.Forms.CheckBox checkBoxSpeciesGroups;
private System.Windows.Forms.ColumnHeader columnHeaderSpecies;
private System.Windows.Forms.ColumnHeader columnHeaderStatus;
private System.Windows.Forms.ColumnHeader columnHeaderTribe;
@@ -3773,5 +3412,12 @@ private void InitializeComponent()
private System.Windows.Forms.ColumnHeader columnHeaderStatusIcon;
private System.Windows.Forms.ContextMenuStrip contextMenuStripLibraryHeader;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemResetLibraryColumnWidths;
+ private System.Windows.Forms.ToolStripMenuItem setToMatureToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem clearMatingCooldownToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem justMatedToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem libraryFilterToolStripMenuItem;
+ private System.Windows.Forms.PictureBox pictureBoxColorRegionsTester;
+ private System.Windows.Forms.ToolStripMenuItem downloadSpeciesImagesToolStripMenuItem;
+ private System.Windows.Forms.PictureBox PbCreatureColorsExtractor;
}
}
diff --git a/ARKBreedingStats/Form1.collection.cs b/ARKBreedingStats/Form1.collection.cs
index e0bd6b3c..003e75a4 100644
--- a/ARKBreedingStats/Form1.collection.cs
+++ b/ARKBreedingStats/Form1.collection.cs
@@ -19,13 +19,13 @@ public partial class Form1
private void NewCollection()
{
- if (collectionDirty
+ if (_collectionDirty
&& MessageBox.Show("Your Creature Collection has been modified since it was last saved, " +
"are you sure you want to discard your changes and create a new Library without saving?",
"Discard Changes?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.Yes)
return;
- if (creatureCollection.modIDs?.Any() ?? false)
+ if (_creatureCollection.modIDs?.Any() ?? false)
{
// if old collection had additionalValues, load the original ones to reset all modded values
var (statValuesLoaded, _) = LoadStatAndKibbleValues(applySettings: false);
@@ -35,17 +35,17 @@ private void NewCollection()
}
}
- if (creatureCollection.serverMultipliers == null)
- creatureCollection.serverMultipliers = Values.V.serverMultipliersPresets.GetPreset(ServerMultipliersPresets.OFFICIAL);
+ if (_creatureCollection.serverMultipliers == null)
+ _creatureCollection.serverMultipliers = Values.V.serverMultipliersPresets.GetPreset(ServerMultipliersPresets.OFFICIAL);
// use previously used multipliers again in the new file
- ServerMultipliers oldMultipliers = creatureCollection.serverMultipliers;
+ ServerMultipliers oldMultipliers = _creatureCollection.serverMultipliers;
- creatureCollection = new CreatureCollection
+ _creatureCollection = new CreatureCollection
{
serverMultipliers = oldMultipliers,
ModList = new List()
};
- creatureCollection.FormatVersion = CreatureCollection.CURRENT_FORMAT_VERSION;
+ _creatureCollection.FormatVersion = CreatureCollection.CURRENT_FORMAT_VERSION;
pedigree1.Clear();
breedingPlan1.Clear();
ApplySettingsToValues();
@@ -55,8 +55,8 @@ private void NewCollection()
creatureBoxListView.Clear();
Properties.Settings.Default.LastSaveFile = "";
Properties.Settings.Default.LastImportFile = "";
- currentFileName = null;
- fileSync.ChangeFile(currentFileName);
+ _currentFileName = null;
+ _fileSync.ChangeFile(_currentFileName);
SetCollectionChanged(false);
}
@@ -74,7 +74,7 @@ private void CollectionChanged()
}
else
{
- LoadCollectionFile(currentFileName, true, true);
+ LoadCollectionFile(_currentFileName, true, true);
}
}
@@ -84,10 +84,10 @@ private void CollectionChanged()
private void RecalculateAllCreaturesValues()
{
toolStripProgressBar1.Value = 0;
- toolStripProgressBar1.Maximum = creatureCollection.creatures.Count();
+ toolStripProgressBar1.Maximum = _creatureCollection.creatures.Count();
toolStripProgressBar1.Visible = true;
- int? levelStep = creatureCollection.getWildLevelStep();
- foreach (Creature c in creatureCollection.creatures)
+ int? levelStep = _creatureCollection.getWildLevelStep();
+ foreach (Creature c in _creatureCollection.creatures)
{
c.RecalculateCreatureValues(levelStep);
toolStripProgressBar1.Value++;
@@ -101,7 +101,7 @@ private void RecalculateAllCreaturesValues()
/// If true, the current loaded creatures will be kept and the ones of the loaded file are added
private void LoadCollection(bool add = false)
{
- if (!add && collectionDirty)
+ if (!add && _collectionDirty)
{
if (MessageBox.Show("Your Creature Collection has been modified since it was last saved, are you sure you want to load without saving first?", "Discard Changes?", MessageBoxButtons.YesNo) != DialogResult.Yes)
return;
@@ -125,13 +125,13 @@ private void LoadCollection(bool add = false)
///
private void SaveCollection()
{
- if (string.IsNullOrEmpty(currentFileName))
+ if (string.IsNullOrEmpty(_currentFileName))
{
SaveNewCollection();
}
else
{
- SaveCollectionToFileName(currentFileName);
+ SaveCollectionToFileName(_currentFileName);
}
}
@@ -144,9 +144,9 @@ private void SaveNewCollection()
{
if (dlg.ShowDialog() == DialogResult.OK)
{
- currentFileName = dlg.FileName;
- fileSync.ChangeFile(currentFileName);
- SaveCollectionToFileName(currentFileName);
+ _currentFileName = dlg.FileName;
+ _fileSync.ChangeFile(_currentFileName);
+ SaveCollectionToFileName(_currentFileName);
}
}
}
@@ -167,7 +167,7 @@ private void SaveCollectionToFileName(string filePath)
{
try
{
- fileSync.JustSaving();
+ _fileSync.JustSaving();
using (StreamWriter file = File.CreateText(filePath))
{
JsonSerializer serializer = new JsonSerializer()
@@ -175,7 +175,7 @@ private void SaveCollectionToFileName(string filePath)
Formatting = Properties.Settings.Default.prettifyCollectionJson ? Formatting.Indented : Formatting.None,
DateTimeZoneHandling = DateTimeZoneHandling.Utc // save all date-times as UTC, so synced files don't change the timezones
};
- serializer.Serialize(file, creatureCollection);
+ serializer.Serialize(file, _creatureCollection);
}
fileSaved = true;
@@ -230,7 +230,7 @@ private bool LoadCollectionFile(string filePath, bool keepCurrentCreatures = fal
return false;
}
- CreatureCollection previouslyLoadedCreatureCollection = creatureCollection;
+ CreatureCollection previouslyLoadedCreatureCollection = _creatureCollection;
// Wait until the file is readable
const int numberOfRetries = 5;
@@ -286,10 +286,10 @@ private bool LoadCollectionFile(string filePath, bool keepCurrentCreatures = fal
return false;
}
- creatureCollection = oldLibraryFormat.FormatConverter.ConvertXml2Asb(creatureCollectionOld, filePath);
- creatureCollection.ModList = mods;
+ _creatureCollection = oldLibraryFormat.FormatConverter.ConvertXml2Asb(creatureCollectionOld, filePath);
+ _creatureCollection.ModList = mods;
- if (creatureCollection == null) throw new Exception("Conversion failed");
+ if (_creatureCollection == null) throw new Exception("Conversion failed");
string fileNameWOExt = Path.Combine(Path.GetDirectoryName(filePath), Path.GetFileNameWithoutExtension(filePath));
// check if new fileName is not yet existing
@@ -316,7 +316,7 @@ private bool LoadCollectionFile(string filePath, bool keepCurrentCreatures = fal
{
throw new FormatException("Unhandled format version");
}
- creatureCollection = readCollection;
+ _creatureCollection = readCollection;
}
else
{
@@ -355,25 +355,25 @@ private bool LoadCollectionFile(string filePath, bool keepCurrentCreatures = fal
}
}
- if (creatureCollection.ModValueReloadNeeded)
+ if (_creatureCollection.ModValueReloadNeeded)
{
// load original multipliers if they were changed
if (!LoadStatAndKibbleValues(false).statValuesLoaded)
{
- creatureCollection = new CreatureCollection();
+ _creatureCollection = new CreatureCollection();
return false;
}
}
- if (creatureCollection.ModValueReloadNeeded
- && !LoadModValuesOfCollection(creatureCollection, false, false))
+ if (_creatureCollection.ModValueReloadNeeded
+ && !LoadModValuesOfCollection(_creatureCollection, false, false))
{
- creatureCollection = new CreatureCollection();
+ _creatureCollection = new CreatureCollection();
return false;
}
- if (creatureCollection.serverMultipliers == null)
+ if (_creatureCollection.serverMultipliers == null)
{
- creatureCollection.serverMultipliers = previouslyLoadedCreatureCollection.serverMultipliers ?? Values.V.serverMultipliersPresets.GetPreset(ServerMultipliersPresets.OFFICIAL);
+ _creatureCollection.serverMultipliers = previouslyLoadedCreatureCollection.serverMultipliers ?? Values.V.serverMultipliersPresets.GetPreset(ServerMultipliersPresets.OFFICIAL);
}
if (speciesSelector1.LastSpecies != null && speciesSelector1.LastSpecies.Length > 0)
@@ -381,7 +381,7 @@ private bool LoadCollectionFile(string filePath, bool keepCurrentCreatures = fal
tamingControl1.SetSpecies(Values.V.SpeciesByBlueprint(speciesSelector1.LastSpecies[0]));
}
- creatureCollection.FormatVersion = CreatureCollection.CURRENT_FORMAT_VERSION;
+ _creatureCollection.FormatVersion = CreatureCollection.CURRENT_FORMAT_VERSION;
ApplySettingsToValues();
@@ -389,32 +389,25 @@ private bool LoadCollectionFile(string filePath, bool keepCurrentCreatures = fal
if (keepCurrentCreatures)
{
- creatureWasAdded = previouslyLoadedCreatureCollection.MergeCreatureList(creatureCollection.creatures);
- creatureCollection = previouslyLoadedCreatureCollection;
+ creatureWasAdded = previouslyLoadedCreatureCollection.MergeCreatureList(_creatureCollection.creatures);
+ _creatureCollection = previouslyLoadedCreatureCollection;
}
else
{
- currentFileName = filePath;
- fileSync.ChangeFile(currentFileName);
+ _currentFileName = filePath;
+ _fileSync.ChangeFile(_currentFileName);
creatureBoxListView.Clear();
}
- creatureCollection.DeletedCreatureGuids = null; // the info was processed and is no longer needed.
-
+ _creatureCollection.DeletedCreatureGuids = null; // the info was processed and is no longer needed.
+
// remove creature entries without species information. some outdated and invisible entries can exist with that. the blueprintInfo is not deleted with the current version, so no new such entries should appear.
- creatureCollection.creatures = creatureCollection.creatures
+ _creatureCollection.creatures = _creatureCollection.creatures
.Where(c => !string.IsNullOrEmpty(c.speciesBlueprint)).ToList();
InitializeCollection();
- filterListAllowed = false;
- SetLibraryFilter("Dead", creatureCollection.showFlags.HasFlag(CreatureFlags.Dead));
- SetLibraryFilter("Unavailable", creatureCollection.showFlags.HasFlag(CreatureFlags.Unavailable));
- SetLibraryFilter("Neutered", creatureCollection.showFlags.HasFlag(CreatureFlags.Neutered));
- SetLibraryFilter("Obelisk", creatureCollection.showFlags.HasFlag(CreatureFlags.Obelisk));
- SetLibraryFilter("Cryopod", creatureCollection.showFlags.HasFlag(CreatureFlags.Cryopod));
- SetLibraryFilter("Mutated", creatureCollection.showFlags.HasFlag(CreatureFlags.Mutated));
- checkBoxUseFiltersInTopStatCalculation.Checked = creatureCollection.useFiltersInTopStatCalculation;
+ _filterListAllowed = false;
SetCollectionChanged(creatureWasAdded); // setCollectionChanged only if there really were creatures added from the old library to the just opened one
@@ -423,32 +416,35 @@ private bool LoadCollectionFile(string filePath, bool keepCurrentCreatures = fal
// calculate creature values
RecalculateAllCreaturesValues();
- if (!keepCurrentSelections && creatureCollection.creatures.Any())
+ // set flags for all creatures. this is needed for backwards compatibility (added 05/2020)
+ foreach (Creature c in _creatureCollection.creatures) c.InitializeFlags();
+
+ if (!keepCurrentSelections && _creatureCollection.creatures.Any())
tabControlMain.SelectedTab = tabPageLibrary;
- creatureBoxListView.CreatureCollection = creatureCollection;
+ creatureBoxListView.CreatureCollection = _creatureCollection;
UpdateCreatureListings();
// set global species that was set before loading
if (selectedSpecies != null
- && creatureCollection.creatures.Any(c => c.Species != null && c.Species.Equals(selectedSpecies))
+ && _creatureCollection.creatures.Any(c => c.Species != null && c.Species.Equals(selectedSpecies))
)
{
speciesSelector1.SetSpecies(selectedSpecies);
}
- else if (creatureCollection.creatures.Any())
- speciesSelector1.SetSpecies(creatureCollection.creatures[0].Species);
+ else if (_creatureCollection.creatures.Any())
+ speciesSelector1.SetSpecies(_creatureCollection.creatures[0].Species);
// set library species to what it was before loading
if (selectedlibrarySpecies == null
- || !creatureCollection.creatures.Any(c => c.Species != null && c.Species.Equals(selectedlibrarySpecies))
+ || !_creatureCollection.creatures.Any(c => c.Species != null && c.Species.Equals(selectedlibrarySpecies))
)
selectedlibrarySpecies = speciesSelector1.SelectedSpecies;
if (selectedlibrarySpecies != null)
- listBoxSpeciesLib.SelectedIndex = listBoxSpeciesLib.Items.IndexOf(selectedlibrarySpecies);
+ listBoxSpeciesLib.SelectedItem = selectedlibrarySpecies;
- filterListAllowed = true;
+ _filterListAllowed = true;
FilterLib();
// apply last sorting
@@ -457,7 +453,7 @@ private bool LoadCollectionFile(string filePath, bool keepCurrentCreatures = fal
UpdateTempCreatureDropDown();
Properties.Settings.Default.LastSaveFile = filePath;
- lastAutoSaveBackup = DateTime.Now.AddMinutes(-10);
+ _lastAutoSaveBackup = DateTime.Now.AddMinutes(-10);
return true;
}
@@ -472,24 +468,24 @@ private void SetCollectionChanged(bool changed, Species species = null)
if (changed)
{
if (species == null || pedigree1.creature != null && pedigree1.creature.Species == species)
- pedigreeNeedsUpdate = true;
+ _pedigreeNeedsUpdate = true;
if (species == null || breedingPlan1.CurrentSpecies == species)
breedingPlan1.breedingPlanNeedsUpdate = true;
}
- if (autoSave && changed)
+ if (_autoSave && changed)
{
// save changes automatically
- if (!string.IsNullOrEmpty(currentFileName) && autoSaveMinutes > 0 && (DateTime.Now - lastAutoSaveBackup).TotalMinutes > autoSaveMinutes && FileService.IsValidJsonFile(currentFileName))
+ if (!string.IsNullOrEmpty(_currentFileName) && _autoSaveMinutes > 0 && (DateTime.Now - _lastAutoSaveBackup).TotalMinutes > _autoSaveMinutes && FileService.IsValidJsonFile(_currentFileName))
{
- string filenameWOExt = Path.GetFileNameWithoutExtension(currentFileName);
+ string filenameWOExt = Path.GetFileNameWithoutExtension(_currentFileName);
string timeStamp = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss");
string backupFileName = filenameWOExt + "_backup_" + timeStamp + COLLECTION_FILE_EXTENSION;
- string backupFilePath = Path.Combine(Path.GetDirectoryName(currentFileName), backupFileName);
- File.Copy(currentFileName, backupFilePath);
- lastAutoSaveBackup = DateTime.Now;
+ string backupFilePath = Path.Combine(Path.GetDirectoryName(_currentFileName), backupFileName);
+ File.Copy(_currentFileName, backupFilePath);
+ _lastAutoSaveBackup = DateTime.Now;
// delete oldest backupfile if more than a certain number
- var directory = new DirectoryInfo(Path.GetDirectoryName(currentFileName));
+ var directory = new DirectoryInfo(Path.GetDirectoryName(_currentFileName));
var oldBackupfiles = directory.GetFiles()
.Where(f => f.Name.Length == backupFileName.Length &&
f.Name.Substring(0, filenameWOExt.Length + 8) == filenameWOExt + "_backup_")
@@ -513,10 +509,10 @@ private void SetCollectionChanged(bool changed, Species species = null)
SaveCollection();
return; // function is called soon again from savecollection()
}
- collectionDirty = changed;
- string fileName = string.IsNullOrEmpty(currentFileName) ? null : Path.GetFileName(currentFileName);
+ _collectionDirty = changed;
+ string fileName = string.IsNullOrEmpty(_currentFileName) ? null : Path.GetFileName(_currentFileName);
Text = $"ARK Smart Breeding{(string.IsNullOrEmpty(fileName) ? string.Empty : " - " + fileName)}{(changed ? " *" : "")}";
- openFolderOfCurrentFileToolStripMenuItem.Enabled = !string.IsNullOrEmpty(currentFileName);
+ openFolderOfCurrentFileToolStripMenuItem.Enabled = !string.IsNullOrEmpty(_currentFileName);
}
}
}
diff --git a/ARKBreedingStats/Form1.cs b/ARKBreedingStats/Form1.cs
index 1f5f36dc..7172d455 100644
--- a/ARKBreedingStats/Form1.cs
+++ b/ARKBreedingStats/Form1.cs
@@ -1,5 +1,4 @@
-using ARKBreedingStats.duplicates;
-using ARKBreedingStats.importExported;
+using ARKBreedingStats.importExported;
using ARKBreedingStats.library;
using ARKBreedingStats.Library;
using ARKBreedingStats.ocr;
@@ -23,61 +22,54 @@ namespace ARKBreedingStats
{
public partial class Form1 : Form
{
- private CreatureCollection creatureCollection = new CreatureCollection();
- private string currentFileName;
- private bool collectionDirty;
+ private CreatureCollection _creatureCollection = new CreatureCollection();
+ private string _currentFileName;
+ private bool _collectionDirty;
///
/// List of all top stats per species
///
- private readonly Dictionary topLevels = new Dictionary();
- private readonly List statIOs = new List();
- private readonly List testingIOs = new List();
- private int activeStatIndex = -1;
- private readonly bool[] activeStats = { true, true, true, true, true, true, true, true, true, true, true, true }; // stats used by the creature (some don't use oxygen)
- private bool pedigreeNeedsUpdate;
- private bool libraryNeedsUpdate;
-
- public delegate void LevelChangedEventHandler(StatIO s);
- public delegate void InputValueChangedEventHandler(StatIO s);
- public delegate void collectionChangedEventHandler(bool changed = true, Species species = null); // if null is passed for species, breeding-related controls are not updated
- public delegate void SetSpeciesEventHandler(Species species);
+ private readonly Dictionary _topLevels = new Dictionary();
+ private readonly List _statIOs = new List();
+ private readonly List _testingIOs = new List();
+ private int _activeStatIndex = -1;
+ private readonly bool[] _activeStats = { true, true, true, true, true, true, true, true, true, true, true, true }; // stats used by the creature (some don't use oxygen)
+ private bool _pedigreeNeedsUpdate;
+ private bool _libraryNeedsUpdate;
+
+ public delegate void CollectionChangedEventHandler(bool changed = true, Species species = null); // if null is passed for species, breeding-related controls are not updated
public delegate void SetMessageLabelTextEventHandler(string text = null, MessageBoxIcon icon = MessageBoxIcon.None);
- private bool updateTorporInTester, filterListAllowed;
+ private bool _updateTorporInTester;
+ private bool _filterListAllowed;
+
///
/// The stat indices that are considered for color highlighting and topness calculation.
///
- private readonly bool[] considerStatHighlight = new bool[Values.STATS_COUNT];
- private bool autoSave;
- private DateTime lastAutoSaveBackup = DateTime.Now.AddDays(-1);
- private int autoSaveMinutes;
- private Creature creatureTesterEdit;
- private int hiddenLevelsCreatureTester;
- private FileSync fileSync;
- private FileWatcherExports filewatcherExports;
- private readonly Extraction extractor = new Extraction();
- ///
- /// Some creatures have hidden stats they level, e.g. oxygen for aquatics
- ///
- private bool displayHiddenStats;
- private SpeechRecognition speechRecognition;
- private readonly System.Windows.Forms.Timer timerGlobal = new System.Windows.Forms.Timer();
- private readonly Dictionary libraryViews;
- private ExportedCreatureList exportedCreatureList;
- private MergingDuplicatesWindow mergingDuplicatesWindow;
- private ExportedCreatureControl exportedCreatureControl;
- private readonly ToolTip tt = new ToolTip();
- private bool reactOnSelectionChange;
- private CancellationTokenSource cancelTokenLibrarySelection;
- private bool clearExtractionCreatureData;
+ private readonly bool[] _considerStatHighlight = new bool[Values.STATS_COUNT];
+ private bool _autoSave;
+ private DateTime _lastAutoSaveBackup = DateTime.Now.AddDays(-1);
+ private int _autoSaveMinutes;
+ private Creature _creatureTesterEdit;
+ private int _hiddenLevelsCreatureTester;
+ private FileSync _fileSync;
+ private FileWatcherExports _filewatcherExports;
+ private readonly Extraction _extractor = new Extraction();
+ private SpeechRecognition _speechRecognition;
+ private readonly System.Windows.Forms.Timer _timerGlobal = new System.Windows.Forms.Timer();
+ private ExportedCreatureList _exportedCreatureList;
+ private ExportedCreatureControl _exportedCreatureControl;
+ private readonly ToolTip _tt;
+ private bool _reactOnCreatureSelectionChange;
+ private CancellationTokenSource _cancelTokenLibrarySelection;
+ private bool _clearExtractionCreatureData;
///
/// The last tab-page opened in the settings.
///
- private SettingsTabPages settingsLastTabPage;
+ private SettingsTabPages _settingsLastTabPage;
///
/// Custom replacings for species names used in naming patterns.
///
- private Dictionary customReplacingsNamingPattern;
+ private Dictionary _customReplacingNamingPattern;
// 0: Health
// 1: Stamina / Charge Capacity
@@ -93,15 +85,15 @@ public partial class Form1 : Form
// 11: CraftingSpeedMultiplier
// OCR stuff
- public ARKOverlay overlay;
- private static double[] lastOCRValues;
- private Species lastOCRSpecies;
+ private ARKOverlay _overlay;
+ private static double[] _lastOcrValues;
+ private Species _lastOcrSpecies;
public Form1()
{
var args = Environment.GetCommandLineArgs();
if (args.Contains("cleanupUpdater"))
- FileService.TryDeleteFile(Path.Combine(Path.GetTempPath(), Updater.UPDATER_EXE));
+ FileService.TryDeleteFile(Path.Combine(Path.GetTempPath(), Updater.UpdaterExe));
// load settings of older version if possible after an upgrade
if (Properties.Settings.Default.UpgradeRequired)
@@ -121,23 +113,12 @@ public Form1()
Properties.Settings.Default.NamingPatterns[0] = Properties.Settings.Default.sequentialUniqueNamePattern;
}
+ _tt = new ToolTip();
initLocalization();
InitializeComponent();
columnHeaderTo.DisplayIndex = 16; // workaround for designer issue with displayIndices.
- libraryViews = new Dictionary
- {
- { "Dead", true },
- { "Unavailable", true },
- { "Neutered", true },
- { "Mutated", true },
- { "Obelisk", true },
- { "Cryopod", true },
- { "Females", true },
- { "Males", true }
- };
-
// Create an instance of a ListView column sorter and assign it
// to the ListView controls
listViewLibrary.ListViewItemSorter = new ListViewColumnSorter();
@@ -168,7 +149,7 @@ public Form1()
notesControl1.changed += SetCollectionChanged;
creatureInfoInputExtractor.CreatureDataRequested += CreatureInfoInput_CreatureDataRequested;
creatureInfoInputTester.CreatureDataRequested += CreatureInfoInput_CreatureDataRequested;
- speciesSelector1.onSpeciesChanged += SpeciesSelector1_onSpeciesChanged;
+ speciesSelector1.OnSpeciesSelected += SpeciesSelector1OnSpeciesSelected;
statsMultiplierTesting1.OnApplyMultipliers += StatsMultiplierTesting1_OnApplyMultipliers;
raisingControl1.AdjustTimers += timerList1.AdjustAllTimersByOffset;
@@ -179,12 +160,12 @@ public Form1()
openSettingsToolStripMenuItem.ShortcutKeyDisplayString = new KeysConverter().ConvertTo(Keys.Control, typeof(string))?.ToString().Replace("None", ",");
- timerGlobal.Interval = 1000;
- timerGlobal.Tick += TimerGlobal_Tick;
+ _timerGlobal.Interval = 1000;
+ _timerGlobal.Tick += TimerGlobal_Tick;
ReloadNamePatternCustomReplacings();
- reactOnSelectionChange = true;
+ _reactOnCreatureSelectionChange = true;
}
private void Form1_Load(object sender, EventArgs e)
@@ -192,12 +173,8 @@ private void Form1_Load(object sender, EventArgs e)
setLocalizations(false);
// load window-position and size
- Size = Properties.Settings.Default.formSize;
- if (Size.Height < 200)
- Size = new Size(Size.Width, 200);
- if (Size.Width < 400)
- Size = new Size(400, Size.Height);
- Location = Properties.Settings.Default.formLocation;
+ Size = new Size(Math.Max(600, Properties.Settings.Default.MainWindowRect.Width), Math.Max(500, Properties.Settings.Default.MainWindowRect.Height));
+ Location = new Point(Properties.Settings.Default.MainWindowRect.X, Properties.Settings.Default.MainWindowRect.Y);
// check if form is on screen
bool isOnScreen = false;
foreach (Screen screen in Screen.AllScreens)
@@ -226,37 +203,9 @@ private void Form1_Load(object sender, EventArgs e)
Dictionary custW = new Dictionary();
if (custWs != null && custWd != null)
{
- var newToOldIndicesStatWeightings = new int[] { 0, 1, -1, 2, 3, -1, -1, 4, 5, 6, -1, -1 };
-
- // TODO remove this when new stat-order is established, e.g. in 6 months (2019-11)
- // if statWeights use the old order, convert
- for (int i = 0; i < custWd.Length; i++)
+ for (int i = 0; i < custWs.Length && i < custWd.Length; i++)
{
- if (custWd[i].Length == 7)
- {
- double[] newOrder = new double[Values.STATS_COUNT];
- for (int s = 0; s < Values.STATS_COUNT; s++)
- {
- if (newToOldIndicesStatWeightings[s] >= 0)
- {
- newOrder[s] = custWd[i][newToOldIndicesStatWeightings[s]];
- }
- else
- {
- newOrder[s] = 1;
- }
- }
- custWd[i] = newOrder;
- }
- }
- // end of conversion
-
- for (int i = 0; i < custWs.Length; i++)
- {
- if (i < custWd.Length)
- {
- custW.Add(custWs[i], custWd[i]);
- }
+ custW.Add(custWs[i], custWd[i]);
}
}
breedingPlan1.statWeighting.CustomWeightings = custW;
@@ -264,8 +213,8 @@ private void Form1_Load(object sender, EventArgs e)
if (custWs != null && custWd != null && custWd.Length > custWs.Length)
breedingPlan1.statWeighting.WeightValues = custWd[custWs.Length];
- autoSave = Properties.Settings.Default.autosave;
- autoSaveMinutes = Properties.Settings.Default.autosaveMinutes;
+ _autoSave = Properties.Settings.Default.autosave;
+ _autoSaveMinutes = Properties.Settings.Default.autosaveMinutes;
// load weapondamages
tamingControl1.WeaponDamages = Properties.Settings.Default.weaponDamages;
@@ -295,52 +244,52 @@ private void Form1_Load(object sender, EventArgs e)
statIOTesting.LevelChanged += testingStatIOValueUpdate;
statIO.InputValueChanged += StatIOQuickWildLevelCheck;
statIO.Click += new System.EventHandler(this.StatIO_Click);
- considerStatHighlight[s] = (Properties.Settings.Default.consideredStats & (1 << s)) != 0;
+ _considerStatHighlight[s] = (Properties.Settings.Default.consideredStats & (1 << s)) != 0;
- statIOs.Add(statIO);
- testingIOs.Add(statIOTesting);
+ _statIOs.Add(statIO);
+ _testingIOs.Add(statIOTesting);
}
// add controls in the order they are shown ingame
for (int s = 0; s < Values.STATS_COUNT; s++)
{
- flowLayoutPanelStatIOsExtractor.Controls.Add(statIOs[Values.statsDisplayOrder[s]]);
- flowLayoutPanelStatIOsExtractor.SetFlowBreak(statIOs[Values.statsDisplayOrder[s]], true);
- flowLayoutPanelStatIOsTester.Controls.Add(testingIOs[Values.statsDisplayOrder[s]]);
- flowLayoutPanelStatIOsTester.SetFlowBreak(testingIOs[Values.statsDisplayOrder[s]], true);
- checkedListBoxConsiderStatTop.Items.Add(Utils.StatName(Values.statsDisplayOrder[s]), considerStatHighlight[Values.statsDisplayOrder[s]]);
+ flowLayoutPanelStatIOsExtractor.Controls.Add(_statIOs[Values.statsDisplayOrder[s]]);
+ flowLayoutPanelStatIOsExtractor.SetFlowBreak(_statIOs[Values.statsDisplayOrder[s]], true);
+ flowLayoutPanelStatIOsTester.Controls.Add(_testingIOs[Values.statsDisplayOrder[s]]);
+ flowLayoutPanelStatIOsTester.SetFlowBreak(_testingIOs[Values.statsDisplayOrder[s]], true);
+ checkedListBoxConsiderStatTop.Items.Add(Utils.StatName(Values.statsDisplayOrder[s]), _considerStatHighlight[Values.statsDisplayOrder[s]]);
}
// torpor should not show bar, it get's too wide and is not interesting for breeding
- statIOs[(int)StatNames.Torpidity].ShowBarAndLock = false;
- testingIOs[(int)StatNames.Torpidity].ShowBarAndLock = false;
+ _statIOs[(int)StatNames.Torpidity].ShowBarAndLock = false;
+ _testingIOs[(int)StatNames.Torpidity].ShowBarAndLock = false;
// move sums and footnote to bottom
flowLayoutPanelStatIOsExtractor.Controls.Add(panelSums);
flowLayoutPanelStatIOsExtractor.Controls.Add(labelFootnote);
flowLayoutPanelStatIOsTester.Controls.Add(panelStatTesterFootnote);
// some stats are not used for any species, hide them permamently (until needed in a later release)
- statIOs[(int)StatNames.Water].Hide();
- statIOs[(int)StatNames.Temperature].Hide();
- statIOs[(int)StatNames.TemperatureFortitude].Hide();
- testingIOs[(int)StatNames.Water].Hide();
- testingIOs[(int)StatNames.Temperature].Hide();
- testingIOs[(int)StatNames.TemperatureFortitude].Hide();
+ _statIOs[(int)StatNames.Water].Hide();
+ _statIOs[(int)StatNames.Temperature].Hide();
+ _statIOs[(int)StatNames.TemperatureFortitude].Hide();
+ _testingIOs[(int)StatNames.Water].Hide();
+ _testingIOs[(int)StatNames.Temperature].Hide();
+ _testingIOs[(int)StatNames.TemperatureFortitude].Hide();
breedingPlan1.MutationLimit = Properties.Settings.Default.MutationLimitBreedingPlanner;
// enable 0-lock for dom-levels of oxygen, food (most often they are not leveld up)
- statIOs[(int)StatNames.Oxygen].DomLevelLockedZero = true;
- statIOs[(int)StatNames.Food].DomLevelLockedZero = true;
+ _statIOs[(int)StatNames.Oxygen].DomLevelLockedZero = true;
+ _statIOs[(int)StatNames.Food].DomLevelLockedZero = true;
InitializeCollection();
- filterListAllowed = true;
+ _filterListAllowed = true;
// Set up the file watcher
- fileSync = new FileSync(currentFileName, CollectionChanged);
+ _fileSync = new FileSync(_currentFileName, CollectionChanged);
// exports file watcher
bool enableExportWatcher = Utils.GetFirstImportExportFolder(out string exportFolderDefault)
&& Properties.Settings.Default.AutoImportExportedCreatures;
- filewatcherExports = new FileWatcherExports(exportFolderDefault, ImportExportedAddIfPossible_WatcherThread, enableExportWatcher);
+ _filewatcherExports = new FileWatcherExports(exportFolderDefault, ImportExportedAddIfPossible_WatcherThread, enableExportWatcher);
if (!LoadStatAndKibbleValues(applySettings: false).statValuesLoaded || !Values.V.species.Any())
{
@@ -379,11 +328,10 @@ private void Form1_Load(object sender, EventArgs e)
for (int s = 0; s < Values.STATS_COUNT; s++)
{
- statIOs[s].Input = 0;
+ _statIOs[s].Input = 0;
}
speciesSelector1.LastSpecies = Properties.Settings.Default.lastSpecies;
- speciesSelector1.lastTabPage = tabPageExtractor;
if (Properties.Settings.Default.lastSpecies?.Any() == true)
{
@@ -409,9 +357,9 @@ private void Form1_Load(object sender, EventArgs e)
// UI loaded
//// initialize controls
- radarChart1.initializeVariables(creatureCollection.maxChartLevel);
- radarChartExtractor.initializeVariables(creatureCollection.maxChartLevel);
- radarChartLibrary.initializeVariables(creatureCollection.maxChartLevel);
+ radarChart1.initializeVariables(_creatureCollection.maxChartLevel);
+ radarChartExtractor.initializeVariables(_creatureCollection.maxChartLevel);
+ radarChartLibrary.initializeVariables(_creatureCollection.maxChartLevel);
extractionTestControl1.CopyToExtractor += ExtractionTestControl1_CopyToExtractor;
extractionTestControl1.CopyToTester += ExtractionTestControl1_CopyToTester;
@@ -426,14 +374,26 @@ private void Form1_Load(object sender, EventArgs e)
extractionTestControl1.LoadExtractionTestCases(Properties.Settings.Default.LastSaveFileTestCases);
}
+ creatureInfoInputTester.pBcolorRegion = pictureBoxColorRegionsTester;
+ creatureInfoInputExtractor.pBcolorRegion = PbCreatureColorsExtractor;
+
// set TLS-protocol (github needs at least TLS 1.2) for update-check
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
// check for updates
- if (DateTime.Now.AddHours(-12) > Properties.Settings.Default.lastUpdateCheck)
+ if (DateTime.Now.AddHours(-20) > Properties.Settings.Default.lastUpdateCheck)
CheckForUpdates(true);
- timerGlobal.Start();
+ if (!Properties.Settings.Default.AskedToDownloadImageFiles)
+ {
+ Properties.Settings.Default.AskedToDownloadImageFiles = true;
+ if (!File.Exists(FileService.GetPath("img", "Giant Queen Bee.png"))
+ && MessageBox.Show("Download species images to display the creature colors?\n\nThe file to be downloaded has a size of ~13 MB.",
+ "Download species images?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
+ DownloadSpeciesImagesAsync();
+ }
+
+ _timerGlobal.Start();
}
///
@@ -446,12 +406,12 @@ private void InitializeSpeechRecognition()
{
// var speechRecognitionAvailable = (AppDomain.CurrentDomain.GetAssemblies().Any(a => a.FullName.Substring(0, 13) == "System.Speech")); // TODO doens't work as intended. Should only require System.Speech if available to allow running it on MONO
- speechRecognition = new SpeechRecognition(creatureCollection.maxWildLevel, creatureCollection.considerWildLevelSteps ? creatureCollection.wildLevelStep : 1, Values.V.speciesWithAliasesList, lbListening);
- if (speechRecognition.Initialized)
+ _speechRecognition = new SpeechRecognition(_creatureCollection.maxWildLevel, _creatureCollection.considerWildLevelSteps ? _creatureCollection.wildLevelStep : 1, Values.V.speciesWithAliasesList, lbListening);
+ if (_speechRecognition.Initialized)
{
speechRecognitionInitialized = true;
- speechRecognition.speechRecognized += TellTamingData;
- speechRecognition.speechCommandRecognized += SpeechCommand;
+ _speechRecognition.speechRecognized += TellTamingData;
+ _speechRecognition.speechCommandRecognized += SpeechCommand;
lbListening.Visible = true;
}
else
@@ -461,8 +421,8 @@ private void InitializeSpeechRecognition()
}
if (!speechRecognitionInitialized)
{
- speechRecognition?.Dispose();
- speechRecognition = null;
+ _speechRecognition?.Dispose();
+ _speechRecognition = null;
lbListening.Visible = false;
}
}
@@ -481,7 +441,7 @@ private void TellTamingData(string speciesName, int level)
{
tamingControl1.SetLevel(level, false);
tamingControl1.SetSpecies(speciesSelector1.SelectedSpecies);
- overlay?.SetInfoText($"{speciesName} ({Loc.s("Level")} {level}):\n{tamingControl1.quickTamingInfos}");
+ _overlay?.SetInfoText($"{speciesName} ({Loc.S("Level")} {level}):\n{tamingControl1.quickTamingInfos}");
}
}
@@ -577,13 +537,13 @@ private void TbSpeciesGlobal_KeyUp(object sender, KeyEventArgs e)
}
// global species changed / globalspecieschanged
- private void SpeciesSelector1_onSpeciesChanged(bool speciesChanged)
+ private void SpeciesSelector1OnSpeciesSelected(bool speciesChanged)
{
Species species = speciesSelector1.SelectedSpecies;
ToggleViewSpeciesSelector(false);
tbSpeciesGlobal.Text = species.name;
if (!speciesChanged) return;
- clearExtractionCreatureData = true; // as soon as the user changes the species, it's assumed it's not an exported creature anymore
+ _clearExtractionCreatureData = true; // as soon as the user changes the species, it's assumed it's not an exported creature anymore
pbSpecies.Image = speciesSelector1.SpeciesImage();
creatureInfoInputExtractor.SelectedSpecies = species;
@@ -592,16 +552,16 @@ private void SpeciesSelector1_onSpeciesChanged(bool speciesChanged)
for (int s = 0; s < Values.STATS_COUNT; s++)
{
- activeStats[s] = displayHiddenStats
+ _activeStats[s] = Properties.Settings.Default.DisplayHiddenStats
? species.UsesStat(s)
: species.DisplaysStat(s);
- statIOs[s].IsActive = activeStats[s];
- testingIOs[s].IsActive = species.UsesStat(s);
- if (!activeStats[s]) statIOs[s].Input = 0;
- statIOs[s].Title = Utils.StatName(s, false, glowSpecies: isglowSpecies);
- testingIOs[s].Title = Utils.StatName(s, false, isglowSpecies);
+ _statIOs[s].IsActive = _activeStats[s];
+ _testingIOs[s].IsActive = species.UsesStat(s);
+ if (!_activeStats[s]) _statIOs[s].Input = 0;
+ _statIOs[s].Title = Utils.StatName(s, false, glowSpecies: isglowSpecies);
+ _testingIOs[s].Title = Utils.StatName(s, false, isglowSpecies);
// don't lock special stats of glowspecies
if ((isglowSpecies &&
(s == (int)StatNames.Stamina
@@ -613,7 +573,7 @@ private void SpeciesSelector1_onSpeciesChanged(bool speciesChanged)
)
)
{
- statIOs[s].DomLevelLockedZero = false;
+ _statIOs[s].DomLevelLockedZero = false;
}
}
if (tabControlMain.SelectedTab == tabPageExtractor)
@@ -624,7 +584,7 @@ private void SpeciesSelector1_onSpeciesChanged(bool speciesChanged)
{
UpdateAllTesterValues();
statPotentials1.Species = species;
- statPotentials1.SetLevels(testingIOs.Select(s => s.LevelWild).ToArray(), true);
+ statPotentials1.SetLevels(_testingIOs.Select(s => s.LevelWild).ToArray(), true);
SetTesterInfoInputCreature();
}
else if (tabControlMain.SelectedTab == tabPageLibrary)
@@ -654,9 +614,9 @@ private void SpeciesSelector1_onSpeciesChanged(bool speciesChanged)
}
}
- hiddenLevelsCreatureTester = 0;
+ _hiddenLevelsCreatureTester = 0;
- tt.SetToolTip(tbSpeciesGlobal, species != null ? species.DescriptiveNameAndMod + "\n" + species.blueprintPath : "[unknown]");
+ _tt.SetToolTip(tbSpeciesGlobal, species != null ? species.DescriptiveNameAndMod + "\n" + species.blueprintPath : "[unknown]");
}
private void numericUpDown_Enter(object sender, EventArgs e)
@@ -671,7 +631,7 @@ private void numericUpDown_Enter(object sender, EventArgs e)
private void ApplySettingsToValues()
{
// apply multipliers
- Values.V.ApplyMultipliers(creatureCollection, cbEventMultipliers.Checked);
+ Values.V.ApplyMultipliers(_creatureCollection, cbEventMultipliers.Checked);
tamingControl1.SetTamingMultipliers(Values.V.currentServerMultipliers.TamingSpeedMultiplier,
Values.V.currentServerMultipliers.DinoCharacterFoodDrainMultiplier);
@@ -681,42 +641,41 @@ private void ApplySettingsToValues()
raisingControl1.UpdateRaisingData();
// apply level settings
- creatureBoxListView.CreatureCollection = creatureCollection;
+ creatureBoxListView.CreatureCollection = _creatureCollection;
for (int s = 0; s < Values.STATS_COUNT; s++)
{
- statIOs[s].barMaxLevel = creatureCollection.maxChartLevel;
- testingIOs[s].barMaxLevel = creatureCollection.maxChartLevel;
+ _statIOs[s].barMaxLevel = _creatureCollection.maxChartLevel;
+ _testingIOs[s].barMaxLevel = _creatureCollection.maxChartLevel;
}
- breedingPlan1.MaxWildLevels = creatureCollection.maxWildLevel;
- radarChart1.initializeVariables(creatureCollection.maxChartLevel);
- radarChartExtractor.initializeVariables(creatureCollection.maxChartLevel);
- radarChartLibrary.initializeVariables(creatureCollection.maxChartLevel);
- statPotentials1.levelDomMax = creatureCollection.maxDomLevel;
- statPotentials1.levelGraphMax = creatureCollection.maxChartLevel;
+ breedingPlan1.MaxWildLevels = _creatureCollection.maxWildLevel;
+ radarChart1.initializeVariables(_creatureCollection.maxChartLevel);
+ radarChartExtractor.initializeVariables(_creatureCollection.maxChartLevel);
+ radarChartLibrary.initializeVariables(_creatureCollection.maxChartLevel);
+ statPotentials1.levelDomMax = _creatureCollection.maxDomLevel;
+ statPotentials1.levelGraphMax = _creatureCollection.maxChartLevel;
- speechRecognition?.SetMaxLevelAndSpecies(creatureCollection.maxWildLevel, creatureCollection.considerWildLevelSteps ? creatureCollection.wildLevelStep : 1, Values.V.speciesWithAliasesList);
- if (overlay != null)
+ _speechRecognition?.SetMaxLevelAndSpecies(_creatureCollection.maxWildLevel, _creatureCollection.considerWildLevelSteps ? _creatureCollection.wildLevelStep : 1, Values.V.speciesWithAliasesList);
+ if (_overlay != null)
{
- overlay.InfoDuration = Properties.Settings.Default.OverlayInfoDuration;
- overlay.checkInventoryStats = Properties.Settings.Default.inventoryCheckTimer;
+ _overlay.InfoDuration = Properties.Settings.Default.OverlayInfoDuration;
+ _overlay.checkInventoryStats = Properties.Settings.Default.inventoryCheckTimer;
}
- displayHiddenStats = Properties.Settings.Default.oxygenForAll;
ArkOCR.OCR.screenCaptureApplicationName = Properties.Settings.Default.OCRApp;
if (Properties.Settings.Default.showOCRButton)
{
- Loc.ControlText(btReadValuesFromArk, tt);
+ Loc.ControlText(btReadValuesFromArk, _tt);
}
else
{
btReadValuesFromArk.Text = "Import Exported Data";
- tt.SetToolTip(btReadValuesFromArk, "Displays all exported creatures in the default-folder (needs to be set in the settings).");
+ _tt.SetToolTip(btReadValuesFromArk, "Displays all exported creatures in the default-folder (needs to be set in the settings).");
}
ArkOCR.OCR.waitBeforeScreenCapture = Properties.Settings.Default.waitBeforeScreenCapture;
ocrControl1.SetWhiteThreshold(Properties.Settings.Default.OCRWhiteThreshold);
- int maxImprintingPercentage = creatureCollection.allowMoreThanHundredImprinting ? 100000 : 100;
+ int maxImprintingPercentage = _creatureCollection.allowMoreThanHundredImprinting ? 100000 : 100;
numericUpDownImprintingBonusExtractor.Maximum = maxImprintingPercentage;
numericUpDownImprintingBonusTester.Maximum = maxImprintingPercentage;
@@ -735,13 +694,13 @@ private void ApplySettingsToValues()
// update enabled stats
for (int s = 0; s < Values.STATS_COUNT; s++)
{
- activeStats[s] = speciesSelector1.SelectedSpecies == null
+ _activeStats[s] = speciesSelector1.SelectedSpecies == null
? (Species.displayedStatsDefault & 1 << s) != 0
- : displayHiddenStats
+ : Properties.Settings.Default.DisplayHiddenStats
? speciesSelector1.SelectedSpecies.UsesStat(s)
: speciesSelector1.SelectedSpecies.DisplaysStat(s);
- statIOs[s].IsActive = activeStats[s];
- if (!activeStats[s]) statIOs[s].Input = 0;
+ _statIOs[s].IsActive = _activeStats[s];
+ if (!_activeStats[s]) _statIOs[s].Input = 0;
}
if (tabControlMain.SelectedTab == tabPageStatTesting)
{
@@ -802,16 +761,16 @@ private void importingFromSavegameEmptyToolStripMenuItem_Click(object sender, Ev
///
private void CreateCreatureTagList()
{
- creatureCollection.tags.Clear();
- foreach (Creature c in creatureCollection.creatures)
+ _creatureCollection.tags.Clear();
+ foreach (Creature c in _creatureCollection.creatures)
{
foreach (string t in c.tags)
{
- if (!creatureCollection.tags.Contains(t))
- creatureCollection.tags.Add(t);
+ if (!_creatureCollection.tags.Contains(t))
+ _creatureCollection.tags.Add(t);
}
}
- creatureCollection.tags.Sort();
+ _creatureCollection.tags.Sort();
breedingPlan1.CreateTagList();
}
@@ -834,7 +793,6 @@ private void loadAndAddToolStripMenuItem_Click(object sender, EventArgs e)
LoadCollection(true);
}
-
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
SaveCollection();
@@ -849,17 +807,17 @@ private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
/// This function should be called if the creatureCollection was changed, i.e. after loading a file or adding/removing a creature
///
/// If not null, only the creatures of the species are updated
- private void UpdateCreatureListings(Species species = null)
+ private void UpdateCreatureListings(Species species = null, bool keepCurrentlySelectedSpecies = true)
{
// if speciesIndex == null consider all creatures, else recalculate only the indicated species if applicable
- List creatures = creatureCollection.creatures;
+ List creatures = _creatureCollection.creatures;
if (species != null)
{
creatures = creatures.Where(c => c.Species == species).ToList();
}
UpdateOwnerServerTagLists();
CalculateTopStats(creatures);
- UpdateSpeciesLists(creatureCollection.creatures);
+ UpdateSpeciesLists(_creatureCollection.creatures, keepCurrentlySelectedSpecies);
FilterLib();
UpdateStatusBar();
breedingPlan1.breedingPlanNeedsUpdate = true;
@@ -871,12 +829,10 @@ private void UpdateCreatureListings(Species species = null)
/// This function should be called if the creatureCollection is changed, i.e. after loading a file or adding/removing a creature.
/// It updates the listed species in the treelist and in the speciesSelector.
///
- private void UpdateSpeciesLists(List creatures)
+ private void UpdateSpeciesLists(List creatures, bool keepCurrentlySelectedSpecies = true)
{
- Species selectedSpecies = null;
- if (listBoxSpeciesLib.SelectedIndex > 0
- && listBoxSpeciesLib.SelectedItem.GetType() == typeof(Species))
- selectedSpecies = listBoxSpeciesLib.SelectedItem as Species;
+ Species selectedSpecies = keepCurrentlySelectedSpecies && listBoxSpeciesLib.SelectedItem is Species sp ? sp : null;
+
// clear specieslist
listBoxSpeciesLib.Items.Clear();
List availableSpecies = new List();
@@ -895,13 +851,13 @@ private void UpdateSpeciesLists(List creatures)
// add node to show all
listBoxSpeciesLib.BeginUpdate();
- listBoxSpeciesLib.Items.Insert(0, "All");
+ listBoxSpeciesLib.Items.Add(Loc.S("All"));
foreach (Species s in availableSpecies)
listBoxSpeciesLib.Items.Add(s);
listBoxSpeciesLib.EndUpdate();
if (selectedSpecies != null)
- listBoxSpeciesLib.SelectedIndex = listBoxSpeciesLib.Items.IndexOf(selectedSpecies);
+ listBoxSpeciesLib.SelectedItem = selectedSpecies;
breedingPlan1.SetSpeciesList(availableSpecies, creatures);
speciesSelector1.SetLibrarySpecies(availableSpecies);
@@ -912,101 +868,46 @@ private void UpdateSpeciesLists(List creatures)
///
private void UpdateOwnerServerTagLists()
{
- const string NOTAVAILABLE = "n/a";
- filterListAllowed = false;
+ string notavailable = Loc.S("na");
+ _filterListAllowed = false;
//// clear lists
// owner
- checkedListBoxOwner.Items.Clear();
- var ownerList = new Dictionary();
-
- var tribesList = new Dictionary();
-
- // server checkboxes
- checkedListBoxFilterServers.Items.Clear();
- var serverList = new Dictionary();
-
- // tag checkboxes
- checkedListBoxFilterTags.Items.Clear();
- var tagList = new Dictionary();
-
+ var ownerList = new List();
+ var tribesList = new List();
+ var serverList = new List();
//// check all creature for info
- foreach (Creature c in creatureCollection.creatures)
+ var creaturesToCheck = _creatureCollection.creatures.Where(c => !c.flags.HasFlag(CreatureFlags.Placeholder)).ToArray();
+ foreach (Creature c in creaturesToCheck)
{
- SetListValue(c.owner, ownerList);
- SetListValue(c.tribe, tribesList);
- SetListValue(c.server, serverList);
-
- void SetListValue(string _value, Dictionary _list)
- {
- if (string.IsNullOrEmpty(_value))
- {
- if (!_list.ContainsKey(NOTAVAILABLE))
- _list.Add(NOTAVAILABLE, 1);
- else
- _list[NOTAVAILABLE]++;
- }
- else if (!_list.ContainsKey(_value))
- {
- _list.Add(_value, 1);
- }
- else
- {
- _list[_value]++;
- }
- }
+ AddIfNotContains(ownerList, c.owner);
+ AddIfNotContains(tribesList, c.tribe);
+ AddIfNotContains(serverList, c.server);
- // tags
- if (!(c.tags?.Any() ?? false))
- {
- if (!tagList.ContainsKey(NOTAVAILABLE))
- tagList.Add(NOTAVAILABLE, 1);
- else
- tagList[NOTAVAILABLE]++;
- }
- else
+ void AddIfNotContains(List list, string name)
{
- for (int t = 0; t < c.tags.Count; t++)
- {
- if (!tagList.ContainsKey(c.tags[t]))
- {
- tagList.Add(c.tags[t], 1);
- }
- else
- {
- tagList[c.tags[t]]++;
- }
- }
+ if (!string.IsNullOrEmpty(name) && !list.Contains(name))
+ list.Add(name);
}
}
- //// create checkbox controls
+ ownerList.Sort();
+ tribesList.Sort();
+ serverList.Sort();
+
// owners
- foreach (var owner in ownerList.OrderBy(o => o.Key != NOTAVAILABLE).ThenBy(o => o.Key))
+ foreach (var owner in ownerList)
{
- checkedListBoxOwner.Items.Add($"{owner.Key} ({owner.Value})", !creatureCollection.hiddenOwners.Contains(owner.Key));
- if (owner.Key != NOTAVAILABLE && !tribesControl1.PlayerExists(owner.Key))
- tribesControl1.AddPlayer(owner.Key);
+ if (!string.IsNullOrEmpty(owner) && !tribesControl1.PlayerExists(owner))
+ tribesControl1.AddPlayer(owner);
}
// tribes
- foreach (var tribe in tribesList.OrderBy(o => o.Key != NOTAVAILABLE).ThenBy(o => o.Key))
- {
- if (tribe.Key != NOTAVAILABLE && !tribesControl1.TribeExists(tribe.Key))
- tribesControl1.AddTribe(tribe.Key);
- }
-
- // servers
- foreach (var server in serverList.OrderBy(o => o.Key != NOTAVAILABLE).ThenBy(o => o.Key))
+ foreach (var tribe in tribesList)
{
- checkedListBoxFilterServers.Items.Add($"{server.Key} ({server.Value})", !creatureCollection.hiddenServers.Contains(server.Key));
- }
-
- // tags
- foreach (var tag in tagList.OrderBy(o => o.Key != NOTAVAILABLE).ThenBy(o => o.Key))
- {
- checkedListBoxFilterTags.Items.Add($"{tag.Key} ({tag.Value})", !creatureCollection.dontShowTags.Contains(tag.Key));
+ if (!string.IsNullOrEmpty(tribe) && !tribesControl1.TribeExists(tribe))
+ tribesControl1.AddTribe(tribe);
}
///// Apply autocomplete lists
@@ -1026,14 +927,14 @@ void SetListValue(string _value, Dictionary _list)
creatureInfoInputTester.OwnersTribes = ownersTribes;
// server
- var serverArray = serverList.Select(s => s.Key).ToArray();
+ var serverArray = serverList.ToArray();
creatureInfoInputExtractor.ServersList = serverArray;
creatureInfoInputTester.ServersList = serverArray;
- creatureCollection.ownerList = owners;
- creatureCollection.serverList = serverArray;
+ _creatureCollection.ownerList = owners;
+ _creatureCollection.serverList = serverArray;
- filterListAllowed = true;
+ _filterListAllowed = true;
}
#region check for update
@@ -1045,7 +946,7 @@ private void checkForUpdatedStatsToolStripMenuItem_Click(object sender, EventArg
private async void CheckForUpdates(bool silentCheck = false)
{
- bool? updaterRunning = await Updater.CheckForPortableUpdate(silentCheck, collectionDirty);
+ bool? updaterRunning = await Updater.CheckForPortableUpdate(silentCheck, _collectionDirty);
if (!updaterRunning.HasValue) return; // error
if (updaterRunning.Value)
{
@@ -1124,12 +1025,12 @@ private void UpdateParentListInput(CreatureInfoInput input)
{
// set possible parents
bool fromExtractor = input == creatureInfoInputExtractor;
- Creature creature = new Creature(speciesSelector1.SelectedSpecies, "", "", "", 0, GetCurrentWildLevels(fromExtractor), levelStep: creatureCollection.getWildLevelStep());
+ Creature creature = new Creature(speciesSelector1.SelectedSpecies, "", "", "", 0, GetCurrentWildLevels(fromExtractor), levelStep: _creatureCollection.getWildLevelStep());
List[] parents = FindPossibleParents(creature);
input.ParentsSimilarities = FindParentSimilarities(parents, creature);
input.Parents = parents;
input.parentListValid = true;
- input.NamesOfAllCreatures = creatureCollection.creatures.Select(c => c.name).ToList();
+ input.NamesOfAllCreatures = _creatureCollection.creatures.Select(c => c.name).ToList();
}
private void newToolStripMenuItem_Click(object sender, EventArgs e)
@@ -1139,7 +1040,7 @@ private void newToolStripMenuItem_Click(object sender, EventArgs e)
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
- if (collectionDirty && MessageBox.Show("Your Creature Collection has been modified since it was last saved, " +
+ if (_collectionDirty && MessageBox.Show("Your Creature Collection has been modified since it was last saved, " +
"are you sure you want to discard your changes and quit without saving?",
"Discard Changes?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
e.Cancel = true;
@@ -1218,8 +1119,7 @@ private void Form1_FormClosed(object sender, FormClosedEventArgs e)
// save window-position and size
if (WindowState != FormWindowState.Minimized)
{
- Properties.Settings.Default.formSize = Size;
- Properties.Settings.Default.formLocation = Location;
+ Properties.Settings.Default.MainWindowRect = new Rectangle(Location.X, Location.Y, Size.Width, Size.Height);
}
// Save column-widths, display-indices and sort-order of the TimerControlListView
@@ -1262,7 +1162,7 @@ private void Form1_FormClosed(object sender, FormClosedEventArgs e)
Properties.Settings.Default.Save();
// remove old cache-files
- string imgCachePath = FileService.GetPath("img/cache");
+ string imgCachePath = FileService.GetPath("img", "cache");
if (Directory.Exists(imgCachePath))
{
DirectoryInfo directory = new DirectoryInfo(imgCachePath);
@@ -1280,8 +1180,8 @@ private void Form1_FormClosed(object sender, FormClosedEventArgs e)
}
}
- tt.Dispose();
- timerGlobal.Dispose();
+ _tt.Dispose();
+ _timerGlobal.Dispose();
}
///
@@ -1294,6 +1194,9 @@ private void SetMessageLabelText(string text = null, MessageBoxIcon icon = Messa
lbLibrarySelectionInfo.Text = text;
switch (icon)
{
+ case MessageBoxIcon.Information:
+ lbLibrarySelectionInfo.BackColor = Color.LightGreen;
+ break;
case MessageBoxIcon.Warning:
lbLibrarySelectionInfo.BackColor = Color.LightSalmon;
break;
@@ -1303,233 +1206,19 @@ private void SetMessageLabelText(string text = null, MessageBoxIcon icon = Messa
}
}
- private void checkBoxShowDead_CheckedChanged(object sender, EventArgs e)
- {
- SetLibraryFilter("Dead", checkBoxShowDead.Checked);
- }
-
- private void checkBoxShowUnavailableCreatures_CheckedChanged(object sender, EventArgs e)
- {
- SetLibraryFilter("Unavailable", checkBoxShowUnavailableCreatures.Checked);
- }
-
- private void checkBoxShowNeuteredCreatures_CheckedChanged(object sender, EventArgs e)
- {
- SetLibraryFilter("Neutered", checkBoxShowNeuteredCreatures.Checked);
- }
-
- private void checkBoxShowMutatedCreatures_CheckedChanged(object sender, EventArgs e)
- {
- SetLibraryFilter("Mutated", checkBoxShowMutatedCreatures.Checked);
- }
-
- private void checkBoxShowObeliskCreatures_CheckedChanged(object sender, EventArgs e)
- {
- SetLibraryFilter("Obelisk", checkBoxShowObeliskCreatures.Checked);
- }
-
- private void checkBoxShowCryopodCreatures_CheckedChanged(object sender, EventArgs e)
- {
- SetLibraryFilter("Cryopod", checkBoxShowCryopodCreatures.Checked);
- }
-
- private void cbLibraryShowFemales_CheckedChanged(object sender, EventArgs e)
- {
- SetLibraryFilter("Females", cbLibraryShowFemales.Checked);
- }
-
- private void cbLibraryShowMales_CheckedChanged(object sender, EventArgs e)
- {
- SetLibraryFilter("Males", cbLibraryShowMales.Checked);
- }
-
- private void deadCreaturesToolStripMenuItem_Click(object sender, EventArgs e)
- {
- SetLibraryFilter("Dead", deadCreaturesToolStripMenuItem.Checked);
- }
-
- private void unavailableCreaturesToolStripMenuItem_Click(object sender, EventArgs e)
- {
- SetLibraryFilter("Unavailable", unavailableCreaturesToolStripMenuItem.Checked);
- }
-
- private void obeliskCreaturesToolStripMenuItem_Click(object sender, EventArgs e)
- {
- SetLibraryFilter("Obelisk", obeliskCreaturesToolStripMenuItem.Checked);
- }
-
- private void cryopodCreaturesToolStripMenuItem_Click(object sender, EventArgs e)
- {
- SetLibraryFilter("Cryopod", cryopodCreaturesToolStripMenuItem.Checked);
- }
-
- private void neuteredCreaturesToolStripMenuItem_Click(object sender, EventArgs e)
- {
- SetLibraryFilter("Neutered", neuteredCreaturesToolStripMenuItem.Checked);
- }
-
- private void mutatedCreaturesToolStripMenuItem_Click(object sender, EventArgs e)
- {
- SetLibraryFilter("Mutated", mutatedCreaturesToolStripMenuItem.Checked);
- }
-
- private void femalesToolStripMenuItem_Click(object sender, EventArgs e)
- {
- SetLibraryFilter("Females", femalesToolStripMenuItem.Checked);
- }
-
- private void malesToolStripMenuItem_Click(object sender, EventArgs e)
- {
- SetLibraryFilter("Males", malesToolStripMenuItem.Checked);
- }
-
- private void checkBoxUseFiltersInTopStatCalculation_CheckedChanged(object sender, EventArgs e)
- {
- creatureCollection.useFiltersInTopStatCalculation = checkBoxUseFiltersInTopStatCalculation.Checked;
- CalculateTopStats(creatureCollection.creatures);
- FilterLib();
- }
-
private void listBoxSpeciesLib_SelectedIndexChanged(object sender, EventArgs e)
{
SetSpecies(listBoxSpeciesLib.SelectedItem as Species);
FilterLib();
}
- private void cbOwnerFilterAll_CheckedChanged(object sender, EventArgs e)
- {
- filterListAllowed = false;
-
- bool chck = cbOwnerFilterAll.Checked;
- creatureCollection.hiddenOwners.Clear();
- for (int i = 0; i < checkedListBoxOwner.Items.Count; i++)
- {
- checkedListBoxOwner.SetItemChecked(i, chck);
- if (!chck)
- {
- string owner = Regex.Match(checkedListBoxOwner.Items[i].ToString(), @"^(.+?)(?: \(\d+\))?$").Groups[1].Value;
- creatureCollection.hiddenOwners.Add(owner);
- }
- }
-
- filterListAllowed = true;
- FilterLib();
- }
-
- private void cbServerFilterAll_CheckedChanged(object sender, EventArgs e)
- {
- filterListAllowed = false;
-
- bool chck = cbServerFilterAll.Checked;
- creatureCollection.hiddenServers.Clear();
- for (int i = 0; i < checkedListBoxFilterServers.Items.Count; i++)
- {
- checkedListBoxFilterServers.SetItemChecked(i, chck);
- if (!chck)
- {
- string server = Regex.Match(checkedListBoxFilterServers.Items[i].ToString(), @"^(.+?)(?: \(\d+\))?$").Groups[1].Value;
- creatureCollection.hiddenServers.Add(server);
- }
- }
-
- breedingPlan1.breedingPlanNeedsUpdate = true; // needed for serverFilterOption
-
- filterListAllowed = true;
- FilterLib();
- }
-
- private void checkedListBoxOwner_ItemCheck(object sender, ItemCheckEventArgs e)
- {
- if (filterListAllowed)
- {
- // update shownOwners
- string owner = Regex.Match(checkedListBoxOwner.Items[e.Index].ToString(), @"^(.+?)(?: \(\d+\))?$").Groups[1].Value;
- if (e.NewValue == CheckState.Unchecked)
- {
- creatureCollection.hiddenOwners.Add(owner);
- }
- else
- {
- creatureCollection.hiddenOwners.Remove(owner);
- }
-
- RecalculateTopStatsIfNeeded();
- FilterLib();
- }
- }
-
- private void checkedListBoxFilterServers_ItemCheck(object sender, ItemCheckEventArgs e)
- {
- if (filterListAllowed)
- {
- // update shownServers
- string server = Regex.Match(checkedListBoxFilterServers.Items[e.Index].ToString(), @"^(.+?)(?: \(\d+\))?$").Groups[1].Value;
- if (!string.IsNullOrEmpty(server))
- {
- if (e.NewValue == CheckState.Unchecked)
- {
- creatureCollection.hiddenServers.Add(server);
- }
- else
- {
- creatureCollection.hiddenServers.Remove(server);
- }
-
- breedingPlan1.breedingPlanNeedsUpdate = true; // needed for serverFilterOption
-
- RecalculateTopStatsIfNeeded();
- FilterLib();
- }
- }
- }
-
- private void cbFilterTagsAll_CheckedChanged(object sender, EventArgs e)
- {
- filterListAllowed = false;
-
- bool chck = cbFilterTagsAll.Checked;
- creatureCollection.dontShowTags.Clear();
- for (int i = 0; i < checkedListBoxFilterTags.Items.Count; i++)
- {
- checkedListBoxFilterTags.SetItemChecked(i, chck);
- if (!chck)
- {
- string tagName = Regex.Match(checkedListBoxFilterTags.Items[i].ToString(), @"^(.+?)(?: \(\d+\))?$").Groups[1].Value;
- creatureCollection.dontShowTags.Add(tagName);
- }
- }
-
- filterListAllowed = true;
- FilterLib();
- }
-
- private void checkedListBoxFilterTags_ItemCheck(object sender, ItemCheckEventArgs e)
- {
- if (filterListAllowed)
- {
- // update shownTags
- string tag = Regex.Match(checkedListBoxFilterTags.Items[e.Index].ToString(), @"^(.+?)(?: \(\d+\))?$").Groups[1].Value;
- if (e.NewValue == CheckState.Unchecked)
- {
- creatureCollection.dontShowTags.Add(tag);
- }
- else
- {
- creatureCollection.dontShowTags.Remove(tag);
- }
-
- RecalculateTopStatsIfNeeded();
- FilterLib();
- }
- }
-
///
/// Recalculate topstats if filters are used in topstat-calculation
///
private void RecalculateTopStatsIfNeeded()
{
- if (creatureCollection.useFiltersInTopStatCalculation)
- CalculateTopStats(creatureCollection.creatures);
+ if (Properties.Settings.Default.useFiltersInTopStatCalculation)
+ CalculateTopStats(_creatureCollection.creatures);
}
private void deleteSelectedToolStripMenuItem_Click(object sender, EventArgs e)
@@ -1555,10 +1244,10 @@ private void CreatureBoxListView_FindParents(Creature creature)
private List[] FindPossibleParents(Creature creature)
{
- var fatherList = creatureCollection.creatures
+ var fatherList = _creatureCollection.creatures
.Where(cr => cr.Species == creature.Species && cr.sex == Sex.Male && cr != creature)
.OrderBy(cr => cr.name);
- var motherList = creatureCollection.creatures
+ var motherList = _creatureCollection.creatures
.Where(cr => cr.Species == creature.Species && cr.sex == Sex.Female && cr != creature)
.OrderBy(cr => cr.name);
@@ -1592,7 +1281,7 @@ private List[] FindParentSimilarities(List[] parents, Creature cr
int moved = 0;
for (int p = 0; p < parents[ps].Count - moved; p++)
{
- if (parents[ps][p].status != CreatureStatus.Available)
+ if (parents[ps][p].Status != CreatureStatus.Available)
{
parentListSimilarities[ps].Add(parentListSimilarities[ps][p]);
parentListSimilarities[ps].RemoveAt(p);
@@ -1649,25 +1338,24 @@ private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
{
UpdateAllTesterValues();
statPotentials1.Species = speciesSelector1.SelectedSpecies;
- statPotentials1.SetLevels(testingIOs.Select(s => s.LevelWild).ToArray(), true);
+ statPotentials1.SetLevels(_testingIOs.Select(s => s.LevelWild).ToArray(), true);
}
else if (tabControlMain.SelectedTab == tabPageLibrary)
{
if (Properties.Settings.Default.ApplyGlobalSpeciesToLibrary && speciesSelector1.SelectedSpecies != null)
- listBoxSpeciesLib.SelectedIndex = listBoxSpeciesLib.Items.IndexOf(speciesSelector1.SelectedSpecies);
- else if (libraryNeedsUpdate)
+ listBoxSpeciesLib.SelectedItem = speciesSelector1.SelectedSpecies;
+ else if (_libraryNeedsUpdate)
FilterLib();
}
else if (tabControlMain.SelectedTab == tabPagePedigree)
{
- if (pedigreeNeedsUpdate && listViewLibrary.SelectedItems.Count > 0)
+ if (_pedigreeNeedsUpdate && listViewLibrary.SelectedItems.Count > 0)
{
- Creature c = null;
- c = (Creature)listViewLibrary.SelectedItems[0].Tag;
+ Creature c = (Creature)listViewLibrary.SelectedItems[0].Tag;
pedigree1.EnabledColorRegions = c.Species?.colors?.Select(n => !string.IsNullOrEmpty(n?.name)).ToArray() ?? new bool[6] { true, true, true, true, true, true };
pedigree1.SetCreature(c, true);
- pedigreeNeedsUpdate = false;
+ _pedigreeNeedsUpdate = false;
}
}
else if (tabControlMain.SelectedTab == tabPageTaming)
@@ -1714,7 +1402,7 @@ private void ExtractBaby(Creature mother, Creature father)
private void NumericUpDownTestingTE_ValueChanged(object sender, EventArgs e)
{
UpdateAllTesterValues();
- lbWildLevelTester.Text = "PreTame Level: " + Math.Ceiling(Math.Round((testingIOs[(int)StatNames.Torpidity].LevelWild + 1) / (1 + NumericUpDownTestingTE.Value / 200), 6));
+ lbWildLevelTester.Text = "PreTame Level: " + Math.Ceiling(Math.Round((_testingIOs[(int)StatNames.Torpidity].LevelWild + 1) / (1 + NumericUpDownTestingTE.Value / 200), 6));
}
private void numericUpDownImprintingBonusTester_ValueChanged(object sender, EventArgs e)
@@ -1759,7 +1447,7 @@ private void ExportSelectedCreatureToClipboard(bool breeding = true, bool ARKml
if (tabControlMain.SelectedTab == tabPageStatTesting || tabControlMain.SelectedTab == tabPageExtractor)
{
bool fromExtractor = tabControlMain.SelectedTab == tabPageExtractor;
- if (!fromExtractor || extractor.validResults)
+ if (!fromExtractor || _extractor.validResults)
{
CreatureInfoInput input;
bool bred;
@@ -1769,8 +1457,8 @@ private void ExportSelectedCreatureToClipboard(bool breeding = true, bool ARKml
{
input = creatureInfoInputExtractor;
bred = rbBredExtractor.Checked;
- te = extractor.UniqueTE();
- imprinting = extractor.ImprintingBonus;
+ te = _extractor.UniqueTE();
+ imprinting = _extractor.ImprintingBonus;
}
else
{
@@ -1780,7 +1468,7 @@ private void ExportSelectedCreatureToClipboard(bool breeding = true, bool ARKml
imprinting = (double)numericUpDownImprintingBonusTester.Value / 100;
}
- var levelStep = creatureCollection.getWildLevelStep();
+ var levelStep = _creatureCollection.getWildLevelStep();
Creature creature = new Creature(species, input.CreatureName, input.CreatureOwner, input.CreatureTribe, input.CreatureSex, GetCurrentWildLevels(fromExtractor), GetCurrentDomLevels(fromExtractor), te, bred, imprinting, levelStep)
{
colors = input.RegionColors,
@@ -1927,7 +1615,7 @@ private void PasteCreatureValuesFromClipboard()
if (Values.V.TryGetSpeciesByName(m.Groups[2].Value, out Species species))
{
- var cv = new CreatureValues(species, m.Groups[1].Value, "", "", sex, sv, totalLevel, te, te, te > 0 || ib > 0, ib > 0, ib, CreatureFlags.None, null, null)
+ var cv = new CreatureValues(species, m.Groups[1].Value, string.Empty, string.Empty, sex, sv, totalLevel, te, te, te > 0 || ib > 0, ib > 0, ib, CreatureFlags.None, null, null)
{
levelsWild = wl,
levelsDom = dl
@@ -1947,40 +1635,60 @@ private void buttonRecalculateTops_Click(object sender, EventArgs e)
int consideredStats = 0;
for (int s = 0; s < Values.STATS_COUNT; s++)
{
- considerStatHighlight[Values.statsDisplayOrder[s]] = checkedListBoxConsiderStatTop.GetItemChecked(s);
+ _considerStatHighlight[Values.statsDisplayOrder[s]] = checkedListBoxConsiderStatTop.GetItemChecked(s);
// save consideredStats
- if (considerStatHighlight[s])
+ if (_considerStatHighlight[s])
consideredStats += 1 << s;
}
Properties.Settings.Default.consideredStats = consideredStats;
// recalculate topstats
- CalculateTopStats(creatureCollection.creatures);
+ CalculateTopStats(_creatureCollection.creatures);
FilterLib();
}
- private void removeCooldownGrowingToolStripMenuItem_Click(object sender, EventArgs e)
+ private void SetMatureBreedingStateOfSelectedCreatures(bool setMature = false, bool clearMatingCooldown = false, bool justMated = false)
{
listViewLibrary.BeginUpdate();
foreach (ListViewItem i in listViewLibrary.SelectedItems)
{
Creature c = (Creature)i.Tag;
- if (c.cooldownUntil > DateTime.Now)
- c.cooldownUntil = null;
- if (c.growingUntil > DateTime.Now)
+ if (setMature && c.growingUntil > DateTime.Now)
c.growingUntil = null;
- i.SubItems[11].Text = "-"; // LVI index
- // color for cooldown
- CooldownColors(c, out Color forecolor, out Color backcolor);
- i.SubItems[11].ForeColor = forecolor;
- i.SubItems[11].BackColor = backcolor;
+ if (clearMatingCooldown && c.cooldownUntil > DateTime.Now)
+ c.cooldownUntil = null;
+
+ if (justMated)
+ c.cooldownUntil = DateTime.Now.AddSeconds(c.Species.breeding?.matingCooldownMinAdjusted ?? 0);
+
+ i.SubItems[11].Text =
+ DisplayedCreatureCountdown(c.cooldownUntil, c.growingUntil)?.ToString() ?? "-";
+
+ CooldownColors(c, out Color foreColor, out Color backColor);
+ i.SubItems[11].ForeColor = foreColor;
+ i.SubItems[11].BackColor = backColor;
}
breedingPlan1.breedingPlanNeedsUpdate = true;
listViewLibrary.EndUpdate();
}
+ private void setToMatureToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ SetMatureBreedingStateOfSelectedCreatures(setMature: true);
+ }
+
+ private void clearMatingCooldownToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ SetMatureBreedingStateOfSelectedCreatures(clearMatingCooldown: true);
+ }
+
+ private void justMatedToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ SetMatureBreedingStateOfSelectedCreatures(justMated: true);
+ }
+
private void aliveToolStripMenuItem_Click(object sender, EventArgs e)
{
SetStatusOfSelected(CreatureStatus.Available);
@@ -2016,18 +1724,18 @@ private void SetStatus(IEnumerable cs, CreatureStatus s)
List speciesBlueprints = new List();
foreach (Creature c in cs)
{
- if (c.status != s)
+ if (c.Status != s)
{
changed = true;
- c.status = s;
+ c.Status = s;
if (!speciesBlueprints.Contains(c.speciesBlueprint))
speciesBlueprints.Add(c.speciesBlueprint);
}
}
if (changed)
{
- // update list / recalculate topstats
- CalculateTopStats(creatureCollection.creatures.Where(c => speciesBlueprints.Contains(c.speciesBlueprint)).ToList());
+ // update list / recalculate topStats
+ CalculateTopStats(_creatureCollection.creatures.Where(c => speciesBlueprints.Contains(c.speciesBlueprint)).ToList());
FilterLib();
UpdateStatusBar();
SetCollectionChanged(true, speciesBlueprints.Count == 1 ? Values.V.SpeciesByBlueprint(speciesBlueprints[0]) : null);
@@ -2059,7 +1767,7 @@ private void bestBreedingPartnersToolStripMenuItem_Click(object sender, EventArg
///
private void ShowBestBreedingPartner(Creature c)
{
- if (c.status != CreatureStatus.Available
+ if (c.Status != CreatureStatus.Available
&& MessageBox.Show("Selected Creature is currently not marked as \"Available\" and probably cannot be used for breeding right now. " +
"Do you want to change its status to \"Available\"?",
"Selected Creature not Available",
@@ -2094,25 +1802,25 @@ private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
private void OpenSettingsDialog(SettingsTabPages page = SettingsTabPages.Unknown)
{
if (page == SettingsTabPages.Unknown)
- page = settingsLastTabPage;
- using (Settings settingsfrm = new Settings(creatureCollection, page))
+ page = _settingsLastTabPage;
+ using (Settings settingsfrm = new Settings(_creatureCollection, page))
{
bool libraryTopCreatureColorHighlight = Properties.Settings.Default.LibraryHighlightTopCreatures;
if (settingsfrm.ShowDialog() == DialogResult.OK)
{
ApplySettingsToValues();
if (settingsfrm.LanguageChanged) setLocalizations();
- autoSave = Properties.Settings.Default.autosave;
- autoSaveMinutes = Properties.Settings.Default.autosaveMinutes;
- creatureBoxListView.CreatureCollection = creatureCollection;
- fileSync.ChangeFile(currentFileName); // only to trigger the update, filename is not changed
+ _autoSave = Properties.Settings.Default.autosave;
+ _autoSaveMinutes = Properties.Settings.Default.autosaveMinutes;
+ creatureBoxListView.CreatureCollection = _creatureCollection;
+ _fileSync.ChangeFile(_currentFileName); // only to trigger the update, filename is not changed
bool enableExportWatcher = Utils.GetFirstImportExportFolder(out string exportFolderDefault)
&& Properties.Settings.Default.AutoImportExportedCreatures;
- filewatcherExports.SetWatchFolder(exportFolderDefault, enableExportWatcher);
+ _filewatcherExports.SetWatchFolder(exportFolderDefault, enableExportWatcher);
InitializeSpeechRecognition();
- overlay?.SetInfoPositions();
+ _overlay?.SetInfoPositions();
if (Properties.Settings.Default.DevTools)
statsMultiplierTesting1.CheckIfMultipliersAreEqualToSettings();
@@ -2123,7 +1831,7 @@ private void OpenSettingsDialog(SettingsTabPages page = SettingsTabPages.Unknown
SetCollectionChanged(true);
}
- settingsLastTabPage = settingsfrm.LastTabPageIndex;
+ _settingsLastTabPage = settingsfrm.LastTabPageIndex;
}
}
@@ -2133,7 +1841,7 @@ private void OpenSettingsDialog(SettingsTabPages page = SettingsTabPages.Unknown
///
private void StatIOQuickWildLevelCheck(StatIO sIO)
{
- clearExtractionCreatureData = true; // as soon as the user changes stat-values, it's assumed it's not an exported creature anymore
+ _clearExtractionCreatureData = true; // as soon as the user changes stat-values, it's assumed it's not an exported creature anymore
if (cbQuickWildCheck.Checked)
{
int lvlWild = (int)Math.Round((sIO.Input - speciesSelector1.SelectedSpecies.stats[sIO.statIndex].BaseValue) / (speciesSelector1.SelectedSpecies.stats[sIO.statIndex].BaseValue * speciesSelector1.SelectedSpecies.stats[sIO.statIndex].IncPerWildLevel));
@@ -2141,7 +1849,7 @@ private void StatIOQuickWildLevelCheck(StatIO sIO)
sIO.LevelDom = 0;
if (sIO.statIndex == (int)StatNames.Torpidity)
{
- SetQuickTamingInfo(statIOs[(int)StatNames.Torpidity].LevelWild + 1);
+ SetQuickTamingInfo(_statIOs[(int)StatNames.Torpidity].LevelWild + 1);
}
}
}
@@ -2242,13 +1950,13 @@ public void DoOCR(string imageFilePath = "", bool manuallyTriggered = true)
for (int i = 0; i < displayedStatIndices.Length; i++)
{
- statIOs[displayedStatIndices[i]].Input = statIOs[displayedStatIndices[i]].percent
+ _statIOs[displayedStatIndices[i]].Input = _statIOs[displayedStatIndices[i]].percent
? OCRvalues[i] / 100.0
: OCRvalues[i];
}
// use imprinting if existing
- if (OCRvalues.Length > 8 && OCRvalues[8] >= 0 && (OCRvalues[8] <= 100 || creatureCollection.allowMoreThanHundredImprinting))
+ if (OCRvalues.Length > 8 && OCRvalues[8] >= 0 && (OCRvalues[8] <= 100 || _creatureCollection.allowMoreThanHundredImprinting))
{
rbBredExtractor.Checked = true;
if (!Properties.Settings.Default.OCRIgnoresImprintValue)
@@ -2284,9 +1992,9 @@ public void DoOCR(string imageFilePath = "", bool manuallyTriggered = true)
{
bool sameValues = true;
- if (lastOCRValues != null)
+ if (_lastOcrValues != null)
for (int i = 0; i < 10; i++)
- if (OCRvalues[i] != lastOCRValues[i])
+ if (OCRvalues[i] != _lastOcrValues[i])
{
sameValues = false;
break;
@@ -2296,10 +2004,10 @@ public void DoOCR(string imageFilePath = "", bool manuallyTriggered = true)
// on automated, we take the first one that yields an error-free level extraction
if (manuallyTriggered && sameValues)
{
- int newindex = (possibleSpecies.IndexOf(lastOCRSpecies) + 1) % possibleSpecies.Count;
+ int newindex = (possibleSpecies.IndexOf(_lastOcrSpecies) + 1) % possibleSpecies.Count;
speciesSelector1.SetSpecies(possibleSpecies[newindex]);
- lastOCRSpecies = possibleSpecies[newindex];
- lastOCRValues = OCRvalues;
+ _lastOcrSpecies = possibleSpecies[newindex];
+ _lastOcrValues = OCRvalues;
ExtractLevels(true);
}
else
@@ -2311,8 +2019,8 @@ public void DoOCR(string imageFilePath = "", bool manuallyTriggered = true)
// if the last OCR'ed values are the same as this one, the user may not be happy with the dino species selection and want another one
// so we'll cycle to the next one, but only if the OCR is manually triggered, on autotrigger (ie, overlay), don't change
speciesSelector1.SetSpecies(possibleSpecies[dinooption]);
- lastOCRSpecies = possibleSpecies[dinooption];
- lastOCRValues = OCRvalues;
+ _lastOcrSpecies = possibleSpecies[dinooption];
+ _lastOcrValues = OCRvalues;
foundPossiblyGood = ExtractLevels(showLevelsInOverlay: !manuallyTriggered);
}
}
@@ -2329,7 +2037,7 @@ public void DoOCR(string imageFilePath = "", bool manuallyTriggered = true)
ExtractLevels();
}
- lastOCRValues = OCRvalues;
+ _lastOcrValues = OCRvalues;
if (tabControlMain.SelectedTab != TabPageOCR)
tabControlMain.SelectedTab = tabPageExtractor;
}
@@ -2390,7 +2098,7 @@ private List DetermineSpeciesFromStats(double[] stats, string speciesNa
if (incWild > 0)
{
//possibleLevel = ((statIOs[s].Input - species.stats[s].AddWhenTamed) - baseValue) / (baseValue * incWild); // this fails if creature is wild
- possibleLevel = (statIOs[s].Input - baseValue) / (baseValue * incWild);
+ possibleLevel = (_statIOs[s].Input - baseValue) / (baseValue * incWild);
if (possibleLevel < 0)
{
@@ -2406,8 +2114,8 @@ private List DetermineSpeciesFromStats(double[] stats, string speciesNa
baseValue = species.stats[(int)StatNames.Torpidity].BaseValue;
incWild = species.stats[(int)StatNames.Torpidity].IncPerWildLevel;
- possibleLevel = (statIOs[(int)StatNames.Torpidity].Input - species.stats[(int)StatNames.Torpidity].AddWhenTamed - baseValue) / (baseValue * incWild);
- double possibleLevelWild = (statIOs[(int)StatNames.Torpidity].Input - baseValue) / (baseValue * incWild);
+ possibleLevel = (_statIOs[(int)StatNames.Torpidity].Input - species.stats[(int)StatNames.Torpidity].AddWhenTamed - baseValue) / (baseValue * incWild);
+ double possibleLevelWild = (_statIOs[(int)StatNames.Torpidity].Input - baseValue) / (baseValue * incWild);
if (possibleLevelWild < 0 || Math.Round(possibleLevel, 3) > (double)numericUpDownLevel.Value - 1 || Math.Round(possibleLevel, 3) % 1 > 0.001 && Math.Round(possibleLevelWild, 3) % 1 > 0.001)
continue;
@@ -2430,7 +2138,7 @@ private List DetermineSpeciesFromStats(double[] stats, string speciesNa
// now oxygen
baseValue = species.stats[(int)StatNames.Oxygen].BaseValue;
incWild = species.stats[(int)StatNames.Oxygen].IncPerWildLevel;
- possibleLevel = (statIOs[(int)StatNames.Oxygen].Input - species.stats[(int)StatNames.Oxygen].AddWhenTamed - baseValue) / (baseValue * incWild);
+ possibleLevel = (_statIOs[(int)StatNames.Oxygen].Input - species.stats[(int)StatNames.Oxygen].AddWhenTamed - baseValue) / (baseValue * incWild);
if (possibleLevel < 0 || possibleLevel > (double)numericUpDownLevel.Value - 1)
continue;
@@ -2438,7 +2146,7 @@ private List DetermineSpeciesFromStats(double[] stats, string speciesNa
if (Math.Round(possibleLevel, 3) != (int)possibleLevel || possibleLevel > (double)numericUpDownLevel.Value / 2)
likely = false;
- if (statIOs[(int)StatNames.Oxygen].Input != 0 && baseValue == 0)
+ if (_statIOs[(int)StatNames.Oxygen].Input != 0 && baseValue == 0)
likely = false; // having an oxygen value for non-oxygen dino is a disqualifier
if (likely)
@@ -2454,25 +2162,25 @@ private List DetermineSpeciesFromStats(double[] stats, string speciesNa
private void chkbToggleOverlay_CheckedChanged(object sender, EventArgs e)
{
- if (overlay == null)
+ if (_overlay == null)
{
- overlay = new ARKOverlay
+ _overlay = new ARKOverlay
{
ExtractorForm = this,
InfoDuration = Properties.Settings.Default.OverlayInfoDuration,
checkInventoryStats = Properties.Settings.Default.inventoryCheckTimer
};
- overlay.InitLabelPositions();
+ _overlay.InitLabelPositions();
}
if (!SetOverlayLocation()) return;
- overlay.Visible = cbToggleOverlay.Checked;
- overlay.EnableOverlayTimer = cbToggleOverlay.Checked;
+ _overlay.Visible = cbToggleOverlay.Checked;
+ _overlay.EnableOverlayTimer = cbToggleOverlay.Checked;
// disable speechrecognition if overlay is disabled. (no use if no data can be displayed)
- if (speechRecognition != null && !cbToggleOverlay.Checked)
- speechRecognition.Listen = false;
+ if (_speechRecognition != null && !cbToggleOverlay.Checked)
+ _speechRecognition.Listen = false;
}
///
@@ -2486,7 +2194,7 @@ private bool SetOverlayLocation()
{
if (Properties.Settings.Default.UseCustomOverlayLocation)
{
- overlay.Location = Properties.Settings.Default.CustomOverlayLocation;
+ _overlay.Location = Properties.Settings.Default.CustomOverlayLocation;
}
else
{
@@ -2501,7 +2209,7 @@ private bool SetOverlayLocation()
}
IntPtr mwhd = p[0].MainWindowHandle;
Screen scr = Screen.FromHandle(mwhd);
- overlay.Location = scr.WorkingArea.Location;
+ _overlay.Location = scr.WorkingArea.Location;
}
}
return true;
@@ -2509,7 +2217,7 @@ private bool SetOverlayLocation()
private void toolStripButtonCopy2Tester_Click(object sender, EventArgs e)
{
- double te = extractor.UniqueTE();
+ double te = _extractor.UniqueTE();
NumericUpDownTestingTE.ValueSave = (decimal)(te >= 0 ? te * 100 : 80);
numericUpDownImprintingBonusTester.Value = numericUpDownImprintingBonusExtractor.Value;
if (rbBredExtractor.Checked)
@@ -2520,9 +2228,9 @@ private void toolStripButtonCopy2Tester_Click(object sender, EventArgs e)
rbWildTester.Checked = true;
for (int s = 0; s < Values.STATS_COUNT; s++)
{
- testingIOs[s].LevelWild = statIOs[s].LevelWild;
- testingIOs[s].LevelDom = statIOs[s].LevelDom;
- testingStatIOValueUpdate(testingIOs[s]);
+ _testingIOs[s].LevelWild = _statIOs[s].LevelWild;
+ _testingIOs[s].LevelDom = _statIOs[s].LevelDom;
+ testingStatIOValueUpdate(_testingIOs[s]);
}
// set the data in the creatureInfoInput
@@ -2559,8 +2267,8 @@ private void toolStripButtonClear_Click(object sender, EventArgs e)
{
for (int s = 0; s < Values.STATS_COUNT; s++)
{
- testingIOs[s].LevelDom = 0;
- testingIOs[s].LevelWild = 0;
+ _testingIOs[s].LevelDom = 0;
+ _testingIOs[s].LevelWild = 0;
}
creatureInfoInputTester.Clear();
}
@@ -2571,7 +2279,7 @@ private void toolStripButtonCopy2Extractor_Click(object sender, EventArgs e)
ClearAll();
// copy values from tester over to extractor
for (int s = 0; s < Values.STATS_COUNT; s++)
- statIOs[s].Input = testingIOs[s].Input;
+ _statIOs[s].Input = _testingIOs[s].Input;
if (rbBredTester.Checked)
rbBredExtractor.Checked = true;
else if (rbTamedTester.Checked)
@@ -2580,7 +2288,7 @@ private void toolStripButtonCopy2Extractor_Click(object sender, EventArgs e)
rbWildExtractor.Checked = true;
numericUpDownImprintingBonusExtractor.Value = numericUpDownImprintingBonusTester.Value;
// set total level
- numericUpDownLevel.Value = testingIOs[(int)StatNames.Torpidity].LevelWild + GetCurrentDomLevels(false).Sum() + 1;
+ numericUpDownLevel.Value = _testingIOs[(int)StatNames.Torpidity].LevelWild + GetCurrentDomLevels(false).Sum() + 1;
creatureInfoInputExtractor.CreatureSex = creatureInfoInputTester.CreatureSex;
creatureInfoInputExtractor.RegionColors = creatureInfoInputTester.RegionColors;
@@ -2608,7 +2316,7 @@ private void saveToolStripButton1_Click(object sender, EventArgs e)
///
private void ShowLevelsInOverlay()
{
- if (overlay != null && overlay.checkInventoryStats)
+ if (_overlay != null && _overlay.checkInventoryStats)
{
var wildLevels = GetCurrentWildLevels();
var tamedLevels = GetCurrentDomLevels();
@@ -2619,13 +2327,13 @@ private void ShowLevelsInOverlay()
{
wildLevels[i] = wildLevels[i] > 0 ? wildLevels[i] : 0;
tamedLevels[i] = tamedLevels[i] > 0 ? tamedLevels[i] : 0;
- colors[i] = statIOs[i].BackColor;
+ colors[i] = _statIOs[i].BackColor;
}
int levelWild = wildLevels[(int)StatNames.Torpidity] + 1;
int levelDom = tamedLevels.Sum();
string extraText = speciesSelector1.SelectedSpecies.name;
- if (!extractor.postTamed)
+ if (!_extractor.postTamed)
{
string foodName = speciesSelector1.SelectedSpecies.taming.eats[0];
int foodNeeded = Taming.FoodAmountNeeded(speciesSelector1.SelectedSpecies, levelWild, Values.V.currentServerMultipliers.TamingSpeedMultiplier, foodName, speciesSelector1.SelectedSpecies.taming.nonViolent);
@@ -2636,14 +2344,14 @@ private void ShowLevelsInOverlay()
+ "\nTaming Effectiveness: " + Math.Round(100 * te, 1) + " % (+" + bonusLevel + " lvl)";
}
- overlay.SetStatLevels(wildLevels, tamedLevels, levelWild, levelDom, colors);
- overlay.SetInfoText(extraText);
+ _overlay.SetStatLevels(wildLevels, tamedLevels, levelWild, levelDom, colors);
+ _overlay.SetInfoText(extraText);
}
}
private void findDuplicatesToolStripMenuItem_Click(object sender, EventArgs e)
{
- ShowDuplicateMergerAndCheckForDuplicates(creatureCollection.creatures);
+ ShowDuplicateMergerAndCheckForDuplicates(_creatureCollection.creatures);
}
private void ShowDuplicateMergerAndCheckForDuplicates(List creatureList)
@@ -2651,15 +2359,14 @@ private void ShowDuplicateMergerAndCheckForDuplicates(List creatureLis
MessageBox.Show("This feature is not yet included.");
return;
// TODO
-#pragma warning disable 162
- if (mergingDuplicatesWindow == null || mergingDuplicatesWindow.IsDisposed)
- {
- mergingDuplicatesWindow = new duplicates.MergingDuplicatesWindow();
- mergingDuplicatesWindow.RefreshLibrary += FilterLib;
- }
- mergingDuplicatesWindow.Show();
- mergingDuplicatesWindow.CheckForDuplicates(creatureList);
-#pragma warning restore 162
+
+ //if (mergingDuplicatesWindow == null || mergingDuplicatesWindow.IsDisposed)
+ //{
+ // mergingDuplicatesWindow = new duplicates.MergingDuplicatesWindow();
+ // mergingDuplicatesWindow.RefreshLibrary += FilterLib;
+ //}
+ //mergingDuplicatesWindow.Show();
+ //mergingDuplicatesWindow.CheckForDuplicates(creatureList);
}
private void btnReadValuesFromArk_Click(object sender, EventArgs e)
@@ -2679,7 +2386,7 @@ private void button2TamingCalc_Click(object sender, EventArgs e)
{
tamingControl1.SetSpecies(speciesSelector1.SelectedSpecies);
if (cbQuickWildCheck.Checked)
- tamingControl1.SetLevel(statIOs[(int)StatNames.Torpidity].LevelWild + 1);
+ tamingControl1.SetLevel(_statIOs[(int)StatNames.Torpidity].LevelWild + 1);
else
tamingControl1.SetLevel((int)numericUpDownLevel.Value);
tabControlMain.SelectedTab = tabPageTaming;
@@ -2700,20 +2407,20 @@ private void labelImprintedCount_MouseClick(object sender, MouseEventArgs e)
imprintingBonus = Math.Round(100 * cuddleCount * imprintingGainPerCuddle, 5);
cuddleCount--;
}
- while (imprintingBonus > 100 && !creatureCollection.allowMoreThanHundredImprinting);
+ while (imprintingBonus > 100 && !_creatureCollection.allowMoreThanHundredImprinting);
numericUpDownImprintingBonusTester.ValueSave = (decimal)imprintingBonus;
}
}
else if (e.Button == MouseButtons.Right)
{
- double imprintingFactorTorpor = speciesSelector1.SelectedSpecies.StatImprintMultipliers[(int)StatNames.Torpidity] * creatureCollection.serverMultipliers.BabyImprintingStatScaleMultiplier;
+ double imprintingFactorTorpor = speciesSelector1.SelectedSpecies.StatImprintMultipliers[(int)StatNames.Torpidity] * _creatureCollection.serverMultipliers.BabyImprintingStatScaleMultiplier;
// set imprinting value so the set levels in the tester yield the value in the extractor
double imprintingBonus = imprintingFactorTorpor != 0
- ? (statIOs[(int)StatNames.Torpidity].Input / StatValueCalculation.CalculateValue(speciesSelector1.SelectedSpecies, (int)StatNames.Torpidity, testingIOs[(int)StatNames.Torpidity].LevelWild, 0, true, 1, 0) - 1) / imprintingFactorTorpor
+ ? (_statIOs[(int)StatNames.Torpidity].Input / StatValueCalculation.CalculateValue(speciesSelector1.SelectedSpecies, (int)StatNames.Torpidity, _testingIOs[(int)StatNames.Torpidity].LevelWild, 0, true, 1, 0) - 1) / imprintingFactorTorpor
: 0;
if (imprintingBonus < 0)
imprintingBonus = 0;
- if (!creatureCollection.allowMoreThanHundredImprinting && imprintingBonus > 1)
+ if (!_creatureCollection.allowMoreThanHundredImprinting && imprintingBonus > 1)
imprintingBonus = 1;
numericUpDownImprintingBonusTester.ValueSave = 100 * (decimal)imprintingBonus;
}
@@ -2753,7 +2460,7 @@ private bool LoadModValuesOfCollection(CreatureCollection cc, bool showResult, b
+ "The library may not display all creatures.",
"Unknown mod IDs", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- bool result = LoadModValueFiles(filePaths, showResult, applySettings, out List mods);
+ bool result = LoadModValueFiles(filePaths, showResult, applySettings, out _);
return result;
}
@@ -2761,17 +2468,19 @@ private void loadAdditionalValuesToolStripMenuItem_Click(object sender, EventArg
{
using (var modValuesManager = new ModValuesManager
{
- CreatureCollection = creatureCollection
+ CreatureCollection = _creatureCollection
})
{
+ Utils.SetFormRectangle(modValuesManager, Properties.Settings.Default.ModManagerWindowRect);
modValuesManager.ShowDialog();
+ Properties.Settings.Default.ModManagerWindowRect = Utils.GetFormRectangle(modValuesManager);
}
// if the mods for the library changed,
// first check if all mod value files are available and load missing files if possible,
// then reload all values and modvalues
- if (creatureCollection.ModValueReloadNeeded
- && LoadModValuesOfCollection(creatureCollection, true, true))
+ if (_creatureCollection.ModValueReloadNeeded
+ && LoadModValuesOfCollection(_creatureCollection, true, true))
SetCollectionChanged(true);
}
@@ -2782,23 +2491,23 @@ private void toolStripButtonAddPlayer_Click(object sender, EventArgs e)
private void UpdateStatusBar()
{
- var creatureCount = creatureCollection.creatures.Where(c => !c.flags.HasFlag(CreatureFlags.Placeholder));
+ var creatureCount = _creatureCollection.creatures.Where(c => !c.flags.HasFlag(CreatureFlags.Placeholder));
int total = creatureCount.Count();
- int obelisk = creatureCount.Count(c => c.status == CreatureStatus.Obelisk);
- int cryopod = creatureCount.Count(c => c.status == CreatureStatus.Cryopod);
+ int obelisk = creatureCount.Count(c => c.Status == CreatureStatus.Obelisk);
+ int cryopod = creatureCount.Count(c => c.Status == CreatureStatus.Cryopod);
- bool modsLoaded = creatureCollection.ModList?.Any() ?? false;
+ bool modsLoaded = _creatureCollection.ModList?.Any() ?? false;
toolStripStatusLabel.Text = total + " creatures in Library"
+ (total > 0 ? " ("
- + "available: " + creatureCount.Count(c => c.status == CreatureStatus.Available)
- + ", unavailable: " + creatureCount.Count(c => c.status == CreatureStatus.Unavailable)
- + ", dead: " + creatureCount.Count(c => c.status == CreatureStatus.Dead)
- + (obelisk > 0 ? ", obelisk: " + obelisk : "")
- + (cryopod > 0 ? ", cryopod: " + cryopod : "")
- : "")
- + ". v" + Application.ProductVersion /*+ "-BETA"*/ + " / values: " + Values.V.Version +
- (modsLoaded ? ", additional values from " + creatureCollection.ModList.Count.ToString() + " mods (" + string.Join(", ", creatureCollection.ModList.Select(m => m.title).ToArray()) + ")" : "");
+ + "available: " + creatureCount.Count(c => c.Status == CreatureStatus.Available)
+ + ", unavailable: " + creatureCount.Count(c => c.Status == CreatureStatus.Unavailable)
+ + ", dead: " + creatureCount.Count(c => c.Status == CreatureStatus.Dead)
+ + (obelisk > 0 ? ", obelisk: " + obelisk : string.Empty)
+ + (cryopod > 0 ? ", cryopod: " + cryopod : string.Empty)
+ + ")" : string.Empty)
+ + ". v" + Application.ProductVersion /*+ "-BETA"*/ + " / values: " + Values.V.Version +
+ (modsLoaded ? ", additional values from " + _creatureCollection.ModList.Count + " mods (" + string.Join(", ", _creatureCollection.ModList.Select(m => m.title).ToArray()) + ")" : string.Empty);
}
private void toolStripButtonAddNote_Click(object sender, EventArgs e)
@@ -2813,13 +2522,13 @@ private void toolStripButtonRemoveNote_Click(object sender, EventArgs e)
private void labelListening_Click(object sender, EventArgs e)
{
- speechRecognition?.ToggleListening();
+ _speechRecognition?.ToggleListening();
}
private void CreateIncubationTimer(Creature mother, Creature father, TimeSpan incubationDuration, bool incubationStarted)
{
raisingControl1.AddIncubationTimer(mother, father, incubationDuration, incubationStarted);
- libraryNeedsUpdate = true; // because mating-cooldown of mother was set
+ _libraryNeedsUpdate = true; // because mating-cooldown of mother was set
}
private void TimerGlobal_Tick(object sender, EventArgs e)
@@ -2835,7 +2544,7 @@ private void cbEvolutionEvent_CheckedChanged(object sender, EventArgs e)
private void ApplyEvolutionMultipliers()
{
- Values.V.ApplyMultipliers(creatureCollection, cbEventMultipliers.Checked, false);
+ Values.V.ApplyMultipliers(_creatureCollection, cbEventMultipliers.Checked, false);
tamingControl1.SetTamingMultipliers(Values.V.currentServerMultipliers.TamingSpeedMultiplier,
Values.V.currentServerMultipliers.DinoCharacterFoodDrainMultiplier);
@@ -2859,9 +2568,9 @@ private void OcrupdateWhiteThreshold(int value)
private void toolStripCBTempCreatures_SelectedIndexChanged(object sender, EventArgs e)
{
- if (toolStripCBTempCreatures.SelectedIndex >= 0 && toolStripCBTempCreatures.SelectedIndex < creatureCollection.creaturesValues.Count)
+ if (toolStripCBTempCreatures.SelectedIndex >= 0 && toolStripCBTempCreatures.SelectedIndex < _creatureCollection.creaturesValues.Count)
{
- SetCreatureValuesToExtractor(creatureCollection.creaturesValues[toolStripCBTempCreatures.SelectedIndex]);
+ SetCreatureValuesToExtractor(_creatureCollection.creaturesValues[toolStripCBTempCreatures.SelectedIndex]);
toolStripButtonDeleteTempCreature.Visible = true;
}
else
@@ -2875,8 +2584,8 @@ private void SetCreatureValuesToTester(CreatureValues cv)
speciesSelector1.SetSpecies(Values.V.SpeciesByBlueprint(cv.speciesBlueprint));
for (int s = 0; s < Values.STATS_COUNT; s++)
{
- testingIOs[s].LevelWild = cv.levelsWild[s];
- testingIOs[s].LevelDom = cv.levelsDom[s];
+ _testingIOs[s].LevelWild = cv.levelsWild[s];
+ _testingIOs[s].LevelDom = cv.levelsDom[s];
}
SetCreatureValuesToInfoInput(cv, creatureInfoInputTester);
@@ -2920,7 +2629,7 @@ private void toolStripButtonSaveCreatureValuesTemp_Click(object sender, EventArg
{
CreatureValues cv = new CreatureValues();
for (int s = 0; s < Values.STATS_COUNT; s++)
- cv.statValues[s] = statIOs[s].Input;
+ cv.statValues[s] = _statIOs[s].Input;
cv.speciesName = speciesSelector1.SelectedSpecies.name;
cv.speciesBlueprint = speciesSelector1.SelectedSpecies.blueprintPath;
cv.name = creatureInfoInputExtractor.CreatureName;
@@ -2945,7 +2654,7 @@ private void toolStripButtonSaveCreatureValuesTemp_Click(object sender, EventArg
cv.isTamed = true;
cv.imprintingBonus = (double)numericUpDownImprintingBonusExtractor.Value * 0.01;
- creatureCollection.creaturesValues.Add(cv);
+ _creatureCollection.creaturesValues.Add(cv);
SetCollectionChanged(true);
UpdateTempCreatureDropDown();
@@ -2956,7 +2665,7 @@ private void toolStripButtonDeleteTempCreature_Click(object sender, EventArgs e)
if (toolStripCBTempCreatures.SelectedIndex >= 0
&& MessageBox.Show("Remove the data of this cached creature?", "Delete?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
- creatureCollection.creaturesValues.RemoveAt(toolStripCBTempCreatures.SelectedIndex);
+ _creatureCollection.creaturesValues.RemoveAt(toolStripCBTempCreatures.SelectedIndex);
UpdateTempCreatureDropDown();
SetCollectionChanged(true, null);
}
@@ -2968,7 +2677,7 @@ private void toolStripButtonDeleteTempCreature_Click(object sender, EventArgs e)
private void UpdateTempCreatureDropDown()
{
toolStripCBTempCreatures.Items.Clear();
- foreach (CreatureValues cv in creatureCollection.creaturesValues)
+ foreach (CreatureValues cv in _creatureCollection.creaturesValues)
toolStripCBTempCreatures.Items.Add($"{cv.name} ({cv.Species?.name ?? "unknown species"})");
}
@@ -2988,26 +2697,26 @@ private void CreatureInfoInput_CreatureDataRequested(CreatureInfoInput input, bo
cr.name = input.CreatureName;
if (input == creatureInfoInputExtractor)
{
- cr.levelsWild = statIOs.Select(s => s.LevelWild).ToArray();
- cr.imprintingBonus = extractor.ImprintingBonus;
- cr.tamingEff = extractor.UniqueTE();
+ cr.levelsWild = _statIOs.Select(s => s.LevelWild).ToArray();
+ cr.imprintingBonus = _extractor.ImprintingBonus;
+ cr.tamingEff = _extractor.UniqueTE();
cr.isBred = rbBredExtractor.Checked;
}
else
{
- cr.levelsWild = testingIOs.Select(s => s.LevelWild).ToArray();
+ cr.levelsWild = _testingIOs.Select(s => s.LevelWild).ToArray();
cr.imprintingBonus = (double)numericUpDownImprintingBonusTester.Value / 100;
cr.tamingEff = (double)NumericUpDownTestingTE.Value / 100;
cr.isBred = rbBredTester.Checked;
}
Species species = speciesSelector1.SelectedSpecies;
cr.Species = species;
- cr.RecalculateCreatureValues(creatureCollection.getWildLevelStep());
+ cr.RecalculateCreatureValues(_creatureCollection.getWildLevelStep());
if (openPatternEditor)
- input.OpenNamePatternEditor(cr, topLevels.ContainsKey(cr.Species) ? topLevels[species] : null, customReplacingsNamingPattern, namingPatternIndex, ReloadNamePatternCustomReplacings);
+ input.OpenNamePatternEditor(cr, _topLevels.ContainsKey(cr.Species) ? _topLevels[species] : null, _customReplacingNamingPattern, namingPatternIndex, ReloadNamePatternCustomReplacings);
else
- input.GenerateCreatureName(cr, topLevels.ContainsKey(cr.Species) ? topLevels[species] : null, customReplacingsNamingPattern, showDuplicateNameWarning, namingPatternIndex);
+ input.GenerateCreatureName(cr, _topLevels.ContainsKey(cr.Species) ? _topLevels[species] : null, _customReplacingNamingPattern, showDuplicateNameWarning, namingPatternIndex);
}
private void ExtractionTestControl1_CopyToTester(string speciesBP, int[] wildLevels, int[] domLevels, bool postTamed, bool bred, double te, double imprintingBonus, bool gotoTester, testCases.TestCaseControl tcc)
@@ -3029,8 +2738,8 @@ private void ExtractionTestControl1_CopyToExtractor(string speciesBlueprint, int
ClearAll();
for (int s = 0; s < Values.STATS_COUNT; s++)
{
- statIOs[s].DomLevelLockedZero = false;
- statIOs[s].Input = statValues[s];
+ _statIOs[s].DomLevelLockedZero = false;
+ _statIOs[s].Input = statValues[s];
}
speciesSelector1.SetSpecies(Values.V.SpeciesByBlueprint(speciesBlueprint));
@@ -3053,7 +2762,7 @@ private void ExtractionTestControl1_CopyToExtractor(string speciesBlueprint, int
if (tcc != null)
{
- bool success = extractor.validResults;
+ bool success = _extractor.validResults;
if (!success)
tcc.setTestResult(false, (int)watch.ElapsedMilliseconds, 0, "extraction failed");
else
@@ -3063,13 +2772,13 @@ private void ExtractionTestControl1_CopyToExtractor(string speciesBlueprint, int
int resultCount = -Values.STATS_COUNT; // one result per stat is allowed, only count the additional ones. // TODO only consider possible stats
for (int s = 0; s < Values.STATS_COUNT; s++)
{
- resultCount += extractor.results[s].Count;
+ resultCount += _extractor.results[s].Count;
bool statValid = false;
- for (int r = 0; r < extractor.results[s].Count; r++)
+ for (int r = 0; r < _extractor.results[s].Count; r++)
{
- if (extractor.results[s][r].levelWild == -1 || s == (int)StatNames.SpeedMultiplier && extractor.results[s][r].levelWild == 0 || extractor.results[s][r].levelWild == tcc.testCase.levelsWild[s]
- && extractor.results[s][r].levelDom == tcc.testCase.levelsDom[s]
- && (extractor.results[s][r].TE.Max == -1 || extractor.results[s][r].TE.Includes(tcc.testCase.tamingEff))
+ if (_extractor.results[s][r].levelWild == -1 || s == (int)StatNames.SpeedMultiplier && _extractor.results[s][r].levelWild == 0 || _extractor.results[s][r].levelWild == tcc.testCase.levelsWild[s]
+ && _extractor.results[s][r].levelDom == tcc.testCase.levelsDom[s]
+ && (_extractor.results[s][r].TE.Max == -1 || _extractor.results[s][r].TE.Includes(tcc.testCase.tamingEff))
)
{
statValid = true;
@@ -3092,10 +2801,10 @@ private void ExtractionTestControl1_CopyToExtractor(string speciesBlueprint, int
private void LoadMultipliersFromTestCase(testCases.ExtractionTestCase etc)
{
// set all stat-multipliers from testcase
- creatureCollection.serverMultipliers = etc.serverMultipliers.Copy(true);
- creatureCollection.singlePlayerSettings = etc.singleplayerSettings;
- creatureCollection.allowMoreThanHundredImprinting = etc.allowMoreThanHundredPercentImprinting;
- creatureCollection.maxWildLevel = etc.maxWildLevel;
+ _creatureCollection.serverMultipliers = etc.serverMultipliers.Copy(true);
+ _creatureCollection.singlePlayerSettings = etc.singleplayerSettings;
+ _creatureCollection.allowMoreThanHundredImprinting = etc.allowMoreThanHundredPercentImprinting;
+ _creatureCollection.maxWildLevel = etc.maxWildLevel;
if (Values.V.loadedModsHash == 0 || Values.V.loadedModsHash != etc.modListHash)
LoadStatAndKibbleValues(false); // load original multipliers if they were changed
@@ -3104,7 +2813,7 @@ private void LoadMultipliersFromTestCase(testCases.ExtractionTestCase etc)
LoadModValueFiles(Values.V.modsManifest.modsByFiles.Where(mi => etc.ModIDs.Contains(mi.Value.mod.id)).Select(mi => mi.Value.mod.FileName).ToList(),
false, false, out _);
- Values.V.ApplyMultipliers(creatureCollection);
+ Values.V.ApplyMultipliers(_creatureCollection);
}
private void tsBtAddAsExtractionTest_Click(object sender, EventArgs e)
@@ -3121,16 +2830,16 @@ private void tsBtAddAsExtractionTest_Click(object sender, EventArgs e)
etc.imprintingBonus = etc.bred ? (double)numericUpDownImprintingBonusTester.Value / 100 : 0;
etc.levelsDom = GetCurrentDomLevels(false);
etc.levelsWild = GetCurrentWildLevels(false);
- etc.ModIDs = creatureCollection.modIDs?.ToList();
- etc.serverMultipliers = creatureCollection.serverMultipliers;
+ etc.ModIDs = _creatureCollection.modIDs?.ToList();
+ etc.serverMultipliers = _creatureCollection.serverMultipliers;
etc.Species = speciesSelector1.SelectedSpecies;
- etc.singleplayerSettings = creatureCollection.singlePlayerSettings;
- etc.allowMoreThanHundredPercentImprinting = creatureCollection.allowMoreThanHundredImprinting;
- etc.maxWildLevel = creatureCollection.maxWildLevel;
+ etc.singleplayerSettings = _creatureCollection.singlePlayerSettings;
+ etc.allowMoreThanHundredPercentImprinting = _creatureCollection.allowMoreThanHundredImprinting;
+ etc.maxWildLevel = _creatureCollection.maxWildLevel;
double[] statValues = new double[Values.STATS_COUNT];
for (int s = 0; s < Values.STATS_COUNT; s++)
- statValues[s] = statIOs[s].Input;
+ statValues[s] = _statIOs[s].Input;
etc.statValues = statValues;
extractionTestControl1.AddTestCase(etc);
@@ -3142,14 +2851,14 @@ private void copyToMultiplierTesterToolStripButton_Click(object sender, EventArg
{
double[] statValues = new double[Values.STATS_COUNT];
for (int s = 0; s < Values.STATS_COUNT; s++)
- statValues[s] = statIOs[s].Input;
+ statValues[s] = _statIOs[s].Input;
bool fromExtractor = tabControlMain.SelectedTab == tabPageExtractor;
var wildLevels = GetCurrentWildLevels(false);
// the torpor level of the tester is only the sum of the recognized stats. Use the level of the extractor, if that value was recognized.
- if (statIOs[(int)StatNames.Torpidity].LevelWild > 0)
- wildLevels[(int)StatNames.Torpidity] = statIOs[(int)StatNames.Torpidity].LevelWild;
+ if (_statIOs[(int)StatNames.Torpidity].LevelWild > 0)
+ wildLevels[(int)StatNames.Torpidity] = _statIOs[(int)StatNames.Torpidity].LevelWild;
statsMultiplierTesting1.SetCreatureValues(statValues,
wildLevels,
@@ -3164,21 +2873,21 @@ private void copyToMultiplierTesterToolStripButton_Click(object sender, EventArg
private void StatsMultiplierTesting1_OnApplyMultipliers()
{
- Values.V.ApplyMultipliers(creatureCollection);
+ Values.V.ApplyMultipliers(_creatureCollection);
SetCollectionChanged(true);
}
private void openFolderOfCurrentFileToolStripMenuItem_Click(object sender, EventArgs e)
{
- if (string.IsNullOrEmpty(currentFileName)) return;
- string path = Path.GetDirectoryName(currentFileName);
+ if (string.IsNullOrEmpty(_currentFileName)) return;
+ string path = Path.GetDirectoryName(_currentFileName);
if (string.IsNullOrEmpty(path)) return;
Process.Start(path);
}
private void customStatOverridesToolStripMenuItem_Click(object sender, EventArgs e)
{
- using (var frm = new mods.CustomStatOverridesEditor(Values.V.species, creatureCollection))
+ using (var frm = new mods.CustomStatOverridesEditor(Values.V.species, _creatureCollection))
{
frm.Location = Properties.Settings.Default.CustomStatOverrideLocation;
if (Properties.Settings.Default.CustomStatOverrideSize.Width > 40
@@ -3187,7 +2896,7 @@ private void customStatOverridesToolStripMenuItem_Click(object sender, EventArgs
frm.ShowDialog();
if (frm.StatOverridesChanged)
{
- Values.V.ApplyMultipliers(creatureCollection, eventMultipliers: cbEventMultipliers.Checked, applyStatMultipliers: true);
+ Values.V.ApplyMultipliers(_creatureCollection, eventMultipliers: cbEventMultipliers.Checked, applyStatMultipliers: true);
SetCollectionChanged(true);
}
Properties.Settings.Default.CustomStatOverrideLocation = frm.Location;
@@ -3240,7 +2949,7 @@ private void Form1_DragDrop(object sender, DragEventArgs e)
if (File.GetAttributes(filePath).HasFlag(FileAttributes.Directory))
{
ShowExportedCreatureListControl();
- exportedCreatureList.LoadFilesInFolder(filePath);
+ _exportedCreatureList.LoadFilesInFolder(filePath);
}
else if (ext == ".ini")
{
@@ -3248,7 +2957,7 @@ private void Form1_DragDrop(object sender, DragEventArgs e)
}
else if (ext == ".asb")
{
- if (!collectionDirty
+ if (!_collectionDirty
|| MessageBox.Show("Your Creature Collection has been modified since it was last saved, " +
"are you sure you want to discard your changes and load the file without saving first?",
"Discard Changes?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
@@ -3306,10 +3015,10 @@ private void GenerateCreatureNames()
Creature cr = ((Creature)listViewLibrary.SelectedItems[s].Tag);
if (sameSpecies == null || sameSpecies[0].Species != cr.Species)
- sameSpecies = creatureCollection.creatures.Where(c => c.Species == cr.Species).ToList();
+ sameSpecies = _creatureCollection.creatures.Where(c => c.Species == cr.Species).ToList();
// set new name
- cr.name = NamePatterns.GenerateCreatureName(cr, sameSpecies, topLevels.ContainsKey(cr.Species) ? topLevels[cr.Species] : null, customReplacingsNamingPattern, false, 0);
+ cr.name = NamePatterns.GenerateCreatureName(cr, sameSpecies, _topLevels.ContainsKey(cr.Species) ? _topLevels[cr.Species] : null, _customReplacingNamingPattern, false, 0);
UpdateDisplayedCreatureValues(cr, false, false);
}
@@ -3354,24 +3063,12 @@ private void ReloadNamePatternCustomReplacings(PatternEditor pe = null)
{
string filePath = FileService.GetJsonPath(FileService.CustomReplacingsNamePattern);
string errorMessage = null;
- if (!File.Exists(filePath) || !FileService.LoadJSONFile(filePath, out customReplacingsNamingPattern, out errorMessage))
+ if (!File.Exists(filePath) || !FileService.LoadJSONFile(filePath, out _customReplacingNamingPattern, out errorMessage))
{
if (!string.IsNullOrEmpty(errorMessage))
MessageBox.Show(errorMessage, "ASB Custom replacings file loading error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
- else if (pe != null) pe.SetCustomReplacings(customReplacingsNamingPattern);
- }
-
- private void speciesGroupToolStripMenuItem_Click(object sender, EventArgs e)
- {
- checkBoxSpeciesGroups.Checked = speciesGroupToolStripMenuItem.Checked;
- FilterLib();
- }
-
- private void checkBoxSpeciesGroups_CheckedChanged(object sender, EventArgs e)
- {
- speciesGroupToolStripMenuItem.Checked = checkBoxSpeciesGroups.Checked;
- FilterLib();
+ else if (pe != null) pe.SetCustomReplacings(_customReplacingNamingPattern);
}
private void toolStripMenuItemResetLibraryColumnWidths_Click(object sender, EventArgs e)
@@ -3384,7 +3081,7 @@ private void copyInfographicToClipboardToolStripMenuItem_Click(object sender, Ev
{
if (listViewLibrary.SelectedItems.Count == 0) return;
- (listViewLibrary.SelectedItems[0].Tag as Creature).ExportInfoGraphicToClipboard(creatureCollection);
+ (listViewLibrary.SelectedItems[0].Tag as Creature).ExportInfoGraphicToClipboard(_creatureCollection);
}
private void ToolStripMenuItemOpenWiki_Click(object sender, EventArgs e)
@@ -3397,6 +3094,24 @@ private void ToolStripMenuItemOpenWiki_Click(object sender, EventArgs e)
}
}
+ private void libraryFilterToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ var libraryFilter = new LibraryFilter(_creatureCollection);
+ Utils.SetFormRectangle(libraryFilter, Properties.Settings.Default.LibraryFilterWindowRect);
+
+ bool useFilterInTopStatsOld = Properties.Settings.Default.useFiltersInTopStatCalculation;
+ if (libraryFilter.ShowDialog() == DialogResult.OK)
+ {
+ if (Properties.Settings.Default.useFiltersInTopStatCalculation
+ || Properties.Settings.Default.useFiltersInTopStatCalculation != useFilterInTopStatsOld)
+ CalculateTopStats(_creatureCollection.creatures);
+
+ FilterLib();
+ }
+
+ Properties.Settings.Default.LibraryFilterWindowRect = Utils.GetFormRectangle(libraryFilter);
+ }
+
///
/// Verify if the right click was into the header of the list view, if so, open a specific contextMenu.
///
@@ -3410,5 +3125,30 @@ private void contextMenuStripLibrary_Opening(object sender, CancelEventArgs e)
contextMenuStripLibraryHeader.Show(Control.MousePosition);
}
}
+
+ private void downloadSpeciesImagesToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ DownloadSpeciesImagesAsync();
+ }
+
+ private async void DownloadSpeciesImagesAsync()
+ {
+ bool overwrite = !Directory.Exists(FileService.GetPath("img"));
+ if (!overwrite)
+ {
+ var msgBoxResult = MessageBox.Show(
+ "Some species color region image files seem to already exist.\nDo you want to overwrite them with possible new versions?",
+ "ASB: Overwrite existing species images?", MessageBoxButtons.YesNoCancel,
+ MessageBoxIcon.Question);
+ if (msgBoxResult == DialogResult.Yes)
+ overwrite = true;
+ else if (msgBoxResult != DialogResult.No)
+ return;
+ }
+
+ var (success, result) = await Updater.DownloadSpeciesImages(overwrite).ConfigureAwait(true);
+
+ MessageBox.Show(result, "ASB: Species images download", MessageBoxButtons.OK, success ? MessageBoxIcon.Information : MessageBoxIcon.Error);
+ }
}
}
diff --git a/ARKBreedingStats/Form1.extractor.cs b/ARKBreedingStats/Form1.extractor.cs
index d3699d68..ffe1ea52 100644
--- a/ARKBreedingStats/Form1.extractor.cs
+++ b/ARKBreedingStats/Form1.extractor.cs
@@ -42,11 +42,11 @@ private void ShowSumOfChosenLevels()
{
if (s == (int)StatNames.Torpidity)
continue;
- if (extractor.results[s].Count > extractor.chosenResults[s])
+ if (_extractor.results[s].Count > _extractor.chosenResults[s])
{
- sumW += statIOs[s].LevelWild > 0 ? statIOs[s].LevelWild : 0;
- sumD += statIOs[s].LevelDom;
- if (extractor.results[s].Count != 1)
+ sumW += _statIOs[s].LevelWild > 0 ? _statIOs[s].LevelWild : 0;
+ sumD += _statIOs[s].LevelDom;
+ if (_extractor.results[s].Count != 1)
{
allUnique = false;
}
@@ -56,24 +56,24 @@ private void ShowSumOfChosenLevels()
valid = false;
break;
}
- statIOs[s].TopLevel = StatIOStatus.Neutral;
+ _statIOs[s].TopLevel = StatIOStatus.Neutral;
}
if (valid)
{
- sumW -= allUnique || statIOs[(int)StatNames.SpeedMultiplier].LevelWild < 0 ? 0 : statIOs[(int)StatNames.SpeedMultiplier].LevelWild;
+ sumW -= allUnique || _statIOs[(int)StatNames.SpeedMultiplier].LevelWild < 0 ? 0 : _statIOs[(int)StatNames.SpeedMultiplier].LevelWild;
string offSetWild = "✓";
lbSumDom.Text = sumD.ToString();
- if (sumW <= extractor.levelWildSum)
+ if (sumW <= _extractor.levelWildSum)
{
lbSumWild.ForeColor = SystemColors.ControlText;
}
else
{
lbSumWild.ForeColor = Color.Red;
- offSetWild = "+" + (sumW - extractor.levelWildSum);
+ offSetWild = "+" + (sumW - _extractor.levelWildSum);
inbound = false;
}
- if (sumD == extractor.levelDomSum)
+ if (sumD == _extractor.levelDomSum)
{
lbSumDom.ForeColor = SystemColors.ControlText;
}
@@ -82,43 +82,43 @@ private void ShowSumOfChosenLevels()
lbSumDom.ForeColor = Color.Red;
inbound = false;
// if there are no other combination options, the total level may be wrong
- if (extractor.uniqueResults)
+ if (_extractor.uniqueResults)
numericUpDownLevel.BackColor = Color.LightSalmon;
}
lbSumWild.Text = offSetWild;
}
else
{
- lbSumWild.Text = "n/a";
- lbSumDom.Text = "n/a";
+ lbSumWild.Text = Loc.S("na");
+ lbSumDom.Text = Loc.S("na");
}
panelSums.BackColor = inbound ? SystemColors.Control : Color.FromArgb(255, 200, 200);
- bool torporLevelValid = numericUpDownLevel.Value > statIOs[(int)StatNames.Torpidity].LevelWild;
+ bool torporLevelValid = numericUpDownLevel.Value > _statIOs[(int)StatNames.Torpidity].LevelWild;
if (!torporLevelValid)
{
numericUpDownLevel.BackColor = Color.LightSalmon;
- statIOs[(int)StatNames.Torpidity].Status = StatIOStatus.Error;
+ _statIOs[(int)StatNames.Torpidity].Status = StatIOStatus.Error;
}
- bool allValid = valid && inbound && torporLevelValid && extractor.validResults;
+ bool allValid = valid && inbound && torporLevelValid && _extractor.validResults;
if (allValid)
{
- radarChartExtractor.setLevels(statIOs.Select(s => s.LevelWild).ToArray());
+ radarChartExtractor.setLevels(_statIOs.Select(s => s.LevelWild).ToArray());
toolStripButtonSaveCreatureValuesTemp.Visible = false;
cbExactlyImprinting.BackColor = Color.Transparent;
- if (topLevels.TryGetValue(speciesSelector1.SelectedSpecies, out int[] topSpeciesLevels))
+ if (_topLevels.TryGetValue(speciesSelector1.SelectedSpecies, out int[] topSpeciesLevels))
{
for (int s = 0; s < Values.STATS_COUNT; s++)
{
if (s == (int)StatNames.Torpidity)
continue;
- if (statIOs[s].LevelWild > 0)
+ if (_statIOs[s].LevelWild > 0)
{
- if (statIOs[s].LevelWild == topSpeciesLevels[s])
- statIOs[s].TopLevel = StatIOStatus.TopLevel;
- else if (topSpeciesLevels[s] != -1 && statIOs[s].LevelWild > topSpeciesLevels[s])
- statIOs[s].TopLevel = StatIOStatus.NewTopLevel;
+ if (_statIOs[s].LevelWild == topSpeciesLevels[s])
+ _statIOs[s].TopLevel = StatIOStatus.TopLevel;
+ else if (topSpeciesLevels[s] != -1 && _statIOs[s].LevelWild > topSpeciesLevels[s])
+ _statIOs[s].TopLevel = StatIOStatus.NewTopLevel;
}
}
}
@@ -133,21 +133,21 @@ private void ShowSumOfChosenLevels()
/// Also delete infos like the guid, parents and mutations
private void ClearAll(bool clearExtraCreatureData = true)
{
- extractor.Clear();
+ _extractor.Clear();
listViewPossibilities.Items.Clear();
for (int s = 0; s < Values.STATS_COUNT; s++)
{
- statIOs[s].Clear();
+ _statIOs[s].Clear();
}
ExtractionFailed(); // set background of controls to neutral
labelFootnote.Text = string.Empty;
labelFootnote.BackColor = Color.Transparent;
labelTE.Text = string.Empty;
- activeStatIndex = -1;
+ _activeStatIndex = -1;
lbSumDom.Text = string.Empty;
lbSumWild.Text = string.Empty;
lbSumDomSB.Text = string.Empty;
- updateTorporInTester = true;
+ _updateTorporInTester = true;
creatureInfoInputExtractor.ButtonEnabled = false;
groupBoxPossibilities.Visible = false;
groupBoxRadarChartExtractor.Visible = false;
@@ -164,7 +164,7 @@ private void ClearAll(bool clearExtraCreatureData = true)
creatureInfoInputExtractor.DomesticatedAt = DateTime.Now;
creatureInfoInputExtractor.parentListValid = false;
creatureInfoInputExtractor.CreatureGuid = Guid.Empty;
- exportedCreatureControl = null;
+ _exportedCreatureControl = null;
creatureInfoInputExtractor.SetArkId(0, false);
}
@@ -185,40 +185,40 @@ private void buttonExtract_Click(object sender, EventArgs e)
private bool ExtractLevels(bool autoExtraction = false, bool statInputsHighPrecision = false, bool showLevelsInOverlay = false, Creature existingCreature = null)
{
SuspendLayout();
- int activeStatKeeper = activeStatIndex;
- ClearAll(clearExtractionCreatureData);
+ int activeStatKeeper = _activeStatIndex;
+ ClearAll(_clearExtractionCreatureData);
if (cbExactlyImprinting.Checked)
- extractor.possibleIssues |= IssueNotes.Issue.ImprintingLocked;
+ _extractor.possibleIssues |= IssueNotes.Issue.ImprintingLocked;
- extractor.ExtractLevels(speciesSelector1.SelectedSpecies, (int)numericUpDownLevel.Value, statIOs,
+ _extractor.ExtractLevels(speciesSelector1.SelectedSpecies, (int)numericUpDownLevel.Value, _statIOs,
(double)numericUpDownLowerTEffBound.Value / 100, (double)numericUpDownUpperTEffBound.Value / 100,
rbTamedExtractor.Checked, rbBredExtractor.Checked,
(double)numericUpDownImprintingBonusExtractor.Value / 100, !cbExactlyImprinting.Checked,
- creatureCollection.allowMoreThanHundredImprinting, creatureCollection.serverMultipliers.BabyImprintingStatScaleMultiplier,
+ _creatureCollection.allowMoreThanHundredImprinting, _creatureCollection.serverMultipliers.BabyImprintingStatScaleMultiplier,
Values.V.currentServerMultipliers.BabyCuddleIntervalMultiplier,
- creatureCollection.considerWildLevelSteps, creatureCollection.wildLevelStep, statInputsHighPrecision, out bool imprintingBonusChanged);
+ _creatureCollection.considerWildLevelSteps, _creatureCollection.wildLevelStep, statInputsHighPrecision, out bool imprintingBonusChanged);
- numericUpDownImprintingBonusExtractor.ValueSave = (decimal)extractor.ImprintingBonus * 100;
+ numericUpDownImprintingBonusExtractor.ValueSave = (decimal)_extractor.ImprintingBonus * 100;
numericUpDownImprintingBonusExtractor_ValueChanged(null, null);
if (imprintingBonusChanged && !autoExtraction)
{
- extractor.possibleIssues |= IssueNotes.Issue.ImprintingNotPossible;
+ _extractor.possibleIssues |= IssueNotes.Issue.ImprintingNotPossible;
}
- bool everyStatHasAtLeastOneResult = extractor.EveryStatHasAtLeastOneResult;
+ bool everyStatHasAtLeastOneResult = _extractor.EveryStatHasAtLeastOneResult;
// remove all results that require a total wild-level higher than the max
// Tek-variants have 20% higher levels
- extractor.RemoveImpossibleTEsAccordingToMaxWildLevel((int)Math.Ceiling(creatureCollection.maxWildLevel * (speciesSelector1.SelectedSpecies.name.StartsWith("Tek ") ? 1.2 : 1)));
+ _extractor.RemoveImpossibleTEsAccordingToMaxWildLevel((int)Math.Ceiling(_creatureCollection.maxWildLevel * (speciesSelector1.SelectedSpecies.name.StartsWith("Tek ") ? 1.2 : 1)));
- if (everyStatHasAtLeastOneResult && !extractor.EveryStatHasAtLeastOneResult)
+ if (everyStatHasAtLeastOneResult && !_extractor.EveryStatHasAtLeastOneResult)
{
- MessageBox.Show(string.Format(Loc.s("issueMaxWildLevelTooLow"), creatureCollection.maxWildLevel), "ASB: Maybe the wild max level is set too low", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ MessageBox.Show(string.Format(Loc.S("issueMaxWildLevelTooLow"), _creatureCollection.maxWildLevel), "ASB: Maybe the wild max level is set too low", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
- if (!extractor.SetStatLevelBoundsAndFilter(out int statIssue))
+ if (!_extractor.SetStatLevelBoundsAndFilter(out int statIssue))
{
if (statIssue == -1)
{
@@ -228,33 +228,33 @@ private bool ExtractLevels(bool autoExtraction = false, bool statInputsHighPreci
ResumeLayout();
return false;
}
- extractor.possibleIssues |= IssueNotes.Issue.Typo | IssueNotes.Issue.CreatureLevel;
- statIOs[statIssue].Status = StatIOStatus.Error;
- statIOs[(int)StatNames.Torpidity].Status = StatIOStatus.Error;
+ _extractor.possibleIssues |= IssueNotes.Issue.Typo | IssueNotes.Issue.CreatureLevel;
+ _statIOs[statIssue].Status = StatIOStatus.Error;
+ _statIOs[(int)StatNames.Torpidity].Status = StatIOStatus.Error;
}
// get mean-level (most probable for the wild levels)
// TODO handle species without wild levels in speed better (some flyers)
- double meanWildLevel = Math.Round((double)extractor.levelWildSum / 7, 1);
+ double meanWildLevel = Math.Round((double)_extractor.levelWildSum / 7, 1);
bool nonUniqueStats = false;
for (int s = 0; s < Values.STATS_COUNT; s++)
{
- if (!activeStats[s])
+ if (!_activeStats[s])
{
- statIOs[s].Status = StatIOStatus.Neutral;
+ _statIOs[s].Status = StatIOStatus.Neutral;
}
- else if (extractor.results[s].Any())
+ else if (_extractor.results[s].Any())
{
if (existingCreature != null)
{
// set the wild levels to the existing ones
int r = 0;
- for (int b = 1; b < extractor.results[s].Count; b++)
+ for (int b = 1; b < _extractor.results[s].Count; b++)
{
- if (extractor.results[s][b].levelWild == existingCreature.levelsWild[s]
- && extractor.results[s][b].levelDom >= existingCreature.levelsDom[s]
- && extractor.results[s][b].TE.Includes(existingCreature.tamingEff))
+ if (_extractor.results[s][b].levelWild == existingCreature.levelsWild[s]
+ && _extractor.results[s][b].levelDom >= existingCreature.levelsDom[s]
+ && _extractor.results[s][b].TE.Includes(existingCreature.tamingEff))
{
r = b;
break;
@@ -266,51 +266,51 @@ private bool ExtractLevels(bool autoExtraction = false, bool statInputsHighPreci
{
// choose the most probable wild-level, aka the level nearest to the mean of the wild levels.
int r = 0;
- for (int b = 1; b < extractor.results[s].Count; b++)
+ for (int b = 1; b < _extractor.results[s].Count; b++)
{
- if (Math.Abs(meanWildLevel - extractor.results[s][b].levelWild) < Math.Abs(meanWildLevel - extractor.results[s][r].levelWild))
+ if (Math.Abs(meanWildLevel - _extractor.results[s][b].levelWild) < Math.Abs(meanWildLevel - _extractor.results[s][r].levelWild))
r = b;
}
SetLevelCombination(s, r);
}
- if (extractor.results[s].Count > 1)
+ if (_extractor.results[s].Count > 1)
{
- statIOs[s].Status = StatIOStatus.Nonunique;
+ _statIOs[s].Status = StatIOStatus.NonUnique;
nonUniqueStats = true;
}
else
{
- statIOs[s].Status = StatIOStatus.Unique;
+ _statIOs[s].Status = StatIOStatus.Unique;
}
}
else
{
// no results for this stat
- statIOs[s].Status = StatIOStatus.Error;
- extractor.validResults = false;
- if (rbTamedExtractor.Checked && extractor.statsWithTE.Contains(s))
+ _statIOs[s].Status = StatIOStatus.Error;
+ _extractor.validResults = false;
+ if (rbTamedExtractor.Checked && _extractor.statsWithTE.Contains(s))
{
- extractor.possibleIssues |= IssueNotes.Issue.TamingEffectivenessRange;
+ _extractor.possibleIssues |= IssueNotes.Issue.TamingEffectivenessRange;
}
// if the stat is changed by singleplayer-settings, list that as a possible issue
if (s == (int)StatNames.Health
|| s == (int)StatNames.MeleeDamageMultiplier)
{
- extractor.possibleIssues |= IssueNotes.Issue.Singleplayer;
+ _extractor.possibleIssues |= IssueNotes.Issue.Singleplayer;
}
}
}
- if (!extractor.validResults)
+ if (!_extractor.validResults)
{
ExtractionFailed(IssueNotes.Issue.Typo | IssueNotes.Issue.WildTamedBred | IssueNotes.Issue.LockedDom |
IssueNotes.Issue.OutdatedIngameValues | IssueNotes.Issue.ImprintingNotUpdated |
- (statIOs[(int)StatNames.Torpidity].LevelWild >= (int)numericUpDownLevel.Value ? IssueNotes.Issue.CreatureLevel : IssueNotes.Issue.None));
+ (_statIOs[(int)StatNames.Torpidity].LevelWild >= (int)numericUpDownLevel.Value ? IssueNotes.Issue.CreatureLevel : IssueNotes.Issue.None));
ResumeLayout();
return false;
}
- extractor.uniqueResults = !nonUniqueStats;
- if (!extractor.uniqueResults)
+ _extractor.uniqueResults = !nonUniqueStats;
+ if (!_extractor.uniqueResults)
{
groupBoxPossibilities.Visible = true;
lbInfoYellowStats.Visible = true;
@@ -321,17 +321,17 @@ private bool ExtractLevels(bool autoExtraction = false, bool statInputsHighPreci
for (int s = 0; s < Values.STATS_COUNT; s++)
{
if (s != (int)StatNames.Torpidity)
- domLevelsChosenSum += extractor.results[s][extractor.chosenResults[s]].levelDom;
+ domLevelsChosenSum += _extractor.results[s][_extractor.chosenResults[s]].levelDom;
}
- if (domLevelsChosenSum != extractor.levelDomSum)
+ if (domLevelsChosenSum != _extractor.levelDomSum)
{
// sum of domlevels is not correct. Try to find another combination
- domLevelsChosenSum -= extractor.results[(int)StatNames.MeleeDamageMultiplier][extractor.chosenResults[(int)StatNames.MeleeDamageMultiplier]].levelDom;
+ domLevelsChosenSum -= _extractor.results[(int)StatNames.MeleeDamageMultiplier][_extractor.chosenResults[(int)StatNames.MeleeDamageMultiplier]].levelDom;
bool changeChosenResult = false;
int cR = 0;
- for (int r = 0; r < extractor.results[(int)StatNames.MeleeDamageMultiplier].Count; r++)
+ for (int r = 0; r < _extractor.results[(int)StatNames.MeleeDamageMultiplier].Count; r++)
{
- if (domLevelsChosenSum + extractor.results[(int)StatNames.MeleeDamageMultiplier][r].levelDom == extractor.levelDomSum)
+ if (domLevelsChosenSum + _extractor.results[(int)StatNames.MeleeDamageMultiplier][r].levelDom == _extractor.levelDomSum)
{
cR = r;
changeChosenResult = true;
@@ -342,31 +342,31 @@ private bool ExtractLevels(bool autoExtraction = false, bool statInputsHighPreci
SetLevelCombination((int)StatNames.MeleeDamageMultiplier, cR);
}
- if (extractor.postTamed)
+ if (_extractor.postTamed)
SetUniqueTE();
else
{
- labelTE.Text = Loc.s("notYetTamed");
+ labelTE.Text = Loc.S("notYetTamed");
labelTE.BackColor = Color.Transparent;
}
SetWildSpeedLevelAccordingToOthers();
- lbSumDomSB.Text = extractor.levelDomSum.ToString();
+ lbSumDomSB.Text = _extractor.levelDomSum.ToString();
ShowSumOfChosenLevels();
if (showLevelsInOverlay)
ShowLevelsInOverlay();
SetActiveStat(activeStatKeeper);
- if (!extractor.postTamed)
+ if (!_extractor.postTamed)
{
- labelFootnote.Text = Loc.s("lbNotYetTamed");
+ labelFootnote.Text = Loc.S("lbNotYetTamed");
button2TamingCalc.Visible = true;
// display taming info
SetQuickTamingInfo(cbQuickWildCheck.Checked
- ? statIOs[(int)StatNames.Torpidity].LevelWild + 1
+ ? _statIOs[(int)StatNames.Torpidity].LevelWild + 1
: (int)numericUpDownLevel.Value);
}
@@ -381,11 +381,11 @@ private void UpdateQuickTamingInfo()
{
for (int s = 0; s < Values.STATS_COUNT; s++)
{
- int lvlWild = (int)Math.Round((statIOs[s].Input - speciesSelector1.SelectedSpecies.stats[s].BaseValue) / (speciesSelector1.SelectedSpecies.stats[s].BaseValue * speciesSelector1.SelectedSpecies.stats[s].IncPerWildLevel));
- statIOs[s].LevelWild = lvlWild < 0 ? 0 : lvlWild;
- statIOs[s].LevelDom = 0;
+ int lvlWild = (int)Math.Round((_statIOs[s].Input - speciesSelector1.SelectedSpecies.stats[s].BaseValue) / (speciesSelector1.SelectedSpecies.stats[s].BaseValue * speciesSelector1.SelectedSpecies.stats[s].IncPerWildLevel));
+ _statIOs[s].LevelWild = lvlWild < 0 ? 0 : lvlWild;
+ _statIOs[s].LevelDom = 0;
}
- SetQuickTamingInfo(statIOs[(int)StatNames.Torpidity].LevelWild + 1);
+ SetQuickTamingInfo(_statIOs[(int)StatNames.Torpidity].LevelWild + 1);
}
panelWildTamedBred.Enabled = !showQuickTamingInfo;
groupBoxDetailsExtractor.Enabled = !showQuickTamingInfo;
@@ -408,7 +408,7 @@ private void SetQuickTamingInfo(int level)
///
private void ExtractionFailed(IssueNotes.Issue issues = IssueNotes.Issue.None)
{
- issues |= extractor.possibleIssues; // add all issues that arised during extraction
+ issues |= _extractor.possibleIssues; // add all issues that arised during extraction
if (issues == IssueNotes.Issue.None)
{
// set background of inputs to neutral
@@ -423,7 +423,8 @@ private void ExtractionFailed(IssueNotes.Issue issues = IssueNotes.Issue.None)
llOnlineHelpExtractionIssues.Visible = false;
labelErrorHelp.Visible = false;
lbImprintingFailInfo.Visible = false; // TODO move imprinting-fail to upper note-info
- extractor.possibleIssues = IssueNotes.Issue.None;
+ _extractor.possibleIssues = IssueNotes.Issue.None;
+ PbCreatureColorsExtractor.Visible = true;
}
else
{
@@ -443,7 +444,7 @@ private void ExtractionFailed(IssueNotes.Issue issues = IssueNotes.Issue.None)
{
numericUpDownLevel.BackColor = Color.LightSalmon;
numericUpDownImprintingBonusExtractor.BackColor = Color.LightSalmon;
- statIOs[(int)StatNames.Torpidity].Status = StatIOStatus.Error;
+ _statIOs[(int)StatNames.Torpidity].Status = StatIOStatus.Error;
}
if (issues.HasFlag(IssueNotes.Issue.ImprintingLocked))
cbExactlyImprinting.BackColor = Color.LightSalmon;
@@ -456,7 +457,7 @@ private void ExtractionFailed(IssueNotes.Issue issues = IssueNotes.Issue.None)
bool oneStatIsDomLocked = false;
for (int s = 0; s < Values.STATS_COUNT; s++)
{
- if (statIOs[s].DomLevelLockedZero)
+ if (_statIOs[s].DomLevelLockedZero)
{
oneStatIsDomLocked = true;
break;
@@ -472,7 +473,7 @@ private void ExtractionFailed(IssueNotes.Issue issues = IssueNotes.Issue.None)
if (!issues.HasFlag(IssueNotes.Issue.StatMultipliers))
issues |= IssueNotes.Issue.StatMultipliers; // add this always?
- if (rbTamedExtractor.Checked && creatureCollection.considerWildLevelSteps)
+ if (rbTamedExtractor.Checked && _creatureCollection.considerWildLevelSteps)
issues |= IssueNotes.Issue.WildLevelSteps;
labelErrorHelp.Text = "The extraction failed. See the following list of possible causes:\n\n" +
@@ -484,7 +485,7 @@ private void ExtractionFailed(IssueNotes.Issue issues = IssueNotes.Issue.None)
lbInfoYellowStats.Visible = false;
if (rbBredExtractor.Checked && numericUpDownImprintingBonusExtractor.Value > 0)
{
- lbImprintingFailInfo.Text = Loc.s("lbImprintingFailInfo");
+ lbImprintingFailInfo.Text = Loc.S("lbImprintingFailInfo");
lbImprintingFailInfo.Visible = true;
}
else if (rbTamedExtractor.Checked
@@ -497,6 +498,7 @@ private void ExtractionFailed(IssueNotes.Issue issues = IssueNotes.Issue.None)
lbImprintingFailInfo.Visible = true;
}
toolStripButtonSaveCreatureValuesTemp.Visible = true;
+ PbCreatureColorsExtractor.Visible = false;
// check for updates
if (DateTime.Now.AddHours(-5) > Properties.Settings.Default.lastUpdateCheck)
@@ -510,12 +512,12 @@ private void ExtractionFailed(IssueNotes.Issue issues = IssueNotes.Issue.None)
///
private void SetUniqueTE()
{
- double te = Math.Round(extractor.UniqueTE(), 5);
+ double te = Math.Round(_extractor.UniqueTE(), 5);
if (te >= 0)
{
labelTE.Text = $"Extracted: {Math.Round(100 * te, 2)} %";
- if (rbTamedExtractor.Checked && extractor.postTamed)
- labelTE.Text += $" (wildlevel: {Creature.CalculatePreTameWildLevel(statIOs[(int)StatNames.Torpidity].LevelWild + 1, te)})";
+ if (rbTamedExtractor.Checked && _extractor.postTamed)
+ labelTE.Text += $" (wildlevel: {Creature.CalculatePreTameWildLevel(_statIOs[(int)StatNames.Torpidity].LevelWild + 1, te)})";
labelTE.BackColor = Color.Transparent;
}
else
@@ -538,22 +540,22 @@ private void SetUniqueTE()
///
private void SetActiveStat(int statIndex)
{
- if (statIndex != activeStatIndex)
+ if (statIndex != _activeStatIndex)
{
- activeStatIndex = -1;
+ _activeStatIndex = -1;
listViewPossibilities.BeginUpdate();
listViewPossibilities.Items.Clear();
for (int s = 0; s < Values.STATS_COUNT; s++)
{
- if (s == statIndex && statIOs[s].Status == StatIOStatus.Nonunique)
+ if (s == statIndex && _statIOs[s].Status == StatIOStatus.NonUnique)
{
- statIOs[s].Selected = true;
+ _statIOs[s].Selected = true;
SetPossibilitiesListview(s);
- activeStatIndex = statIndex;
+ _activeStatIndex = statIndex;
}
else
{
- statIOs[s].Selected = false;
+ _statIOs[s].Selected = false;
}
}
listViewPossibilities.EndUpdate();
@@ -566,23 +568,23 @@ private void SetActiveStat(int statIndex)
///
private void SetPossibilitiesListview(int s)
{
- if (s < extractor.results.Length)
+ if (s < _extractor.results.Length)
{
- bool resultsValid = extractor.FilterResultsByFixed(s) == -1;
- for (int r = 0; r < extractor.results[s].Count; r++)
+ bool resultsValid = _extractor.FilterResultsByFixed(s) == -1;
+ for (int r = 0; r < _extractor.results[s].Count; r++)
{
List subItems = new List();
- double te = Math.Round(extractor.results[s][r].TE.Mean, 5);
- subItems.Add(extractor.results[s][r].levelWild.ToString());
- subItems.Add(extractor.results[s][r].levelDom.ToString());
+ double te = Math.Round(_extractor.results[s][r].TE.Mean, 5);
+ subItems.Add(_extractor.results[s][r].levelWild.ToString());
+ subItems.Add(_extractor.results[s][r].levelDom.ToString());
subItems.Add(te >= 0 ? (te * 100).ToString() : string.Empty);
- subItems.Add(te > 0 ? Creature.CalculatePreTameWildLevel(extractor.levelWildSum + 1, te).ToString() : string.Empty);
+ subItems.Add(te > 0 ? Creature.CalculatePreTameWildLevel(_extractor.levelWildSum + 1, te).ToString() : string.Empty);
ListViewItem lvi = new ListViewItem(subItems.ToArray());
- if (!resultsValid || extractor.results[s][r].currentlyNotValid)
+ if (!resultsValid || _extractor.results[s][r].currentlyNotValid)
lvi.BackColor = Color.LightSalmon;
- if (extractor.fixedResults[s] && extractor.chosenResults[s] == r)
+ if (_extractor.fixedResults[s] && _extractor.chosenResults[s] == r)
{
lvi.BackColor = Color.LightSkyBlue;
}
@@ -599,14 +601,14 @@ private void listViewPossibilities_SelectedIndexChanged(object sender, EventArgs
if (listViewPossibilities.SelectedIndices.Count > 0)
{
int index = (int)listViewPossibilities.SelectedItems[0].Tag;
- if (index >= 0 && activeStatIndex >= 0)
+ if (index >= 0 && _activeStatIndex >= 0)
{
- SetLevelCombination(activeStatIndex, index, true);
- extractor.fixedResults[activeStatIndex] = true;
+ SetLevelCombination(_activeStatIndex, index, true);
+ _extractor.fixedResults[_activeStatIndex] = true;
}
}
- else if (activeStatIndex >= 0)
- extractor.fixedResults[activeStatIndex] = false;
+ else if (_activeStatIndex >= 0)
+ _extractor.fixedResults[_activeStatIndex] = false;
}
///
@@ -617,10 +619,10 @@ private void listViewPossibilities_SelectedIndexChanged(object sender, EventArgs
///
private void SetLevelCombination(int s, int i, bool validateCombination = false)
{
- statIOs[s].LevelWild = extractor.results[s][i].levelWild;
- statIOs[s].LevelDom = extractor.results[s][i].levelDom;
- statIOs[s].BreedingValue = StatValueCalculation.CalculateValue(speciesSelector1.SelectedSpecies, s, extractor.results[s][i].levelWild, 0, true, 1, 0);
- extractor.chosenResults[s] = i;
+ _statIOs[s].LevelWild = _extractor.results[s][i].levelWild;
+ _statIOs[s].LevelDom = _extractor.results[s][i].levelDom;
+ _statIOs[s].BreedingValue = StatValueCalculation.CalculateValue(speciesSelector1.SelectedSpecies, s, _extractor.results[s][i].levelWild, 0, true, 1, 0);
+ _extractor.chosenResults[s] = i;
if (validateCombination)
{
SetUniqueTE();
@@ -636,14 +638,14 @@ private void SetWildSpeedLevelAccordingToOthers()
{
// wild speed level is wildTotalLevels - determinedWildLevels. sometimes the oxygenlevel cannot be determined as well
bool unique = true;
- int notDeterminedLevels = statIOs[(int)StatNames.Torpidity].LevelWild;
+ int notDeterminedLevels = _statIOs[(int)StatNames.Torpidity].LevelWild;
for (int s = 0; s < Values.STATS_COUNT; s++)
{
if (s == (int)StatNames.SpeedMultiplier || s == (int)StatNames.Torpidity)
continue;
- if (statIOs[s].LevelWild >= 0)
+ if (_statIOs[s].LevelWild >= 0)
{
- notDeterminedLevels -= statIOs[s].LevelWild;
+ notDeterminedLevels -= _statIOs[s].LevelWild;
}
else
{
@@ -654,17 +656,17 @@ private void SetWildSpeedLevelAccordingToOthers()
if (unique)
{
// if all other stats are unique, set speedlevel
- statIOs[(int)StatNames.SpeedMultiplier].LevelWild = Math.Max(0, notDeterminedLevels);
- statIOs[(int)StatNames.SpeedMultiplier].BreedingValue = StatValueCalculation.CalculateValue(speciesSelector1.SelectedSpecies, (int)StatNames.SpeedMultiplier, statIOs[(int)StatNames.SpeedMultiplier].LevelWild, 0, true, 1, 0);
+ _statIOs[(int)StatNames.SpeedMultiplier].LevelWild = Math.Max(0, notDeterminedLevels);
+ _statIOs[(int)StatNames.SpeedMultiplier].BreedingValue = StatValueCalculation.CalculateValue(speciesSelector1.SelectedSpecies, (int)StatNames.SpeedMultiplier, _statIOs[(int)StatNames.SpeedMultiplier].LevelWild, 0, true, 1, 0);
}
else
{
// if not all other levels are unique, set speed and not known levels to unknown
for (int s = 0; s < Values.STATS_COUNT; s++)
{
- if (s == (int)StatNames.SpeedMultiplier || !activeStats[s])
+ if (s == (int)StatNames.SpeedMultiplier || !_activeStats[s])
{
- statIOs[s].LevelWild = -1;
+ _statIOs[s].LevelWild = -1;
}
}
}
@@ -675,14 +677,14 @@ private void CopyExtractionToClipboard()
bool header = true;
bool table = MessageBox.Show("Results can be copied as own table or as a long table-row. Should it be copied as own table?",
"Copy as own table?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes;
- if (extractor.validResults && speciesSelector1.SelectedSpecies != null)
+ if (_extractor.validResults && speciesSelector1.SelectedSpecies != null)
{
List tsv = new List();
string rowLevel = speciesSelector1.SelectedSpecies.name + "\t\t";
string rowValues = string.Empty;
// if taming effectiveness is unique, display it, too
string effString = string.Empty;
- double eff = extractor.UniqueTE();
+ double eff = _extractor.UniqueTE();
if (eff >= 0)
{
effString = "\tTamingEff:\t" + (100 * eff) + "%";
@@ -702,20 +704,20 @@ private void CopyExtractionToClipboard()
}
for (int s = 0; s < Values.STATS_COUNT; s++)
{
- if (extractor.chosenResults[s] < extractor.results[s].Count)
+ if (_extractor.chosenResults[s] < _extractor.results[s].Count)
{
string breedingV = string.Empty;
- if (activeStats[s])
+ if (_activeStats[s])
{
- breedingV = statIOs[s].BreedingValue.ToString();
+ breedingV = _statIOs[s].BreedingValue.ToString();
}
if (table)
{
- tsv.Add(Utils.StatName(s) + "\t" + (statIOs[s].LevelWild >= 0 ? statIOs[s].LevelWild.ToString() : string.Empty) + "\t" + (statIOs[s].LevelWild >= 0 ? statIOs[s].LevelWild.ToString() : string.Empty) + "\t" + breedingV);
+ tsv.Add(Utils.StatName(s) + "\t" + (_statIOs[s].LevelWild >= 0 ? _statIOs[s].LevelWild.ToString() : string.Empty) + "\t" + (_statIOs[s].LevelWild >= 0 ? _statIOs[s].LevelWild.ToString() : string.Empty) + "\t" + breedingV);
}
else
{
- rowLevel += "\t" + (activeStats[s] ? statIOs[s].LevelWild.ToString() : string.Empty);
+ rowLevel += "\t" + (_activeStats[s] ? _statIOs[s].LevelWild.ToString() : string.Empty);
rowValues += "\t" + breedingV;
}
}
@@ -755,13 +757,13 @@ private bool ExtractExportedFileInExtractor(string exportFile)
// check if species is supported.
if (cv.Species == null)
{
- CheckForMissingModFiles(creatureCollection, new List { cv.speciesBlueprint });
+ CheckForMissingModFiles(_creatureCollection, new List { cv.speciesBlueprint });
- int oldModHash = creatureCollection.modListHash;
+ int oldModHash = _creatureCollection.modListHash;
// if mods were added, try to import the creature values again
- if (creatureCollection.ModValueReloadNeeded
- && LoadModValuesOfCollection(creatureCollection, true, true)
- && oldModHash != creatureCollection.modListHash)
+ if (_creatureCollection.ModValueReloadNeeded
+ && LoadModValuesOfCollection(_creatureCollection, true, true)
+ && oldModHash != _creatureCollection.modListHash)
ExtractExportedFileInExtractor(exportFile);
return false;
@@ -770,16 +772,18 @@ private bool ExtractExportedFileInExtractor(string exportFile)
bool creatureExists = ExtractValuesInExtractor(cv, exportFile, true);
- if (Properties.Settings.Default.applyNamePatternOnImportIfEmptyName
+ if ((Properties.Settings.Default.applyNamePatternOnImportIfEmptyName
&& string.IsNullOrEmpty(creatureInfoInputExtractor.CreatureName))
+ || (!creatureExists
+ && Properties.Settings.Default.applyNamePatternOnAutoImportForNewCreatures)
+ )
{
CreatureInfoInput_CreatureDataRequested(creatureInfoInputExtractor, false, false, 0);
if (Properties.Settings.Default.copyNameToClipboardOnImportWhenAutoNameApplied)
{
- if (string.IsNullOrEmpty(creatureInfoInputExtractor.CreatureName))
- Clipboard.SetText("");
- else
- Clipboard.SetText(creatureInfoInputExtractor.CreatureName);
+ Clipboard.SetText(string.IsNullOrEmpty(creatureInfoInputExtractor.CreatureName)
+ ? ""
+ : creatureInfoInputExtractor.CreatureName);
}
}
@@ -800,12 +804,20 @@ private void ExtractExportedFileInExtractor(importExported.ExportedCreatureContr
ExtractValuesInExtractor(ecc.creatureValues, ecc.exportedFile, false);
// gets deleted in extractLevels()
- exportedCreatureControl = ecc;
+ _exportedCreatureControl = ecc;
- if (!string.IsNullOrEmpty(exportedCreatureList?.ownerSuffix))
- creatureInfoInputExtractor.CreatureOwner += exportedCreatureList.ownerSuffix;
+ if (!string.IsNullOrEmpty(_exportedCreatureList?.ownerSuffix))
+ creatureInfoInputExtractor.CreatureOwner += _exportedCreatureList.ownerSuffix;
}
+ ///
+ /// Sets the values of a creature to the extractor and extracts its levels.
+ /// It returns if the creature is already present in the library.
+ ///
+ ///
+ ///
+ ///
+ ///
private bool ExtractValuesInExtractor(CreatureValues cv, string filePath, bool autoExtraction)
{
SetCreatureValuesToExtractor(cv, false);
@@ -831,8 +843,8 @@ private void SetStatsActiveAccordingToUsage(Species species)
{
for (int s = 0; s < Values.STATS_COUNT; s++)
{
- activeStats[s] = species.UsesStat(s);
- statIOs[s].IsActive = activeStats[s];
+ _activeStats[s] = species.UsesStat(s);
+ _statIOs[s].IsActive = _activeStats[s];
}
}
@@ -846,33 +858,33 @@ private void SetCreatureValuesToExtractor(CreatureValues cv, bool setInfoInput =
// at this point, if the creatureValues has parent-ArkIds, make sure these parent-creatures exist
if (cv.Mother == null)
{
- if (creatureCollection.CreatureById(cv.motherGuid, cv.motherArkId, cv.Species, cv.sex, out Creature mother))
+ if (_creatureCollection.CreatureById(cv.motherGuid, cv.motherArkId, cv.Species, cv.sex, out Creature mother))
{
cv.Mother = mother;
}
else if (cv.motherArkId != 0)
{
cv.Mother = new Creature(cv.motherArkId);
- creatureCollection.creatures.Add(cv.Mother);
+ _creatureCollection.creatures.Add(cv.Mother);
}
}
if (cv.Father == null)
{
- if (creatureCollection.CreatureById(cv.fatherGuid, cv.fatherArkId, cv.Species, cv.sex, out Creature father))
+ if (_creatureCollection.CreatureById(cv.fatherGuid, cv.fatherArkId, cv.Species, cv.sex, out Creature father))
{
cv.Father = father;
}
else if (cv.fatherArkId != 0)
{
cv.Father = new Creature(cv.fatherArkId);
- creatureCollection.creatures.Add(cv.Father);
+ _creatureCollection.creatures.Add(cv.Father);
}
}
ClearAll();
speciesSelector1.SetSpecies(Values.V.SpeciesByBlueprint(cv.speciesBlueprint));
for (int s = 0; s < Values.STATS_COUNT; s++)
- statIOs[s].Input = cv.statValues[s];
+ _statIOs[s].Input = cv.statValues[s];
if (setInfoInput)
SetCreatureValuesToInfoInput(cv, creatureInfoInputExtractor);
@@ -901,7 +913,7 @@ private bool IsCreatureAlreadyInLibrary(Guid creatureGuid, long arkId, out Creat
if (creatureGuid != Guid.Empty
&& Utils.IsArkIdImported(arkId, creatureGuid))
{
- existingCreature = creatureCollection.creatures.FirstOrDefault(c => c.guid == creatureGuid
+ existingCreature = _creatureCollection.creatures.FirstOrDefault(c => c.guid == creatureGuid
&& !c.flags.HasFlag(CreatureFlags.Placeholder)
);
if (existingCreature != null)
diff --git a/ARKBreedingStats/Form1.importExported.cs b/ARKBreedingStats/Form1.importExported.cs
index d3ccebdb..9da1ba26 100644
--- a/ARKBreedingStats/Form1.importExported.cs
+++ b/ARKBreedingStats/Form1.importExported.cs
@@ -6,7 +6,9 @@
using System.Drawing;
using System.IO;
using System.Linq;
+using System.Text;
using System.Windows.Forms;
+using ARKBreedingStats.species;
namespace ARKBreedingStats
{
@@ -26,8 +28,8 @@ private void OpenImportExportForm(object sender, EventArgs e)
else
{
ShowExportedCreatureListControl();
- exportedCreatureList.ownerSuffix = loc.OwnerSuffix;
- exportedCreatureList.LoadFilesInFolder(loc.FolderPath);
+ _exportedCreatureList.ownerSuffix = loc.OwnerSuffix;
+ _exportedCreatureList.LoadFilesInFolder(loc.FolderPath);
}
}
@@ -40,7 +42,7 @@ private void ImportExportedCreaturesDefaultFolder()
if (Utils.GetFirstImportExportFolder(out string folder))
{
ShowExportedCreatureListControl();
- exportedCreatureList.LoadFilesInFolder(folder);
+ _exportedCreatureList.LoadFilesInFolder(folder);
}
else if (
MessageBox.Show("There is no valid folder set where the exported creatures are located. Set this folder in the settings.\n\nOpen the settings-page?",
@@ -53,7 +55,7 @@ private void ImportExportedCreaturesDefaultFolder()
private void ImportAllCreaturesInSelectedFolder(object sender, EventArgs e)
{
ShowExportedCreatureListControl();
- exportedCreatureList.chooseFolderAndImport();
+ _exportedCreatureList.chooseFolderAndImport();
}
private void btImportLastExported_Click(object sender, EventArgs e)
@@ -98,7 +100,7 @@ private void ExportedCreatureList_CopyValuesToExtractor(importExported.ExportedC
// add to library automatically if batch-extracting exportedImported values and uniqueLevels
if (addToLibraryIfUnique)
{
- if (extractor.uniqueResults)
+ if (_extractor.uniqueResults)
AddCreatureToCollection(true, exportedCreatureControl.creatureValues.motherArkId, exportedCreatureControl.creatureValues.fatherArkId, goToLibraryTab);
else
exportedCreatureControl.setStatus(importExported.ExportedCreatureControl.ImportStatus.NeedsLevelChosing, DateTime.Now);
@@ -132,51 +134,64 @@ private void ImportExportedAddIfPossible(string filePath)
{
bool alreadyExists = ExtractExportedFileInExtractor(filePath);
bool added = false;
- bool copyNameToClipboard = Properties.Settings.Default.applyNamePatternOnImportIfEmptyName
- && Properties.Settings.Default.copyNameToClipboardOnImportWhenAutoNameApplied;
+ bool copyNameToClipboard = Properties.Settings.Default.copyNameToClipboardOnImportWhenAutoNameApplied
+ && (Properties.Settings.Default.applyNamePatternOnImportIfEmptyName ||
+ (!alreadyExists && Properties.Settings.Default.applyNamePatternOnAutoImportForNewCreatures));
+ Species species = speciesSelector1.SelectedSpecies;
- if (extractor.uniqueResults
- || (alreadyExists && extractor.validResults))
+ if (_extractor.uniqueResults
+ || (alreadyExists && _extractor.validResults))
{
AddCreatureToCollection(true, goToLibraryTab: false);
- SetMessageLabelText($"Successful {(alreadyExists ? "updated" : "added")} creature of the exported file\n" + filePath);
+ SetMessageLabelText($"Successful {(alreadyExists ? "updated" : "added")} {creatureInfoInputExtractor.CreatureName} ({species.name}) of the exported file\n" + filePath, MessageBoxIcon.Information);
added = true;
}
- if (Properties.Settings.Default.PlaySoundOnAutoImport)
- {
- if (added)
- {
- Console.Beep(300, 50);
- Console.Beep(400, 100);
- }
- else
- {
- Console.Beep(300, 50);
- Console.Beep(200, 100);
- }
- }
+ bool topLevels = false;
+ bool newTopLevels = false;
// give feedback in overlay
- if (overlay != null)
+ string infoText;
+ Color textColor;
+ const int colorSaturation = 200;
+ if (added)
{
- string infoText;
- Color textColor;
- const int colorSaturation = 200;
- if (added)
- {
- infoText = $"Creature \"{creatureInfoInputExtractor.CreatureName}\" {(alreadyExists ? "updated in " : "added to")} the library."
- + (copyNameToClipboard ? "\nName copied to clipboard." : "");
- textColor = Color.FromArgb(colorSaturation, 255, colorSaturation);
- }
- else
+ var sb = new StringBuilder();
+ sb.AppendLine($"{species.name} \"{creatureInfoInputExtractor.CreatureName}\" {(alreadyExists ? "updated in " : "added to")} the library.");
+ if (copyNameToClipboard)
+ sb.AppendLine("Name copied to clipboard.");
+
+ for (int s = 0; s < values.Values.STATS_COUNT; s++)
{
- infoText = $"Creature \"{creatureInfoInputExtractor.CreatureName}\" couldn't be extracted uniquely, manual level selection is necessary.";
- textColor = Color.FromArgb(255, colorSaturation, colorSaturation);
+ int statIndex = values.Values.statsDisplayOrder[s];
+ if (!species.UsesStat(statIndex)) continue;
+
+ sb.Append($"{Utils.StatName(statIndex, true, species.IsGlowSpecies)}: {_statIOs[statIndex].LevelWild} ({_statIOs[statIndex].BreedingValue})");
+ if (_statIOs[statIndex].TopLevel == StatIOStatus.NewTopLevel)
+ {
+ sb.Append($" {Loc.S("newTopLevel")}");
+ newTopLevels = true;
+ }
+ else if (_statIOs[statIndex].TopLevel == StatIOStatus.TopLevel)
+ {
+ sb.Append($" {Loc.S("topLevel")}");
+ topLevels = true;
+ }
+ sb.AppendLine();
}
- overlay.SetInfoText(infoText, textColor);
+ infoText = sb.ToString();
+ textColor = Color.FromArgb(colorSaturation, 255, colorSaturation);
+ }
+ else
+ {
+ infoText = $"Creature \"{creatureInfoInputExtractor.CreatureName}\" couldn't be extracted uniquely, manual level selection is necessary.";
+ textColor = Color.FromArgb(255, colorSaturation, colorSaturation);
}
+
+ if (_overlay != null)
+ _overlay.SetInfoText(infoText, textColor);
+
if (added)
{
if (Properties.Settings.Default.MoveAutoImportedFileToSubFolder)
@@ -199,11 +214,28 @@ private void ImportExportedAddIfPossible(string filePath)
// extraction failed, user might expect the name of the new creature in the clipboard
Clipboard.SetText("Automatic extraction was not possible");
}
+
+ if (Properties.Settings.Default.PlaySoundOnAutoImport)
+ {
+ if (added)
+ {
+ if (newTopLevels)
+ Utils.BeepSignal(3);
+ else if (topLevels)
+ Utils.BeepSignal(2);
+ else
+ Utils.BeepSignal(1);
+ }
+ else
+ {
+ Utils.BeepSignal(0);
+ }
+ }
}
private void ExportedCreatureList_CheckGuidInLibrary(importExported.ExportedCreatureControl exportedCreatureControl)
{
- Creature cr = creatureCollection.creatures.SingleOrDefault(c => c.guid == exportedCreatureControl.creatureValues.guid);
+ Creature cr = _creatureCollection.creatures.SingleOrDefault(c => c.guid == exportedCreatureControl.creatureValues.guid);
if (cr != null && !cr.flags.HasFlag(CreatureFlags.Placeholder))
exportedCreatureControl.setStatus(importExported.ExportedCreatureControl.ImportStatus.OldImported, cr.addedToLibrary);
else
@@ -220,26 +252,26 @@ private void llOnlineHelpExtractionIssues_LinkClicked(object sender, LinkLabelLi
///
private void ShowExportedCreatureListControl()
{
- if (exportedCreatureList == null || exportedCreatureList.IsDisposed)
+ if (_exportedCreatureList == null || _exportedCreatureList.IsDisposed)
{
- exportedCreatureList = new importExported.ExportedCreatureList();
- exportedCreatureList.CopyValuesToExtractor += ExportedCreatureList_CopyValuesToExtractor;
- exportedCreatureList.CheckArkIdInLibrary += ExportedCreatureList_CheckGuidInLibrary;
- exportedCreatureList.Location = Properties.Settings.Default.importExportedLocation;
- exportedCreatureList.CheckForUnknownMods += ExportedCreatureList_CheckForUnknownMods;
+ _exportedCreatureList = new importExported.ExportedCreatureList();
+ _exportedCreatureList.CopyValuesToExtractor += ExportedCreatureList_CopyValuesToExtractor;
+ _exportedCreatureList.CheckArkIdInLibrary += ExportedCreatureList_CheckGuidInLibrary;
+ _exportedCreatureList.Location = Properties.Settings.Default.importExportedLocation;
+ _exportedCreatureList.CheckForUnknownMods += ExportedCreatureList_CheckForUnknownMods;
}
- exportedCreatureList.ownerSuffix = "";
- exportedCreatureList.Show();
- exportedCreatureList.BringToFront();
+ _exportedCreatureList.ownerSuffix = "";
+ _exportedCreatureList.Show();
+ _exportedCreatureList.BringToFront();
}
private void ExportedCreatureList_CheckForUnknownMods(List unknownSpeciesBlueprintPaths)
{
- CheckForMissingModFiles(creatureCollection, unknownSpeciesBlueprintPaths);
+ CheckForMissingModFiles(_creatureCollection, unknownSpeciesBlueprintPaths);
// if mods were added, try to import the creature values again
- if (creatureCollection.ModValueReloadNeeded
- && LoadModValuesOfCollection(creatureCollection, true, true))
- exportedCreatureList.LoadFilesInFolder();
+ if (_creatureCollection.ModValueReloadNeeded
+ && LoadModValuesOfCollection(_creatureCollection, true, true))
+ _exportedCreatureList.LoadFilesInFolder();
}
}
}
diff --git a/ARKBreedingStats/Form1.importSave.cs b/ARKBreedingStats/Form1.importSave.cs
index 8166fe71..2b2726f4 100644
--- a/ARKBreedingStats/Form1.importSave.cs
+++ b/ARKBreedingStats/Form1.importSave.cs
@@ -61,22 +61,22 @@ private async void RunSavegameImport(ATImportFileLocation atImportFileLocation)
File.Copy(atImportFileLocation.FileLocation, workingCopyfilename, true);
}
- await ImportSavegame.ImportCollectionFromSavegame(creatureCollection, workingCopyfilename, atImportFileLocation.ServerName);
+ await ImportSavegame.ImportCollectionFromSavegame(_creatureCollection, workingCopyfilename, atImportFileLocation.ServerName);
- UpdateParents(creatureCollection.creatures);
+ UpdateParents(_creatureCollection.creatures);
- foreach (var creature in creatureCollection.creatures)
+ foreach (var creature in _creatureCollection.creatures)
{
creature.RecalculateAncestorGenerations();
}
- UpdateIncubationParents(creatureCollection);
+ UpdateIncubationParents(_creatureCollection);
// update UI
SetCollectionChanged(true);
UpdateCreatureListings();
- if (creatureCollection.creatures.Any())
+ if (_creatureCollection.creatures.Any())
tabControlMain.SelectedTab = tabPageLibrary;
// reapply last sorting
@@ -85,8 +85,8 @@ private async void RunSavegameImport(ATImportFileLocation atImportFileLocation)
UpdateTempCreatureDropDown();
// if unknown mods are used in the savegame-file and the user wants to load the missing mod-files, do it
- if (creatureCollection.ModValueReloadNeeded
- && LoadModValuesOfCollection(creatureCollection, true, true))
+ if (_creatureCollection.ModValueReloadNeeded
+ && LoadModValuesOfCollection(_creatureCollection, true, true))
SetCollectionChanged(true);
}
catch (Exception ex)
diff --git a/ARKBreedingStats/Form1.l10n.cs b/ARKBreedingStats/Form1.l10n.cs
index 427677b4..db639215 100644
--- a/ARKBreedingStats/Form1.l10n.cs
+++ b/ARKBreedingStats/Form1.l10n.cs
@@ -44,14 +44,7 @@ private void setLocalizations(bool init = true)
Loc.ControlText(findDuplicatesToolStripMenuItem);
Loc.ControlText(copyCreatureToolStripMenuItem);
Loc.ControlText(pasteCreatureToolStripMenuItem);
- Loc.ControlText(viewToolStripMenuItem);
- Loc.ControlText(deadCreaturesToolStripMenuItem);
- Loc.ControlText(unavailableCreaturesToolStripMenuItem);
- Loc.ControlText(obeliskCreaturesToolStripMenuItem);
- Loc.ControlText(neuteredCreaturesToolStripMenuItem);
- Loc.ControlText(mutatedCreaturesToolStripMenuItem);
- Loc.ControlText(femalesToolStripMenuItem);
- Loc.ControlText(malesToolStripMenuItem);
+ Loc.ControlText(libraryFilterToolStripMenuItem);
Loc.ControlText(helpToolStripMenuItem);
Loc.ControlText(aboutToolStripMenuItem);
Loc.ControlText(onlinehelpToolStripMenuItem);
@@ -70,9 +63,9 @@ private void setLocalizations(bool init = true)
Loc.ControlText(copyToMultiplierTesterToolStripButton);
// top bar
- Loc.ControlText(cbGuessSpecies, tt);
- Loc.ControlText(btReadValuesFromArk, tt);
- Loc.ControlText(btImportLastExported, tt);
+ Loc.ControlText(cbGuessSpecies, _tt);
+ Loc.ControlText(btReadValuesFromArk, _tt);
+ Loc.ControlText(btImportLastExported, _tt);
Loc.ControlText(cbToggleOverlay);
// tester
@@ -89,9 +82,9 @@ private void setLocalizations(bool init = true)
Loc.ControlText(lbTestingInfo);
Loc.ControlText(gbStatChart, "statChart");
Loc.ControlText(lbCurrentCreature, "CurrentCreature");
- Loc.setToolTip(lbImprintedCount, tt);
- Loc.setToolTip(lbTesterDomLevel, "domLevelExplanation", tt);
- Loc.setToolTip(lbTesterWildLevel, "wildLevelExplanation", tt);
+ Loc.SetToolTip(lbImprintedCount, _tt);
+ Loc.SetToolTip(lbTesterDomLevel, "domLevelExplanation", _tt);
+ Loc.SetToolTip(lbTesterWildLevel, "wildLevelExplanation", _tt);
// extractor
Loc.ControlText(tabPageExtractor, "extractor");
@@ -101,26 +94,27 @@ private void setLocalizations(bool init = true)
Loc.ControlText(lbSum);
Loc.ControlText(lbShouldBe);
Loc.ControlText(lbImprintingFailInfo);
- Loc.ControlText(cbExactlyImprinting, tt);
+ Loc.ControlText(cbExactlyImprinting, _tt);
Loc.ControlText(btExtractLevels);
- Loc.ControlText(cbQuickWildCheck, tt);
+ Loc.ControlText(cbQuickWildCheck, _tt);
Loc.ControlText(rbWildExtractor, "wild");
Loc.ControlText(rbTamedExtractor, "tamed");
Loc.ControlText(rbBredExtractor, "bred");
- Loc.setToolTip(lbImprintingCuddleCountExtractor, tt);
- Loc.setToolTip(lbSumWild, tt);
- Loc.setToolTip(lbSumDom, tt);
- Loc.setToolTip(lbSumDomSB, tt);
- Loc.setToolTip(lbListening, tt);
- Loc.setToolTip(lbExtractorDomLevel, "domLevelExplanation", tt);
- Loc.setToolTip(lbExtractorWildLevel, "wildLevelExplanation", tt);
+ Loc.SetToolTip(lbImprintingCuddleCountExtractor, _tt);
+ Loc.SetToolTip(lbSumWild, _tt);
+ Loc.SetToolTip(lbSumDom, _tt);
+ Loc.SetToolTip(lbSumDomSB, _tt);
+ Loc.SetToolTip(lbListening, _tt);
+ Loc.SetToolTip(lbExtractorDomLevel, "domLevelExplanation", _tt);
+ Loc.SetToolTip(lbExtractorWildLevel, "wildLevelExplanation", _tt);
// library
Loc.ControlText(tabPageLibrary, "library");
- columnHeaderName.Text = Loc.s("Name");
- columnHeaderOwner.Text = Loc.s("Owner");
- columnHeaderNote.Text = Loc.s("Note");
- columnHeaderServer.Text = Loc.s("Server");
+ columnHeaderName.Text = Loc.S("Name");
+ columnHeaderOwner.Text = Loc.S("Owner");
+ columnHeaderTribe.Text = Loc.S("Tribe");
+ columnHeaderNote.Text = Loc.S("Note");
+ columnHeaderServer.Text = Loc.S("Server");
columnHeaderHP.Text = Utils.StatName(StatNames.Health, true);
columnHeaderSt.Text = Utils.StatName(StatNames.Stamina, true);
columnHeaderOx.Text = Utils.StatName(StatNames.Oxygen, true);
@@ -133,19 +127,19 @@ private void setLocalizations(bool init = true)
columnHeaderTemp.Text = Utils.StatName(StatNames.Temperature, true);
columnHeaderCr.Text = Utils.StatName(StatNames.Water, true);
columnHeaderFr.Text = Utils.StatName(StatNames.TemperatureFortitude, true);
- columnHeaderTopStatsNr.Text = Loc.s("Top");
- columnHeaderTopness.Text = Loc.s("topPercentage");
- columnHeaderGen.Text = Loc.s("Generation_Abb");
- columnHeaderLW.Text = Loc.s("LevelWild_Abb");
- columnHeaderMutations.Text = Loc.s("Mutations_Abb");
- columnHeaderAdded.Text = Loc.s("added");
- columnHeaderCooldown.Text = Loc.s("cooldownGrowing");
- columnHeaderColor0.Text = Loc.s("C0");
- columnHeaderColor1.Text = Loc.s("C1");
- columnHeaderColor2.Text = Loc.s("C2");
- columnHeaderColor3.Text = Loc.s("C3");
- columnHeaderColor4.Text = Loc.s("C4");
- columnHeaderColor5.Text = Loc.s("C5");
+ columnHeaderTopStatsNr.Text = Loc.S("Top");
+ columnHeaderTopness.Text = Loc.S("topPercentage");
+ columnHeaderGen.Text = Loc.S("Generation_Abb");
+ columnHeaderLW.Text = Loc.S("LevelWild_Abb");
+ columnHeaderMutations.Text = Loc.S("Mutations_Abb");
+ columnHeaderAdded.Text = Loc.S("added");
+ columnHeaderCooldown.Text = Loc.S("cooldownGrowing");
+ columnHeaderColor0.Text = Loc.S("C0");
+ columnHeaderColor1.Text = Loc.S("C1");
+ columnHeaderColor2.Text = Loc.S("C2");
+ columnHeaderColor3.Text = Loc.S("C3");
+ columnHeaderColor4.Text = Loc.S("C4");
+ columnHeaderColor5.Text = Loc.S("C5");
// other tabs
Loc.ControlText(tabPagePedigree, "pedigree");
diff --git a/ARKBreedingStats/Form1.library.cs b/ARKBreedingStats/Form1.library.cs
index ef4b096e..c7ababb3 100644
--- a/ARKBreedingStats/Form1.library.cs
+++ b/ARKBreedingStats/Form1.library.cs
@@ -5,7 +5,6 @@
using System;
using System.Collections.Generic;
-using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
@@ -34,8 +33,8 @@ private void AddCreatureToCollection(bool fromExtractor = true, long motherArkId
{
input = creatureInfoInputExtractor;
bred = rbBredExtractor.Checked;
- te = extractor.UniqueTE();
- imprinting = extractor.ImprintingBonus;
+ te = _extractor.UniqueTE();
+ imprinting = _extractor.ImprintingBonus;
}
else
{
@@ -45,7 +44,7 @@ private void AddCreatureToCollection(bool fromExtractor = true, long motherArkId
imprinting = (double)numericUpDownImprintingBonusTester.Value / 100;
}
- var levelStep = creatureCollection.getWildLevelStep();
+ var levelStep = _creatureCollection.getWildLevelStep();
Creature creature = new Creature(species, input.CreatureName, input.CreatureOwner, input.CreatureTribe, input.CreatureSex, GetCurrentWildLevels(fromExtractor), GetCurrentDomLevels(fromExtractor), te, bred, imprinting, levelStep: levelStep)
{
// set parents
@@ -64,7 +63,7 @@ private void AddCreatureToCollection(bool fromExtractor = true, long motherArkId
addedToLibrary = DateTime.Now,
mutationsMaternal = input.MutationCounterMother,
mutationsPaternal = input.MutationCounterFather,
- status = input.CreatureStatus,
+ Status = input.CreatureStatus,
colors = input.RegionColors
};
@@ -98,30 +97,30 @@ private void AddCreatureToCollection(bool fromExtractor = true, long motherArkId
creature.RecalculateCreatureValues(levelStep);
creature.RecalculateNewMutations();
- if (creatureCollection.DeletedCreatureGuids != null
- && creatureCollection.DeletedCreatureGuids.Contains(creature.guid))
- creatureCollection.DeletedCreatureGuids.RemoveAll(guid => guid == creature.guid);
+ if (_creatureCollection.DeletedCreatureGuids != null
+ && _creatureCollection.DeletedCreatureGuids.Contains(creature.guid))
+ _creatureCollection.DeletedCreatureGuids.RemoveAll(guid => guid == creature.guid);
- creatureCollection.MergeCreatureList(new List { creature });
+ _creatureCollection.MergeCreatureList(new List { creature });
// set status of exportedCreatureControl if available
- exportedCreatureControl?.setStatus(importExported.ExportedCreatureControl.ImportStatus.JustImported, DateTime.Now);
+ _exportedCreatureControl?.setStatus(importExported.ExportedCreatureControl.ImportStatus.JustImported, DateTime.Now);
// if creature already exists by guid, use the already existing creature object for the parent assignments
- creature = creatureCollection.creatures.SingleOrDefault(c => c.guid == creature.guid) ?? creature;
+ creature = _creatureCollection.creatures.SingleOrDefault(c => c.guid == creature.guid) ?? creature;
// if new creature is parent of existing creatures, update link
- var motherOf = creatureCollection.creatures.Where(c => c.motherGuid == creature.guid).ToList();
+ var motherOf = _creatureCollection.creatures.Where(c => c.motherGuid == creature.guid).ToList();
foreach (Creature c in motherOf)
c.Mother = creature;
- var fatherOf = creatureCollection.creatures.Where(c => c.fatherGuid == creature.guid).ToList();
+ var fatherOf = _creatureCollection.creatures.Where(c => c.fatherGuid == creature.guid).ToList();
foreach (Creature c in fatherOf)
c.Father = creature;
// if the new creature is the ancestor of any other creatures, update the generation count of all creatures
if (motherOf.Any() || fatherOf.Any())
{
- var creaturesOfSpecies = creatureCollection.creatures.Where(c => c.Species == c.Species).ToList();
+ var creaturesOfSpecies = _creatureCollection.creatures.Where(c => c.Species == c.Species).ToList();
foreach (var cr in creaturesOfSpecies) cr.generation = -1;
foreach (var cr in creaturesOfSpecies) cr.RecalculateAncestorGenerations();
}
@@ -134,11 +133,11 @@ private void AddCreatureToCollection(bool fromExtractor = true, long motherArkId
if (creature.Mother == null || creature.Father == null)
UpdateParents(new List { creature });
- UpdateCreatureListings(species);
+ UpdateCreatureListings(species, false);
// show only the added creatures' species
if (goToLibraryTab)
{
- listBoxSpeciesLib.SelectedIndex = listBoxSpeciesLib.Items.IndexOf(creature.Species);
+ listBoxSpeciesLib.SelectedItem = creature.Species;
tabControlMain.SelectedTab = tabPageLibrary;
}
@@ -171,9 +170,9 @@ private void DeleteSelectedCreatures()
if (species != ((Creature)i.Tag).Species)
onlyOneSpecies = false;
}
- creatureCollection.DeleteCreature((Creature)i.Tag);
+ _creatureCollection.DeleteCreature((Creature)i.Tag);
}
- creatureCollection.RemoveUnlinkedPlaceholders();
+ _creatureCollection.RemoveUnlinkedPlaceholders();
UpdateCreatureListings(onlyOneSpecies ? species : null);
SetCollectionChanged(true, onlyOneSpecies ? species : null);
}
@@ -194,13 +193,13 @@ private bool IsArkIdUniqueOrOnlyPlaceHolder(Creature creature)
{
bool arkIdIsUnique = true;
- if (creature.ArkId != 0 && creatureCollection.ArkIdAlreadyExist(creature.ArkId, creature, out Creature guidCreature))
+ if (creature.ArkId != 0 && _creatureCollection.ArkIdAlreadyExist(creature.ArkId, creature, out Creature guidCreature))
{
// if the creature is a placeholder replace the placeholder with the real creature
if (guidCreature.flags.HasFlag(CreatureFlags.Placeholder) && creature.sex == guidCreature.sex && creature.Species == guidCreature.Species)
{
// remove placeholder-creature from collection (is replaced by new creature)
- creatureCollection.creatures.Remove(guidCreature);
+ _creatureCollection.creatures.Remove(guidCreature);
}
else
{
@@ -228,7 +227,7 @@ private int[] GetCurrentWildLevels(bool fromExtractor = true)
int[] levelsWild = new int[Values.STATS_COUNT];
for (int s = 0; s < Values.STATS_COUNT; s++)
{
- levelsWild[s] = fromExtractor ? statIOs[s].LevelWild : testingIOs[s].LevelWild;
+ levelsWild[s] = fromExtractor ? _statIOs[s].LevelWild : _testingIOs[s].LevelWild;
}
return levelsWild;
}
@@ -243,7 +242,7 @@ private int[] GetCurrentDomLevels(bool fromExtractor = true)
int[] levelsDom = new int[Values.STATS_COUNT];
for (int s = 0; s < Values.STATS_COUNT; s++)
{
- levelsDom[s] = fromExtractor ? statIOs[s].LevelDom : testingIOs[s].LevelDom;
+ levelsDom[s] = fromExtractor ? _statIOs[s].LevelDom : _testingIOs[s].LevelDom;
}
return levelsDom;
}
@@ -254,31 +253,31 @@ private int[] GetCurrentDomLevels(bool fromExtractor = true)
private void InitializeCollection()
{
// set pointer to current collection
- pedigree1.creatures = creatureCollection.creatures;
- breedingPlan1.creatureCollection = creatureCollection;
- tribesControl1.Tribes = creatureCollection.tribes;
- tribesControl1.Players = creatureCollection.players;
- timerList1.CreatureCollection = creatureCollection;
- notesControl1.NoteList = creatureCollection.noteList;
- raisingControl1.creatureCollection = creatureCollection;
- statsMultiplierTesting1.CreatureCollection = creatureCollection;
-
- UpdateParents(creatureCollection.creatures);
- UpdateIncubationParents(creatureCollection);
+ pedigree1.creatures = _creatureCollection.creatures;
+ breedingPlan1.creatureCollection = _creatureCollection;
+ tribesControl1.Tribes = _creatureCollection.tribes;
+ tribesControl1.Players = _creatureCollection.players;
+ timerList1.CreatureCollection = _creatureCollection;
+ notesControl1.NoteList = _creatureCollection.noteList;
+ raisingControl1.creatureCollection = _creatureCollection;
+ statsMultiplierTesting1.CreatureCollection = _creatureCollection;
+
+ UpdateParents(_creatureCollection.creatures);
+ UpdateIncubationParents(_creatureCollection);
CreateCreatureTagList();
- if (creatureCollection.modIDs == null) creatureCollection.modIDs = new List();
+ if (_creatureCollection.modIDs == null) _creatureCollection.modIDs = new List();
pedigree1.Clear();
breedingPlan1.Clear();
// assign species objects to creatures
- foreach (var cr in creatureCollection.creatures)
+ foreach (var cr in _creatureCollection.creatures)
{
cr.Species = Values.V.SpeciesByBlueprint(cr.speciesBlueprint);
}
- foreach (var cv in creatureCollection.creaturesValues)
+ foreach (var cv in _creatureCollection.creaturesValues)
{
cv.Species = Values.V.SpeciesByBlueprint(cv.speciesBlueprint);
}
@@ -296,7 +295,7 @@ private void CalculateTopStats(List creatures)
toolStripProgressBar1.Maximum = Values.V.speciesNames.Count;
toolStripProgressBar1.Visible = true;
- List filteredCreatures = (creatureCollection.useFiltersInTopStatCalculation ? ApplyLibraryFilterSettings(creatures) : Enumerable.Empty()).ToList();
+ List filteredCreatures = (Properties.Settings.Default.useFiltersInTopStatCalculation ? ApplyLibraryFilterSettings(creatures) : Enumerable.Empty()).ToList();
foreach (Species species in Values.V.species)
{
toolStripProgressBar1.Value++;
@@ -309,7 +308,7 @@ private void CalculateTopStats(List creatures)
if (species.UsesStat(s))
{
usedStatIndices.Add(s);
- if (considerStatHighlight[s])
+ if (_considerStatHighlight[s])
usedAndConsideredStatIndices.Add(s);
}
}
@@ -329,7 +328,7 @@ private void CalculateTopStats(List creatures)
c.topBreedingStats = new bool[Values.STATS_COUNT];
c.topBreedingCreature = false;
- if (creatureCollection.useFiltersInTopStatCalculation)
+ if (Properties.Settings.Default.useFiltersInTopStatCalculation)
{
//if not in the filtered collection (using library filter settings), continue
if (!filteredCreatures.Contains(c))
@@ -338,9 +337,9 @@ private void CalculateTopStats(List creatures)
else
{
// only consider creature if it's available for breeding
- if (!(c.status == CreatureStatus.Available
- || c.status == CreatureStatus.Cryopod
- || c.status == CreatureStatus.Obelisk
+ if (!(c.Status == CreatureStatus.Available
+ || c.Status == CreatureStatus.Cryopod
+ || c.Status == CreatureStatus.Obelisk
))
continue;
}
@@ -367,13 +366,13 @@ private void CalculateTopStats(List creatures)
continue;
}
- if (!topLevels.ContainsKey(species))
+ if (!_topLevels.ContainsKey(species))
{
- topLevels.Add(species, bestStat);
+ _topLevels.Add(species, bestStat);
}
else
{
- topLevels[species] = bestStat;
+ _topLevels[species] = bestStat;
}
// beststat and bestcreatures now contain the best stats and creatures for each stat.
@@ -475,7 +474,7 @@ private void CalculateTopStats(List creatures)
}
}
foreach (Creature c in creatures)
- c.SetTopStatCount(considerStatHighlight);
+ c.SetTopStatCount(_considerStatHighlight);
}
toolStripProgressBar1.Visible = false;
}
@@ -494,7 +493,7 @@ private void UpdateParents(IEnumerable creatures)
{
Creature mother = null;
Creature father = null;
- foreach (Creature p in creatureCollection.creatures)
+ foreach (Creature p in _creatureCollection.creatures)
{
if (c.motherGuid != Guid.Empty && c.motherGuid == p.guid)
{
@@ -520,7 +519,7 @@ private void UpdateParents(IEnumerable creatures)
}
}
- creatureCollection.creatures.AddRange(placeholderAncestors);
+ _creatureCollection.creatures.AddRange(placeholderAncestors);
}
///
@@ -547,10 +546,10 @@ private Creature EnsurePlaceholderCreature(List placeholders, Creature
Guid creatureGuid = arkId != 0 ? Utils.ConvertArkIdToGuid(arkId) : guid;
var creature = new Creature(tmpl.Species, name, tmpl.owner, tmpl.tribe, sex, new[] { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
- levelStep: creatureCollection.getWildLevelStep())
+ levelStep: _creatureCollection.getWildLevelStep())
{
guid = creatureGuid,
- status = CreatureStatus.Unavailable,
+ Status = CreatureStatus.Unavailable,
flags = CreatureFlags.Placeholder,
ArkId = arkId,
ArkIdImported = Utils.IsArkIdImported(arkId, creatureGuid)
@@ -637,11 +636,11 @@ private void UpdateDisplayedCreatureValues(Creature cr, bool creatureStatusChang
selectedCreatures.Add((Creature)i.Tag);
// data of the selected creature changed, update listview
- cr.RecalculateCreatureValues(creatureCollection.getWildLevelStep());
- // if creaturestatus (available/dead) changed, recalculate topstats (dead creatures are not considered there)
+ cr.RecalculateCreatureValues(_creatureCollection.getWildLevelStep());
+ // if creatureStatus (available/dead) changed, recalculate topStats (dead creatures are not considered there)
if (creatureStatusChanged)
{
- CalculateTopStats(creatureCollection.creatures.Where(c => c.Species == cr.Species).ToList());
+ CalculateTopStats(_creatureCollection.creatures.Where(c => c.Species == cr.Species).ToList());
FilterLib();
UpdateStatusBar();
}
@@ -686,13 +685,26 @@ private void UpdateDisplayedCreatureValues(Creature cr, bool creatureStatusChang
}
}
+ ///
+ /// Returns the dateTime when the countdown of a creature is ready. Either the maturingTime, the matingCooldownTime or null if no countdown is set.
+ ///
+ ///
+ private DateTime? DisplayedCreatureCountdown(DateTime? matingCooldownUntil, DateTime? growingUntil)
+ {
+ var countdown = matingCooldownUntil.HasValue && growingUntil.HasValue
+ ? (matingCooldownUntil.Value > growingUntil.Value ? matingCooldownUntil.Value : growingUntil.Value)
+ : matingCooldownUntil ?? growingUntil;
+ if (countdown == null) return null;
+
+ return DateTime.Now.CompareTo(countdown) < 0 ? countdown : null;
+ }
+
private ListViewItem CreateCreatureLVItem(Creature cr, ListViewGroup g)
{
- double colorFactor = 100d / creatureCollection.maxChartLevel;
+ double colorFactor = 100d / _creatureCollection.maxChartLevel;
DateTime? cldGr = cr.cooldownUntil.HasValue && cr.growingUntil.HasValue ?
(cr.cooldownUntil.Value > cr.growingUntil.Value ? cr.cooldownUntil.Value : cr.growingUntil.Value)
- : cr.cooldownUntil ?? (cr.growingUntil ?? default(DateTime?));
- bool cld = cr.cooldownUntil > cr.growingUntil;
+ : cr.cooldownUntil ?? (cr.growingUntil);
string[] subItems = new[]
{
@@ -707,7 +719,7 @@ private ListViewItem CreateCreatureLVItem(Creature cr, ListViewGroup g)
cr.generation.ToString(),
cr.levelFound.ToString(),
cr.Mutations.ToString(),
- DateTime.Now.CompareTo(cldGr) < 0 ? cldGr.ToString() : "-"
+ DisplayedCreatureCountdown(cr.cooldownUntil,cr.growingUntil)?.ToString() ?? "-"
}
.Concat(cr.levelsWild.Select(x => x.ToString()).ToArray())
.ToArray();
@@ -720,17 +732,13 @@ private ListViewItem CreateCreatureLVItem(Creature cr, ListViewGroup g)
// add the species and status and tribe
subItems = subItems.Concat(new[] {
cr.Species.DescriptiveNameAndMod,
- cr.status.ToString(),
+ cr.Status.ToString(),
cr.tribe,
- Utils.StatusSymbol(cr.status, string.Empty)
+ Utils.StatusSymbol(cr.Status, string.Empty)
}).ToArray();
// check if we display group for species or not.
- ListViewItem lvi;
- if (checkBoxSpeciesGroups.Checked)
- lvi = new ListViewItem(subItems, g);
- else
- lvi = new ListViewItem(subItems);
+ ListViewItem lvi = Properties.Settings.Default.LibraryGroupBySpecies ? new ListViewItem(subItems, g) : new ListViewItem(subItems);
for (int s = 0; s < Values.STATS_COUNT; s++)
{
@@ -748,27 +756,27 @@ private ListViewItem CreateCreatureLVItem(Creature cr, ListViewGroup g)
}
else
lvi.SubItems[s + 12].BackColor = Utils.GetColorFromPercent((int)(cr.levelsWild[s] * (s == (int)StatNames.Torpidity ? colorFactor / 7 : colorFactor)), // TODO set factor to number of other stats (flyers have 6, Gacha has 8?)
- considerStatHighlight[s] ? cr.topBreedingStats[s] ? 0.2 : 0.7 : 0.93);
+ _considerStatHighlight[s] ? cr.topBreedingStats[s] ? 0.2 : 0.7 : 0.93);
}
lvi.SubItems[4].BackColor = cr.flags.HasFlag(CreatureFlags.Neutered) ? Color.FromArgb(220, 220, 220) :
cr.sex == Sex.Female ? Color.FromArgb(255, 230, 255) :
cr.sex == Sex.Male ? Color.FromArgb(220, 235, 255) : SystemColors.Window;
- if (cr.status == CreatureStatus.Dead)
+ if (cr.Status == CreatureStatus.Dead)
{
lvi.SubItems[0].ForeColor = SystemColors.GrayText;
lvi.BackColor = Color.FromArgb(255, 250, 240);
}
- else if (cr.status == CreatureStatus.Unavailable)
+ else if (cr.Status == CreatureStatus.Unavailable)
{
lvi.SubItems[0].ForeColor = SystemColors.GrayText;
}
- else if (cr.status == CreatureStatus.Obelisk)
+ else if (cr.Status == CreatureStatus.Obelisk)
{
lvi.SubItems[0].ForeColor = Color.DarkBlue;
}
- else if (creatureCollection.maxServerLevel > 0
- && cr.levelsWild[(int)StatNames.Torpidity] + 1 + creatureCollection.maxDomLevel > creatureCollection.maxServerLevel)
+ else if (_creatureCollection.maxServerLevel > 0
+ && cr.levelsWild[(int)StatNames.Torpidity] + 1 + _creatureCollection.maxDomLevel > _creatureCollection.maxServerLevel)
{
lvi.SubItems[0].ForeColor = Color.OrangeRed; // this creature may pass the max server level and could be deleted by the game
}
@@ -833,7 +841,7 @@ private ListViewItem CreateCreatureLVItem(Creature cr, ListViewGroup g)
{
if (cr.colors[cl] != 0)
{
- lvi.SubItems[24 + cl].BackColor = CreatureColors.creatureColor(cr.colors[cl]);
+ lvi.SubItems[24 + cl].BackColor = CreatureColors.CreatureColor(cr.colors[cl]);
lvi.SubItems[24 + cl].ForeColor = Utils.ForeColor(lvi.SubItems[24 + cl].BackColor);
}
else
@@ -900,14 +908,14 @@ private void listView_ColumnClick(object sender, ColumnClickEventArgs e)
// onlibrarychange
private async void listViewLibrary_SelectedIndexChanged(object sender, EventArgs e)
{
- cancelTokenLibrarySelection?.Cancel();
- using (cancelTokenLibrarySelection = new CancellationTokenSource())
+ _cancelTokenLibrarySelection?.Cancel();
+ using (_cancelTokenLibrarySelection = new CancellationTokenSource())
{
try
{
- reactOnSelectionChange = false;
- await Task.Delay(20, cancelTokenLibrarySelection.Token); // recalculate breedingplan at most a certain interval
- reactOnSelectionChange = true;
+ _reactOnCreatureSelectionChange = false;
+ await Task.Delay(20, _cancelTokenLibrarySelection.Token); // recalculate breedingplan at most a certain interval
+ _reactOnCreatureSelectionChange = true;
LibrarySelectedIndexChanged();
}
catch (TaskCanceledException)
@@ -915,7 +923,7 @@ private async void listViewLibrary_SelectedIndexChanged(object sender, EventArgs
return;
}
}
- cancelTokenLibrarySelection = null;
+ _cancelTokenLibrarySelection = null;
}
///
@@ -923,7 +931,7 @@ private async void listViewLibrary_SelectedIndexChanged(object sender, EventArgs
///
private void LibrarySelectedIndexChanged()
{
- if (!reactOnSelectionChange)
+ if (!_reactOnCreatureSelectionChange)
return;
int cnt = listViewLibrary.SelectedItems.Count;
@@ -935,7 +943,7 @@ private void LibrarySelectedIndexChanged()
creatureBoxListView.SetCreature(c);
if (tabControlLibFilter.SelectedTab == tabPageLibRadarChart)
radarChartLibrary.setLevels(c.levelsWild);
- pedigreeNeedsUpdate = true;
+ _pedigreeNeedsUpdate = true;
}
// display infos about the selected creatures
@@ -968,70 +976,12 @@ private void LibrarySelectedIndexChanged()
}
}
- ///
- /// Filter the displayed creatures for the library listview
- ///
- ///
- ///
- private void SetLibraryFilter(string param, bool show)
- {
- if (libraryViews.ContainsKey(param) && libraryViews[param] != show)
- {
- libraryViews[param] = show;
-
- switch (param)
- {
- case "Dead":
- creatureCollection.showFlags = show ? (creatureCollection.showFlags | CreatureFlags.Dead) : (creatureCollection.showFlags & ~CreatureFlags.Dead);
- checkBoxShowDead.Checked = show;
- deadCreaturesToolStripMenuItem.Checked = show;
- break;
- case "Unavailable":
- creatureCollection.showFlags = show ? (creatureCollection.showFlags | CreatureFlags.Unavailable) : (creatureCollection.showFlags & ~CreatureFlags.Unavailable);
- checkBoxShowUnavailableCreatures.Checked = show;
- unavailableCreaturesToolStripMenuItem.Checked = show;
- break;
- case "Neutered":
- creatureCollection.showFlags = show ? (creatureCollection.showFlags | CreatureFlags.Neutered) : (creatureCollection.showFlags & ~CreatureFlags.Neutered);
- checkBoxShowNeuteredCreatures.Checked = show;
- neuteredCreaturesToolStripMenuItem.Checked = show;
- break;
- case "Obelisk":
- creatureCollection.showFlags = show ? (creatureCollection.showFlags | CreatureFlags.Obelisk) : (creatureCollection.showFlags & ~CreatureFlags.Obelisk);
- checkBoxShowObeliskCreatures.Checked = show;
- obeliskCreaturesToolStripMenuItem.Checked = show;
- break;
- case "Cryopod":
- creatureCollection.showFlags = show ? (creatureCollection.showFlags | CreatureFlags.Cryopod) : (creatureCollection.showFlags & ~CreatureFlags.Cryopod);
- checkBoxShowCryopodCreatures.Checked = show;
- cryopodCreaturesToolStripMenuItem.Checked = show;
- break;
- case "Mutated":
- creatureCollection.showFlags = show ? (creatureCollection.showFlags | CreatureFlags.Mutated) : (creatureCollection.showFlags & ~CreatureFlags.Mutated);
- checkBoxShowMutatedCreatures.Checked = show;
- mutatedCreaturesToolStripMenuItem.Checked = show;
- break;
- case "Females":
- cbLibraryShowFemales.Checked = show;
- femalesToolStripMenuItem.Checked = show;
- break;
- case "Males":
- cbLibraryShowMales.Checked = show;
- malesToolStripMenuItem.Checked = show;
- break;
- }
-
- RecalculateTopStatsIfNeeded();
- FilterLib();
- }
- }
-
///
/// Call this list to set the listview for the library to the current filters
///
private void FilterLib()
{
- if (!filterListAllowed)
+ if (!_filterListAllowed)
return;
// save selected creatures to re-select them after the filtering
@@ -1039,14 +989,13 @@ private void FilterLib()
foreach (ListViewItem i in listViewLibrary.SelectedItems)
selectedCreatures.Add((Creature)i.Tag);
- var filteredList = from creature in creatureCollection.creatures
+ var filteredList = from creature in _creatureCollection.creatures
where !creature.flags.HasFlag(CreatureFlags.Placeholder)
select creature;
// if only one species should be shown adjust statnames if the selected species is a glow-species
bool chargeStatsHeaders = false;
- if (listBoxSpeciesLib.SelectedIndex > 0
- && listBoxSpeciesLib.SelectedItem is Species selectedSpecies)
+ if (listBoxSpeciesLib.SelectedItem is Species selectedSpecies)
{
filteredList = filteredList.Where(c => c.Species == selectedSpecies);
if (selectedSpecies.IsGlowSpecies)
@@ -1071,10 +1020,10 @@ private void FilterLib()
{
if (selectedCreatures.Contains((Creature)listViewLibrary.Items[i].Tag))
{
- listViewLibrary.Items[i].Focused = true;
listViewLibrary.Items[i].Selected = true;
if (--selectedCount == 0)
{
+ listViewLibrary.Items[i].Focused = true;
listViewLibrary.EnsureVisible(i);
break;
}
@@ -1091,47 +1040,47 @@ private IEnumerable ApplyLibraryFilterSettings(IEnumerable c
if (creatures == null)
return Enumerable.Empty();
- // if only certain owner's creatures should be shown
- bool hideWOOwner = creatureCollection.hiddenOwners.Contains("n/a");
- creatures = creatures.Where(c => !creatureCollection.hiddenOwners.Contains(c.owner) && (!hideWOOwner || !string.IsNullOrEmpty(c.owner)));
-
- // server filter
- bool hideWOServer = creatureCollection.hiddenServers.Contains("n/a");
- creatures = creatures.Where(c => !creatureCollection.hiddenServers.Contains(c.server) && (!hideWOServer || !string.IsNullOrEmpty(c.server)));
-
- // tags filter
- bool dontShowWOTags = creatureCollection.dontShowTags.Contains("n/a");
- creatures = creatures.Where(c => !dontShowWOTags && c.tags.Count == 0 || c.tags.Except(creatureCollection.dontShowTags).Any());
-
- // show also dead creatures?
- if (!libraryViews["Dead"])
- creatures = creatures.Where(c => c.status != CreatureStatus.Dead);
+ if (Properties.Settings.Default.FilterHideOwners?.Any() ?? false)
+ creatures = creatures.Where(c => !Properties.Settings.Default.FilterHideOwners.Contains(c.owner));
- // show also unavailable creatures?
- if (!libraryViews["Unavailable"])
- creatures = creatures.Where(c => c.status != CreatureStatus.Unavailable);
+ if (Properties.Settings.Default.FilterHideTribes?.Any() ?? false)
+ creatures = creatures.Where(c => !Properties.Settings.Default.FilterHideTribes.Contains(c.tribe));
- // show also in obelisks uploaded creatures?
- if (!libraryViews["Obelisk"])
- creatures = creatures.Where(c => c.status != CreatureStatus.Obelisk);
+ if (Properties.Settings.Default.FilterHideServers?.Any() ?? false)
+ creatures = creatures.Where(c => !Properties.Settings.Default.FilterHideServers.Contains(c.server));
- // show also creatures in cryopods?
- if (!libraryViews["Cryopod"])
- creatures = creatures.Where(c => c.status != CreatureStatus.Cryopod);
+ if (Properties.Settings.Default.FilterOnlyIfColorId != 0)
+ creatures = creatures.Where(c => c.colors.Contains(Properties.Settings.Default.FilterOnlyIfColorId));
- // show also neutered creatures?
- if (!libraryViews["Neutered"])
- creatures = creatures.Where(c => !c.flags.HasFlag(CreatureFlags.Neutered));
+ // tags filter
+ if (Properties.Settings.Default.FilterHideTags?.Any() ?? false)
+ {
+ bool hideCreaturesWOTags = Properties.Settings.Default.FilterHideTags.Contains(string.Empty);
+ creatures = creatures.Where(c =>
+ !hideCreaturesWOTags && c.tags.Count == 0 ||
+ c.tags.Except(Properties.Settings.Default.FilterHideTags).Any());
+ }
- // show also creatures with mutations?
- if (!libraryViews["Mutated"])
- creatures = creatures.Where(c => c.Mutations <= 0);
+ // hide creatures with the set hide flags
+ if (Properties.Settings.Default.FilterFlagsExclude != 0)
+ {
+ creatures = creatures.Where(c => ((int)c.flags & Properties.Settings.Default.FilterFlagsExclude) == 0);
+ }
+ if (Properties.Settings.Default.FilterFlagsAllNeeded != 0)
+ {
+ creatures = creatures.Where(c => ((int)c.flags & Properties.Settings.Default.FilterFlagsAllNeeded) == Properties.Settings.Default.FilterFlagsAllNeeded);
+ }
+ if (Properties.Settings.Default.FilterFlagsOneNeeded != 0)
+ {
+ int flagsOneNeeded = Properties.Settings.Default.FilterFlagsOneNeeded |
+ Properties.Settings.Default.FilterFlagsAllNeeded;
+ creatures = creatures.Where(c => ((int)c.flags & flagsOneNeeded) != 0);
+ }
- // show also different sexes?
- if (!libraryViews["Females"])
- creatures = creatures.Where(c => c.sex != Sex.Female);
- if (!libraryViews["Males"])
- creatures = creatures.Where(c => c.sex != Sex.Male);
+ if (!string.IsNullOrEmpty(Properties.Settings.Default.FilterByName))
+ {
+ creatures = creatures.Where(c => c.name.Contains(Properties.Settings.Default.FilterByName));
+ }
return creatures;
}
@@ -1160,12 +1109,12 @@ private void listViewLibrary_KeyUp(object sender, KeyEventArgs e)
else if (e.KeyCode == Keys.A && e.Control)
{
// select all list-entries
- reactOnSelectionChange = false;
+ _reactOnCreatureSelectionChange = false;
listViewLibrary.BeginUpdate();
foreach (ListViewItem i in listViewLibrary.Items)
i.Selected = true;
listViewLibrary.EndUpdate();
- reactOnSelectionChange = true;
+ _reactOnCreatureSelectionChange = true;
listViewLibrary_SelectedIndexChanged(null, null);
}
else if (e.KeyCode == Keys.G && e.Control)
@@ -1246,7 +1195,7 @@ private void ExportAsTextToClipboard(Creature c, bool breeding = true, bool ARKm
{
if (c != null)
{
- double colorFactor = 100d / creatureCollection.maxChartLevel;
+ double colorFactor = 100d / _creatureCollection.maxChartLevel;
bool wild = c.tamingEff == -2;
string modifierText = string.Empty;
if (!breeding)
@@ -1303,11 +1252,11 @@ private void ShowMultiSetter()
using (MultiSetter ms = new MultiSetter(selectedCreatures,
parents,
- creatureCollection.tags,
+ _creatureCollection.tags,
Values.V.species,
- creatureCollection.ownerList,
- creatureCollection.tribes.Select(t => t.TribeName).ToArray(),
- creatureCollection.serverList))
+ _creatureCollection.ownerList,
+ _creatureCollection.tribes.Select(t => t.TribeName).ToArray(),
+ _creatureCollection.serverList))
{
if (ms.ShowDialog() == DialogResult.OK)
{
@@ -1316,7 +1265,7 @@ private void ShowMultiSetter()
if (ms.TagsChanged)
CreateCreatureTagList();
if (ms.SpeciesChanged)
- UpdateSpeciesLists(creatureCollection.creatures);
+ UpdateSpeciesLists(_creatureCollection.creatures);
UpdateOwnerServerTagLists();
SetCollectionChanged(true, !multipleSpecies ? sp : null);
RecalculateTopStatsIfNeeded();
diff --git a/ARKBreedingStats/Form1.tester.cs b/ARKBreedingStats/Form1.tester.cs
index 495eb37d..2af24796 100644
--- a/ARKBreedingStats/Form1.tester.cs
+++ b/ARKBreedingStats/Form1.tester.cs
@@ -49,19 +49,19 @@ private void EditCreatureInTester(Creature c, bool virtualCreature = false)
else
rbWildTester.Checked = true;
- hiddenLevelsCreatureTester = c.levelsWild[(int)StatNames.Torpidity];
+ _hiddenLevelsCreatureTester = c.levelsWild[(int)StatNames.Torpidity];
for (int s = 0; s < Values.STATS_COUNT; s++)
{
if (s != (int)StatNames.Torpidity && c.levelsWild[s] > 0)
- hiddenLevelsCreatureTester -= c.levelsWild[s];
+ _hiddenLevelsCreatureTester -= c.levelsWild[s];
}
for (int s = 0; s < Values.STATS_COUNT; s++)
{
if (s == (int)StatNames.Torpidity)
continue;
- testingIOs[s].LevelWild = c.levelsWild[s];
- testingIOs[s].LevelDom = c.levelsDom[s];
+ _testingIOs[s].LevelWild = c.levelsWild[s];
+ _testingIOs[s].LevelDom = c.levelsDom[s];
}
tabControlMain.SelectedTab = tabPageStatTesting;
SetTesterInfoInputCreature(c, virtualCreature);
@@ -69,22 +69,22 @@ private void EditCreatureInTester(Creature c, bool virtualCreature = false)
private void UpdateAllTesterValues()
{
- updateTorporInTester = false;
+ _updateTorporInTester = false;
for (int s = 0; s < Values.STATS_COUNT; s++)
{
if (s == (int)StatNames.Torpidity)
continue;
if (s == Values.STATS_COUNT - 2) // update torpor after last stat-update
- updateTorporInTester = true;
- testingStatIOsRecalculateValue(testingIOs[s]);
+ _updateTorporInTester = true;
+ testingStatIOsRecalculateValue(_testingIOs[s]);
}
- testingStatIOsRecalculateValue(testingIOs[(int)StatNames.Torpidity]);
+ testingStatIOsRecalculateValue(_testingIOs[(int)StatNames.Torpidity]);
}
private void setTesterInputsTamed(bool tamed)
{
for (int s = 0; s < Values.STATS_COUNT; s++)
- testingIOs[s].postTame = tamed;
+ _testingIOs[s].postTame = tamed;
lbNotYetTamed.Visible = !tamed;
}
@@ -97,36 +97,36 @@ private void testingStatIOValueUpdate(StatIO sIo)
testingStatIOsRecalculateValue(sIo);
// update Torpor-level if changed value is not from torpor-StatIO
- if (updateTorporInTester && sIo.statIndex != (int)StatNames.Torpidity)
+ if (_updateTorporInTester && sIo.statIndex != (int)StatNames.Torpidity)
{
int torporLvl = 0;
for (int s = 0; s < Values.STATS_COUNT; s++)
{
if (s != (int)StatNames.Torpidity)
- torporLvl += testingIOs[s].LevelWild > 0 ? testingIOs[s].LevelWild : 0;
+ torporLvl += _testingIOs[s].LevelWild > 0 ? _testingIOs[s].LevelWild : 0;
}
- testingIOs[(int)StatNames.Torpidity].LevelWild = torporLvl + hiddenLevelsCreatureTester;
+ _testingIOs[(int)StatNames.Torpidity].LevelWild = torporLvl + _hiddenLevelsCreatureTester;
}
int domLevels = 0;
for (int s = 0; s < Values.STATS_COUNT; s++)
{
- domLevels += testingIOs[s].LevelDom;
+ domLevels += _testingIOs[s].LevelDom;
}
- labelDomLevelSum.Text = $"Dom Levels: {domLevels}/{creatureCollection.maxDomLevel}";
- labelDomLevelSum.BackColor = domLevels > creatureCollection.maxDomLevel ? Color.LightSalmon : Color.Transparent;
- labelTesterTotalLevel.Text = $"Total Levels: {testingIOs[(int)StatNames.Torpidity].LevelWild + domLevels + 1}/{testingIOs[(int)StatNames.Torpidity].LevelWild + 1 + creatureCollection.maxDomLevel}";
+ labelDomLevelSum.Text = $"Dom Levels: {domLevels}/{_creatureCollection.maxDomLevel}";
+ labelDomLevelSum.BackColor = domLevels > _creatureCollection.maxDomLevel ? Color.LightSalmon : Color.Transparent;
+ labelTesterTotalLevel.Text = $"Total Levels: {_testingIOs[(int)StatNames.Torpidity].LevelWild + domLevels + 1}/{_testingIOs[(int)StatNames.Torpidity].LevelWild + 1 + _creatureCollection.maxDomLevel}";
creatureInfoInputTester.parentListValid = false;
- int[] levelsWild = testingIOs.Select(s => s.LevelWild).ToArray();
- if (!testingIOs[2].Enabled)
+ int[] levelsWild = _testingIOs.Select(s => s.LevelWild).ToArray();
+ if (!_testingIOs[2].Enabled)
levelsWild[2] = 0;
radarChart1.setLevels(levelsWild);
statPotentials1.SetLevels(levelsWild, false);
//statGraphs1.setGraph(sE, 0, testingIOs[0].LevelWild, testingIOs[0].LevelDom, !radioButtonTesterWild.Checked, (double)NumericUpDownTestingTE.Value / 100, (double)numericUpDownImprintingBonusTester.Value / 100);
if (sIo.statIndex == (int)StatNames.Torpidity)
- lbWildLevelTester.Text = "PreTame Level: " + Math.Ceiling(Math.Round((testingIOs[(int)StatNames.Torpidity].LevelWild + 1) / (1 + NumericUpDownTestingTE.Value / 200), 6));
+ lbWildLevelTester.Text = "PreTame Level: " + Math.Ceiling(Math.Round((_testingIOs[(int)StatNames.Torpidity].LevelWild + 1) / (1 + NumericUpDownTestingTE.Value / 200), 6));
}
private void testingStatIOsRecalculateValue(StatIO sIo)
@@ -145,16 +145,16 @@ private void creatureInfoInputTester_Add2Library_Clicked(CreatureInfoInput sende
private void creatureInfoInputTester_Save2Library_Clicked(CreatureInfoInput sender)
{
- if (creatureTesterEdit == null)
+ if (_creatureTesterEdit == null)
return;
// check if wild levels are changed, if yes warn that the creature can become invalid
- bool wildChanged = Math.Abs(creatureTesterEdit.tamingEff - (double)NumericUpDownTestingTE.Value / 100) > .0005;
+ bool wildChanged = Math.Abs(_creatureTesterEdit.tamingEff - (double)NumericUpDownTestingTE.Value / 100) > .0005;
if (!wildChanged)
{
int[] wildLevels = GetCurrentWildLevels(false);
for (int s = 0; s < Values.STATS_COUNT; s++)
{
- if (wildLevels[s] != creatureTesterEdit.levelsWild[s])
+ if (wildLevels[s] != _creatureTesterEdit.levelsWild[s])
{
wildChanged = true;
break;
@@ -174,47 +174,47 @@ private void creatureInfoInputTester_Save2Library_Clicked(CreatureInfoInput send
// Ids: ArkId and Guid
//if (!IsArkIdUniqueOrOnlyPlaceHolder(creatureTesterEdit)) { return; }
- bool statusChanged = creatureTesterEdit.status != creatureInfoInputTester.CreatureStatus
- || creatureTesterEdit.owner != creatureInfoInputTester.CreatureOwner
- || creatureTesterEdit.mutationsMaternal != creatureInfoInputTester.MutationCounterMother
- || creatureTesterEdit.mutationsPaternal != creatureInfoInputTester.MutationCounterFather;
- bool parentsChanged = creatureTesterEdit.Mother != creatureInfoInputTester.Mother || creatureTesterEdit.Father != creatureInfoInputTester.Father;
- creatureTesterEdit.levelsWild = GetCurrentWildLevels(false);
- creatureTesterEdit.levelsDom = GetCurrentDomLevels(false);
- creatureTesterEdit.tamingEff = (double)NumericUpDownTestingTE.Value / 100;
- creatureTesterEdit.isBred = rbBredTester.Checked;
- creatureTesterEdit.imprintingBonus = (double)numericUpDownImprintingBonusTester.Value / 100;
+ bool statusChanged = _creatureTesterEdit.Status != creatureInfoInputTester.CreatureStatus
+ || _creatureTesterEdit.owner != creatureInfoInputTester.CreatureOwner
+ || _creatureTesterEdit.mutationsMaternal != creatureInfoInputTester.MutationCounterMother
+ || _creatureTesterEdit.mutationsPaternal != creatureInfoInputTester.MutationCounterFather;
+ bool parentsChanged = _creatureTesterEdit.Mother != creatureInfoInputTester.Mother || _creatureTesterEdit.Father != creatureInfoInputTester.Father;
+ _creatureTesterEdit.levelsWild = GetCurrentWildLevels(false);
+ _creatureTesterEdit.levelsDom = GetCurrentDomLevels(false);
+ _creatureTesterEdit.tamingEff = (double)NumericUpDownTestingTE.Value / 100;
+ _creatureTesterEdit.isBred = rbBredTester.Checked;
+ _creatureTesterEdit.imprintingBonus = (double)numericUpDownImprintingBonusTester.Value / 100;
- creatureTesterEdit.name = creatureInfoInputTester.CreatureName;
- creatureTesterEdit.sex = creatureInfoInputTester.CreatureSex;
- creatureTesterEdit.owner = creatureInfoInputTester.CreatureOwner;
- creatureTesterEdit.tribe = creatureInfoInputTester.CreatureTribe;
- creatureTesterEdit.server = creatureInfoInputTester.CreatureServer;
- creatureTesterEdit.Mother = creatureInfoInputTester.Mother;
- creatureTesterEdit.Father = creatureInfoInputTester.Father;
- creatureTesterEdit.note = creatureInfoInputTester.CreatureNote;
- creatureTesterEdit.status = creatureInfoInputTester.CreatureStatus;
- creatureTesterEdit.cooldownUntil = creatureInfoInputTester.CooldownUntil;
- creatureTesterEdit.growingUntil = creatureInfoInputTester.GrowingUntil;
- creatureTesterEdit.domesticatedAt = creatureInfoInputTester.DomesticatedAt;
- creatureTesterEdit.flags = creatureInfoInputTester.CreatureFlags;
- creatureTesterEdit.mutationsMaternal = creatureInfoInputTester.MutationCounterMother;
- creatureTesterEdit.mutationsPaternal = creatureInfoInputTester.MutationCounterFather;
- creatureTesterEdit.colors = creatureInfoInputTester.RegionColors;
- creatureTesterEdit.ArkId = creatureInfoInputTester.ArkId;
+ _creatureTesterEdit.name = creatureInfoInputTester.CreatureName;
+ _creatureTesterEdit.sex = creatureInfoInputTester.CreatureSex;
+ _creatureTesterEdit.owner = creatureInfoInputTester.CreatureOwner;
+ _creatureTesterEdit.tribe = creatureInfoInputTester.CreatureTribe;
+ _creatureTesterEdit.server = creatureInfoInputTester.CreatureServer;
+ _creatureTesterEdit.Mother = creatureInfoInputTester.Mother;
+ _creatureTesterEdit.Father = creatureInfoInputTester.Father;
+ _creatureTesterEdit.note = creatureInfoInputTester.CreatureNote;
+ _creatureTesterEdit.Status = creatureInfoInputTester.CreatureStatus;
+ _creatureTesterEdit.cooldownUntil = creatureInfoInputTester.CooldownUntil;
+ _creatureTesterEdit.growingUntil = creatureInfoInputTester.GrowingUntil;
+ _creatureTesterEdit.domesticatedAt = creatureInfoInputTester.DomesticatedAt;
+ _creatureTesterEdit.flags = creatureInfoInputTester.CreatureFlags;
+ _creatureTesterEdit.mutationsMaternal = creatureInfoInputTester.MutationCounterMother;
+ _creatureTesterEdit.mutationsPaternal = creatureInfoInputTester.MutationCounterFather;
+ _creatureTesterEdit.colors = creatureInfoInputTester.RegionColors;
+ _creatureTesterEdit.ArkId = creatureInfoInputTester.ArkId;
if (wildChanged)
- CalculateTopStats(creatureCollection.creatures.Where(c => c.Species == creatureTesterEdit.Species).ToList());
- UpdateDisplayedCreatureValues(creatureTesterEdit, statusChanged, true);
+ CalculateTopStats(_creatureCollection.creatures.Where(c => c.Species == _creatureTesterEdit.Species).ToList());
+ UpdateDisplayedCreatureValues(_creatureTesterEdit, statusChanged, true);
if (parentsChanged)
- creatureTesterEdit.RecalculateAncestorGenerations();
+ _creatureTesterEdit.RecalculateAncestorGenerations();
// if maturation was changed, update raising-timers
- if (creatureTesterEdit.growingUntil != creatureInfoInputTester.GrowingUntil)
+ if (_creatureTesterEdit.growingUntil != creatureInfoInputTester.GrowingUntil)
{
raisingControl1.RecreateList();
- creatureTesterEdit.StartStopMatureTimer(true);
+ _creatureTesterEdit.StartStopMatureTimer(true);
}
SetTesterInfoInputCreature();
@@ -242,7 +242,7 @@ private void SetTesterInfoInputCreature(Creature c = null, bool virtualCreature
creatureInfoInputTester.CreatureOwner = c.owner;
creatureInfoInputTester.CreatureTribe = c.tribe;
creatureInfoInputTester.CreatureServer = c.server;
- creatureInfoInputTester.CreatureStatus = c.status;
+ creatureInfoInputTester.CreatureStatus = c.Status;
creatureInfoInputTester.CreatureNote = c.note;
creatureInfoInputTester.CooldownUntil = c.cooldownUntil;
creatureInfoInputTester.GrowingUntil = c.growingUntil;
@@ -278,7 +278,7 @@ private void SetTesterInfoInputCreature(Creature c = null, bool virtualCreature
creatureInfoInputTester.MutationCounterMother = 0;
creatureInfoInputTester.parentListValid = false;
}
- creatureTesterEdit = c;
+ _creatureTesterEdit = c;
}
private void SetCreatureValuesToExtractor(Creature c, bool onlyWild = false)
@@ -291,7 +291,7 @@ private void SetCreatureValuesToExtractor(Creature c, bool onlyWild = false)
ClearAll();
// copy values over to extractor
for (int s = 0; s < Values.STATS_COUNT; s++)
- statIOs[s].Input = onlyWild ? StatValueCalculation.CalculateValue(species, s, c.levelsWild[s], 0, true, c.tamingEff, c.imprintingBonus) : c.valuesDom[s];
+ _statIOs[s].Input = onlyWild ? StatValueCalculation.CalculateValue(species, s, c.levelsWild[s], 0, true, c.tamingEff, c.imprintingBonus) : c.valuesDom[s];
speciesSelector1.SetSpecies(species);
if (c.isBred)
diff --git a/ARKBreedingStats/Form1.values.cs b/ARKBreedingStats/Form1.values.cs
index 7503d772..24877e8e 100644
--- a/ARKBreedingStats/Form1.values.cs
+++ b/ARKBreedingStats/Form1.values.cs
@@ -19,6 +19,14 @@ namespace ARKBreedingStats
public partial class Form1
{
+ ///
+ /// Loads the mod value files for the creatureCollection. If a file is not available locally, it's tried to download it.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
private bool LoadModValueFiles(List modValueFileNames, bool showResult, bool applySettings, out List mods)
{
if (modValueFileNames == null) throw new ArgumentNullException();
@@ -37,7 +45,7 @@ private bool LoadModValueFiles(List modValueFileNames, bool showResult,
speciesSelector1.SetSpeciesLists(Values.V.species, Values.V.aliases);
}
- creatureCollection.ModList = mods;
+ _creatureCollection.ModList = mods;
UpdateStatusBar();
return modFilesLoaded;
}
@@ -98,8 +106,8 @@ private static bool CheckAvailabilityAndUpdateModFiles(List modValueFile
if (modValueFilesWithAvailableUpdate.Any()
&& MessageBox.Show("For " + modValueFilesWithAvailableUpdate.Count.ToString() + " value files there is an update available. It is strongly recommended to use the updated versions.\n"
+ "The updated files can be downloaded automatically if you want.\n"
- + "The following files can be downloaded\n\n- "
- + string.Join("\n- ", modValueFilesWithAvailableUpdate)
+ + "The following files can be downloaded\n\n"
+ + string.Join("\n", modValueFilesWithAvailableUpdate)
+ "\n\nDo you want to download these files?",
"Updates for value files available", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)
== DialogResult.Yes)
@@ -110,8 +118,8 @@ private static bool CheckAvailabilityAndUpdateModFiles(List modValueFile
if (missingModValueFilesOnlineAvailable.Any()
&& MessageBox.Show(missingModValueFilesOnlineAvailable.Count.ToString() + " mod-value files are not available locally. Without these files the library will not display all creatures.\n"
+ "The missing files can be downloaded automatically if you want.\n"
- + "The following files can be downloaded\n\n- "
- + string.Join("\n- ", missingModValueFilesOnlineAvailable)
+ + "The following files can be downloaded\n\n"
+ + string.Join("\n", missingModValueFilesOnlineAvailable)
+ "\n\nDo you want to download these files?",
"Missing value files", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)
== DialogResult.Yes)
@@ -122,36 +130,55 @@ private static bool CheckAvailabilityAndUpdateModFiles(List modValueFile
if (missingModValueFilesOnlineNotAvailable.Any())
{
MessageBox.Show(missingModValueFilesOnlineNotAvailable.Count.ToString() + " mod-value files are neither available locally nor online. The creatures of the missing mod will not be displayed.\n"
- + "The following files are missing\n\n- "
- + string.Join("\n- ", missingModValueFilesOnlineNotAvailable),
+ + "The following files are missing\n\n"
+ + string.Join("\n", missingModValueFilesOnlineNotAvailable),
"Missing value files", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
return filesDownloaded;
}
- private async static Task LoadModsManifestAsync(Values values, bool forceUpdate = false)
+ private static async Task LoadModsManifestAsync(Values values, bool forceUpdate = false)
{
- bool success = false;
ModsManifest modsManifest = null;
try
{
- modsManifest = await ModsManifest.TryLoadModManifestFile(forceUpdate);
- success = true;
+ try
+ {
+ modsManifest = await ModsManifest.TryLoadModManifestFile(forceUpdate);
+ // assume all officially supported mods are online available
+ foreach (var m in modsManifest.modsByFiles) m.Value.onlineAvailable = true;
+ }
+ catch (FileNotFoundException)
+ {
+ MessageBox.Show(
+ $"Mods manifest file {Path.Combine(FileService.ValuesFolder, FileService.ModsManifest)} not found " +
+ "and downloading it failed. You can try it later or try to update your application.",
+ "File not found", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return false;
+ }
+ catch (FormatException)
+ {
+ FormatExceptionMessageBox(Path.Combine(FileService.ValuesFolder, FileService.ModsManifest));
+ return false;
+ }
+
+ // load custom manifest file for manually created mod value files
+ if (ModsManifest.TryLoadCustomModManifestFile(out var customModsManifest))
+ {
+ modsManifest = ModsManifest.MergeModsManifest(modsManifest, customModsManifest);
+ }
}
- catch (FileNotFoundException)
+ catch (SerializationException serEx)
{
- MessageBox.Show($"Mods manifest file {Path.Combine(FileService.ValuesFolder, FileService.ModsManifest)} not found " +
- "and downloading it failed. You can try it later or try to update your application.",
- "File not found", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- catch (FormatException)
- {
- FormatExceptionMessageBox(Path.Combine(FileService.ValuesFolder, FileService.ModsManifest));
+ MessageBox.Show(
+ $"Serialization exception while trying to load the mods-manifest file.\n\n{serEx.Message}",
+ "ASB file load error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
+ modsManifest?.Initialize();
values.SetModsManifest(modsManifest);
- return success;
+ return true;
}
private static void LoadServerMultiplierPresets(Values values)
diff --git a/ARKBreedingStats/ImportSavegame.cs b/ARKBreedingStats/ImportSavegame.cs
index 6b908ba5..4ffb9ac7 100644
--- a/ARKBreedingStats/ImportSavegame.cs
+++ b/ARKBreedingStats/ImportSavegame.cs
@@ -119,9 +119,9 @@ private static void ImportCollection(CreatureCollection creatureCollection, List
if (creatureCollection.changeCreatureStatusOnSavegameImport)
{
// mark creatures that are no longer present as unavailable
- var removedCreatures = creatureCollection.creatures.Where(c => c.status == CreatureStatus.Available && c.server == serverName).Except(newCreatures);
+ var removedCreatures = creatureCollection.creatures.Where(c => c.Status == CreatureStatus.Available && c.server == serverName).Except(newCreatures);
foreach (var c in removedCreatures)
- c.status = CreatureStatus.Unavailable;
+ c.Status = CreatureStatus.Unavailable;
}
newCreatures.ForEach(creature =>
@@ -226,11 +226,11 @@ private Creature ConvertGameObject(GameObject creatureObject, int? levelStep)
bool isDead = creatureObject.GetPropertyValue("bIsDead");
if (isDead)
{
- creature.status = CreatureStatus.Dead; // dead is always dead
+ creature.Status = CreatureStatus.Dead; // dead is always dead
}
if (creatureObject.IsCryo)
- creature.status = CreatureStatus.Cryopod;
+ creature.Status = CreatureStatus.Cryopod;
creature.RecalculateCreatureValues(levelStep);
diff --git a/ARKBreedingStats/Loc.cs b/ARKBreedingStats/Loc.cs
index ebc25987..9764574d 100644
--- a/ARKBreedingStats/Loc.cs
+++ b/ARKBreedingStats/Loc.cs
@@ -20,53 +20,69 @@ public static void LoadResourceFile()
rm = new ResourceManager("ARKBreedingStats.local.strings", typeof(Form1).Assembly);
}
- public static string s(string key, bool returnKeyIfValueNA = true)
+ ///
+ /// Returns the localized string.
+ ///
+ public static string S(string key, bool returnKeyIfValueNA = true)
{
- if (rm == null) return string.Empty;
+ if (rm == null) return null;
string s = rm.GetString(key);
- //if (string.IsNullOrEmpty(s)) System.Console.WriteLine("missing: " + key);
- //return string.IsNullOrEmpty(s) ? "MISSING" : s;
- return s ?? (returnKeyIfValueNA && key != null ? key : string.Empty);
+ //if (string.IsNullOrEmpty(s) && !key.EndsWith("TT")) System.Console.WriteLine("missing: " + key); // TODO debug
+ return s ?? (returnKeyIfValueNA ? key : null);
}
- public static void ControlText(Control c) => c.Text = s(c.Name);
- public static void ControlText(Control c, string key) => c.Text = s(key);
+ public static void ControlText(Control c) => c.Text = S(c.Name);
+ public static void ControlText(Control c, string key) => c.Text = S(key);
+
+ ///
+ /// Sets the Text property of the control to the localized string, using the control.Name as key.
+ /// If there is a key with an appended TT, a tooltip is set.
+ ///
public static void ControlText(Control c, ToolTip tt)
{
- c.Text = s(c.Name);
- tt.SetToolTip(c, s(c.Name + "TT", false));
+ c.Text = S(c.Name);
+ tt.SetToolTip(c, S(c.Name + "TT", false));
}
- public static void setToolTip(Control c, ToolTip tt)
+
+ ///
+ /// Sets the tooltip of the control using the localization key of the control name with TT appended.
+ ///
+ public static void SetToolTip(Control c, ToolTip tt)
{
- tt.SetToolTip(c, s(c.Name + "TT", false));
+ tt.SetToolTip(c, S(c.Name + "TT", false));
}
- public static void setToolTip(Control c, string key, ToolTip tt)
+
+ ///
+ /// Sets the tooltip of the control using the custom key.
+ ///
+ public static void SetToolTip(Control c, string key, ToolTip tt)
{
- tt.SetToolTip(c, s(key));
+ tt.SetToolTip(c, S(key));
}
+
///
- /// sets the Text of the control according to the key. Sets the tooltip according to the controlName
+ /// Sets the Text of the control according to the key. Sets the tooltip according to the controlName
///
///
///
///
public static void ControlText(Control c, string key, ToolTip tt)
{
- c.Text = s(key);
- tt.SetToolTip(c, s(c.Name + "TT", false));
+ c.Text = S(key);
+ tt.SetToolTip(c, S(c.Name + "TT", false));
}
public static void ControlText(ToolStripMenuItem i)
{
- i.Text = s(i.Name);
- string tt = s(i.Name + "TT", false);
+ i.Text = S(i.Name);
+ string tt = S(i.Name + "TT", false);
if (!string.IsNullOrEmpty(tt))
i.ToolTipText = tt;
}
public static void ControlText(ToolStripButton i)
{
- i.Text = s(i.Name);
- string tt = s(i.Name + "TT", false);
+ i.Text = S(i.Name);
+ string tt = S(i.Name + "TT", false);
if (!string.IsNullOrEmpty(tt))
i.ToolTipText = tt;
}
diff --git a/ARKBreedingStats/NotesControl.cs b/ARKBreedingStats/NotesControl.cs
index 4e8d9899..8644a879 100644
--- a/ARKBreedingStats/NotesControl.cs
+++ b/ARKBreedingStats/NotesControl.cs
@@ -10,7 +10,7 @@ public partial class NotesControl : UserControl
{
private List noteList;
private Note selectedNote;
- public event Form1.collectionChangedEventHandler changed;
+ public event Form1.CollectionChangedEventHandler changed;
public NotesControl()
{
diff --git a/ARKBreedingStats/Pedigree.cs b/ARKBreedingStats/Pedigree.cs
index e549d565..ccdfeb4b 100644
--- a/ARKBreedingStats/Pedigree.cs
+++ b/ARKBreedingStats/Pedigree.cs
@@ -76,7 +76,7 @@ private void DrawLines(Graphics g)
g.DrawLine(myPen, line[0], line[1], line[2], line[3]);
}
if (children.Any())
- g.DrawString(Loc.s("Descendants"), new Font("Arial", 14), new SolidBrush(Color.Black), 210, 170);
+ g.DrawString(Loc.S("Descendants"), new Font("Arial", 14), new SolidBrush(Color.Black), 210, 170);
}
}
@@ -162,7 +162,7 @@ private void CreatePedigree()
row++;
}
- pictureBox.Image = CreatureColored.getColoredCreature(creature.colors, creature.Species, enabledColorRegions, 256);
+ pictureBox.Image = CreatureColored.GetColoredCreature(creature.colors, creature.Species, enabledColorRegions, 256, creatureSex: creature.sex);
Invalidate();
ResumeLayout();
diff --git a/ARKBreedingStats/PedigreeCreature.cs b/ARKBreedingStats/PedigreeCreature.cs
index ed9c8c97..422d37c2 100644
--- a/ARKBreedingStats/PedigreeCreature.cs
+++ b/ARKBreedingStats/PedigreeCreature.cs
@@ -117,24 +117,24 @@ public Creature Creature
if (!OnlyLevels)
{
- if (creature.status == CreatureStatus.Dead)
+ if (creature.Status == CreatureStatus.Dead)
{
groupBox1.ForeColor = SystemColors.GrayText;
tt.SetToolTip(groupBox1, "Creature has passed away");
}
- else if (creature.status == CreatureStatus.Unavailable)
+ else if (creature.Status == CreatureStatus.Unavailable)
{
groupBox1.ForeColor = SystemColors.GrayText;
tt.SetToolTip(groupBox1, "Creature is currently not available");
}
- else if (creature.status == CreatureStatus.Obelisk)
+ else if (creature.Status == CreatureStatus.Obelisk)
{
groupBox1.ForeColor = SystemColors.GrayText;
tt.SetToolTip(groupBox1, "Creature is currently uploaded in an obelisk");
}
}
- tt.SetToolTip(labelSex, "Sex: " + Loc.s(creature.sex.ToString()));
+ tt.SetToolTip(labelSex, "Sex: " + Loc.S(creature.sex.ToString()));
bool isGlowSpecies = creature.Species?.IsGlowSpecies ?? false;
for (int s = 0; s < displayedStatsCount; s++)
{
@@ -173,7 +173,7 @@ public Creature Creature
labelSex.Text = Utils.SexSymbol(creature.sex);
labelSex.BackColor = creature.flags.HasFlag(CreatureFlags.Neutered) ? SystemColors.GrayText : Utils.SexColor(creature.sex);
// creature Colors
- pictureBox1.Image = CreatureColored.getColoredCreature(creature.colors, null, enabledColorRegions, 24, 22, true);
+ pictureBox1.Image = CreatureColored.GetColoredCreature(creature.colors, null, enabledColorRegions, 24, 22, true);
tt.SetToolTip(pictureBox1, CreatureColored.RegionColorInfo(creature.Species, creature.colors));
labelSex.Visible = true;
pictureBox1.Visible = true;
@@ -203,7 +203,7 @@ public Creature Creature
private void SetTitle()
{
string totalLevel = creature.LevelHatched > 0 ? creature.LevelHatched.ToString() : "?";
- groupBox1.Text = (!OnlyLevels && creature.status != CreatureStatus.Available ? "(" + Utils.StatusSymbol(creature.status) + ") " : string.Empty)
+ groupBox1.Text = (!OnlyLevels && creature.Status != CreatureStatus.Available ? "(" + Utils.StatusSymbol(creature.Status) + ") " : string.Empty)
+ creature.name + " (" + totalLevel + (TotalLevelUnknown ? "+" : string.Empty) + ")";
if (creature.growingUntil > DateTime.Now)
diff --git a/ARKBreedingStats/Properties/AssemblyInfo.cs b/ARKBreedingStats/Properties/AssemblyInfo.cs
index 45c53209..f87a2829 100644
--- a/ARKBreedingStats/Properties/AssemblyInfo.cs
+++ b/ARKBreedingStats/Properties/AssemblyInfo.cs
@@ -30,6 +30,6 @@
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("0.39.6.1")]
+[assembly: AssemblyFileVersion("0.40.0.0")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/ARKBreedingStats/Properties/Settings.Designer.cs b/ARKBreedingStats/Properties/Settings.Designer.cs
index 497aa145..b964b783 100644
--- a/ARKBreedingStats/Properties/Settings.Designer.cs
+++ b/ARKBreedingStats/Properties/Settings.Designer.cs
@@ -12,7 +12,7 @@ namespace ARKBreedingStats.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.6.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -49,25 +49,13 @@ public int consideredStats {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("1400, 1000")]
- public global::System.Drawing.Size formSize {
+ [global::System.Configuration.DefaultSettingValueAttribute("100, 100, 1400, 1000")]
+ public global::System.Drawing.Rectangle MainWindowRect {
get {
- return ((global::System.Drawing.Size)(this["formSize"]));
+ return ((global::System.Drawing.Rectangle)(this["MainWindowRect"]));
}
set {
- this["formSize"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("100, 100")]
- public global::System.Drawing.Point formLocation {
- get {
- return ((global::System.Drawing.Point)(this["formLocation"]));
- }
- set {
- this["formLocation"] = value;
+ this["MainWindowRect"] = value;
}
}
@@ -202,12 +190,12 @@ public string[] lastSpecies {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool oxygenForAll {
+ public bool DisplayHiddenStats {
get {
- return ((bool)(this["oxygenForAll"]));
+ return ((bool)(this["DisplayHiddenStats"]));
}
set {
- this["oxygenForAll"] = value;
+ this["DisplayHiddenStats"] = value;
}
}
@@ -1151,5 +1139,193 @@ public bool AdminConsoleCommandWithCheat {
this["AdminConsoleCommandWithCheat"] = value;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("0")]
+ public int FilterFlagsExclude {
+ get {
+ return ((int)(this["FilterFlagsExclude"]));
+ }
+ set {
+ this["FilterFlagsExclude"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ public string[] FilterHideOwners {
+ get {
+ return ((string[])(this["FilterHideOwners"]));
+ }
+ set {
+ this["FilterHideOwners"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ public string[] FilterHideTribes {
+ get {
+ return ((string[])(this["FilterHideTribes"]));
+ }
+ set {
+ this["FilterHideTribes"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ public string[] FilterHideServers {
+ get {
+ return ((string[])(this["FilterHideServers"]));
+ }
+ set {
+ this["FilterHideServers"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ public string[] FilterHideTags {
+ get {
+ return ((string[])(this["FilterHideTags"]));
+ }
+ set {
+ this["FilterHideTags"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ public bool useFiltersInTopStatCalculation {
+ get {
+ return ((bool)(this["useFiltersInTopStatCalculation"]));
+ }
+ set {
+ this["useFiltersInTopStatCalculation"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("0")]
+ public int FilterOnlyIfColorId {
+ get {
+ return ((int)(this["FilterOnlyIfColorId"]));
+ }
+ set {
+ this["FilterOnlyIfColorId"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("True")]
+ public bool LibraryGroupBySpecies {
+ get {
+ return ((bool)(this["LibraryGroupBySpecies"]));
+ }
+ set {
+ this["LibraryGroupBySpecies"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("50, 50, 800, 600")]
+ public global::System.Drawing.Rectangle LibraryFilterWindowRect {
+ get {
+ return ((global::System.Drawing.Rectangle)(this["LibraryFilterWindowRect"]));
+ }
+ set {
+ this["LibraryFilterWindowRect"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("0")]
+ public int FilterFlagsAllNeeded {
+ get {
+ return ((int)(this["FilterFlagsAllNeeded"]));
+ }
+ set {
+ this["FilterFlagsAllNeeded"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("0")]
+ public int FilterFlagsOneNeeded {
+ get {
+ return ((int)(this["FilterFlagsOneNeeded"]));
+ }
+ set {
+ this["FilterFlagsOneNeeded"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("")]
+ public string FilterByName {
+ get {
+ return ((string)(this["FilterByName"]));
+ }
+ set {
+ this["FilterByName"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("50, 50, 800, 600")]
+ public global::System.Drawing.Rectangle ModManagerWindowRect {
+ get {
+ return ((global::System.Drawing.Rectangle)(this["ModManagerWindowRect"]));
+ }
+ set {
+ this["ModManagerWindowRect"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("20")]
+ public int SpeciesSelectorCountLastSpecies {
+ get {
+ return ((int)(this["SpeciesSelectorCountLastSpecies"]));
+ }
+ set {
+ this["SpeciesSelectorCountLastSpecies"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ public bool applyNamePatternOnAutoImportForNewCreatures {
+ get {
+ return ((bool)(this["applyNamePatternOnAutoImportForNewCreatures"]));
+ }
+ set {
+ this["applyNamePatternOnAutoImportForNewCreatures"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ public bool AskedToDownloadImageFiles {
+ get {
+ return ((bool)(this["AskedToDownloadImageFiles"]));
+ }
+ set {
+ this["AskedToDownloadImageFiles"] = value;
+ }
+ }
}
}
diff --git a/ARKBreedingStats/Properties/Settings.settings b/ARKBreedingStats/Properties/Settings.settings
index 05829ae9..a4b20087 100644
--- a/ARKBreedingStats/Properties/Settings.settings
+++ b/ARKBreedingStats/Properties/Settings.settings
@@ -8,11 +8,8 @@
387
-
- 1400, 1000
-
-
- 100, 100
+
+ 100, 100, 1400, 1000
@@ -47,7 +44,7 @@
-
+
False
@@ -287,5 +284,53 @@
False
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ False
+
+
+ 0
+
+
+ True
+
+
+ 50, 50, 800, 600
+
+
+ 0
+
+
+ 0
+
+
+
+
+
+ 50, 50, 800, 600
+
+
+ 20
+
+
+ False
+
+
+ False
+
\ No newline at end of file
diff --git a/ARKBreedingStats/Settings.cs b/ARKBreedingStats/Settings.cs
new file mode 100644
index 00000000..1748686a
--- /dev/null
+++ b/ARKBreedingStats/Settings.cs
@@ -0,0 +1,28 @@
+namespace ARKBreedingStats.Properties {
+
+
+ // This class allows you to handle specific events on the settings class:
+ // The SettingChanging event is raised before a setting's value is changed.
+ // The PropertyChanged event is raised after a setting's value is changed.
+ // The SettingsLoaded event is raised after the setting values are loaded.
+ // The SettingsSaving event is raised before the setting values are saved.
+ internal sealed partial class Settings {
+
+ public Settings() {
+ // // To add event handlers for saving and changing settings, uncomment the lines below:
+ //
+ // this.SettingChanging += this.SettingChangingEventHandler;
+ //
+ // this.SettingsSaving += this.SettingsSavingEventHandler;
+ //
+ }
+
+ private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
+ // Add code to handle the SettingChangingEvent event here.
+ }
+
+ private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
+ // Add code to handle the SettingsSaving event here.
+ }
+ }
+}
diff --git a/ARKBreedingStats/SpeciesSelector.cs b/ARKBreedingStats/SpeciesSelector.cs
index fbd3ebbb..a048282a 100644
--- a/ARKBreedingStats/SpeciesSelector.cs
+++ b/ARKBreedingStats/SpeciesSelector.cs
@@ -13,25 +13,31 @@ namespace ARKBreedingStats
{
public partial class SpeciesSelector : UserControl
{
- public delegate void speciesChangedEventHandler(bool speciesChanged = true);
+ ///
+ /// Is invoked if a species was selected. The parameter is true if the species was changed.
+ ///
+ public event Action OnSpeciesSelected;
- public event speciesChangedEventHandler onSpeciesChanged;
///
/// The currently selected species
///
public Species SelectedSpecies { get; private set; }
+
///
/// Items for the species list.
///
private List entryList;
- public TabPage lastTabPage;
+
+ ///
+ /// The TextBox control for the species searching which is outside of this control.
+ ///
private uiControls.TextBoxSuggest textbox;
+
///
/// List of species-blueprintpaths last used by the user
///
private List lastSpeciesBPs;
private readonly List iconIndices;
- public readonly int keepNrLastSpecies;
private CancellationTokenSource cancelSource;
public SpeciesSelector()
@@ -39,7 +45,6 @@ public SpeciesSelector()
InitializeComponent();
lastSpeciesBPs = new List();
iconIndices = new List();
- keepNrLastSpecies = 20;
SplitterDistance = Properties.Settings.Default.SpeciesSelectorVerticalSplitterDistance;
// imageList
@@ -217,13 +222,13 @@ public void SetSpecies(Species species)
|| SelectedSpecies == species) return;
lastSpeciesBPs.Remove(species.blueprintPath);
- if (lastSpeciesBPs.Count > keepNrLastSpecies) // only keep keepNrLastSpecies of the last species in this list
- lastSpeciesBPs.RemoveRange(keepNrLastSpecies, lastSpeciesBPs.Count - keepNrLastSpecies);
lastSpeciesBPs.Insert(0, species.blueprintPath);
+ if (lastSpeciesBPs.Count > Properties.Settings.Default.SpeciesSelectorCountLastSpecies) // only keep keepNrLastSpecies of the last species in this list
+ lastSpeciesBPs.RemoveRange(Properties.Settings.Default.SpeciesSelectorCountLastSpecies, lastSpeciesBPs.Count - Properties.Settings.Default.SpeciesSelectorCountLastSpecies);
UpdateLastSpecies();
SelectedSpecies = species;
- onSpeciesChanged?.Invoke();
+ OnSpeciesSelected?.Invoke(true);
}
public void SetTextBox(uiControls.TextBoxSuggest textbox)
@@ -285,7 +290,7 @@ public Image SpeciesImage(string speciesName = "")
private void btCancel_Click(object sender, EventArgs e)
{
- onSpeciesChanged?.Invoke(false);
+ OnSpeciesSelected?.Invoke(false);
}
private void cbDisplayUntameable_CheckedChanged(object sender, EventArgs e)
diff --git a/ARKBreedingStats/StatIO.cs b/ARKBreedingStats/StatIO.cs
index 5ac8be46..c4d0fab5 100644
--- a/ARKBreedingStats/StatIO.cs
+++ b/ARKBreedingStats/StatIO.cs
@@ -12,11 +12,11 @@ public partial class StatIO : UserControl
private string statName;
private double breedingValue;
private StatIOInputType inputType;
- public event Form1.LevelChangedEventHandler LevelChanged;
- public event Form1.InputValueChangedEventHandler InputValueChanged;
+ public event Action LevelChanged;
+ public event Action InputValueChanged;
public int statIndex;
private bool domZeroFixed;
- ToolTip tt = new ToolTip();
+ private readonly ToolTip _tt;
public int barMaxLevel = 45;
public StatIO()
@@ -31,8 +31,8 @@ public StatIO()
groupBox1.Click += groupBox1_Click;
InputType = inputType;
// ToolTips
- tt.InitialDelay = 300;
- tt.SetToolTip(checkBoxFixDomZero, "Check to lock to zero (if you never leveled up this stat)");
+ _tt = new ToolTip { InitialDelay = 300 };
+ _tt.SetToolTip(checkBoxFixDomZero, "Check to lock to zero (if you never leveled up this stat)");
}
public double Input
@@ -43,7 +43,7 @@ public double Input
if (value < 0)
{
numericUpDownInput.Value = 0;
- labelFinalValue.Text = "unknown";
+ labelFinalValue.Text = Loc.S("Unknown");
}
else
{
@@ -103,7 +103,7 @@ public double BreedingValue
}
else
{
- labelBValue.Text = "unknown";
+ labelBValue.Text = Loc.S("Unknown");
}
}
}
@@ -150,7 +150,7 @@ public StatIOStatus Status
case StatIOStatus.Neutral:
BackColor = Color.Transparent; //SystemColors.Control;
break;
- case StatIOStatus.Nonunique:
+ case StatIOStatus.NonUnique:
BackColor = Color.FromArgb(255, 255, 127);
break;
case StatIOStatus.Error:
@@ -161,20 +161,27 @@ public StatIOStatus Status
}
}
+ private StatIOStatus _topLevel;
public StatIOStatus TopLevel
{
+ get => _topLevel;
set
{
- switch (value)
+ _topLevel = value;
+ switch (_topLevel)
{
case StatIOStatus.TopLevel:
labelWildLevel.BackColor = Color.LightGreen;
+ _tt.SetToolTip(labelWildLevel, Loc.S("topLevel"));
break;
case StatIOStatus.NewTopLevel:
labelWildLevel.BackColor = Color.Gold;
+ _tt.SetToolTip(labelWildLevel, Loc.S("newTopLevel"));
break;
default:
labelWildLevel.BackColor = Color.Transparent;
+ _tt.SetToolTip(labelWildLevel, null);
+ _topLevel = StatIOStatus.Neutral;
break;
}
}
@@ -237,7 +244,7 @@ private void numLvW_ValueChanged(object sender, EventArgs e)
}
panelBarWildLevels.Width = lengthPercentage * 283 / 100;
panelBarWildLevels.BackColor = Utils.GetColorFromPercent(lengthPercentage);
- tt.SetToolTip(panelBarWildLevels, Utils.LevelPercentile((int)numLvW.Value));
+ _tt.SetToolTip(panelBarWildLevels, Utils.LevelPercentile((int)numLvW.Value));
if (inputType != StatIOInputType.FinalValueInputType)
LevelChanged(this);
@@ -321,7 +328,7 @@ public enum StatIOStatus
{
Neutral,
Unique,
- Nonunique,
+ NonUnique,
Error,
///
/// wild level is equal to the current top-level
diff --git a/ARKBreedingStats/Taming.cs b/ARKBreedingStats/Taming.cs
index 8b93534e..0b587d5e 100644
--- a/ARKBreedingStats/Taming.cs
+++ b/ARKBreedingStats/Taming.cs
@@ -275,24 +275,24 @@ public static string KnockoutInfo(Species species, int level, double longneck, d
// shocking tranq dart: 26*17 = 442
// electric prod: 226
- koNumbers = (harpoon > 0 ? Math.Ceiling(totalTorpor / (306 * boneDamageAdjuster * harpoon)) + " × " + Loc.s("TranqSpearBolts") + "\n" : string.Empty)
- + (longneck > 0 ? Math.Ceiling(totalTorpor / (442 * boneDamageAdjuster * longneck)) + " × " + Loc.s("ShockingTranqDarts") + "\n" : string.Empty)
- + (longneck > 0 ? Math.Ceiling(totalTorpor / (221 * boneDamageAdjuster * longneck)) + " × " + Loc.s("TranqDarts") + "\n" : string.Empty)
- + (prod > 0 ? Math.Ceiling(totalTorpor / (226 * boneDamageAdjuster * prod)) + " × " + Loc.s("ElectricProdHits") + "\n" : string.Empty)
- + (crossbow > 0 ? Math.Ceiling(totalTorpor / (157.5 * boneDamageAdjuster * crossbow)) + " × " + Loc.s("TranqArrowsCrossBow") + "\n" : string.Empty)
- + (bow > 0 ? Math.Ceiling(totalTorpor / (90 * boneDamageAdjuster * bow)) + " × " + Loc.s("TranqArrowsBow") + "\n" : string.Empty)
- + (slingshot > 0 ? Math.Ceiling(totalTorpor / (24.5 * boneDamageAdjuster * slingshot)) + " × " + Loc.s("SlingshotHits") + "\n" : string.Empty)
- + (club > 0 ? Math.Ceiling(totalTorpor / (10 * boneDamageAdjuster * club)) + " × " + Loc.s("WoodenClubHits") + "\n" : string.Empty);
+ koNumbers = (harpoon > 0 ? Math.Ceiling(totalTorpor / (306 * boneDamageAdjuster * harpoon)) + " × " + Loc.S("TranqSpearBolts") + "\n" : string.Empty)
+ + (longneck > 0 ? Math.Ceiling(totalTorpor / (442 * boneDamageAdjuster * longneck)) + " × " + Loc.S("ShockingTranqDarts") + "\n" : string.Empty)
+ + (longneck > 0 ? Math.Ceiling(totalTorpor / (221 * boneDamageAdjuster * longneck)) + " × " + Loc.S("TranqDarts") + "\n" : string.Empty)
+ + (prod > 0 ? Math.Ceiling(totalTorpor / (226 * boneDamageAdjuster * prod)) + " × " + Loc.S("ElectricProdHits") + "\n" : string.Empty)
+ + (crossbow > 0 ? Math.Ceiling(totalTorpor / (157.5 * boneDamageAdjuster * crossbow)) + " × " + Loc.S("TranqArrowsCrossBow") + "\n" : string.Empty)
+ + (bow > 0 ? Math.Ceiling(totalTorpor / (90 * boneDamageAdjuster * bow)) + " × " + Loc.S("TranqArrowsBow") + "\n" : string.Empty)
+ + (slingshot > 0 ? Math.Ceiling(totalTorpor / (24.5 * boneDamageAdjuster * slingshot)) + " × " + Loc.S("SlingshotHits") + "\n" : string.Empty)
+ + (club > 0 ? Math.Ceiling(totalTorpor / (10 * boneDamageAdjuster * club)) + " × " + Loc.S("WoodenClubHits") + "\n" : string.Empty);
// torpor depletion per s
string torporDepletion = string.Empty;
if (torporDeplPS > 0)
- torporDepletion = "\n" + Loc.s("TimeUntilTorporDepleted") + ": " + Utils.DurationUntil(new TimeSpan(0, 0, (int)Math.Round(totalTorpor / torporDeplPS)))
- + "\n" + Loc.s("TorporDepletion") + ": " + Math.Round(torporDeplPS, 2)
- + " / s;\n" + Loc.s("ApproxOneNarcoberryEvery") + " " + Math.Round(7.5 / torporDeplPS + 3, 1)
- + " s " + Loc.s("OrOneAscerbicMushroom") + " " + Math.Round(25 / torporDeplPS + 3, 1)
- + " s " + Loc.s("OrOneNarcoticEvery") + " " + Math.Round(40 / torporDeplPS + 8, 1)
- + " s " + Loc.s("OrOneBioToxinEvery") + " " + Math.Round(80 / torporDeplPS + 16, 1) + " s";
+ torporDepletion = "\n" + Loc.S("TimeUntilTorporDepleted") + ": " + Utils.DurationUntil(new TimeSpan(0, 0, (int)Math.Round(totalTorpor / torporDeplPS)))
+ + "\n" + Loc.S("TorporDepletion") + ": " + Math.Round(torporDeplPS, 2)
+ + " / s;\n" + Loc.S("ApproxOneNarcoberryEvery") + " " + Math.Round(7.5 / torporDeplPS + 3, 1)
+ + " s " + Loc.S("OrOneAscerbicMushroom") + " " + Math.Round(25 / torporDeplPS + 3, 1)
+ + " s " + Loc.S("OrOneNarcoticEvery") + " " + Math.Round(40 / torporDeplPS + 8, 1)
+ + " s " + Loc.S("OrOneBioToxinEvery") + " " + Math.Round(80 / torporDeplPS + 16, 1) + " s";
return warning + koNumbers + torporDepletion;
}
@@ -305,11 +305,11 @@ public static string QuickInfoOneFood(Species species, int level, double tamingS
TamingTimes(species, level, tamingSpeedMultiplier, tamingFoodRateMultiplier, foodName, foodAmount,
out List foodAmountUsed, out TimeSpan duration, out _, out _, out int narcotics, out _, out double te,
out double hunger, out int bonusLevel, out _);
- return $"{string.Format(Loc.s("WithXFoodTamingTakesTime"), foodAmountUsed[0], foodDisplayName, Utils.DurationUntil(duration))}\n" +
- $"{Loc.s("Narcotics")}: {narcotics}\n" +
- $"{Loc.s("TamingEffectiveness_Abb")}: {Math.Round(100 * te, 1)} %\n" +
- $"{Loc.s("BonusLevel")}: +{(level + bonusLevel)}\n" +
- $"{string.Format(Loc.s("FoodHasToDropUnits"), Math.Round(hunger, 1))}";
+ return $"{string.Format(Loc.S("WithXFoodTamingTakesTime"), foodAmountUsed[0], foodDisplayName, Utils.DurationUntil(duration))}\n" +
+ $"{Loc.S("Narcotics")}: {narcotics}\n" +
+ $"{Loc.S("TamingEffectiveness_Abb")}: {Math.Round(100 * te, 1)} %\n" +
+ $"{Loc.S("BonusLevel")}: +{(level + bonusLevel)}\n" +
+ $"{string.Format(Loc.S("FoodHasToDropUnits"), Math.Round(hunger, 1))}";
}
public static string BoneDamageAdjustersImmobilization(Species species, out Dictionary boneDamageAdjusters)
@@ -327,7 +327,7 @@ public static string BoneDamageAdjustersImmobilization(Species species, out Dict
}
}
if (species.immobilizedBy != null && species.immobilizedBy.Any())
- text += $"{(text.Length > 0 ? "\n" : string.Empty)}{Loc.s("ImmobilizedBy")}: " +
+ text += $"{(text.Length > 0 ? "\n" : string.Empty)}{Loc.S("ImmobilizedBy")}: " +
$"{string.Join(", ", species.immobilizedBy)}";
}
return text;
diff --git a/ARKBreedingStats/TamingControl.cs b/ARKBreedingStats/TamingControl.cs
index 0f109a27..a75dc15d 100644
--- a/ARKBreedingStats/TamingControl.cs
+++ b/ARKBreedingStats/TamingControl.cs
@@ -93,7 +93,7 @@ public void SetSpecies(Species species, bool forceRefresh = false)
rbBD.CheckedChanged += rbBoneDamage_CheckedChanged;
}
rbBoneDamageAdjusterValues[ib] = bd.Value;
- rbBoneDamageAdjusters[ib].Text = $"{Loc.s(bd.Key)} (× {bd.Value})";
+ rbBoneDamageAdjusters[ib].Text = $"{Loc.S(bd.Key)} (× {bd.Value})";
rbBoneDamageAdjusters[ib].Visible = true;
}
for (int j = ib + 1; j < rbBoneDamageAdjusters.Count; j++)
@@ -149,7 +149,7 @@ public void SetSpecies(Species species, bool forceRefresh = false)
tf.Show();
}
if (f == "Kibble")
- tf.foodNameDisplay = $"Kibble ({td.favoriteKibble} {Loc.s("Egg")})";
+ tf.foodNameDisplay = $"Kibble ({td.favoriteKibble} {Loc.S("Egg")})";
if (td.specialFoodValues != null && td.specialFoodValues.ContainsKey(f) && td.specialFoodValues[f].quantity > 1)
tf.foodNameDisplay = td.specialFoodValues[f].quantity + "× " + tf.foodNameDisplay;
}
@@ -228,7 +228,7 @@ private void UpdateTamingData()
labelResult.ForeColor = SystemColors.ControlText;
if (!tameable)
{
- labelResult.Text = Loc.s("speciesNotTameable");
+ labelResult.Text = Loc.S("speciesNotTameable");
labelResult.ForeColor = Color.Red;
}
else if (enoughFood)
@@ -245,9 +245,9 @@ private void UpdateTamingData()
labelResult.Text += kibbleRecipe;
}
else if (foodAmountUsed.Count == 0)
- labelResult.Text = Loc.s("noTamingData");
+ labelResult.Text = Loc.S("noTamingData");
else
- labelResult.Text = Loc.s("notEnoughFoodToTame");
+ labelResult.Text = Loc.S("notEnoughFoodToTame");
numericUpDownCurrentTorpor.ValueSave = (decimal)(selectedSpecies.stats[(int)StatNames.Torpidity].BaseValue * (1 + selectedSpecies.stats[(int)StatNames.Torpidity].IncPerWildLevel * (level - 1)));
@@ -285,10 +285,10 @@ private void UpdateTimeToFeedAll(bool enoughFood = true)
if (hunger < 0) hunger = 0;
if (hunger > neededHunger) hunger = neededHunger;
var durationStarving = new TimeSpan(0, 0, (int)((neededHunger - hunger) / foodDepletion));
- lbTimeUntilStarving.Text = (enoughFood ? $"{Loc.s("TimeUntilFeedingAllFood")}: {Utils.Duration(durationStarving)}" : "");
+ lbTimeUntilStarving.Text = (enoughFood ? $"{Loc.S("TimeUntilFeedingAllFood")}: {Utils.Duration(durationStarving)}" : "");
if ((double)nudTotalFood.Value < neededHunger)
{
- lbTimeUntilStarving.Text += (lbTimeUntilStarving.Text.Length > 0 ? "\n" : "") + $"{Loc.s("WarningMoreStarvingThanFood")}";
+ lbTimeUntilStarving.Text += (lbTimeUntilStarving.Text.Length > 0 ? "\n" : "") + $"{Loc.S("WarningMoreStarvingThanFood")}";
lbTimeUntilStarving.ForeColor = Color.DarkRed;
}
else lbTimeUntilStarving.ForeColor = SystemColors.ControlText;
@@ -302,8 +302,8 @@ private void UpdateTimeToFeedAll(bool enoughFood = true)
private void NoTamingData()
{
// clear text fields
- labelResult.Text = Loc.s("noTamingData");
- lbTimeUntilStarving.Text = Loc.s("noTamingData");
+ labelResult.Text = Loc.S("noTamingData");
+ lbTimeUntilStarving.Text = Loc.S("noTamingData");
// disable enture (i)? tab
this.Enabled = false;
@@ -331,7 +331,7 @@ private void OnlyOneFood(string food)
private void numericUpDownCurrentTorpor_ValueChanged(object sender, EventArgs e)
{
var duration = new TimeSpan(0, 0, Taming.SecondsUntilWakingUp(selectedSpecies, (int)nudLevel.Value, (double)numericUpDownCurrentTorpor.Value));
- lbTimeUntilWakingUp.Text = string.Format(Loc.s("lbTimeUntilWakingUp"), Utils.Duration(duration));
+ lbTimeUntilWakingUp.Text = string.Format(Loc.S("lbTimeUntilWakingUp"), Utils.Duration(duration));
if (duration.TotalSeconds < 30) lbTimeUntilWakingUp.ForeColor = Color.DarkRed;
else if (duration.TotalSeconds < 120) lbTimeUntilWakingUp.ForeColor = Color.DarkGoldenrod;
else lbTimeUntilWakingUp.ForeColor = Color.Black;
@@ -413,13 +413,13 @@ public int WeaponDamagesEnabled
private void buttonAddTorporTimer_Click(object sender, EventArgs e)
{
if (selectedSpecies != null)
- CreateTimer(Loc.s("timerWakeupOf") + " " + selectedSpecies.name, wakeUpTime, null, TimerControl.TimerGroups.Wakeup.ToString());
+ CreateTimer(Loc.S("timerWakeupOf") + " " + selectedSpecies.name, wakeUpTime, null, TimerControl.TimerGroups.Wakeup.ToString());
}
private void btnAddStarvingTimer_Click(object sender, EventArgs e)
{
if (selectedSpecies != null)
- CreateTimer(Loc.s("timerStarvingOf") + " " + selectedSpecies.name, starvingTime, null, TimerControl.TimerGroups.Starving.ToString());
+ CreateTimer(Loc.S("timerStarvingOf") + " " + selectedSpecies.name, starvingTime, null, TimerControl.TimerGroups.Starving.ToString());
}
public void SetTamingMultipliers(double tamingSpeedMultiplier, double tamingFoodRateMultiplier)
@@ -450,7 +450,7 @@ private void UpdateFirstFeedingWaiting()
{
int s = Taming.DurationAfterFirstFeeding(selectedSpecies, (int)nudLevel.Value, foodDepletion);
if (s > 0)
- firstFeedingWaiting = "\n\n" + string.Format(Loc.s("waitingAfterFirstFeeding"), Utils.Duration(s));
+ firstFeedingWaiting = "\n\n" + string.Format(Loc.S("waitingAfterFirstFeeding"), Utils.Duration(s));
else firstFeedingWaiting = "";
}
diff --git a/ARKBreedingStats/TimerControl.cs b/ARKBreedingStats/TimerControl.cs
index 5303d5f1..f6b368fe 100644
--- a/ARKBreedingStats/TimerControl.cs
+++ b/ARKBreedingStats/TimerControl.cs
@@ -18,9 +18,12 @@ public partial class TimerControl : UserControl
public bool updateTimer;
private List timerListEntries;
- public event Form1.collectionChangedEventHandler OnTimerChange;
+ public event Form1.CollectionChangedEventHandler OnTimerChange;
private List creatures;
public SoundPlayer[] sounds;
+ ///
+ /// List of seconds when an alarm should be played if a countdown reaches one these values.
+ ///
private List timerAlerts;
private bool noOverlayUpdate;
@@ -126,7 +129,7 @@ private ListViewItem CreateLvi(string name, DateTime finishTime, TimerListEntry
g = new ListViewGroup(tle.group);
listViewTimer.Groups.Add(g);
}
- ListViewItem lvi = new ListViewItem(new[] { name, finishTime.ToString(), "" }, g)
+ ListViewItem lvi = new ListViewItem(new[] { name, finishTime.ToString(), string.Empty }, g)
{
Tag = tle,
Checked = Properties.Settings.Default.DisplayTimersInOverlayAutomatically
@@ -145,22 +148,24 @@ public void Tick()
if (t.lvi == null)
continue;
TimeSpan diff = t.time.Subtract(now);
+ int totalSeconds = (int)diff.TotalSeconds;
if (updateTimer)
- t.lvi.SubItems[2].Text = diff.TotalSeconds > 0 ? diff.ToString("dd':'hh':'mm':'ss") : "Finished";
- if (!(diff.TotalSeconds >= 0))
+ t.lvi.SubItems[2].Text = totalSeconds > 0 ? diff.ToString("dd':'hh':'mm':'ss") : "Finished";
+ if (diff.TotalSeconds < 0)
continue;
- if (diff.TotalSeconds < 60 && diff.TotalSeconds > 10)
- t.lvi.BackColor = Color.Gold;
- else if (diff.TotalSeconds < 11)
+ if (totalSeconds < 11)
t.lvi.BackColor = Color.LightSalmon;
+ else if (totalSeconds < 61)
+ t.lvi.BackColor = Color.Gold;
- if (!(diff.TotalSeconds < timerAlerts.First() + 1))
+ if (timerAlerts == null || !timerAlerts.Any() || totalSeconds > timerAlerts.First())
continue;
+
for (int i = 0; i < timerAlerts.Count; i++)
{
- if (diff.TotalSeconds < timerAlerts[i] + 0.8 && diff.TotalSeconds > timerAlerts[i] - 0.8)
+ if (totalSeconds == timerAlerts[i])
{
- PlaySound(t.@group, i, "", t.sound);
+ PlaySound(t.@group, i, string.Empty, t.sound);
break;
}
}
@@ -221,9 +226,6 @@ public List TimerAlerts
timerAlerts.RemoveAt(i--);
}
timerAlerts.Sort((t1, t2) => -t1.CompareTo(t2));
-
- if (timerAlerts.Count == 0)
- timerAlerts.Add(0);
}
}
}
@@ -285,16 +287,16 @@ public CreatureCollection CreatureCollection
private void removeToolStripMenuItem_Click(object sender, EventArgs e)
{
- removeSelectedEntry();
+ RemoveSelectedEntry();
}
private void listViewTimer_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Delete)
- removeSelectedEntry();
+ RemoveSelectedEntry();
}
- private void removeSelectedEntry()
+ private void RemoveSelectedEntry()
{
if (listViewTimer.SelectedIndices.Count > 0 && MessageBox.Show("Remove the timer \"" + ((TimerListEntry)listViewTimer.SelectedItems[0].Tag).name + "\""
+ (listViewTimer.SelectedIndices.Count > 1 ? " and " + (listViewTimer.SelectedIndices.Count - 1) + " more timers" : "") + "?"
diff --git a/ARKBreedingStats/Updater.cs b/ARKBreedingStats/Updater.cs
index d8ef195f..71a59f03 100644
--- a/ARKBreedingStats/Updater.cs
+++ b/ARKBreedingStats/Updater.cs
@@ -1,10 +1,9 @@
using Microsoft.Win32;
using Newtonsoft.Json.Linq;
using System;
-using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
-using System.Linq;
+using System.IO.Compression;
using System.Net;
using System.Reflection;
using System.Threading.Tasks;
@@ -12,16 +11,17 @@
namespace ARKBreedingStats
{
- public class Updater
+ public static class Updater
{
- public const string MasterBranchUrl = "https://github.com/cadon/ARKStatsExtractor/raw/master/ARKBreedingStats/";
-
+ ///
+ /// Latest release url.
+ ///
public const string ReleasesUrl = "https://github.com/cadon/ARKStatsExtractor/releases/latest";
- // Release feed URL
- private const string releasesFeedUrl = "https://api.github.com/repos/cadon/ARKStatsExtractor/releases";
- internal const string UPDATER_EXE = "asb-updater.exe";
-
- private const string OBELISK_URI = "https://raw.githubusercontent.com/arkutils/Obelisk/master/data/asb/";
+ private const string ReleasesFeedUrl = "https://api.github.com/repos/cadon/ARKStatsExtractor/releases";
+ internal const string UpdaterExe = "asb-updater.exe";
+ private const string ObeliskUrl = "https://raw.githubusercontent.com/arkutils/Obelisk/master/data/asb/";
+ private const string MasterRawUrl = "https://github.com/cadon/ARKStatsExtractor/raw/master";
+ private const string SpeciesColorRegionZipFileName = "img.zip";
#region main program
@@ -100,8 +100,8 @@ private static bool IsInstalled()
///
private static void LaunchUpdater()
{
- string oldLocation = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, UPDATER_EXE);
- string newLocation = Path.Combine(Path.GetTempPath(), UPDATER_EXE);
+ string oldLocation = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, UpdaterExe);
+ string newLocation = Path.Combine(Path.GetTempPath(), UpdaterExe);
File.Copy(oldLocation, newLocation, true);
@@ -190,7 +190,7 @@ public static async Task FetchReleaseFeed()
string releaseFeed;
try
{
- (_, releaseFeed) = await DownloadAsync(releasesFeedUrl);
+ (_, releaseFeed) = await DownloadAsync(ReleasesFeedUrl);
}
catch (Exception e)
{
@@ -259,7 +259,8 @@ private static string ParseReleaseInfo(string releaseFeed)
catch (Exception e)
{
successfulDownloaded = false;
- MessageBox.Show("Error while trying to download the file\n" + url + "\n\n" + e.Message, "ASB download error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show($"Error while trying to download the file\n{url}\n\n{e.Message}{(e.InnerException == null ? string.Empty : $"\n\n{e.InnerException.Message}")}",
+ "ASB download error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
if (!File.Exists(outFileName))
@@ -297,7 +298,7 @@ private static bool Download(string url, string outFileName)
}
catch (Exception e)
{
- MessageBox.Show("Error while trying to download the file\n" + url + "\n\n" + e.Message, "ASB download error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show($"Error while trying to download the file\n{url}\n\n{e.Message}", "ASB download error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
if (!File.Exists(outFileName))
@@ -307,6 +308,54 @@ private static bool Download(string url, string outFileName)
}
}
+ ///
+ /// Downloads the species color region images and saves them in the data folder.
+ ///
+ internal static async Task<(bool, string)> DownloadSpeciesImages(bool overwrite)
+ {
+ string imagesFolderPath = FileService.GetPath("img");
+ string url = MasterRawUrl + "/" + SpeciesColorRegionZipFileName;
+ string tempFilePath = Path.GetTempFileName();
+ var (downloaded, _) = await DownloadAsync(url, tempFilePath);
+ if (!downloaded)
+ return (false, $"File {url} couldn't be downloaded");
+
+ int fileCountExtracted = 0;
+ int fileCountSkipped = 0;
+
+ try
+ {
+ using (var archive = ZipFile.OpenRead(tempFilePath))
+ {
+ foreach (ZipArchiveEntry file in archive.Entries)
+ {
+ if (string.IsNullOrEmpty(file.Name)) continue;
+
+ var filePathUnzipped = Path.Combine(imagesFolderPath, file.Name);
+ if (File.Exists(filePathUnzipped) &&
+ (!overwrite || !FileService.TryDeleteFile(filePathUnzipped)))
+ {
+ fileCountSkipped++;
+ continue;
+ }
+
+ file.ExtractToFile(filePathUnzipped);
+ fileCountExtracted++;
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ return (false, $"Error while extracting the files in {imagesFolderPath}\n\n{ex.Message}");
+ }
+ finally
+ {
+ FileService.TryDeleteFile(tempFilePath);
+ }
+
+ return (true, $"Image files were downloaded successfully.\n{fileCountExtracted} images extracted\n{fileCountSkipped} already existing images skipped");
+ }
+
#region mod values
internal static async Task DownloadModsManifest()
@@ -319,7 +368,7 @@ internal static async Task DownloadModsManifest()
try
{
- if ((await DownloadAsync(OBELISK_URI + FileService.ModsManifest,
+ if ((await DownloadAsync(ObeliskUrl + FileService.ModsManifest,
tempFilePath)).Item1)
{
// if successful downloaded, move tempFile
@@ -327,20 +376,24 @@ internal static async Task DownloadModsManifest()
{
if (File.Exists(destFilePath)) File.Delete(destFilePath);
File.Move(tempFilePath, destFilePath);
- TryDeleteFile(tempFilePath);
return true;
}
catch (Exception e)
{
- MessageBox.Show("Error while moving mod-manifest file:\n\n" + e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show("Error while moving mod-manifest file:\n\n" + e.Message, "Error",
+ MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
catch (Exception e)
{
- MessageBox.Show("Error while downloading mod-manifest:\n\n" + e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show("Error while downloading mod-manifest:\n\n" + e.Message, "Error", MessageBoxButtons.OK,
+ MessageBoxIcon.Error);
+ }
+ finally
+ {
+ TryDeleteFile(tempFilePath);
}
- TryDeleteFile(tempFilePath);
return false;
}
@@ -362,7 +415,7 @@ internal static async Task DownloadModValuesFileAsync(string modValuesFile
{
try
{
- await DownloadAsync(OBELISK_URI + modValuesFileName,
+ await DownloadAsync(ObeliskUrl + modValuesFileName,
FileService.GetJsonPath(Path.Combine(FileService.ValuesFolder, modValuesFileName)));
return true;
}
@@ -377,13 +430,13 @@ internal static bool DownloadModValuesFile(string modValuesFileName)
{
try
{
- Download(OBELISK_URI + modValuesFileName,
+ Download(ObeliskUrl + modValuesFileName,
FileService.GetJsonPath(Path.Combine(FileService.ValuesFolder, modValuesFileName)));
return true;
}
catch
{
- // TODO
+ // ignored
}
return false;
}
diff --git a/ARKBreedingStats/Utils.cs b/ARKBreedingStats/Utils.cs
index d0a582f7..da04f4e1 100644
--- a/ARKBreedingStats/Utils.cs
+++ b/ARKBreedingStats/Utils.cs
@@ -155,11 +155,11 @@ public static string StatusText(CreatureStatus status)
{
switch (status)
{
- case CreatureStatus.Available: return Loc.s(CreatureStatus.Available.ToString());
- case CreatureStatus.Dead: return Loc.s(CreatureStatus.Dead.ToString());
- case CreatureStatus.Unavailable: return Loc.s(CreatureStatus.Unavailable.ToString());
- case CreatureStatus.Obelisk: return Loc.s(CreatureStatus.Obelisk.ToString());
- case CreatureStatus.Cryopod: return Loc.s(CreatureStatus.Cryopod.ToString());
+ case CreatureStatus.Available: return Loc.S(CreatureStatus.Available.ToString());
+ case CreatureStatus.Dead: return Loc.S(CreatureStatus.Dead.ToString());
+ case CreatureStatus.Unavailable: return Loc.S(CreatureStatus.Unavailable.ToString());
+ case CreatureStatus.Obelisk: return Loc.S(CreatureStatus.Obelisk.ToString());
+ case CreatureStatus.Cryopod: return Loc.S(CreatureStatus.Cryopod.ToString());
default: return "n/a";
}
}
@@ -209,16 +209,16 @@ public static string LevelPercentile(int level)
double[] prb = { 100, 100, 100, 100, 100, 100, 100, 100, 100, 99.99, 99.98, 99.95, 99.88, 99.72, 99.40, 98.83, 97.85, 96.28, 93.94, 90.62, 86.20, 80.61, 73.93, 66.33, 58.10, 49.59, 41.19, 33.26, 26.08, 19.85, 14.66, 10.50, 7.30, 4.92, 3.21, 2.04, 1.25, 0.75, 0.43, 0.24, 0.13 };
if (level < 0) level = 0;
if (level >= prb.Length) level = prb.Length - 1;
- return string.Format(Loc.s("topPercentileLevel"), prb[level].ToString("N2"));
+ return string.Format(Loc.S("topPercentileLevel"), prb[level].ToString("N2"));
}
private static string[] statNames, statNamesAbb, statNamesAberrant, statNamesAberrantAbb;
public static void InitializeLocalizations()
{
- statNames = new[] { Loc.s("Health"), Loc.s("Stamina"), Loc.s("Torpidity"), Loc.s("Oxygen"), Loc.s("Food"), Loc.s("Water"), Loc.s("Temperature"), Loc.s("Weight"), Loc.s("Damage"), Loc.s("Speed"), Loc.s("Fortitude"), Loc.s("CraftingSpeed") };
- statNamesAbb = new[] { Loc.s("Health_Abb"), Loc.s("Stamina_Abb"), Loc.s("Torpidity_Abb"), Loc.s("Oxygen_Abb"), Loc.s("Food_Abb"), Loc.s("Water_Abb"), Loc.s("Temperature_Abb"), Loc.s("Weight_Abb"), Loc.s("Damage_Abb"), Loc.s("Speed_Abb"), Loc.s("Fortitude_Abb"), Loc.s("CraftingSpeed_Abb") };
- statNamesAberrant = new[] { Loc.s("Health"), Loc.s("ChargeCapacity"), Loc.s("Torpidity"), Loc.s("ChargeRegeneration"), Loc.s("Food"), Loc.s("Water"), Loc.s("Temperature"), Loc.s("Weight"), Loc.s("ChargeEmissionRange"), Loc.s("Speed"), Loc.s("Fortitude"), Loc.s("CraftingSpeed") };
- statNamesAberrantAbb = new[] { Loc.s("Health_Abb"), Loc.s("ChargeCapacity_Abb"), Loc.s("Torpidity_Abb"), Loc.s("ChargeRegeneration_Abb"), Loc.s("Food_Abb"), Loc.s("Water_Abb"), Loc.s("Temperature_Abb"), Loc.s("Weight_Abb"), Loc.s("ChargeEmissionRange_Abb"), Loc.s("Speed_Abb"), Loc.s("Fortitude_Abb"), Loc.s("CraftingSpeed_Abb") };
+ statNames = new[] { Loc.S("Health"), Loc.S("Stamina"), Loc.S("Torpidity"), Loc.S("Oxygen"), Loc.S("Food"), Loc.S("Water"), Loc.S("Temperature"), Loc.S("Weight"), Loc.S("Damage"), Loc.S("Speed"), Loc.S("Fortitude"), Loc.S("CraftingSpeed") };
+ statNamesAbb = new[] { Loc.S("Health_Abb"), Loc.S("Stamina_Abb"), Loc.S("Torpidity_Abb"), Loc.S("Oxygen_Abb"), Loc.S("Food_Abb"), Loc.S("Water_Abb"), Loc.S("Temperature_Abb"), Loc.S("Weight_Abb"), Loc.S("Damage_Abb"), Loc.S("Speed_Abb"), Loc.S("Fortitude_Abb"), Loc.S("CraftingSpeed_Abb") };
+ statNamesAberrant = new[] { Loc.S("Health"), Loc.S("ChargeCapacity"), Loc.S("Torpidity"), Loc.S("ChargeRegeneration"), Loc.S("Food"), Loc.S("Water"), Loc.S("Temperature"), Loc.S("Weight"), Loc.S("ChargeEmissionRange"), Loc.S("Speed"), Loc.S("Fortitude"), Loc.S("CraftingSpeed") };
+ statNamesAberrantAbb = new[] { Loc.S("Health_Abb"), Loc.S("ChargeCapacity_Abb"), Loc.S("Torpidity_Abb"), Loc.S("ChargeRegeneration_Abb"), Loc.S("Food_Abb"), Loc.S("Water_Abb"), Loc.S("Temperature_Abb"), Loc.S("Weight_Abb"), Loc.S("ChargeEmissionRange_Abb"), Loc.S("Speed_Abb"), Loc.S("Fortitude_Abb"), Loc.S("CraftingSpeed_Abb") };
}
///
@@ -282,7 +282,7 @@ public static string Duration(int seconds)
/// Returns the timespan and the DateTime when the timespan is over
public static string DurationUntil(TimeSpan ts)
{
- return ts.ToString("d':'hh':'mm':'ss") + " (" + Loc.s("until") + ": " + ShortTimeDate(DateTime.Now.Add(ts)) + ")";
+ return ts.ToString("d':'hh':'mm':'ss") + " (" + Loc.S("until") + ": " + ShortTimeDate(DateTime.Now.Add(ts)) + ")";
}
///
@@ -293,7 +293,7 @@ public static string DurationUntil(TimeSpan ts)
///
public static string ShortTimeDate(DateTime? dt, bool omitDateIfToday = true)
{
- if (dt == null) return "unknown";
+ if (dt == null) return Loc.S("Unknown");
return dt.Value.ToShortTimeString() + (omitDateIfToday && DateTime.Today == dt.Value.Date ? string.Empty : " - " + dt.Value.ToShortDateString());
}
@@ -341,8 +341,8 @@ public static bool ShowTextInput(string text, out string input, string title = "
};
Label textLabel = new Label { Left = 20, Top = 15, Text = text, AutoSize = true };
TextBox textBox = new TextBox { Left = 20, Top = 40, Width = 200 };
- Button buttonOK = new Button { Text = Loc.s("OK"), Left = 120, Width = 100, Top = 70, DialogResult = DialogResult.OK };
- Button buttonCancel = new Button { Text = Loc.s("Cancel"), Left = 20, Width = 80, Top = 70, DialogResult = DialogResult.Cancel };
+ Button buttonOK = new Button { Text = Loc.S("OK"), Left = 120, Width = 100, Top = 70, DialogResult = DialogResult.OK };
+ Button buttonCancel = new Button { Text = Loc.S("Cancel"), Left = 20, Width = 80, Top = 70, DialogResult = DialogResult.Cancel };
buttonOK.Click += (sender, e) => { inputForm.Close(); };
buttonCancel.Click += (sender, e) => { inputForm.Close(); };
inputForm.Controls.Add(textBox);
@@ -446,5 +446,54 @@ public static async void BlinkAsync(Control ctlr, Color c, int duration = 500, b
ctlr.BackColor = original;
}
}
+
+ ///
+ /// Returns the rectangle of the passed form.
+ ///
+ public static Rectangle GetFormRectangle(Form form) =>
+ new Rectangle(form.Location.X, form.Location.Y, form.Width, form.Height);
+
+ ///
+ /// Sets the form rectangle to the passed data.
+ ///
+ public static void SetFormRectangle(Form form, Rectangle rect)
+ {
+ form.Location = new Point(rect.X, rect.Y);
+ form.Width = rect.Width;
+ form.Height = rect.Height;
+ }
+
+ ///
+ /// Beeps. 0: failure, 1: success, 2: good, 3: great.
+ ///
+ ///
+ public static void BeepSignal(int kind)
+ {
+ switch (kind)
+ {
+ case 0:
+ Console.Beep(300, 50);
+ Console.Beep(200, 100);
+ break;
+ case 1:
+ Console.Beep(300, 50);
+ Console.Beep(400, 100);
+ break;
+ case 2:
+ Console.Beep(300, 50);
+ Console.Beep(400, 50);
+ Console.Beep(500, 50);
+ Console.Beep(400, 100);
+ break;
+ case 3:
+ Console.Beep(300, 50);
+ Console.Beep(400, 50);
+ Console.Beep(500, 50);
+ Console.Beep(600, 50);
+ Console.Beep(650, 50);
+ Console.Beep(600, 100);
+ break;
+ }
+ }
}
}
diff --git a/ARKBreedingStats/importExported/ImportExported.cs b/ARKBreedingStats/importExported/ImportExported.cs
index 17ee2615..97468585 100644
--- a/ARKBreedingStats/importExported/ImportExported.cs
+++ b/ARKBreedingStats/importExported/ImportExported.cs
@@ -253,7 +253,8 @@ private static int ParseColor(string text, int colorIndex, Species species)
&& double.TryParse(text.Substring(14, 8), System.Globalization.NumberStyles.AllowDecimalPoint | System.Globalization.NumberStyles.AllowLeadingSign, dotSeparatorCulture, out double g)
&& double.TryParse(text.Substring(25, 8), System.Globalization.NumberStyles.AllowDecimalPoint | System.Globalization.NumberStyles.AllowLeadingSign, dotSeparatorCulture, out double b)
&& double.TryParse(text.Substring(36, 8), System.Globalization.NumberStyles.AllowDecimalPoint | System.Globalization.NumberStyles.AllowLeadingSign, dotSeparatorCulture, out double a)
- && (r != 0 || g != 0 || b != 0 || a != 1) // no color
+ && !(r == 0 && g == 0 && b == 0 && a == 1) // no color
+ && !(r == 1 && g == 1 && b == 1 && a == 1) // no color
)
return Values.V.Colors.ClosestColorID(r, g, b, a);
diff --git a/ARKBreedingStats/library/Creature.cs b/ARKBreedingStats/library/Creature.cs
index c1f76b42..afcc236c 100644
--- a/ARKBreedingStats/library/Creature.cs
+++ b/ARKBreedingStats/library/Creature.cs
@@ -18,8 +18,8 @@ public class Creature : IEquatable
public string name;
[JsonProperty]
public Sex sex;
- [JsonProperty]
- public CreatureStatus status;
+ [JsonProperty("status")]
+ private CreatureStatus _status;
[JsonProperty]
public CreatureFlags flags;
[JsonProperty]
@@ -171,7 +171,7 @@ public Creature(Species species, string name, string owner, string tribe, Sex se
this.tamingEff = tamingEff;
this.isBred = isBred;
imprintingBonus = imprinting;
- status = CreatureStatus.Available;
+ Status = CreatureStatus.Available;
CalculateLevelFound(levelStep);
}
@@ -183,7 +183,7 @@ public Species Species
if (value != null)
speciesBlueprint = value.blueprintPath;
}
- get { return _species; }
+ get => _species;
}
///
@@ -199,17 +199,19 @@ public Creature(long arkId)
flags = CreatureFlags.Placeholder;
}
- public bool Equals(Creature other)
- {
- return other.guid == guid;
- }
+ public bool Equals(Creature other) => other != null && other.guid == guid;
- public override bool Equals(object obj)
- {
- if (obj == null)
- return false;
+ public override bool Equals(object obj) => obj is Creature creatureObj && creatureObj.guid == guid;
- return obj is Creature creatureObj && Equals(creatureObj);
+ public CreatureStatus Status
+ {
+ get => _status;
+ set
+ {
+ _status = value;
+ // remove other status while keeping the other flags
+ flags = (flags & CreatureFlags.StatusMask) | (CreatureFlags)(1 << (int)value);
+ }
}
public override int GetHashCode()
@@ -369,10 +371,7 @@ public void RecalculateNewMutations()
public int Mutations => mutationsMaternal + mutationsPaternal;
- public override string ToString()
- {
- return name + " (" + _species.name + ")";
- }
+ public override string ToString() => $"{name} ({_species.name})";
///
/// Starts the timer for maturation.
@@ -435,6 +434,20 @@ private void InitializeArrays()
if (topBreedingStats == null) topBreedingStats = new bool[Values.STATS_COUNT];
}
+ ///
+ /// Sets flags of properties that are stored in their own field.
+ /// Should be called until the flags are used globally and if no backwards compatibility is needed anymore.
+ ///
+ public void InitializeFlags()
+ {
+ // status
+ flags = (flags & CreatureFlags.StatusMask) | (CreatureFlags)(1 << (int)_status);
+ // sex
+ flags = (flags & ~(CreatureFlags.Female | CreatureFlags.Male)) | (sex == Sex.Female ? CreatureFlags.Female : sex == Sex.Male ? CreatureFlags.Male : CreatureFlags.None);
+ // mutated
+ flags = (flags & ~CreatureFlags.Mutated) | (Mutations > 0 ? CreatureFlags.Mutated : CreatureFlags.None);
+ }
+
///
/// Calculates the pretame wild level. This value can be off due to wrong inputs due to ingame rounding.
///
@@ -465,8 +478,8 @@ public enum CreatureFlags
{
None = 0,
Available = 1,
- Unavailable = 2,
- Dead = 4,
+ Dead = 2,
+ Unavailable = 4,
Obelisk = 8,
Cryopod = 16,
// Deleted = 32, // not used anymore
@@ -475,6 +488,12 @@ public enum CreatureFlags
///
/// If a creature has unknown parents, they are placeholders until they are imported. placeholders are not shown in the library
///
- Placeholder = 256
+ Placeholder = 256,
+ Female = 512,
+ Male = 1024,
+ ///
+ /// If applied to the flags with &, the status is removed.
+ ///
+ StatusMask = Mutated | Neutered | Placeholder | Female | Male
}
}
\ No newline at end of file
diff --git a/ARKBreedingStats/library/CreatureCollection.cs b/ARKBreedingStats/library/CreatureCollection.cs
index 0eed34a7..0a1a3f9b 100644
--- a/ARKBreedingStats/library/CreatureCollection.cs
+++ b/ARKBreedingStats/library/CreatureCollection.cs
@@ -24,16 +24,6 @@ public class CreatureCollection
[JsonProperty]
public List incubationListEntries = new List();
[JsonProperty]
- public List hiddenOwners = new List(); // which owners are not selected to be shown
- [JsonProperty]
- public List hiddenServers = new List();
- [JsonProperty]
- public List dontShowTags = new List(); // which tags are selected to be not shown
- [JsonProperty]
- internal CreatureFlags showFlags = CreatureFlags.Available | CreatureFlags.Cryopod | CreatureFlags.Dead | CreatureFlags.Mutated | CreatureFlags.Neutered | CreatureFlags.Obelisk | CreatureFlags.Unavailable;
- [JsonProperty]
- public bool useFiltersInTopStatCalculation = false;
- [JsonProperty]
public int maxDomLevel = 73;
[JsonProperty]
public int maxWildLevel = 150;
@@ -100,7 +90,7 @@ public class CreatureCollection
///
/// Some mods allow to change stat values of species in an extra ini file. These overrides are stored here.
- /// The last item is an array of possible imprintingMultiplier overrides.
+ /// The last item (i.e. index Values.STATS_COUNT) is an array of possible imprintingMultiplier overrides.
///
[JsonProperty]
public Dictionary CustomSpeciesStats;
@@ -118,15 +108,15 @@ public static int CalculateModListHash(List modList)
///
/// Calculates a hashcode for a list of mods and their order. Can be used to check for changes.
///
- public static int CalculateModListHash(List modIDList)
+ public static int CalculateModListHash(List modIdList)
{
- if (modIDList == null) { return 0; }
- return string.Join(",", modIDList).GetHashCode();
+ if (modIdList == null) { return 0; }
+ return string.Join(",", modIdList).GetHashCode();
}
///
- /// Recalculates the modListHash for comparison and sets the mod-IDs of the modvalues for the library.
- /// Should be called after the mods are changed.
+ /// Recalculates the modListHash for comparison and sets the mod-IDs of the modValues for the library.
+ /// Should be called after the loaded mods are changed.
///
public void UpdateModList()
{
@@ -147,7 +137,7 @@ public List ModList
///
/// Returns true if the currently loaded modValues differ from the listed modValues of the library-file.
///
- public bool ModValueReloadNeeded { get { return modListHash == 0 || modListHash != Values.V.loadedModsHash; } }
+ public bool ModValueReloadNeeded => modListHash == 0 || modListHash != Values.V.loadedModsHash;
///
/// Adds creatures to the current library.
@@ -197,10 +187,12 @@ public bool MergeCreatureList(List creaturesToMerge, bool addPreviousl
}
creatureExisting.colors = creatureNew.colors;
- creatureExisting.status = creatureNew.status;
+ creatureExisting.Status = creatureNew.Status;
creatureExisting.sex = creatureNew.sex;
creatureExisting.cooldownUntil = creatureNew.cooldownUntil;
- creatureExisting.domesticatedAt = creatureNew.domesticatedAt;
+ if (!creatureExisting.domesticatedAt.HasValue || creatureExisting.domesticatedAt.Value.Year < 2000
+ || (creatureNew.domesticatedAt.HasValue && creatureNew.domesticatedAt.Value.Year > 2000 && creatureExisting.domesticatedAt > creatureNew.domesticatedAt))
+ creatureExisting.domesticatedAt = creatureNew.domesticatedAt;
creatureExisting.generation = creatureNew.generation;
creatureExisting.growingUntil = creatureNew.growingUntil;
creatureExisting.imprintingBonus = creatureNew.imprintingBonus;
@@ -225,7 +217,7 @@ void UpdateString(ref string oldCreatureValue, ref string newCreatureValue)
bool recalculate = false;
if (creatureExisting.flags.HasFlag(CreatureFlags.Placeholder) ||
- (creatureExisting.status == CreatureStatus.Unavailable && creatureNew.status == CreatureStatus.Available))
+ (creatureExisting.Status == CreatureStatus.Unavailable && creatureNew.Status == CreatureStatus.Available))
{
creatureExisting.levelFound = creatureNew.levelFound;
creatureExisting.levelsDom = creatureNew.levelsDom;
diff --git a/ARKBreedingStats/library/CreatureExtensions.cs b/ARKBreedingStats/library/CreatureExtensions.cs
index 1d279f15..d1b984a4 100644
--- a/ARKBreedingStats/library/CreatureExtensions.cs
+++ b/ARKBreedingStats/library/CreatureExtensions.cs
@@ -41,7 +41,7 @@ public static Bitmap InfoGraphic(this Creature creature, CreatureCollection cc)
g.DrawString(creature.Species.DescriptiveNameAndMod, fontHeader, fontBrush, 3, currentYPosition);
currentYPosition += 19;
- g.DrawString($"Level {creature.LevelHatched} | {Utils.SexSymbol(creature.sex) + (creature.flags.HasFlag(CreatureFlags.Neutered) ? $" ({Loc.s(creature.sex == Sex.Female ? "Spayed" : "Neutered")})" : string.Empty)} | {creature.Mutations} mutations | generation {creature.generation}", font, fontBrush, 8, currentYPosition);
+ g.DrawString($"Level {creature.LevelHatched} | {Utils.SexSymbol(creature.sex) + (creature.flags.HasFlag(CreatureFlags.Neutered) ? $" ({Loc.S(creature.sex == Sex.Female ? "Spayed" : "Neutered")})" : string.Empty)} | {creature.Mutations} mutations | generation {creature.generation}", font, fontBrush, 8, currentYPosition);
currentYPosition += 17;
using (var p = new Pen(Color.LightGray, 1))
@@ -110,22 +110,22 @@ public static Bitmap InfoGraphic(this Creature creature, CreatureCollection cc)
if (maxColorNameLength < 0) maxColorNameLength = 0;
g.DrawString("Colors", font, fontBrush, xColor, currentYPosition);
int colorRow = 0;
- for (int ci = 0; ci < Species.COLOR_REGION_COUNT; ci++)
+ for (int ci = 0; ci < Species.ColorRegionCount; ci++)
{
if (string.IsNullOrEmpty(creature.Species.colors[ci]?.name))
continue;
int y = currentYPosition + 20 + (colorRow++) * rowHeight;
- Color c = CreatureColors.creatureColor(creature.colors[ci]);
- Color fc = Utils.ForeColor(c);
+ Color c = CreatureColors.CreatureColor(creature.colors[ci]);
+ //Color fc = Utils.ForeColor(c);
using (var b = new SolidBrush(c))
g.FillEllipse(b, xColor, y, circleDiameter, circleDiameter);
g.DrawEllipse(penBlack, xColor, y, circleDiameter, circleDiameter);
string colorRegionName = creature.Species.colors[ci].name;
- string colorName = CreatureColors.creatureColorName(creature.colors[ci]);
+ string colorName = CreatureColors.CreatureColorName(creature.colors[ci]);
int totalColorLenght = colorRegionName.Length + 11;
if (totalColorLenght > maxColorNameLength)
diff --git a/ARKBreedingStats/local/strings.Designer.cs b/ARKBreedingStats/local/strings.Designer.cs
index a0e904a7..f2cc9047 100644
--- a/ARKBreedingStats/local/strings.Designer.cs
+++ b/ARKBreedingStats/local/strings.Designer.cs
@@ -87,6 +87,15 @@ internal static string addedAt {
}
}
+ ///
+ /// Looks up a localized string similar to All.
+ ///
+ internal static string All {
+ get {
+ return ResourceManager.GetString("All", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to There is already a creature in your library that has all the available top-stats ({0} {1}).
///The currently selected conservative-breeding-mode might show some suggestions that may seem non-optimal.
@@ -98,6 +107,15 @@ internal static string AlreadyCreatureWithTopStats {
}
}
+ ///
+ /// Looks up a localized string similar to apply.
+ ///
+ internal static string apply {
+ get {
+ return ResourceManager.GetString("apply", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to That is approx. one Narcoberry every.
///
@@ -144,7 +162,7 @@ internal static string Body {
}
///
- /// Looks up a localized string similar to Bonus-Level.
+ /// Looks up a localized string similar to Bonus Level.
///
internal static string BonusLevel {
get {
@@ -260,6 +278,24 @@ internal static string btAddWakeUpTimer {
}
}
+ ///
+ /// Looks up a localized string similar to Apply OTS Preset.
+ ///
+ internal static string BtApplyOTSPreset {
+ get {
+ return ResourceManager.GetString("BtApplyOTSPreset", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Set the values for owner, tribe and server from the saved preset.
+ ///
+ internal static string BtApplyOTSPresetTT {
+ get {
+ return ResourceManager.GetString("BtApplyOTSPresetTT", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Apply new Weightings.
///
@@ -370,6 +406,25 @@ internal static string btSaveChanges {
}
}
+ ///
+ /// Looks up a localized string similar to Save OTS.
+ ///
+ internal static string BtSaveOTSPreset {
+ get {
+ return ResourceManager.GetString("BtSaveOTSPreset", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Save Owner, Tribe and Server as preset.
+ ///The preset can be applied by the Apply Preset button.
+ ///
+ internal static string BtSaveOTSPresetTT {
+ get {
+ return ResourceManager.GetString("BtSaveOTSPresetTT", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Update creature in Library.
///
@@ -618,6 +673,33 @@ internal static string checkForUpdatedStatsToolStripMenuItem {
}
}
+ ///
+ /// Looks up a localized string similar to Clear.
+ ///
+ internal static string clear {
+ get {
+ return ResourceManager.GetString("clear", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to .
+ ///
+ internal static string clearColors {
+ get {
+ return ResourceManager.GetString("clearColors", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Clear Color Filters.
+ ///
+ internal static string clearColorsFilters {
+ get {
+ return ResourceManager.GetString("clearColorsFilters", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Club.
///
@@ -969,6 +1051,42 @@ internal static string fileToolStripMenuItem {
}
}
+ ///
+ /// Looks up a localized string similar to Only creatures with all of these flags will be displayed.
+ ///
+ internal static string filterAllNeededInfo {
+ get {
+ return ResourceManager.GetString("filterAllNeededInfo", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Filter by name.
+ ///
+ internal static string filterByName {
+ get {
+ return ResourceManager.GetString("filterByName", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Creatures with this flag will not be shown.
+ ///
+ internal static string filterExcludeInfo {
+ get {
+ return ResourceManager.GetString("filterExcludeInfo", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Only creatures with one of these flags will be displayed.
+ ///
+ internal static string filterOneNeededInfo {
+ get {
+ return ResourceManager.GetString("filterOneNeededInfo", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Find Duplicates….
///
@@ -1122,6 +1240,15 @@ internal static string gpTorporTime {
}
}
+ ///
+ /// Looks up a localized string similar to Group library by species.
+ ///
+ internal static string groupLibraryBySpecies {
+ get {
+ return ResourceManager.GetString("groupLibraryBySpecies", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Grown in.
///
@@ -1176,6 +1303,15 @@ internal static string helpToolStripMenuItem {
}
}
+ ///
+ /// Looks up a localized string similar to .
+ ///
+ internal static string holdCtrlForRandomColors {
+ get {
+ return ResourceManager.GetString("holdCtrlForRandomColors", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Immobilized by.
///
@@ -1248,6 +1384,135 @@ internal static string imprintingBonus {
}
}
+ ///
+ /// Looks up a localized string similar to This species is known to show wrong stat values ingame, this can prevent a successful extraction..
+ ///
+ internal static string issueCauseArkStatIssue {
+ get {
+ return ResourceManager.GetString("issueCauseArkStatIssue", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Check if the total level of the creature is entered correctly.
+ ///If the creature is bred, also check if the BabyStatScaleImprintingBonus is set correctly..
+ ///
+ internal static string issueCauseCreatureLevel {
+ get {
+ return ResourceManager.GetString("issueCauseCreatureLevel", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to You locked the imprinting-value by checking "Exactly, don't adjust" and the tool won't adjust it, this may cause the extraction to fail..
+ ///
+ internal static string issueCauseImprintingLocked {
+ get {
+ return ResourceManager.GetString("issueCauseImprintingLocked", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The imprinting-percentage given is not possible with the current multipliers and may cause wrong values during the extraction-process.
+ ///Make sure the BabyCuddleIntervallMultiplier and the BabyMatureSpeedMultiplier are set correctly.
+ ///They may have to be set to the value when the creature hatched/was born, even if they were changed..
+ ///
+ internal static string issueCauseImprintingNotPossible {
+ get {
+ return ResourceManager.GetString("issueCauseImprintingNotPossible", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Sometimes the game doesn't update the stat-value after an imprinting. Try the extraction after the creature was cryoed again..
+ ///
+ internal static string issueCauseImprintingNotUpdated {
+ get {
+ return ResourceManager.GetString("issueCauseImprintingNotUpdated", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Uncheck all Lock-to-Zero-buttons in the stats (all lock-symbols should be green and opened)..
+ ///
+ internal static string issueCauseLockedDomLevel {
+ get {
+ return ResourceManager.GetString("issueCauseLockedDomLevel", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The maximal wild level is set too low, go to the settings and adjust it..
+ ///
+ internal static string issueCauseMaxWildLevel {
+ get {
+ return ResourceManager.GetString("issueCauseMaxWildLevel", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The stats of the creature were changed recently and the game displays the old values. Level up a stat, that should trigger a recalculation of the values..
+ ///
+ internal static string issueCauseOutdatedIngameValues {
+ get {
+ return ResourceManager.GetString("issueCauseOutdatedIngameValues", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to If you have enabled the Singleplayer-Settings in the game, make sure the according checkbox is enabled in the settings in this application as well..
+ ///
+ internal static string issueCauseSingleplayer {
+ get {
+ return ResourceManager.GetString("issueCauseSingleplayer", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The stat multipliers in the Settings are not set to the multipliers of the server. Ask your admin for the correct multipliers and adjust them in the Settings..
+ ///
+ internal static string issueCauseStatMultipliers {
+ get {
+ return ResourceManager.GetString("issueCauseStatMultipliers", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Taming-Effectiveness-Range too narrow, increase the upper and / or decrase the lower bound..
+ ///
+ internal static string issueCauseTamingEffectivenessRange {
+ get {
+ return ResourceManager.GetString("issueCauseTamingEffectivenessRange", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Double check if all stat-values are entered correctly..
+ ///
+ internal static string issueCauseTypo {
+ get {
+ return ResourceManager.GetString("issueCauseTypo", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Adjust or disable the "Consider Wild-level - steps" in the settings..
+ ///
+ internal static string issueCauseWildLevelSteps {
+ get {
+ return ResourceManager.GetString("issueCauseWildLevelSteps", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Make sure the correct state (wild, tamed, bred) for the creature is chosen..
+ ///
+ internal static string issueCauseWildTamedBred {
+ get {
+ return ResourceManager.GetString("issueCauseWildTamedBred", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to The extraction is potentially possible, but it seems the max wild level is set too low for a valid extraction. Check if you set the correct value in the settings.
///The current value is {0} and this creature seems to have a higher wild level than this.
@@ -1521,6 +1786,24 @@ internal static string library {
}
}
+ ///
+ /// Looks up a localized string similar to Library Filter.
+ ///
+ internal static string libraryFilter {
+ get {
+ return ResourceManager.GetString("libraryFilter", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Filter library….
+ ///
+ internal static string libraryFilterToolStripMenuItem {
+ get {
+ return ResourceManager.GetString("libraryFilterToolStripMenuItem", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Load and A&dd....
///
@@ -1647,6 +1930,15 @@ internal static string Mutations_Abb {
}
}
+ ///
+ /// Looks up a localized string similar to n/a.
+ ///
+ internal static string na {
+ get {
+ return ResourceManager.GetString("na", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Name.
///
@@ -1710,6 +2002,24 @@ internal static string newToolStripMenuItem {
}
}
+ ///
+ /// Looks up a localized string similar to new top level.
+ ///
+ internal static string newTopLevel {
+ get {
+ return ResourceManager.GetString("newTopLevel", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to no color.
+ ///
+ internal static string noColor {
+ get {
+ return ResourceManager.GetString("noColor", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to No possible pairings found for {0}. 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..
///
@@ -1801,6 +2111,15 @@ internal static string onlinehelpToolStripMenuItem {
}
}
+ ///
+ /// Looks up a localized string similar to Only creatures that have this color.
+ ///
+ internal static string onlyCreaturesWithThisColor {
+ get {
+ return ResourceManager.GetString("onlyCreaturesWithThisColor", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to only pairings with "{0}".
///
@@ -1855,6 +2174,24 @@ internal static string Owner {
}
}
+ ///
+ /// Looks up a localized string similar to Owner filter from library.
+ ///
+ internal static string ownerFilterFromLibrary {
+ get {
+ return ResourceManager.GetString("ownerFilterFromLibrary", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to owners.
+ ///
+ internal static string owners {
+ get {
+ return ResourceManager.GetString("owners", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Oxygen.
///
@@ -1900,6 +2237,15 @@ internal static string Player {
}
}
+ ///
+ /// Looks up a localized string similar to Possible Level-Range: {0}–{1}.
+ ///
+ internal static string possibleLevelRange {
+ get {
+ return ResourceManager.GetString("possibleLevelRange", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Probability for this Best Possible outcome.
///
@@ -2051,6 +2397,24 @@ internal static string Server {
}
}
+ ///
+ /// Looks up a localized string similar to Server filter from library.
+ ///
+ internal static string serverFilterFromLibrary {
+ get {
+ return ResourceManager.GetString("serverFilterFromLibrary", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to servers.
+ ///
+ internal static string servers {
+ get {
+ return ResourceManager.GetString("servers", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Set Status.
///
@@ -2087,6 +2451,15 @@ internal static string ShockingTranqDarts {
}
}
+ ///
+ /// Looks up a localized string similar to Show only natural occuring colors.
+ ///
+ internal static string showOnlyNaturalOccuring {
+ get {
+ return ResourceManager.GetString("showOnlyNaturalOccuring", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Slingshot.
///
@@ -2204,6 +2577,15 @@ internal static string Status {
}
}
+ ///
+ /// Looks up a localized string similar to tags.
+ ///
+ internal static string tags {
+ get {
+ return ResourceManager.GetString("tags", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Tail.
///
@@ -2447,6 +2829,15 @@ internal static string Top {
}
}
+ ///
+ /// Looks up a localized string similar to top level.
+ ///
+ internal static string topLevel {
+ get {
+ return ResourceManager.GetString("topLevel", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Tp%.
///
@@ -2546,6 +2937,24 @@ internal static string Tribe {
}
}
+ ///
+ /// Looks up a localized string similar to Tribe filter from library.
+ ///
+ internal static string tribeFilterFromLibrary {
+ get {
+ return ResourceManager.GetString("tribeFilterFromLibrary", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to tribes.
+ ///
+ internal static string tribes {
+ get {
+ return ResourceManager.GetString("tribes", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Add as Test.
///
@@ -2582,6 +2991,15 @@ internal static string until {
}
}
+ ///
+ /// Looks up a localized string similar to Use filter in top stat calculation.
+ ///
+ internal static string useFilterInTopStatCalculation {
+ get {
+ return ResourceManager.GetString("useFilterInTopStatCalculation", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to View.
///
diff --git a/ARKBreedingStats/local/strings.de.resx b/ARKBreedingStats/local/strings.de.resx
index 352631a2..863fcb05 100644
--- a/ARKBreedingStats/local/strings.de.resx
+++ b/ARKBreedingStats/local/strings.de.resx
@@ -139,7 +139,7 @@
Gezüchtet
- Breeding Plan…
+ Zucht Plan…
Zucht-Wert
@@ -292,7 +292,7 @@ Die angezeigten Level werden ohne Validierung angezeigt und gelten nur für wild
Tote Kreaturen
- Default
+ Standard
Entfernen…
@@ -334,7 +334,7 @@ Die angezeigten Level werden ohne Validierung angezeigt und gelten nur für wild
In Zwischenablage exportieren
- Extraction Issues…
+ Extraktionsprobleme…
Extraktor
@@ -382,7 +382,7 @@ Die angezeigten Level werden ohne Validierung angezeigt und gelten nur für wild
Hunger-Zeit
- Torpor-Time
+ Benommenheits-Zeit
Ausgewachsen
@@ -415,7 +415,7 @@ Die angezeigten Level werden ohne Validierung angezeigt und gelten nur für wild
Werte von Zwischenablage importieren
- Imprinting Bonus
+ Prägungsbonus
Die Extraktion ist möglich, jedoch scheint das maximale wilde Level zu niedrig eingestellt zu sein, um die Level korrekt zu extrahieren.Prüfe, ob der richtige Werde in den Einstellungen gesetzt ist.
@@ -574,7 +574,7 @@ Wenn eine Nummer mit Plus-Zeichen angezeigt wird, ist die Summe zu hoch, und ein
OK
- Online Manual…
+ Online Anleitung…
oder ein Bio-Toxin pro
@@ -682,7 +682,7 @@ Wenn eine Nummer mit Plus-Zeichen angezeigt wird, ist die Summe zu hoch, und ein
Zähm-Info
- TE
+ ZE
Alles füttern von
@@ -837,8 +837,7 @@ Wähle den "Hohe-Stats"-Modus aus, um bessere Vorschläge zu erhalten.
Click to create an incubation-entry in the Raising-tab
- Check if all creatures should be excluded and only be included when have the include-mark on their tag.
-If this checkbox is unchecked, all creatures will be included by default, and only excluded if one of their tags has the exclude-mark and none has the include-mark.
+ Aktivieren, um nur Kreaturen hinzuzufügen, wenn sie einen Tag haben, der explizit ausgewählt ist. Wenn dies deaktiviert ist, werden alle Kreaturen standardmäßig berücksichtigt und nur ausgeschlossen, wenn sie einen Ausschluss Tag und keinen Einschluss Tag haben.
Inklusive Kreaturen mit Cooldown
@@ -856,8 +855,7 @@ If this checkbox is unchecked, all creatures will be included by default, and on
Zucht-Score
- The Breeding-Score of a paring is not comparable to the Breeding-Score of another breeding-mode.
-The numbers in the different modes are generated in incompatible ways.
+ Der Zucht-Score eines Paares kann nicht mit dem Zucht-Score von anderen Zucht-Modi verglichen werden, die Werte werden imkompatibel erzeugt.
Zucht Zeiten
@@ -872,8 +870,8 @@ The numbers in the different modes are generated in incompatible ways.
nicht verfügbar
- Consider only creatures with at most this many mutations.
-Set to -1 for any number of mutation.
+ Nur Kreaturen mit maximal diesen Mutationen einbeziehen.
+Setze auf -1 um Kreaturen unabhängig der Mutationen anzuzeigen.
nur Paarungen mit "{0}"
@@ -891,26 +889,22 @@ Set to -1 for any number of mutation.
Hohe Stats
- Check for best next-generation-results.
-The chance for an overall good creature is better.
-Check if it's not important to have a Top-Stats-Offspring.
+ Aktivieren um die besten Vorschläge für die nächste Generation zu bekommen, wenn Top-Stats nicht wichtig sind.
- Top Stats Lc
+ Kombiniere Top Stats lucky
- Top Stats Cn
+ Kombiniere Top Stats sicher
- Top Stats, Conservative.
-Check for best long-term-results and if you want to go safe.
-This mode will get to the best possible offspring steady and surely.
-Some offsprings might be worse than in High-Stats-Mode, but that's the mode you go if you want to have that perfect creature in some generations.
+ Kombiniere Top Stats sicher
+Wählen, um alle Top stats in einer Kreatur zu vereinen.
+Einige Nachkommen werden teilweise ein niedrigeres Gesamtlevel als im High-Stats-Mode haben, aber die Top-Stats werden hier nacheinander zusammengeführt.
- Top Stats, Feeling Lucky.
-Check for best long-term-results and if you're feeling lucky. It can be faster to get the perfect creature than in the Top-Stat-Conservative-Mode if you're lucky.
-Some offsprings might be worse than in High-Stats-Mode, but you also have a chance to the best possible offspring.
+ Kombiniere Top Stats lucky
+Wählen, um die Top stats in einer Kreature zu vereinen. Dieser Modus geht ein Risiko ein und versucht mehrere Top-Stats auf einmal zu vereinen. Wenn es klappt, geht es schneller, aber die Wahrscheinlichkeit ist geringer als im konservativen Modus.
Wähle eine Spezies aus, um Vorschläge zu Paarungen nach dem ausgewählten Zucht-Modus zu bekommen.
@@ -1008,4 +1002,154 @@ Some offsprings might be worse than in High-Stats-Mode, but you also have a chan
Paarungsdauer
+
+ Alle
+
+
+ n. a.
+
+
+ nur natürlich vorkommende Farben
+
+
+ Anwenden
+
+
+ Bibliotheks-Filter
+
+
+ Besitzer
+
+
+ Server
+
+
+ Tags
+
+
+ Stämme
+
+
+ Filter in Berechnung der Top Stats benutzen
+
+
+ Farbfilter löschen
+
+
+ Bibliothek nach Spezies gruppieren
+
+
+ Bibliothek filtern…
+
+
+ Nur Kreaturen mit dieser Farbe
+
+
+ Besitzer Filter von der Bibliothek
+
+
+ Möglicher Level-Bereich: {0}–{1}
+
+
+ Server Filter von der Bibliothek
+
+
+ Stamm Filter von der Bibliothek
+
+
+ Zurücksetzen
+
+
+ Nur Kreaturen mit allen diesen Eigenschaften wird angezeigt
+
+
+ Nach Namen filtern
+
+
+ Kreaturen mit einer dieser Eigenschaften wird nicht angezeigt
+
+
+ Nur Kreaturen mit einer dieser Eigenschaften wird angezeigt
+
+
+ Hinzugefügt am
+
+
+ Überprüfe ob alle Werte korrekt eingetragen sind.
+
+
+ Stelle sicher, dass der Status (wild, gezähmt, gezüchtet) richtig eingestellt ist.
+
+
+ Zucht-Effektivitäts-Bereich zu eingeschränkt, erhöhe die obere, bzw. erniedrige die untere Grenze.
+
+
+ Deaktiviere alle Sperre-domestizierte-Level-Schlösser (setze alle Schloss-Symbole auf grün und offen).
+
+
+ Der Imprinting Wert ist gesperrt, weil "Exakt, nicht anpassen" aktiviert ist, und der Extraktor diesen Wert nicht anpassen kann, dies kann eine erfolgreiche Extraktion verhindern.
+
+
+ Manchmal aktualisiert ARK die Stat-Werte nach einer Prägung nicht direkt. Versuche die Extraktion erneut nachdem die Kreatur in einem Cryopod war.
+
+
+ Der eingegebene Prägungs-Wert ist mit den eingestellten Server-Multiplikatoren nicht möglich.
+Stelle sicher, dass die Werte von BabyCuddleIntervallMultiplier und BabyMatureSpeedMultiplier in den Einstellungen wie auf dem Server eingestellt sind.
+
+
+ Stelle sicher dass die Einzelspieler-Einstellung in den Einstellungen wie im Spiel gesetzt ist.
+
+
+ Passe den Wert "Berücksichtige wilde Level" in den Einstellung an oder deaktiviere sie.
+
+
+ Die Einstellung "Maximales wildes Level" ist zu niedrig, passe sie auf den Wert des Servers an.
+
+
+ Die Stat Multiplikatoren in den Einstellungen entsprechen nicht denen auf dem Server. Frage den Admin über die korrekten Werte und passe sie in den Einstellungen an.
+
+
+ Die Stat-Werte der Kreatur wurden möglicherweise kürzlich im Spiel geändert und das Spiel zeigt noch die alten Werte an. Cryo die Kreatur oder levele den entsprechenden Stat auf, um die Werte zu aktualisieren.
+
+
+ Überprüfe ob das Gesamtlevel der Kreatur richtig eingegeben wurde.
+Wenn die Kreature gezüchtet ist, überprüfe auch den BabyStatScaleImprintingMultiplier.
+
+
+ Diese Spezies ist bekannt dafür in ARK falsche Werte anzuzeigen, dies kann eine erfolgreiche Extraktion verhindern.
+
+
+ BSS Preset
+
+
+ BSS speichern
+
+
+ Speichere Besitzer, Stamm und Server als Voreinstellung.
+Diese kann mit BSS Preset angewandt werden.
+
+
+ Setze die Werte für Besitzer, Stamm und Server von der Voreinstellung ein.
+
+
+ Nur die beste Empfehlung für Weibchen
+
+
+ Ein Partner kann mehr Mutationen haben
+
+
+ keine Farbe
+
+
+ top Level
+
+
+ neues top Level
+
+
+ Halte Strg für zufällige Farben
+
+
+ Lösche Farben
+
\ No newline at end of file
diff --git a/ARKBreedingStats/local/strings.es.resx b/ARKBreedingStats/local/strings.es.resx
index 09a3c181..7a611e92 100644
--- a/ARKBreedingStats/local/strings.es.resx
+++ b/ARKBreedingStats/local/strings.es.resx
@@ -992,4 +992,22 @@ Algunas crías pueden ser peores que en el modo de estadísticas altas, pero tam
Co&nfiguracíón
+
+ sin color
+
+
+ nivel superior
+
+
+ nuevo nivel superior
+
+
+ eliminar colores
+
+
+ servidores
+
+
+ mostrar solo colores naturales
+
\ No newline at end of file
diff --git a/ARKBreedingStats/local/strings.fr.resx b/ARKBreedingStats/local/strings.fr.resx
index 1439f5b8..12f63263 100644
--- a/ARKBreedingStats/local/strings.fr.resx
+++ b/ARKBreedingStats/local/strings.fr.resx
@@ -1017,4 +1017,19 @@ Certaines progénitures peuvent être moins bonnes qu'en mode Statistiques Elev
Ajouté à
+
+ sans couleur
+
+
+ haut niveau
+
+
+ nouveau niveau supérieur
+
+
+ serveurs
+
+
+ n'afficher que les couleurs naturelles
+
\ No newline at end of file
diff --git a/ARKBreedingStats/local/strings.it.resx b/ARKBreedingStats/local/strings.it.resx
index 56203c3b..f01d5921 100644
--- a/ARKBreedingStats/local/strings.it.resx
+++ b/ARKBreedingStats/local/strings.it.resx
@@ -311,9 +311,6 @@ Se lo strumento riconosce il nome della specie, lo prenderà, altrimenti control
Tutti i livelli, TE e IB del Tester, e i valori delle statistiche dell'estrattore saranno copiati in Stat-Multiplier-Tester
-
- Creature
-
Balestra
@@ -671,9 +668,6 @@ Se viene visualizzato un numero con un segno più, la somma è troppo alta e dev
Pedigree
-
-
-
Giocatore
@@ -928,4 +922,22 @@ Questa modalità arriverà alla miglior prole possibile, ferma e sicura.Alcune p
Impostazioni
+
+ Creatura
+
+
+ nessun colore
+
+
+ livello superiore
+
+
+ nuovo livello superiore
+
+
+ server
+
+
+ mostra solo i colori naturali
+
\ No newline at end of file
diff --git a/ARKBreedingStats/local/strings.resx b/ARKBreedingStats/local/strings.resx
index 6e4a9224..2750032e 100644
--- a/ARKBreedingStats/local/strings.resx
+++ b/ARKBreedingStats/local/strings.resx
@@ -130,7 +130,7 @@
Body
- Bonus-Level
+ Bonus Level
Bow
@@ -898,19 +898,19 @@ The chance for an overall good creature is better.
Check if it's not important to have a Top-Stats-Offspring.
- Top Stats Lc
+ Combine top stats lucky
- Top Stats Cn
+ Combine top stats steady
- Top Stats, Conservative.
+ Combine top stats steady
Check for best long-term-results and if you want to go safe.
This mode will get to the best possible offspring steady and surely.
Some offsprings might be worse than in High-Stats-Mode, but that's the mode you go if you want to have that perfect creature in some generations.
- Top Stats, Feeling Lucky.
+ Combine top stats steady
Check for best long-term-results and if you're feeling lucky. It can be faster to get the perfect creature than in the Top-Stat-Conservative-Mode if you're lucky.
Some offsprings might be worse than in High-Stats-Mode, but you also have a chance to the best possible offspring.
@@ -1019,4 +1019,146 @@ Some offsprings might be worse than in High-Stats-Mode, but you also have a chan
Added at
+
+ All
+
+
+ n/a
+
+
+ Show only natural occuring colors
+
+
+ apply
+
+
+ Library Filter
+
+
+ owners
+
+
+ servers
+
+
+ tags
+
+
+ tribes
+
+
+ Use filter in top stat calculation
+
+
+ Clear Color Filters
+
+
+ Group library by species
+
+
+ Filter library…
+
+
+ Only creatures that have this color
+
+
+ Owner filter from library
+
+
+ Possible Level-Range: {0}–{1}
+
+
+ Server filter from library
+
+
+ Tribe filter from library
+
+
+ Clear
+
+
+ Only creatures with all of these flags will be displayed
+
+
+ Filter by name
+
+
+ Creatures with this flag will not be shown
+
+
+ Only creatures with one of these flags will be displayed
+
+
+ Double check if all stat-values are entered correctly.
+
+
+ Make sure the correct state (wild, tamed, bred) for the creature is chosen.
+
+
+ Taming-Effectiveness-Range too narrow, increase the upper and / or decrase the lower bound.
+
+
+ Uncheck all Lock-to-Zero-buttons in the stats (all lock-symbols should be green and opened).
+
+
+ You locked the imprinting-value by checking "Exactly, don't adjust" and the tool won't adjust it, this may cause the extraction to fail.
+
+
+ Sometimes the game doesn't update the stat-value after an imprinting. Try the extraction after the creature was cryoed again.
+
+
+ The imprinting-percentage given is not possible with the current multipliers and may cause wrong values during the extraction-process.
+Make sure the BabyCuddleIntervallMultiplier and the BabyMatureSpeedMultiplier are set correctly.
+They may have to be set to the value when the creature hatched/was born, even if they were changed.
+
+
+ If you have enabled the Singleplayer-Settings in the game, make sure the according checkbox is enabled in the settings in this application as well.
+
+
+ Adjust or disable the "Consider Wild-level - steps" in the settings.
+
+
+ The maximal wild level is set too low, go to the settings and adjust it.
+
+
+ The stat multipliers in the Settings are not set to the multipliers of the server. Ask your admin for the correct multipliers and adjust them in the Settings.
+
+
+ The stats of the creature were changed recently and the game displays the old values. Level up a stat, that should trigger a recalculation of the values.
+
+
+ Check if the total level of the creature is entered correctly.
+If the creature is bred, also check if the BabyStatScaleImprintingBonus is set correctly.
+
+
+ This species is known to show wrong stat values ingame, this can prevent a successful extraction.
+
+
+ Apply OTS Preset
+
+
+ Save OTS
+
+
+ Save Owner, Tribe and Server as preset.
+The preset can be applied by the Apply Preset button
+
+
+ Set the values for owner, tribe and server from the saved preset
+
+
+ no color
+
+
+ top level
+
+
+ new top level
+
+
+ clear colors
+
+
+ Hold Ctrl for random colors
+
\ No newline at end of file
diff --git a/ARKBreedingStats/local/strings.zh.resx b/ARKBreedingStats/local/strings.zh.resx
index ebacfaeb..4ed79676 100644
--- a/ARKBreedingStats/local/strings.zh.resx
+++ b/ARKBreedingStats/local/strings.zh.resx
@@ -297,9 +297,6 @@
Club
-
- 包括具有冷却的生物
-
颜色
@@ -569,9 +566,6 @@ If a number with a plus sign is shown, the sum is too high and you need to choos
库
-
-
-
&读取...
@@ -935,4 +929,19 @@ If a number with a plus sign is shown, the sum is too high and you need to choos
最差可能
+
+ 加载和添加…
+
+
+ 包括具有冷却的生物
+
+
+ 没有颜色
+
+
+ 伺服器
+
+
+ 仅显示自然发生的颜色
+
\ No newline at end of file
diff --git a/ARKBreedingStats/miscClasses/IssueNotes.cs b/ARKBreedingStats/miscClasses/IssueNotes.cs
index 58bfe24c..5c666b92 100644
--- a/ARKBreedingStats/miscClasses/IssueNotes.cs
+++ b/ARKBreedingStats/miscClasses/IssueNotes.cs
@@ -8,6 +8,11 @@ namespace ARKBreedingStats.miscClasses
///
public static class IssueNotes
{
+ ///
+ /// Returns a list of possible reasons that could cause the issues.
+ ///
+ ///
+ ///
public static string getHelpTexts(Issue issues)
{
List notes = new List();
@@ -16,36 +21,32 @@ public static string getHelpTexts(Issue issues)
while (i >= n)
{
if ((i & n) != 0)
- notes.Add((notes.Count + 1).ToString() + ". " + getHelpText((Issue)n));
+ notes.Add($"{(notes.Count + 1)}. {GetHelpText((Issue)n)}");
n <<= 1;
}
return string.Join("\n\n", notes.ToArray());
}
- private static string getHelpText(Issue issue)
+ private static string GetHelpText(Issue issue)
{
switch (issue)
{
- case Issue.Typo: return "Double check if all stat-values are entered correctly.";
- case Issue.WildTamedBred: return "Make sure the correct state (wild, tamed, bred) for the creature is chosen.";
- case Issue.TamingEffectivenessRange: return "Taming-Effectiveness-Range too narrow, increase the upper and / or decrase the lower bound.";
- case Issue.LockedDom: return "Uncheck all Lock-to-Zero-buttons in the stats (all lock-symbols should be green and opened).";
- case Issue.ImprintingLocked: return "You locked the imprinting-value by checking \"Exactly, don't adjust\" and the tool won't adjust it, this may cause the extraction to fail.";
- case Issue.ImprintingNotUpdated: return "Sometimes the game doesn't update the stat-value after an imprinting. Try to leave and re-enter the render-distance or (wait for a) restart the server and try again.";
- case Issue.ImprintingNotPossible:
- return "The imprinting-percentage given is not possible with the current multipliers and may cause wrong values during the extraction-process.\n"
- + "Make sure the BabyCuddleIntervallMultiplier and the BabyMatureSpeedMultiplier are set correctly.\n"
- + "They may have to be set to the value when the creature hatched/was born, even if they were changed.";
- case Issue.Singleplayer: return "If you have enabled the Singleplayer-Settings in the game, make sure the according checkbox is enabled in the settings in this application as well";
- case Issue.WildLevelSteps: return "Adjust or disable the \"Consider Wild-level - steps\" in the settings.";
- case Issue.MaxWildLevel: return "The maximal wild level is set too low, go to the settings and adjust it";
- case Issue.StatMultipliers: return "The multipliers in the Settings (File - Settings) are not set to the multipliers of the server. Ask your admin for the correct multipliers and adjust them in the Settings.";
- case Issue.OutdatedIngameValues: return "The stats of the creature were changed recently and the game displays the old values. Level up a stat, that should trigger a recalculation of the values.";
- case Issue.ASBUpdate: return "The stat-values in this tool are wrong or the game does show wrong stats. You can send me a screenshot that contains the stats of the creature ingame and the extractor with the typed in values along with the stat-multipliers in the settings via reddit or github.";
- case Issue.CreatureLevel: return "Check if the total level of the creature is entered correctly.\nIf the creature is bred, also check if the BabyStatScaleImprintingBonus is set correctly.";
- case Issue.ARKStatIssue: return "This species is known to show wrong stat values ingame, this can prevent a successful extraction.";
+ case Issue.Typo: return Loc.S("issueCauseTypo");
+ case Issue.WildTamedBred: return Loc.S("issueCauseWildTamedBred");
+ case Issue.TamingEffectivenessRange: return Loc.S("issueCauseTamingEffectivenessRange");
+ case Issue.LockedDom: return Loc.S("issueCauseLockedDomLevel");
+ case Issue.ImprintingLocked: return Loc.S("issueCauseImprintingLocked");
+ case Issue.ImprintingNotUpdated: return Loc.S("issueCauseImprintingNotUpdated");
+ case Issue.ImprintingNotPossible: return Loc.S("issueCauseImprintingNotPossible");
+ case Issue.Singleplayer: return Loc.S("issueCauseSingleplayer");
+ case Issue.WildLevelSteps: return Loc.S("issueCauseWildLevelSteps");
+ case Issue.MaxWildLevel: return Loc.S("issueCauseMaxWildLevel");
+ case Issue.StatMultipliers: return Loc.S("issueCauseStatMultipliers");
+ case Issue.ArkStatIssue: return Loc.S("issueCauseArkStatIssue");
+ case Issue.CreatureLevel: return Loc.S("issueCauseCreatureLevel");
+ case Issue.OutdatedIngameValues: return Loc.S("issueCauseOutdatedIngameValues");
}
- return "";
+ return string.Empty;
}
// order the enums according to their desired position in the issue-help, i.e. critical and common issues first
@@ -65,9 +66,8 @@ public enum Issue
TamingEffectivenessRange = 512,
ImprintingLocked = 1024,
WildLevelSteps = 2048,
- OutdatedIngameValues = 4096,
- ASBUpdate = 8192,
- ARKStatIssue = 16384
+ ArkStatIssue = 4096,
+ OutdatedIngameValues = 8192
}
}
}
diff --git a/ARKBreedingStats/mods/HandleUnknownMods.cs b/ARKBreedingStats/mods/HandleUnknownMods.cs
index dbb9197c..c905a050 100644
--- a/ARKBreedingStats/mods/HandleUnknownMods.cs
+++ b/ARKBreedingStats/mods/HandleUnknownMods.cs
@@ -34,10 +34,12 @@ public static (List locallyAvailableModFiles, List onlineAvailab
{
if (Values.V.modsManifest.modsByTag.ContainsKey(modTag))
{
- if (Values.V.modsManifest.modsByTag[modTag].downloaded)
+ if (Values.V.modsManifest.modsByTag[modTag].locallyAvailable)
locallyAvailableModFiles.Add(modTag);
- else
+ else if (Values.V.modsManifest.modsByTag[modTag].onlineAvailable)
onlineAvailableModFiles.Add(modTag);
+ else
+ unavailableModFiles.Add(modTag);
}
else
unavailableModFiles.Add(modTag);
diff --git a/ARKBreedingStats/mods/ModInfo.cs b/ARKBreedingStats/mods/ModInfo.cs
index 15b478e7..d34718ba 100644
--- a/ARKBreedingStats/mods/ModInfo.cs
+++ b/ARKBreedingStats/mods/ModInfo.cs
@@ -19,9 +19,9 @@ public class ModInfo
///
/// Indicates if the according json-file is downloaded.
///
- public bool downloaded;
+ public bool locallyAvailable;
///
- /// If true the modInfo is available online. If not it's probably customly created.
+ /// If true the modInfo is available online. If not it's probably manually created.
///
public bool onlineAvailable;
public bool currentlyInLibrary;
@@ -35,7 +35,9 @@ private void SetVersion(StreamingContext context)
public override string ToString()
{
return (mod?.title ?? "unknown mod")
- + (!downloaded && onlineAvailable ? " (DL)" : "");
+ + (onlineAvailable
+ ? (!locallyAvailable ? " (DL)" : string.Empty)
+ : " (Custom)");
}
}
}
diff --git a/ARKBreedingStats/mods/ModValuesManager.Designer.cs b/ARKBreedingStats/mods/ModValuesManager.Designer.cs
index ce458586..8a9257ea 100644
--- a/ARKBreedingStats/mods/ModValuesManager.Designer.cs
+++ b/ARKBreedingStats/mods/ModValuesManager.Designer.cs
@@ -51,6 +51,9 @@ private void InitializeComponent()
this.btClose = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.btAddMod = new System.Windows.Forms.Button();
+ this.BtRemoveAllMods = new System.Windows.Forms.Button();
+ this.label5 = new System.Windows.Forms.Label();
+ this.LbModVersion = new System.Windows.Forms.Label();
this.tableLayoutPanel1.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox1.SuspendLayout();
@@ -84,6 +87,7 @@ private void InitializeComponent()
this.tableLayoutPanel1.Controls.Add(this.btClose, 3, 2);
this.tableLayoutPanel1.Controls.Add(this.groupBox2, 2, 0);
this.tableLayoutPanel1.Controls.Add(this.btAddMod, 1, 0);
+ this.tableLayoutPanel1.Controls.Add(this.BtRemoveAllMods, 1, 2);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
@@ -131,6 +135,8 @@ private void InitializeComponent()
//
// groupBox1
//
+ this.groupBox1.Controls.Add(this.label5);
+ this.groupBox1.Controls.Add(this.LbModVersion);
this.groupBox1.Controls.Add(this.lbAvailableForDownload);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.llbSteamPage);
@@ -149,8 +155,9 @@ private void InitializeComponent()
//
// lbAvailableForDownload
//
+ this.lbAvailableForDownload.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.lbAvailableForDownload.AutoSize = true;
- this.lbAvailableForDownload.Location = new System.Drawing.Point(6, 185);
+ this.lbAvailableForDownload.Location = new System.Drawing.Point(7, 215);
this.lbAvailableForDownload.Name = "lbAvailableForDownload";
this.lbAvailableForDownload.Size = new System.Drawing.Size(223, 13);
this.lbAvailableForDownload.TabIndex = 7;
@@ -160,6 +167,7 @@ private void InitializeComponent()
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(6, 25);
+ this.label2.Margin = new System.Windows.Forms.Padding(3);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(57, 13);
this.label2.TabIndex = 0;
@@ -168,7 +176,8 @@ private void InitializeComponent()
// llbSteamPage
//
this.llbSteamPage.AutoSize = true;
- this.llbSteamPage.Location = new System.Drawing.Point(6, 79);
+ this.llbSteamPage.Location = new System.Drawing.Point(6, 101);
+ this.llbSteamPage.Margin = new System.Windows.Forms.Padding(3);
this.llbSteamPage.Name = "llbSteamPage";
this.llbSteamPage.Size = new System.Drawing.Size(88, 13);
this.llbSteamPage.TabIndex = 6;
@@ -179,7 +188,8 @@ private void InitializeComponent()
// label3
//
this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(6, 61);
+ this.label3.Location = new System.Drawing.Point(7, 82);
+ this.label3.Margin = new System.Windows.Forms.Padding(3);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(39, 13);
this.label3.TabIndex = 1;
@@ -188,7 +198,8 @@ private void InitializeComponent()
// lbModId
//
this.lbModId.AutoSize = true;
- this.lbModId.Location = new System.Drawing.Point(106, 61);
+ this.lbModId.Location = new System.Drawing.Point(106, 82);
+ this.lbModId.Margin = new System.Windows.Forms.Padding(3);
this.lbModId.Name = "lbModId";
this.lbModId.Size = new System.Drawing.Size(15, 13);
this.lbModId.TabIndex = 5;
@@ -197,7 +208,8 @@ private void InitializeComponent()
// label4
//
this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(6, 43);
+ this.label4.Location = new System.Drawing.Point(7, 63);
+ this.label4.Margin = new System.Windows.Forms.Padding(3);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(46, 13);
this.label4.TabIndex = 2;
@@ -206,7 +218,8 @@ private void InitializeComponent()
// lbModTag
//
this.lbModTag.AutoSize = true;
- this.lbModTag.Location = new System.Drawing.Point(106, 43);
+ this.lbModTag.Location = new System.Drawing.Point(106, 63);
+ this.lbModTag.Margin = new System.Windows.Forms.Padding(3);
this.lbModTag.Name = "lbModTag";
this.lbModTag.Size = new System.Drawing.Size(22, 13);
this.lbModTag.TabIndex = 4;
@@ -217,6 +230,7 @@ private void InitializeComponent()
this.lbModName.AutoSize = true;
this.lbModName.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lbModName.Location = new System.Drawing.Point(106, 25);
+ this.lbModName.Margin = new System.Windows.Forms.Padding(3);
this.lbModName.Name = "lbModName";
this.lbModName.Size = new System.Drawing.Size(46, 16);
this.lbModName.TabIndex = 3;
@@ -319,6 +333,36 @@ private void InitializeComponent()
this.btAddMod.UseVisualStyleBackColor = true;
this.btAddMod.Click += new System.EventHandler(this.BtAddMod_Click);
//
+ // BtRemoveAllMods
+ //
+ this.BtRemoveAllMods.Location = new System.Drawing.Point(236, 477);
+ this.BtRemoveAllMods.Name = "BtRemoveAllMods";
+ this.BtRemoveAllMods.Size = new System.Drawing.Size(34, 23);
+ this.BtRemoveAllMods.TabIndex = 7;
+ this.BtRemoveAllMods.Text = "≪";
+ this.BtRemoveAllMods.UseVisualStyleBackColor = true;
+ this.BtRemoveAllMods.Click += new System.EventHandler(this.BtRemoveAllMods_Click);
+ //
+ // label5
+ //
+ this.label5.AutoSize = true;
+ this.label5.Location = new System.Drawing.Point(6, 44);
+ this.label5.Margin = new System.Windows.Forms.Padding(3);
+ this.label5.Name = "label5";
+ this.label5.Size = new System.Drawing.Size(65, 13);
+ this.label5.TabIndex = 8;
+ this.label5.Text = "Mod version";
+ //
+ // LbModVersion
+ //
+ this.LbModVersion.AutoSize = true;
+ this.LbModVersion.Location = new System.Drawing.Point(106, 44);
+ this.LbModVersion.Margin = new System.Windows.Forms.Padding(3);
+ this.LbModVersion.Name = "LbModVersion";
+ this.LbModVersion.Size = new System.Drawing.Size(41, 13);
+ this.LbModVersion.TabIndex = 9;
+ this.LbModVersion.Text = "version";
+ //
// ModValuesManager
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -328,7 +372,7 @@ private void InitializeComponent()
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
this.Name = "ModValuesManager";
this.ShowInTaskbar = false;
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = "Mod Values Manager";
this.tableLayoutPanel1.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
@@ -365,5 +409,8 @@ private void InitializeComponent()
private System.Windows.Forms.Button btAddMod;
private System.Windows.Forms.Label lbAvailableForDownload;
private System.Windows.Forms.Button btOpenValuesFolder;
+ private System.Windows.Forms.Button BtRemoveAllMods;
+ private System.Windows.Forms.Label label5;
+ private System.Windows.Forms.Label LbModVersion;
}
}
\ No newline at end of file
diff --git a/ARKBreedingStats/mods/ModValuesManager.cs b/ARKBreedingStats/mods/ModValuesManager.cs
index 03fa0645..bd880654 100644
--- a/ARKBreedingStats/mods/ModValuesManager.cs
+++ b/ARKBreedingStats/mods/ModValuesManager.cs
@@ -79,12 +79,11 @@ private void BtLoadModFile_Click(object sender, EventArgs e)
{
if (cc.ModList.Contains(modValues.mod))
{
- MessageBox.Show("The mod\n" + modValues.mod.title + "\nis already loaded.", "Already loaded", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ MessageBox.Show($"The mod\n{modValues.mod.title}\nis already loaded.", "Already loaded", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
cc.ModList.Add(modValues.mod);
- Values.V.UpdateManualModValueFiles();
UpdateModListBoxes();
}
}
@@ -151,7 +150,10 @@ private void UpdateModListBoxes()
foreach (ModInfo mi in modInfos)
{
- if (!mi.currentlyInLibrary) lbAvailableModFiles.Items.Add(mi);
+ if (!mi.currentlyInLibrary)
+ {
+ lbAvailableModFiles.Items.Add(mi);
+ }
}
lbModList.SelectedItem = selectedMiLib;
@@ -178,8 +180,10 @@ private void DisplayModInfo(ModInfo modInfo)
{
if (modInfo?.mod == null) return;
lbModName.Text = modInfo.mod.title;
+ LbModVersion.Text = modInfo.version;
lbModTag.Text = modInfo.mod.tag;
lbModId.Text = modInfo.mod.id;
+ llbSteamPage.Visible = modInfo.onlineAvailable; // it's assumed that the officially supported mods all have a steam page
}
private void BtClose_Click(object sender, EventArgs e)
@@ -243,5 +247,17 @@ private void LbModList_MouseDoubleClick(object sender, MouseEventArgs e)
{
RemoveSelectedMod();
}
+
+ private void BtRemoveAllMods_Click(object sender, EventArgs e)
+ {
+ ModInfo mi = (ModInfo)lbModList.SelectedItem;
+ if (mi?.mod == null || cc?.ModList == null) return;
+
+ cc.ModList.Clear();
+
+ UpdateModListBoxes();
+ lbModList.SelectedIndex = -1;
+ lbAvailableModFiles.SelectedItem = null;
+ }
}
}
diff --git a/ARKBreedingStats/mods/ModsManifest.cs b/ARKBreedingStats/mods/ModsManifest.cs
index 1a4d97bd..3f4ee309 100644
--- a/ARKBreedingStats/mods/ModsManifest.cs
+++ b/ARKBreedingStats/mods/ModsManifest.cs
@@ -1,6 +1,7 @@
using Newtonsoft.Json;
using System.Collections.Generic;
using System.IO;
+using System.Linq;
using System.Runtime.Serialization;
using System.Threading.Tasks;
@@ -43,38 +44,45 @@ public ModsManifest()
///
public static async Task TryLoadModManifestFile(bool forceDownload = false, int downloadTry = 0)
{
- string modsManifestPath = Path.Combine(FileService.ValuesFolder, FileService.ModsManifest);
- if (forceDownload || !File.Exists(FileService.GetJsonPath(modsManifestPath)))
- await TryDownloadFileAsync();
-
- if (FileService.LoadJSONFile(FileService.GetJsonPath(modsManifestPath), out ModsManifest tmpV, out string errorMessage))
- {
- tmpV.Initialize();
- return tmpV;
- }
- else
+ while (true)
{
+ string modsManifestPath = Path.Combine(FileService.ValuesFolder, FileService.ModsManifest);
+ if (forceDownload || !File.Exists(FileService.GetJsonPath(modsManifestPath))) await TryDownloadFileAsync();
+
+ if (FileService.LoadJSONFile(FileService.GetJsonPath(modsManifestPath), out ModsManifest tmpV, out string errorMessage))
+ {
+ return tmpV;
+ }
+
if (!forceDownload && downloadTry == 0)
{
- // file is probably corrupted, try to redownload
- return await TryLoadModManifestFile(forceDownload: true, downloadTry: 1);
+ // file is probably corrupted, try to redownload it
+ forceDownload = true;
+ downloadTry = 1;
+ continue;
}
- else throw new SerializationException(errorMessage);
+
+ throw new SerializationException(errorMessage);
}
}
- private void Initialize()
+ ///
+ /// Users can create an additional custom manifest file for manually created mod files. If available, it's loaded with this method.
+ ///
+ ///
+ public static bool TryLoadCustomModManifestFile(out ModsManifest customModsManifest)
{
- string valuesPath = FileService.GetJsonPath(FileService.ValuesFolder);
- foreach (KeyValuePair mi in modsByFiles)
+ customModsManifest = null;
+ string filePath = FileService.GetJsonPath(FileService.ValuesFolder, FileService.ModsManifestCustom);
+ if (!File.Exists(filePath)) return false;
+
+ if (FileService.LoadJSONFile(filePath, out ModsManifest tmpV, out string errorMessage))
{
- if (mi.Value.mod != null)
- {
- mi.Value.mod.FileName = mi.Key;
- mi.Value.onlineAvailable = true;
- mi.Value.downloaded = mi.Value.mod.FileName != null && File.Exists(Path.Combine(valuesPath, mi.Value.mod.FileName));
- }
+ customModsManifest = tmpV;
+ return true;
}
+
+ throw new SerializationException(errorMessage);
}
///
@@ -86,20 +94,30 @@ private static async Task TryDownloadFileAsync()
return await Updater.DownloadModsManifest();
}
- [OnDeserialized]
- private void SetModDictionaries(StreamingContext c)
+ ///
+ /// The manifest file only contains a dictionary by fileName. This method initializes the other properties.
+ ///
+ internal void Initialize()
{
modsByTag = new Dictionary();
modsByID = new Dictionary();
+ string valuesPath = FileService.GetJsonPath(FileService.ValuesFolder);
+
foreach (KeyValuePair fmi in modsByFiles)
{
- if (!string.IsNullOrEmpty(fmi.Value.mod?.tag)
+ if (fmi.Value.mod == null) continue;
+
+ fmi.Value.mod.FileName = fmi.Key;
+ fmi.Value.locallyAvailable = !string.IsNullOrEmpty(fmi.Value.mod.FileName) && File.Exists(Path.Combine(valuesPath, fmi.Value.mod.FileName));
+
+ if (!string.IsNullOrEmpty(fmi.Value.mod.tag)
&& !modsByTag.ContainsKey(fmi.Value.mod.tag))
{
modsByTag.Add(fmi.Value.mod.tag, fmi.Value);
}
- if (!string.IsNullOrEmpty(fmi.Value.mod?.id)
+
+ if (!string.IsNullOrEmpty(fmi.Value.mod.id)
&& !modsByID.ContainsKey(fmi.Value.mod.id))
{
modsByID.Add(fmi.Value.mod.id, fmi.Value);
@@ -120,11 +138,24 @@ public bool DownloadModFiles(List modValueFiles)
if (Updater.DownloadModValuesFile(mf)
&& modsByFiles.ContainsKey(mf))
{
- modsByFiles[mf].downloaded = true;
+ modsByFiles[mf].locallyAvailable = true;
filesDownloaded = true;
}
}
return filesDownloaded;
}
+
+ ///
+ /// Merges two mod manifests (while for duplicate entries the manifest2 item will be kept) and returns the combined one. This is used to combine the official manifest with the custom created manifest.
+ ///
+ ///
+ ///
+ ///
+ internal static ModsManifest MergeModsManifest(ModsManifest manifest1, ModsManifest manifest2)
+ => new ModsManifest()
+ {
+ modsByFiles = manifest2.modsByFiles.Concat(manifest1.modsByFiles.Where(m1 => !manifest2.modsByFiles.ContainsKey(m1.Key))).ToDictionary(m => m.Key, m => m.Value)
+ };
+
}
}
diff --git a/ARKBreedingStats/multiplierTesting/StatMultiplierTestingControl.cs b/ARKBreedingStats/multiplierTesting/StatMultiplierTestingControl.cs
index ed42dce0..6a0940e2 100644
--- a/ARKBreedingStats/multiplierTesting/StatMultiplierTestingControl.cs
+++ b/ARKBreedingStats/multiplierTesting/StatMultiplierTestingControl.cs
@@ -141,16 +141,16 @@ public double[] StatMultipliers
}
}
- public void SetStatValues(double[] statValues)
+ public void SetStatValues(double[] statValues, double?[] customOverrides)
{
if (statValues != null && statValues.Length == 5)
{
updateValues = false;
- nudB.Value = (decimal)statValues[0];
- nudIw.Value = (decimal)statValues[1];
- nudId.Value = (decimal)statValues[2];
- nudTa.Value = (decimal)statValues[3];
- nudTm.Value = (decimal)statValues[4];
+ nudB.Value = (decimal)(customOverrides?[0] ?? statValues[0]);
+ nudIw.Value = (decimal)(customOverrides?[1] ?? statValues[1]);
+ nudId.Value = (decimal)(customOverrides?[2] ?? statValues[2]);
+ nudTa.Value = (decimal)(customOverrides?[3] ?? statValues[3]);
+ nudTm.Value = (decimal)(customOverrides?[4] ?? statValues[4]);
UpdateCalculations(true);
}
}
diff --git a/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.cs b/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.cs
index a184c790..c09bf260 100644
--- a/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.cs
+++ b/ARKBreedingStats/multiplierTesting/StatsMultiplierTesting.cs
@@ -15,7 +15,7 @@ public partial class StatsMultiplierTesting : UserControl
public event Action OnApplyMultipliers;
private readonly List statControls;
- private CreatureCollection cc;
+ private CreatureCollection _cc;
private Species selectedSpecies;
private Nud fineAdjustmentsNud;
private MinMaxDouble fineAdjustmentRange;
@@ -195,18 +195,18 @@ private void rbBred_CheckedChanged(object sender, EventArgs e)
///
private void SetStatMultipliersFromCC()
{
- if (cc?.serverMultipliers?.statMultipliers == null) return;
+ if (_cc?.serverMultipliers?.statMultipliers == null) return;
for (int s = 0; s < Values.STATS_COUNT; s++)
{
var m = new double[4];
for (int i = 0; i < 4; i++)
- m[i] = cc.serverMultipliers.statMultipliers[s]?[i] ?? 1;
+ m[i] = _cc.serverMultipliers.statMultipliers[s]?[i] ?? 1;
statControls[s].StatMultipliers = m;
}
- SetIBM(cc.serverMultipliers.BabyImprintingStatScaleMultiplier);
+ SetIBM(_cc.serverMultipliers.BabyImprintingStatScaleMultiplier);
- cbSingleplayerSettings.Checked = cc.singlePlayerSettings;
+ cbSingleplayerSettings.Checked = _cc.singlePlayerSettings;
btUseMultipliersFromSettings.Visible = false;
}
@@ -216,10 +216,15 @@ public void SetSpecies(Species species, bool forceUpdate = false)
if (species != null && (forceUpdate || cbUpdateOnSpeciesChange.Checked))
{
selectedSpecies = species;
+
+ double?[][] customStatOverrides = null;
+ bool customStatsAvailable =
+ _cc?.CustomSpeciesStats?.TryGetValue(species.blueprintPath, out customStatOverrides) ?? false;
+
for (int s = 0; s < Values.STATS_COUNT; s++)
{
- statControls[s].SetStatValues(selectedSpecies.fullStatsRaw[s]);
- statControls[s].StatImprintingBonusMultiplier = selectedSpecies.StatImprintMultipliers[s];
+ statControls[s].SetStatValues(selectedSpecies.fullStatsRaw[s], customStatsAvailable ? customStatOverrides?[s] : null);
+ statControls[s].StatImprintingBonusMultiplier = customStatsAvailable ? customStatOverrides?[Values.STATS_COUNT]?[s] ?? selectedSpecies.StatImprintMultipliers[s] : selectedSpecies.StatImprintMultipliers[s];
statControls[s].Visible = species.UsesStat(s);
}
statControls[(int)StatNames.Health].TBHM = selectedSpecies.TamedBaseHealthMultiplier;
@@ -283,17 +288,17 @@ public void SetCreatureValues(double[] statValues, int[] levelsWild, int[] level
internal void CheckIfMultipliersAreEqualToSettings()
{
bool showWarning = false;
- if (cc?.serverMultipliers?.statMultipliers != null)
+ if (_cc?.serverMultipliers?.statMultipliers != null)
{
- showWarning = cc.serverMultipliers.BabyImprintingStatScaleMultiplier != (double)nudIBM.Value
- || cc.singlePlayerSettings != cbSingleplayerSettings.Checked;
+ showWarning = _cc.serverMultipliers.BabyImprintingStatScaleMultiplier != (double)nudIBM.Value
+ || _cc.singlePlayerSettings != cbSingleplayerSettings.Checked;
if (!showWarning)
{
for (int s = 0; s < Values.STATS_COUNT; s++)
{
for (int si = 0; si < 4; si++)
{
- showWarning = cc.serverMultipliers.statMultipliers[s][si] != statControls[s].StatMultipliers[si];
+ showWarning = _cc.serverMultipliers.statMultipliers[s][si] != statControls[s].StatMultipliers[si];
if (showWarning) break;
}
if (showWarning) break;
@@ -312,7 +317,7 @@ public CreatureCollection CreatureCollection
{
set
{
- cc = value;
+ _cc = value;
SetStatMultipliersFromCC();
}
}
@@ -376,12 +381,12 @@ private void useDefaultStatMultipliersToolStripMenuItem_Click(object sender, Eve
private void copyStatMultipliersToSettingsToolStripMenuItem_Click(object sender, EventArgs e)
{
- if (cc?.serverMultipliers?.statMultipliers == null) return;
+ if (_cc?.serverMultipliers?.statMultipliers == null) return;
for (int s = 0; s < Values.STATS_COUNT; s++)
- cc.serverMultipliers.statMultipliers[s] = statControls[s].StatMultipliers;
- cc.serverMultipliers.BabyImprintingStatScaleMultiplier = (double)nudIBM.Value;
- cc.singlePlayerSettings = cbSingleplayerSettings.Checked;
+ _cc.serverMultipliers.statMultipliers[s] = statControls[s].StatMultipliers;
+ _cc.serverMultipliers.BabyImprintingStatScaleMultiplier = (double)nudIBM.Value;
+ _cc.singlePlayerSettings = cbSingleplayerSettings.Checked;
OnApplyMultipliers?.Invoke();
btUseMultipliersFromSettings.Visible = false;
}
diff --git a/ARKBreedingStats/oldLibraryFormat/FormatConverter.cs b/ARKBreedingStats/oldLibraryFormat/FormatConverter.cs
index 47451d77..cd1f577b 100644
--- a/ARKBreedingStats/oldLibraryFormat/FormatConverter.cs
+++ b/ARKBreedingStats/oldLibraryFormat/FormatConverter.cs
@@ -112,7 +112,7 @@ public static void UpgradeFormatTo12Stats(CreatureCollectionOld ccOld, CreatureC
owner = c.owner,
server = c.server,
sex = c.sex,
- status = c.status,
+ Status = c.status,
tags = c.tags,
tamingEff = c.tamingEff,
tribe = c.tribe
@@ -230,9 +230,6 @@ public static void TransferParameters(CreatureCollectionOld ccOld, CreatureColle
ccNew.allowMoreThanHundredImprinting = ccOld.allowMoreThanHundredImprinting;
ccNew.changeCreatureStatusOnSavegameImport = ccOld.changeCreatureStatusOnSavegameImport;
ccNew.considerWildLevelSteps = ccOld.considerWildLevelSteps;
- ccNew.dontShowTags = ccOld.dontShowTags;
- ccNew.hiddenOwners = ccOld.hiddenOwners;
- ccNew.hiddenServers = ccOld.hiddenServers;
ccNew.incubationListEntries = ccOld.incubationListEntries.Select(ile => new IncubationTimerEntry
{
fatherGuid = ile.fatherGuid,
@@ -249,19 +246,6 @@ public static void TransferParameters(CreatureCollectionOld ccOld, CreatureColle
ccNew.ownerList = ccOld.ownerList;
ccNew.players = ccOld.players;
ccNew.serverList = ccOld.serverList;
- ccNew.showFlags = CreatureFlags.Available;
- if (ccOld.showCryopod)
- ccNew.showFlags |= CreatureFlags.Cryopod;
- if (ccOld.showDeads)
- ccNew.showFlags |= CreatureFlags.Dead;
- if (ccOld.showMutated)
- ccNew.showFlags |= CreatureFlags.Mutated;
- if (ccOld.showNeutered)
- ccNew.showFlags |= CreatureFlags.Neutered;
- if (ccOld.showObelisk)
- ccNew.showFlags |= CreatureFlags.Obelisk;
- if (ccOld.showUnavailable)
- ccNew.showFlags |= CreatureFlags.Unavailable;
ccNew.singlePlayerSettings = ccOld.singlePlayerSettings;
ccNew.tags = ccOld.tags;
ccNew.tagsExclude = ccOld.tagsExclude;
@@ -275,7 +259,6 @@ public static void TransferParameters(CreatureCollectionOld ccOld, CreatureColle
time = tle.time
}).ToList();
ccNew.tribes = ccOld.tribes;
- ccNew.useFiltersInTopStatCalculation = ccOld.useFiltersInTopStatCalculation;
ccNew.wildLevelStep = ccOld.wildLevelStep;
// check if multiplier-conversion is possible
diff --git a/ARKBreedingStats/raising/ParentStats.cs b/ARKBreedingStats/raising/ParentStats.cs
index 275e5612..dd13f3fb 100644
--- a/ARKBreedingStats/raising/ParentStats.cs
+++ b/ARKBreedingStats/raising/ParentStats.cs
@@ -9,31 +9,31 @@ namespace ARKBreedingStats.raising
{
public partial class ParentStats : UserControl
{
- private readonly List parentStatValues;
- private readonly Label lbLevel;
+ private readonly List _parentStatValues;
+ private readonly Label _lbLevel;
public int maxChartLevel;
public ParentStats()
{
InitializeComponent();
- parentStatValues = new List();
+ _parentStatValues = new List();
for (int s = 0; s < values.Values.STATS_COUNT; s++)
{
ParentStatValues psv = new ParentStatValues();
psv.StatName = Utils.StatName(s, true) + (Utils.Precision(s) == 1 ? "" : " %");
- parentStatValues.Add(psv);
+ _parentStatValues.Add(psv);
flowLayoutPanel1.SetFlowBreak(psv, true);
}
for (int s = 0; s < values.Values.STATS_COUNT; s++)
- flowLayoutPanel1.Controls.Add(parentStatValues[values.Values.statsDisplayOrder[s]]);
+ flowLayoutPanel1.Controls.Add(_parentStatValues[values.Values.statsDisplayOrder[s]]);
- lbLevel = new Label
+ _lbLevel = new Label
{
Location = new Point(6, 215),
AutoSize = true
};
- groupBox1.Controls.Add(lbLevel);
+ groupBox1.Controls.Add(_lbLevel);
Clear();
}
@@ -41,19 +41,19 @@ public ParentStats()
public void Clear()
{
for (int s = 0; s < values.Values.STATS_COUNT; s++)
- parentStatValues[s].setValues();
- lbLevel.Text = "";
+ _parentStatValues[s].setValues();
+ _lbLevel.Text = "";
}
- public void setParentValues(Creature mother, Creature father)
+ public void SetParentValues(Creature mother, Creature father)
{
if (mother == null && father == null)
{
- labelMother.Text = "unknown";
- labelFather.Text = "unknown";
+ labelMother.Text = Loc.S("Unknown");
+ labelFather.Text = Loc.S("Unknown");
for (int s = 0; s < values.Values.STATS_COUNT; s++)
{
- parentStatValues[s].setValues();
+ _parentStatValues[s].setValues();
}
return;
}
@@ -66,7 +66,7 @@ public void setParentValues(Creature mother, Creature father)
bool statDisplayed = s != (int)StatNames.Torpidity
&& species.UsesStat(s);
- parentStatValues[s].Visible = statDisplayed;
+ _parentStatValues[s].Visible = statDisplayed;
if (!statDisplayed)
continue;
@@ -78,7 +78,7 @@ public void setParentValues(Creature mother, Creature father)
if (maxChartLevel > 0)
bestLevelPercent = (100 * bestLevel) / maxChartLevel;
}
- parentStatValues[s].setValues(
+ _parentStatValues[s].setValues(
mother == null ? -1 : (mother.valuesBreeding[s] * (Utils.Precision(s) == 1 ? 1 : 100)),
father == null ? -1 : (father.valuesBreeding[s] * (Utils.Precision(s) == 1 ? 1 : 100)),
mother != null && father != null ? (mother.valuesBreeding[s] > father.valuesBreeding[s] ? 1 : 2) : 0,
@@ -86,8 +86,8 @@ public void setParentValues(Creature mother, Creature father)
bestLevelPercent
);
}
- labelMother.Text = mother == null ? "unknown" : mother.name;
- labelFather.Text = father == null ? "unknown" : (labelMother.Width > 78 ? "\n" : "") + father.name;
+ labelMother.Text = mother == null ? Loc.S("Unknown") : mother.name;
+ labelFather.Text = father == null ? Loc.S("Unknown") : (labelMother.Width > 78 ? "\n" : "") + father.name;
if (mother != null && father != null)
{
int minLv = 1, maxLv = 1;
@@ -104,10 +104,10 @@ public void setParentValues(Creature mother, Creature father)
minLv += father.levelsWild[s];
}
}
- lbLevel.Text = $"Possible Level-Range: {minLv} - {maxLv}";
+ _lbLevel.Text = string.Format(Loc.S("possibleLevelRange"), minLv, maxLv);
}
else
- lbLevel.Text = "";
+ _lbLevel.Text = "";
}
}
}
diff --git a/ARKBreedingStats/raising/RaisingControl.cs b/ARKBreedingStats/raising/RaisingControl.cs
index a0b039de..51e24d02 100644
--- a/ARKBreedingStats/raising/RaisingControl.cs
+++ b/ARKBreedingStats/raising/RaisingControl.cs
@@ -13,8 +13,8 @@ public partial class RaisingControl : UserControl
{
public delegate void ExtractBabyEventHandler(Creature mother, Creature father);
public event ExtractBabyEventHandler extractBaby;
- public event Form1.collectionChangedEventHandler onChange;
- public event Form1.SetSpeciesEventHandler SetGlobalSpecies;
+ public event Form1.CollectionChangedEventHandler onChange;
+ public event Action SetGlobalSpecies;
private Species selectedSpecies;
public bool updateListView;
private TimeSpan babyTime, maturationTime;
@@ -60,7 +60,7 @@ public void UpdateRaisingData(Species species, bool forceUpdate = false)
if (Raising.GetRaisingTimes(selectedSpecies, out TimeSpan matingTime, out string incubationMode, out TimeSpan incubationTime, out babyTime, out maturationTime, out TimeSpan nextMatingMin, out TimeSpan nextMatingMax))
{
if (matingTime != TimeSpan.Zero)
- listViewRaisingTimes.Items.Add(new ListViewItem(new[] { Loc.s("matingTime"), matingTime.ToString("d':'hh':'mm':'ss") }));
+ listViewRaisingTimes.Items.Add(new ListViewItem(new[] { Loc.S("matingTime"), matingTime.ToString("d':'hh':'mm':'ss") }));
TimeSpan totalTime = incubationTime;
DateTime until = DateTime.Now.Add(totalTime);
@@ -113,7 +113,7 @@ string FoodAmountString(string _foodName)
var raisingInfo = new StringBuilder();
if (nextMatingMin != TimeSpan.Zero)
- raisingInfo.AppendLine($"{Loc.s("TimeBetweenMating")}: {nextMatingMin:d':'hh':'mm':'ss} to {nextMatingMax:d':'hh':'mm':'ss}");
+ raisingInfo.AppendLine($"{Loc.S("TimeBetweenMating")}: {nextMatingMin:d':'hh':'mm':'ss} to {nextMatingMax:d':'hh':'mm':'ss}");
string eggInfo = Raising.EggTemperature(selectedSpecies);
if (!string.IsNullOrEmpty(eggInfo))
@@ -466,7 +466,7 @@ private void listViewBabies_SelectedIndexChanged(object sender, EventArgs e)
nudMaturationProgress.Value = (decimal)maturing;
}
}
- parentStats1.setParentValues(c.Mother, c.Father);
+ parentStats1.SetParentValues(c.Mother, c.Father);
// edit-box
creatureMaturationEdit = c;
@@ -480,7 +480,7 @@ private void listViewBabies_SelectedIndexChanged(object sender, EventArgs e)
Species species = ite.mother.Species;
SetGlobalSpecies?.Invoke(species);
- parentStats1.setParentValues(ite.mother, ite.father);
+ parentStats1.SetParentValues(ite.mother, ite.father);
// edit-box
creatureMaturationEdit = null;
diff --git a/ARKBreedingStats/settings/Settings.Designer.cs b/ARKBreedingStats/settings/Settings.Designer.cs
index aedab2d9..a7d5891a 100644
--- a/ARKBreedingStats/settings/Settings.Designer.cs
+++ b/ARKBreedingStats/settings/Settings.Designer.cs
@@ -108,6 +108,9 @@ private void InitializeComponent()
this.buttonEventToDefault = new System.Windows.Forms.Button();
this.labelEvent = new System.Windows.Forms.Label();
this.tabPage1 = new System.Windows.Forms.TabPage();
+ this.GbSpecies = new System.Windows.Forms.GroupBox();
+ this.LbSpeciesSelectorCountLastUsed = new System.Windows.Forms.Label();
+ this.NudSpeciesSelectorCountLastUsed = new ARKBreedingStats.uiControls.Nud();
this.groupBox26 = new System.Windows.Forms.GroupBox();
this.cbAdminConsoleCommandWithCheat = new System.Windows.Forms.CheckBox();
this.groupBox25 = new System.Windows.Forms.GroupBox();
@@ -193,7 +196,7 @@ private void InitializeComponent()
this.groupBox21 = new System.Windows.Forms.GroupBox();
this.label41 = new System.Windows.Forms.Label();
this.cbCopyPatternNameToClipboard = new System.Windows.Forms.CheckBox();
- this.cbApplyNamePatternOnImport = new System.Windows.Forms.CheckBox();
+ this.cbApplyNamePatternOnImportOnEmptyNames = new System.Windows.Forms.CheckBox();
this.groupBox19 = new System.Windows.Forms.GroupBox();
this.label26 = new System.Windows.Forms.Label();
this.nudWarnImportMoreThan = new System.Windows.Forms.NumericUpDown();
@@ -221,6 +224,7 @@ private void InitializeComponent()
this.cbbOCRApp = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
+ this.cbApplyNamePatternOnImportOnNewCreatures = new System.Windows.Forms.CheckBox();
this.groupBoxMultiplier.SuspendLayout();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudMatingSpeed)).BeginInit();
@@ -256,6 +260,8 @@ private void InitializeComponent()
this.groupBox11.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudWildLevelStep)).BeginInit();
this.tabPage1.SuspendLayout();
+ this.GbSpecies.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.NudSpeciesSelectorCountLastUsed)).BeginInit();
this.groupBox26.SuspendLayout();
this.groupBox25.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudDefaultFontSize)).BeginInit();
@@ -1197,7 +1203,7 @@ private void InitializeComponent()
this.groupBox7.Size = new System.Drawing.Size(317, 49);
this.groupBox7.TabIndex = 2;
this.groupBox7.TabStop = false;
- this.groupBox7.Text = "Hidden Stats";
+ this.groupBox7.Text = "Extractor";
//
// checkBoxDisplayHiddenStats
//
@@ -1401,6 +1407,7 @@ private void InitializeComponent()
// tabPage1
//
this.tabPage1.AutoScroll = true;
+ this.tabPage1.Controls.Add(this.GbSpecies);
this.tabPage1.Controls.Add(this.groupBox26);
this.tabPage1.Controls.Add(this.groupBox25);
this.tabPage1.Controls.Add(this.groupBox24);
@@ -1421,12 +1428,45 @@ private void InitializeComponent()
this.tabPage1.Text = "General";
this.tabPage1.UseVisualStyleBackColor = true;
//
+ // GbSpecies
+ //
+ this.GbSpecies.Controls.Add(this.LbSpeciesSelectorCountLastUsed);
+ this.GbSpecies.Controls.Add(this.NudSpeciesSelectorCountLastUsed);
+ this.GbSpecies.Location = new System.Drawing.Point(6, 321);
+ this.GbSpecies.Name = "GbSpecies";
+ this.GbSpecies.Size = new System.Drawing.Size(317, 46);
+ this.GbSpecies.TabIndex = 14;
+ this.GbSpecies.TabStop = false;
+ this.GbSpecies.Text = "Species Selection";
+ //
+ // LbSpeciesSelectorCountLastUsed
+ //
+ this.LbSpeciesSelectorCountLastUsed.AutoSize = true;
+ this.LbSpeciesSelectorCountLastUsed.Location = new System.Drawing.Point(6, 21);
+ this.LbSpeciesSelectorCountLastUsed.Name = "LbSpeciesSelectorCountLastUsed";
+ this.LbSpeciesSelectorCountLastUsed.Size = new System.Drawing.Size(187, 13);
+ this.LbSpeciesSelectorCountLastUsed.TabIndex = 1;
+ this.LbSpeciesSelectorCountLastUsed.Text = "Number of displayed last used species";
+ //
+ // NudSpeciesSelectorCountLastUsed
+ //
+ this.NudSpeciesSelectorCountLastUsed.ForeColor = System.Drawing.SystemColors.GrayText;
+ this.NudSpeciesSelectorCountLastUsed.Location = new System.Drawing.Point(252, 19);
+ this.NudSpeciesSelectorCountLastUsed.Name = "NudSpeciesSelectorCountLastUsed";
+ this.NudSpeciesSelectorCountLastUsed.NeutralNumber = new decimal(new int[] {
+ 0,
+ 0,
+ 0,
+ 0});
+ this.NudSpeciesSelectorCountLastUsed.Size = new System.Drawing.Size(57, 20);
+ this.NudSpeciesSelectorCountLastUsed.TabIndex = 0;
+ //
// groupBox26
//
this.groupBox26.Controls.Add(this.cbAdminConsoleCommandWithCheat);
- this.groupBox26.Location = new System.Drawing.Point(5, 575);
+ this.groupBox26.Location = new System.Drawing.Point(329, 624);
this.groupBox26.Name = "groupBox26";
- this.groupBox26.Size = new System.Drawing.Size(318, 43);
+ this.groupBox26.Size = new System.Drawing.Size(413, 43);
this.groupBox26.TabIndex = 13;
this.groupBox26.TabStop = false;
this.groupBox26.Text = "Console Commands";
@@ -1498,7 +1538,7 @@ private void InitializeComponent()
this.groupBox24.Controls.Add(this.cbKeepExpiredTimersInOverlay);
this.groupBox24.Controls.Add(this.cbDeleteExpiredTimersOnSaving);
this.groupBox24.Controls.Add(this.cbTimersInOverlayAutomatically);
- this.groupBox24.Location = new System.Drawing.Point(5, 418);
+ this.groupBox24.Location = new System.Drawing.Point(6, 470);
this.groupBox24.Name = "groupBox24";
this.groupBox24.Size = new System.Drawing.Size(317, 94);
this.groupBox24.TabIndex = 11;
@@ -1558,7 +1598,7 @@ private void InitializeComponent()
// groupBox17
//
this.groupBox17.Controls.Add(this.cbbLanguage);
- this.groupBox17.Location = new System.Drawing.Point(5, 518);
+ this.groupBox17.Location = new System.Drawing.Point(6, 570);
this.groupBox17.Name = "groupBox17";
this.groupBox17.Size = new System.Drawing.Size(317, 51);
this.groupBox17.TabIndex = 9;
@@ -1599,7 +1639,7 @@ private void InitializeComponent()
this.groupBox9.Controls.Add(this.cbLibraryHighlightTopCreatures);
this.groupBox9.Controls.Add(this.cbApplyGlobalSpeciesToLibrary);
this.groupBox9.Controls.Add(this.cbCreatureColorsLibrary);
- this.groupBox9.Location = new System.Drawing.Point(6, 321);
+ this.groupBox9.Location = new System.Drawing.Point(6, 373);
this.groupBox9.Name = "groupBox9";
this.groupBox9.Size = new System.Drawing.Size(317, 91);
this.groupBox9.TabIndex = 7;
@@ -1963,7 +2003,7 @@ private void InitializeComponent()
this.customSCCustom.Location = new System.Drawing.Point(6, 139);
this.customSCCustom.Name = "customSCCustom";
this.customSCCustom.Size = new System.Drawing.Size(401, 23);
- this.customSCCustom.SoundFile = null;
+ this.customSCCustom.SoundFile = "";
this.customSCCustom.TabIndex = 7;
//
// customSCWakeup
@@ -1971,7 +2011,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 = "";
+ this.customSCWakeup.SoundFile = null;
this.customSCWakeup.TabIndex = 6;
//
// customSCBirth
@@ -1979,7 +2019,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 = "";
+ this.customSCBirth.SoundFile = null;
this.customSCBirth.TabIndex = 5;
//
// customSCStarving
@@ -1987,7 +2027,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 = null;
+ this.customSCStarving.SoundFile = "";
this.customSCStarving.TabIndex = 4;
//
// label20
@@ -2341,12 +2381,13 @@ private void InitializeComponent()
//
// groupBox21
//
+ this.groupBox21.Controls.Add(this.cbApplyNamePatternOnImportOnNewCreatures);
this.groupBox21.Controls.Add(this.label41);
this.groupBox21.Controls.Add(this.cbCopyPatternNameToClipboard);
- this.groupBox21.Controls.Add(this.cbApplyNamePatternOnImport);
+ this.groupBox21.Controls.Add(this.cbApplyNamePatternOnImportOnEmptyNames);
this.groupBox21.Location = new System.Drawing.Point(6, 549);
this.groupBox21.Name = "groupBox21";
- this.groupBox21.Size = new System.Drawing.Size(318, 82);
+ this.groupBox21.Size = new System.Drawing.Size(318, 121);
this.groupBox21.TabIndex = 8;
this.groupBox21.TabStop = false;
this.groupBox21.Text = "Auto naming on import";
@@ -2354,31 +2395,31 @@ private void InitializeComponent()
// label41
//
this.label41.AutoSize = true;
- this.label41.Location = new System.Drawing.Point(23, 39);
+ this.label41.Location = new System.Drawing.Point(6, 19);
this.label41.Name = "label41";
- this.label41.Size = new System.Drawing.Size(157, 13);
+ this.label41.Size = new System.Drawing.Size(235, 13);
this.label41.TabIndex = 11;
- this.label41.Text = "The first naming pattern is used.";
+ this.label41.Text = "Apply first naming pattern automatically on import";
//
// cbCopyPatternNameToClipboard
//
this.cbCopyPatternNameToClipboard.AutoSize = true;
- this.cbCopyPatternNameToClipboard.Location = new System.Drawing.Point(26, 58);
+ this.cbCopyPatternNameToClipboard.Location = new System.Drawing.Point(6, 98);
this.cbCopyPatternNameToClipboard.Name = "cbCopyPatternNameToClipboard";
this.cbCopyPatternNameToClipboard.Size = new System.Drawing.Size(208, 17);
this.cbCopyPatternNameToClipboard.TabIndex = 1;
this.cbCopyPatternNameToClipboard.Text = "When applied, copy name to clipboard";
this.cbCopyPatternNameToClipboard.UseVisualStyleBackColor = true;
//
- // cbApplyNamePatternOnImport
+ // cbApplyNamePatternOnImportOnEmptyNames
//
- this.cbApplyNamePatternOnImport.AutoSize = true;
- this.cbApplyNamePatternOnImport.Location = new System.Drawing.Point(6, 19);
- this.cbApplyNamePatternOnImport.Name = "cbApplyNamePatternOnImport";
- this.cbApplyNamePatternOnImport.Size = new System.Drawing.Size(243, 17);
- this.cbApplyNamePatternOnImport.TabIndex = 0;
- this.cbApplyNamePatternOnImport.Text = "Apply name pattern on empty names on import";
- this.cbApplyNamePatternOnImport.UseVisualStyleBackColor = true;
+ this.cbApplyNamePatternOnImportOnEmptyNames.AutoSize = true;
+ this.cbApplyNamePatternOnImportOnEmptyNames.Location = new System.Drawing.Point(6, 38);
+ this.cbApplyNamePatternOnImportOnEmptyNames.Name = "cbApplyNamePatternOnImportOnEmptyNames";
+ this.cbApplyNamePatternOnImportOnEmptyNames.Size = new System.Drawing.Size(119, 17);
+ this.cbApplyNamePatternOnImportOnEmptyNames.TabIndex = 0;
+ this.cbApplyNamePatternOnImportOnEmptyNames.Text = "if the name is empty";
+ this.cbApplyNamePatternOnImportOnEmptyNames.UseVisualStyleBackColor = true;
//
// groupBox19
//
@@ -2667,6 +2708,16 @@ private void InitializeComponent()
this.panel1.Size = new System.Drawing.Size(758, 30);
this.panel1.TabIndex = 12;
//
+ // cbApplyNamePatternOnImportOnNewCreatures
+ //
+ this.cbApplyNamePatternOnImportOnNewCreatures.AutoSize = true;
+ this.cbApplyNamePatternOnImportOnNewCreatures.Location = new System.Drawing.Point(6, 61);
+ this.cbApplyNamePatternOnImportOnNewCreatures.Name = "cbApplyNamePatternOnImportOnNewCreatures";
+ this.cbApplyNamePatternOnImportOnNewCreatures.Size = new System.Drawing.Size(203, 17);
+ this.cbApplyNamePatternOnImportOnNewCreatures.TabIndex = 12;
+ this.cbApplyNamePatternOnImportOnNewCreatures.Text = "if the creature is imported the first time";
+ this.cbApplyNamePatternOnImportOnNewCreatures.UseVisualStyleBackColor = true;
+ //
// Settings
//
this.AcceptButton = this.buttonOK;
@@ -2727,6 +2778,9 @@ private void InitializeComponent()
this.groupBox11.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudWildLevelStep)).EndInit();
this.tabPage1.ResumeLayout(false);
+ this.GbSpecies.ResumeLayout(false);
+ this.GbSpecies.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.NudSpeciesSelectorCountLastUsed)).EndInit();
this.groupBox26.ResumeLayout(false);
this.groupBox26.PerformLayout();
this.groupBox25.ResumeLayout(false);
@@ -2917,7 +2971,7 @@ private void InitializeComponent()
private System.Windows.Forms.GroupBox groupBox20;
private System.Windows.Forms.CheckBox cbPrettifyJSON;
private System.Windows.Forms.GroupBox groupBox21;
- private System.Windows.Forms.CheckBox cbApplyNamePatternOnImport;
+ private System.Windows.Forms.CheckBox cbApplyNamePatternOnImportOnEmptyNames;
private System.Windows.Forms.CheckBox cbCopyPatternNameToClipboard;
private System.Windows.Forms.GroupBox groupBox22;
private System.Windows.Forms.Label label28;
@@ -2979,5 +3033,9 @@ private void InitializeComponent()
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.GroupBox groupBox26;
private System.Windows.Forms.CheckBox cbAdminConsoleCommandWithCheat;
+ private System.Windows.Forms.GroupBox GbSpecies;
+ private System.Windows.Forms.Label LbSpeciesSelectorCountLastUsed;
+ private uiControls.Nud NudSpeciesSelectorCountLastUsed;
+ private System.Windows.Forms.CheckBox cbApplyNamePatternOnImportOnNewCreatures;
}
}
\ No newline at end of file
diff --git a/ARKBreedingStats/settings/Settings.cs b/ARKBreedingStats/settings/Settings.cs
index 538a7170..cc670f8c 100644
--- a/ARKBreedingStats/settings/Settings.cs
+++ b/ARKBreedingStats/settings/Settings.cs
@@ -25,6 +25,7 @@ public Settings(CreatureCollection cc, SettingsTabPages page)
this.cc = cc;
CreateListOfProcesses();
LoadSettings(cc);
+ Localization();
tabControlSettings.SelectTab((int)page);
}
@@ -129,12 +130,12 @@ private void InitializeData()
languages = new Dictionary
{
{ "System language", ""},
- { Loc.s("de"), "de"},
- { Loc.s("en"), "en"},
- { Loc.s("es"), "es"},
- { Loc.s("fr"), "fr"},
- { Loc.s("it"), "it"},
- { Loc.s("zh"), "zh"},
+ { Loc.S("de"), "de"},
+ { Loc.S("en"), "en"},
+ { Loc.S("es"), "es"},
+ { Loc.S("fr"), "fr"},
+ { Loc.S("it"), "it"},
+ { Loc.S("zh"), "zh"},
};
foreach (string l in languages.Keys)
cbbLanguage.Items.Add(l);
@@ -189,7 +190,7 @@ private void LoadSettings(CreatureCollection cc)
if (Properties.Settings.Default.celsius) radioButtonCelsius.Checked = true;
else radioButtonFahrenheit.Checked = true;
cbIgnoreSexInBreedingPlan.Checked = Properties.Settings.Default.IgnoreSexInBreedingPlan;
- checkBoxDisplayHiddenStats.Checked = Properties.Settings.Default.oxygenForAll;
+ checkBoxDisplayHiddenStats.Checked = Properties.Settings.Default.DisplayHiddenStats;
tbDefaultFontName.Text = Properties.Settings.Default.DefaultFontName;
nudDefaultFontSize.Value = (decimal)Properties.Settings.Default.DefaultFontSize;
@@ -246,7 +247,8 @@ private void LoadSettings(CreatureCollection cc)
}
}
nudWarnImportMoreThan.Value = Properties.Settings.Default.WarnWhenImportingMoreCreaturesThan;
- cbApplyNamePatternOnImport.Checked = Properties.Settings.Default.applyNamePatternOnImportIfEmptyName;
+ cbApplyNamePatternOnImportOnEmptyNames.Checked = Properties.Settings.Default.applyNamePatternOnImportIfEmptyName;
+ cbApplyNamePatternOnImportOnNewCreatures.Checked = Properties.Settings.Default.applyNamePatternOnAutoImportForNewCreatures;
cbCopyPatternNameToClipboard.Checked = Properties.Settings.Default.copyNameToClipboardOnImportWhenAutoNameApplied;
cbAutoImportExported.Checked = Properties.Settings.Default.AutoImportExportedCreatures;
cbPlaySoundOnAutomaticImport.Checked = Properties.Settings.Default.PlaySoundOnAutoImport;
@@ -271,6 +273,8 @@ private void LoadSettings(CreatureCollection cc)
cbSaveImportCryo.Checked = Properties.Settings.Default.SaveImportCryo;
#endregion
+ NudSpeciesSelectorCountLastUsed.ValueSave = Properties.Settings.Default.SpeciesSelectorCountLastSpecies;
+
cbDevTools.Checked = Properties.Settings.Default.DevTools;
cbPrettifyJSON.Checked = Properties.Settings.Default.prettifyCollectionJson;
@@ -344,7 +348,7 @@ private void SaveSettings()
Properties.Settings.Default.SpeechRecognition = chkbSpeechRecognition.Checked;
Properties.Settings.Default.syncCollection = chkCollectionSync.Checked;
Properties.Settings.Default.celsius = radioButtonCelsius.Checked;
- Properties.Settings.Default.oxygenForAll = checkBoxDisplayHiddenStats.Checked;
+ Properties.Settings.Default.DisplayHiddenStats = checkBoxDisplayHiddenStats.Checked;
Properties.Settings.Default.DefaultFontName = tbDefaultFontName.Text;
Properties.Settings.Default.DefaultFontSize = (float)nudDefaultFontSize.Value;
@@ -395,7 +399,8 @@ private void SaveSettings()
.Where(location => !string.IsNullOrWhiteSpace(location.FolderPath))
.Select(location => $"{location.ConvenientName}|{location.OwnerSuffix}|{location.FolderPath}").ToArray();
- Properties.Settings.Default.applyNamePatternOnImportIfEmptyName = cbApplyNamePatternOnImport.Checked;
+ Properties.Settings.Default.applyNamePatternOnImportIfEmptyName = cbApplyNamePatternOnImportOnEmptyNames.Checked;
+ Properties.Settings.Default.applyNamePatternOnAutoImportForNewCreatures = cbApplyNamePatternOnImportOnNewCreatures.Checked;
Properties.Settings.Default.copyNameToClipboardOnImportWhenAutoNameApplied = cbCopyPatternNameToClipboard.Checked;
Properties.Settings.Default.AutoImportExportedCreatures = cbAutoImportExported.Checked;
Properties.Settings.Default.PlaySoundOnAutoImport = cbPlaySoundOnAutomaticImport.Checked;
@@ -417,6 +422,8 @@ private void SaveSettings()
Properties.Settings.Default.SaveImportCryo = cbSaveImportCryo.Checked;
#endregion
+ Properties.Settings.Default.SpeciesSelectorCountLastSpecies = (int)NudSpeciesSelectorCountLastUsed.Value;
+
Properties.Settings.Default.DevTools = cbDevTools.Checked;
Properties.Settings.Default.prettifyCollectionJson = cbPrettifyJSON.Checked;
@@ -425,7 +432,7 @@ private void SaveSettings()
string oldLanguageSetting = Properties.Settings.Default.language;
string lang = cbbLanguage.SelectedItem.ToString();
- Properties.Settings.Default.language = languages.ContainsKey(lang) ? languages[lang] : "";
+ Properties.Settings.Default.language = languages.ContainsKey(lang) ? languages[lang] : string.Empty;
LanguageChanged = oldLanguageSetting != Properties.Settings.Default.language;
Properties.Settings.Default.Save();
@@ -852,5 +859,11 @@ private void button1_Click(object sender, EventArgs e)
{
tbOCRCaptureApp.Text = DefaultOCRProcessName;
}
+
+ private void Localization()
+ {
+ Loc.ControlText(buttonOK, "OK");
+ Loc.ControlText(buttonCancel, "Cancel");
+ }
}
}
diff --git a/ARKBreedingStats/species/ARKColor.cs b/ARKBreedingStats/species/ARKColor.cs
index 55e46ac1..0b9b97dd 100644
--- a/ARKBreedingStats/species/ARKColor.cs
+++ b/ARKBreedingStats/species/ARKColor.cs
@@ -24,7 +24,7 @@ public class ARKColor
public ARKColor()
{
id = 0;
- name = "unknown";
+ name = Loc.S("noColor");
color = Color.LightGray;
arkRgba = null;
hash = 0;
@@ -84,13 +84,6 @@ private static int LinearColorComponentToColorComponentClamped(double lc)
///
///
public static int ColorHashCode(double r, double g, double b, double a)
- {
- return (
- Math.Round(r, 5).ToString() + "," +
- Math.Round(g, 5).ToString() + "," +
- Math.Round(b, 5).ToString() + "," +
- Math.Round(a, 5).ToString()
- ).GetHashCode();
- }
+ => $"{Math.Round(r, 5)},{Math.Round(g, 5)},{Math.Round(b, 5)},{Math.Round(a, 5)}".GetHashCode();
}
}
diff --git a/ARKBreedingStats/species/ColorRegion.cs b/ARKBreedingStats/species/ColorRegion.cs
index fe2a6191..7d639bdb 100644
--- a/ARKBreedingStats/species/ColorRegion.cs
+++ b/ARKBreedingStats/species/ColorRegion.cs
@@ -20,7 +20,7 @@ public class ColorRegion
public ColorRegion()
{
- name = Loc.s("unknown");
+ name = Loc.S("Unknown");
}
///
diff --git a/ARKBreedingStats/species/CreatureColors.cs b/ARKBreedingStats/species/CreatureColors.cs
index 388f7212..7576cf21 100644
--- a/ARKBreedingStats/species/CreatureColors.cs
+++ b/ARKBreedingStats/species/CreatureColors.cs
@@ -4,14 +4,32 @@ namespace ARKBreedingStats.species
{
static class CreatureColors
{
- public static string creatureColorName(int colorId)
+ ///
+ /// Returns the name of a color by id.
+ ///
+ ///
+ ///
+ public static string CreatureColorName(int colorId)
{
return values.Values.V.Colors.ByID(colorId).name;
}
- public static Color creatureColor(int colorId)
+ ///
+ /// Returns the Color struct of an ArkColor by id.
+ ///
+ ///
+ ///
+ public static Color CreatureColor(int colorId)
{
return values.Values.V.Colors.ByID(colorId).color;
}
+
+ ///
+ /// Returns the ArkColor by id.
+ ///
+ public static ARKColor CreatureArkColor(int colorId)
+ {
+ return values.Values.V.Colors.ByID(colorId);
+ }
}
}
diff --git a/ARKBreedingStats/species/Species.cs b/ARKBreedingStats/species/Species.cs
index 96a74e14..5a23b052 100644
--- a/ARKBreedingStats/species/Species.cs
+++ b/ARKBreedingStats/species/Species.cs
@@ -90,7 +90,10 @@ public class Species
///
public bool IsDomesticable;
- public const int COLOR_REGION_COUNT = 6;
+ ///
+ /// Number of possible color regions for all species.
+ ///
+ public const int ColorRegionCount = 6;
///
/// creates properties that are not created during deserialization. They are set later with the raw-values with the multipliers applied.
@@ -137,8 +140,8 @@ private void Initialize(StreamingContext context)
TamedBaseHealthMultiplier = 1;
if (colors == null)
- colors = new List(COLOR_REGION_COUNT);
- for (int ci = colors.Count; ci < COLOR_REGION_COUNT; ci++)
+ colors = new List(ColorRegionCount);
+ for (int ci = colors.Count; ci < ColorRegionCount; ci++)
colors.Add(null);
if (string.IsNullOrEmpty(blueprintPath))
blueprintPath = string.Empty;
@@ -167,7 +170,7 @@ private void Initialize(StreamingContext context)
public void InitializeColors(ARKColors arkColors)
{
- for (int i = 0; i < COLOR_REGION_COUNT; i++)
+ for (int i = 0; i < ColorRegionCount; i++)
colors[i]?.Initialize(arkColors);
}
diff --git a/ARKBreedingStats/uiControls/LibraryFilter.Designer.cs b/ARKBreedingStats/uiControls/LibraryFilter.Designer.cs
new file mode 100644
index 00000000..97ddf7f5
--- /dev/null
+++ b/ARKBreedingStats/uiControls/LibraryFilter.Designer.cs
@@ -0,0 +1,462 @@
+namespace ARKBreedingStats.uiControls
+{
+ partial class LibraryFilter
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this.CbTagsAll = new System.Windows.Forms.CheckBox();
+ this.CbServersAll = new System.Windows.Forms.CheckBox();
+ this.CbTribesAll = new System.Windows.Forms.CheckBox();
+ this.LbStatus = new System.Windows.Forms.Label();
+ this.LbTags = new System.Windows.Forms.Label();
+ this.LbServers = new System.Windows.Forms.Label();
+ this.LbTribes = new System.Windows.Forms.Label();
+ this.ClbTags = new System.Windows.Forms.CheckedListBox();
+ this.ClbServers = new System.Windows.Forms.CheckedListBox();
+ this.ClbTribes = new System.Windows.Forms.CheckedListBox();
+ this.ClbOwners = new System.Windows.Forms.CheckedListBox();
+ this.LbOwners = new System.Windows.Forms.Label();
+ this.CbOwnersAll = new System.Windows.Forms.CheckBox();
+ this.FlpStatus = new System.Windows.Forms.FlowLayoutPanel();
+ this.LbColors = new System.Windows.Forms.Label();
+ this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
+ this.BtColorFilter = new System.Windows.Forms.Button();
+ this.BtClearColorFilters = new System.Windows.Forms.Button();
+ this.BtClearFlagFilter = new System.Windows.Forms.Button();
+ this.panel1 = new System.Windows.Forms.Panel();
+ this.CbLibraryGroupSpecies = new System.Windows.Forms.CheckBox();
+ this.CbUseFilterInTopStatCalculation = new System.Windows.Forms.CheckBox();
+ this.BtApply = new System.Windows.Forms.Button();
+ this.BtCancel = new System.Windows.Forms.Button();
+ this.panel2 = new System.Windows.Forms.Panel();
+ this.TbFilterByName = new System.Windows.Forms.TextBox();
+ this.LbFilterByName = new System.Windows.Forms.Label();
+ this.tableLayoutPanel1.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ this.flowLayoutPanel1.SuspendLayout();
+ this.panel1.SuspendLayout();
+ this.panel2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Inset;
+ this.tableLayoutPanel1.ColumnCount = 1;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 0, 0);
+ this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 2);
+ this.tableLayoutPanel1.Controls.Add(this.panel2, 0, 1);
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 3;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(800, 450);
+ this.tableLayoutPanel1.TabIndex = 0;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.ColumnCount = 6;
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 110F));
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 112F));
+ this.tableLayoutPanel2.Controls.Add(this.CbTagsAll, 3, 1);
+ this.tableLayoutPanel2.Controls.Add(this.CbServersAll, 2, 1);
+ this.tableLayoutPanel2.Controls.Add(this.CbTribesAll, 1, 1);
+ this.tableLayoutPanel2.Controls.Add(this.LbStatus, 4, 0);
+ this.tableLayoutPanel2.Controls.Add(this.LbTags, 3, 0);
+ this.tableLayoutPanel2.Controls.Add(this.LbServers, 2, 0);
+ this.tableLayoutPanel2.Controls.Add(this.LbTribes, 1, 0);
+ this.tableLayoutPanel2.Controls.Add(this.ClbTags, 3, 2);
+ this.tableLayoutPanel2.Controls.Add(this.ClbServers, 2, 2);
+ this.tableLayoutPanel2.Controls.Add(this.ClbTribes, 1, 2);
+ this.tableLayoutPanel2.Controls.Add(this.ClbOwners, 0, 2);
+ this.tableLayoutPanel2.Controls.Add(this.LbOwners, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.CbOwnersAll, 0, 1);
+ this.tableLayoutPanel2.Controls.Add(this.FlpStatus, 4, 2);
+ this.tableLayoutPanel2.Controls.Add(this.LbColors, 5, 0);
+ this.tableLayoutPanel2.Controls.Add(this.flowLayoutPanel1, 5, 2);
+ this.tableLayoutPanel2.Controls.Add(this.BtClearColorFilters, 5, 1);
+ this.tableLayoutPanel2.Controls.Add(this.BtClearFlagFilter, 4, 1);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(2, 2);
+ this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(0);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.Padding = new System.Windows.Forms.Padding(3);
+ this.tableLayoutPanel2.RowCount = 3;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(796, 370);
+ this.tableLayoutPanel2.TabIndex = 3;
+ //
+ // CbTagsAll
+ //
+ this.CbTagsAll.AutoSize = true;
+ this.CbTagsAll.Location = new System.Drawing.Point(432, 19);
+ this.CbTagsAll.Name = "CbTagsAll";
+ this.CbTagsAll.Size = new System.Drawing.Size(36, 17);
+ this.CbTagsAll.TabIndex = 12;
+ this.CbTagsAll.Text = "all";
+ this.CbTagsAll.UseVisualStyleBackColor = true;
+ this.CbTagsAll.CheckedChanged += new System.EventHandler(this.CbTagsAll_CheckedChanged);
+ //
+ // CbServersAll
+ //
+ this.CbServersAll.AutoSize = true;
+ this.CbServersAll.Location = new System.Drawing.Point(290, 19);
+ this.CbServersAll.Name = "CbServersAll";
+ this.CbServersAll.Size = new System.Drawing.Size(36, 17);
+ this.CbServersAll.TabIndex = 11;
+ this.CbServersAll.Text = "all";
+ this.CbServersAll.UseVisualStyleBackColor = true;
+ this.CbServersAll.CheckedChanged += new System.EventHandler(this.CbServersAll_CheckedChanged);
+ //
+ // CbTribesAll
+ //
+ this.CbTribesAll.AutoSize = true;
+ this.CbTribesAll.Location = new System.Drawing.Point(148, 19);
+ this.CbTribesAll.Name = "CbTribesAll";
+ this.CbTribesAll.Size = new System.Drawing.Size(36, 17);
+ this.CbTribesAll.TabIndex = 10;
+ this.CbTribesAll.Text = "all";
+ this.CbTribesAll.UseVisualStyleBackColor = true;
+ this.CbTribesAll.CheckedChanged += new System.EventHandler(this.CbTribesAll_CheckedChanged);
+ //
+ // LbStatus
+ //
+ this.LbStatus.Anchor = System.Windows.Forms.AnchorStyles.None;
+ this.LbStatus.AutoSize = true;
+ this.LbStatus.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.LbStatus.Location = new System.Drawing.Point(616, 3);
+ this.LbStatus.Name = "LbStatus";
+ this.LbStatus.Size = new System.Drawing.Size(19, 13);
+ this.LbStatus.TabIndex = 8;
+ this.LbStatus.Text = "St";
+ //
+ // LbTags
+ //
+ this.LbTags.Anchor = System.Windows.Forms.AnchorStyles.None;
+ this.LbTags.AutoSize = true;
+ this.LbTags.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.LbTags.Location = new System.Drawing.Point(494, 3);
+ this.LbTags.Name = "LbTags";
+ this.LbTags.Size = new System.Drawing.Size(11, 13);
+ this.LbTags.TabIndex = 7;
+ this.LbTags.Text = "t";
+ //
+ // LbServers
+ //
+ this.LbServers.Anchor = System.Windows.Forms.AnchorStyles.None;
+ this.LbServers.AutoSize = true;
+ this.LbServers.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.LbServers.Location = new System.Drawing.Point(349, 3);
+ this.LbServers.Name = "LbServers";
+ this.LbServers.Size = new System.Drawing.Size(17, 13);
+ this.LbServers.TabIndex = 6;
+ this.LbServers.Text = "sr";
+ //
+ // LbTribes
+ //
+ this.LbTribes.Anchor = System.Windows.Forms.AnchorStyles.None;
+ this.LbTribes.AutoSize = true;
+ this.LbTribes.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.LbTribes.Location = new System.Drawing.Point(208, 3);
+ this.LbTribes.Name = "LbTribes";
+ this.LbTribes.Size = new System.Drawing.Size(15, 13);
+ this.LbTribes.TabIndex = 5;
+ this.LbTribes.Text = "tr";
+ //
+ // ClbTags
+ //
+ this.ClbTags.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.ClbTags.FormattingEnabled = true;
+ this.ClbTags.Location = new System.Drawing.Point(432, 48);
+ this.ClbTags.Name = "ClbTags";
+ this.ClbTags.Size = new System.Drawing.Size(136, 316);
+ this.ClbTags.TabIndex = 3;
+ //
+ // ClbServers
+ //
+ this.ClbServers.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.ClbServers.FormattingEnabled = true;
+ this.ClbServers.Location = new System.Drawing.Point(290, 48);
+ this.ClbServers.Name = "ClbServers";
+ this.ClbServers.Size = new System.Drawing.Size(136, 316);
+ this.ClbServers.TabIndex = 2;
+ //
+ // ClbTribes
+ //
+ this.ClbTribes.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.ClbTribes.FormattingEnabled = true;
+ this.ClbTribes.Location = new System.Drawing.Point(148, 48);
+ this.ClbTribes.Name = "ClbTribes";
+ this.ClbTribes.Size = new System.Drawing.Size(136, 316);
+ this.ClbTribes.TabIndex = 1;
+ //
+ // ClbOwners
+ //
+ this.ClbOwners.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.ClbOwners.FormattingEnabled = true;
+ this.ClbOwners.Location = new System.Drawing.Point(6, 48);
+ this.ClbOwners.Name = "ClbOwners";
+ this.ClbOwners.Size = new System.Drawing.Size(136, 316);
+ this.ClbOwners.TabIndex = 0;
+ //
+ // LbOwners
+ //
+ this.LbOwners.Anchor = System.Windows.Forms.AnchorStyles.None;
+ this.LbOwners.AutoSize = true;
+ this.LbOwners.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.LbOwners.Location = new System.Drawing.Point(50, 3);
+ this.LbOwners.Name = "LbOwners";
+ this.LbOwners.Size = new System.Drawing.Size(47, 13);
+ this.LbOwners.TabIndex = 4;
+ this.LbOwners.Text = "owners";
+ //
+ // CbOwnersAll
+ //
+ this.CbOwnersAll.AutoSize = true;
+ this.CbOwnersAll.Location = new System.Drawing.Point(6, 19);
+ this.CbOwnersAll.Name = "CbOwnersAll";
+ this.CbOwnersAll.Size = new System.Drawing.Size(36, 17);
+ this.CbOwnersAll.TabIndex = 9;
+ this.CbOwnersAll.Text = "all";
+ this.CbOwnersAll.UseVisualStyleBackColor = true;
+ this.CbOwnersAll.CheckedChanged += new System.EventHandler(this.CbOwnersAll_CheckedChanged);
+ //
+ // FlpStatus
+ //
+ this.FlpStatus.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.FlpStatus.Location = new System.Drawing.Point(574, 48);
+ this.FlpStatus.Name = "FlpStatus";
+ this.FlpStatus.Size = new System.Drawing.Size(104, 316);
+ this.FlpStatus.TabIndex = 14;
+ //
+ // LbColors
+ //
+ this.LbColors.Anchor = System.Windows.Forms.AnchorStyles.None;
+ this.LbColors.AutoSize = true;
+ this.LbColors.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.LbColors.Location = new System.Drawing.Point(728, 3);
+ this.LbColors.Name = "LbColors";
+ this.LbColors.Size = new System.Drawing.Size(18, 13);
+ this.LbColors.TabIndex = 15;
+ this.LbColors.Text = "Cl";
+ //
+ // flowLayoutPanel1
+ //
+ this.flowLayoutPanel1.Controls.Add(this.BtColorFilter);
+ this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.flowLayoutPanel1.Location = new System.Drawing.Point(684, 48);
+ this.flowLayoutPanel1.Name = "flowLayoutPanel1";
+ this.flowLayoutPanel1.Size = new System.Drawing.Size(106, 316);
+ this.flowLayoutPanel1.TabIndex = 16;
+ //
+ // BtColorFilter
+ //
+ this.BtColorFilter.Location = new System.Drawing.Point(3, 3);
+ this.BtColorFilter.Name = "BtColorFilter";
+ this.BtColorFilter.Size = new System.Drawing.Size(99, 133);
+ this.BtColorFilter.TabIndex = 0;
+ this.BtColorFilter.Text = "color";
+ this.BtColorFilter.UseVisualStyleBackColor = true;
+ this.BtColorFilter.Click += new System.EventHandler(this.BtColorFilter_Click);
+ //
+ // BtClearColorFilters
+ //
+ this.BtClearColorFilters.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.BtClearColorFilters.Location = new System.Drawing.Point(684, 19);
+ this.BtClearColorFilters.Name = "BtClearColorFilters";
+ this.BtClearColorFilters.Size = new System.Drawing.Size(106, 23);
+ this.BtClearColorFilters.TabIndex = 17;
+ this.BtClearColorFilters.Text = "ClearColorFilter";
+ this.BtClearColorFilters.UseVisualStyleBackColor = true;
+ this.BtClearColorFilters.Click += new System.EventHandler(this.BtClearColorFilters_Click);
+ //
+ // BtClearFlagFilter
+ //
+ this.BtClearFlagFilter.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.BtClearFlagFilter.Location = new System.Drawing.Point(574, 19);
+ this.BtClearFlagFilter.Name = "BtClearFlagFilter";
+ this.BtClearFlagFilter.Size = new System.Drawing.Size(104, 23);
+ this.BtClearFlagFilter.TabIndex = 18;
+ this.BtClearFlagFilter.Text = "Clear";
+ this.BtClearFlagFilter.UseVisualStyleBackColor = true;
+ this.BtClearFlagFilter.Click += new System.EventHandler(this.BtClearFlagFilter_Click);
+ //
+ // panel1
+ //
+ this.panel1.Controls.Add(this.CbLibraryGroupSpecies);
+ this.panel1.Controls.Add(this.CbUseFilterInTopStatCalculation);
+ this.panel1.Controls.Add(this.BtApply);
+ this.panel1.Controls.Add(this.BtCancel);
+ this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.panel1.Location = new System.Drawing.Point(5, 415);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(790, 30);
+ this.panel1.TabIndex = 4;
+ //
+ // CbLibraryGroupSpecies
+ //
+ this.CbLibraryGroupSpecies.AutoSize = true;
+ this.CbLibraryGroupSpecies.Dock = System.Windows.Forms.DockStyle.Left;
+ this.CbLibraryGroupSpecies.Location = new System.Drawing.Point(170, 0);
+ this.CbLibraryGroupSpecies.Name = "CbLibraryGroupSpecies";
+ this.CbLibraryGroupSpecies.Size = new System.Drawing.Size(138, 30);
+ this.CbLibraryGroupSpecies.TabIndex = 3;
+ this.CbLibraryGroupSpecies.Text = "Group library by species";
+ this.CbLibraryGroupSpecies.UseVisualStyleBackColor = true;
+ //
+ // CbUseFilterInTopStatCalculation
+ //
+ this.CbUseFilterInTopStatCalculation.AutoSize = true;
+ this.CbUseFilterInTopStatCalculation.Dock = System.Windows.Forms.DockStyle.Left;
+ this.CbUseFilterInTopStatCalculation.Location = new System.Drawing.Point(0, 0);
+ this.CbUseFilterInTopStatCalculation.Name = "CbUseFilterInTopStatCalculation";
+ this.CbUseFilterInTopStatCalculation.Size = new System.Drawing.Size(170, 30);
+ this.CbUseFilterInTopStatCalculation.TabIndex = 2;
+ this.CbUseFilterInTopStatCalculation.Text = "Use filter in top stat calculation";
+ this.CbUseFilterInTopStatCalculation.UseVisualStyleBackColor = true;
+ //
+ // BtApply
+ //
+ this.BtApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.BtApply.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.BtApply.Location = new System.Drawing.Point(708, 0);
+ this.BtApply.Name = "BtApply";
+ this.BtApply.Size = new System.Drawing.Size(75, 23);
+ this.BtApply.TabIndex = 0;
+ this.BtApply.Text = "Apply";
+ this.BtApply.UseVisualStyleBackColor = true;
+ this.BtApply.Click += new System.EventHandler(this.BtApply_Click);
+ //
+ // BtCancel
+ //
+ this.BtCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.BtCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.BtCancel.Location = new System.Drawing.Point(627, 0);
+ this.BtCancel.Name = "BtCancel";
+ this.BtCancel.Size = new System.Drawing.Size(75, 23);
+ this.BtCancel.TabIndex = 1;
+ this.BtCancel.Text = "Cancel";
+ this.BtCancel.UseVisualStyleBackColor = true;
+ //
+ // panel2
+ //
+ this.panel2.Controls.Add(this.TbFilterByName);
+ this.panel2.Controls.Add(this.LbFilterByName);
+ this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.panel2.Location = new System.Drawing.Point(5, 377);
+ this.panel2.Name = "panel2";
+ this.panel2.Size = new System.Drawing.Size(790, 30);
+ this.panel2.TabIndex = 5;
+ //
+ // TbFilterByName
+ //
+ this.TbFilterByName.Dock = System.Windows.Forms.DockStyle.Left;
+ this.TbFilterByName.Location = new System.Drawing.Point(69, 0);
+ this.TbFilterByName.Name = "TbFilterByName";
+ this.TbFilterByName.Size = new System.Drawing.Size(260, 20);
+ this.TbFilterByName.TabIndex = 1;
+ //
+ // LbFilterByName
+ //
+ this.LbFilterByName.AutoSize = true;
+ this.LbFilterByName.Dock = System.Windows.Forms.DockStyle.Left;
+ this.LbFilterByName.Location = new System.Drawing.Point(0, 0);
+ this.LbFilterByName.Name = "LbFilterByName";
+ this.LbFilterByName.Size = new System.Drawing.Size(69, 13);
+ this.LbFilterByName.TabIndex = 0;
+ this.LbFilterByName.Text = "filter by name";
+ this.LbFilterByName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // LibraryFilter
+ //
+ this.AcceptButton = this.BtApply;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoScroll = true;
+ this.CancelButton = this.BtCancel;
+ this.ClientSize = new System.Drawing.Size(800, 450);
+ this.Controls.Add(this.tableLayoutPanel1);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
+ this.Name = "LibraryFilter";
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.tableLayoutPanel1.ResumeLayout(false);
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ this.flowLayoutPanel1.ResumeLayout(false);
+ this.panel1.ResumeLayout(false);
+ this.panel1.PerformLayout();
+ this.panel2.ResumeLayout(false);
+ this.panel2.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
+ private System.Windows.Forms.Button BtApply;
+ private System.Windows.Forms.Button BtCancel;
+ private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
+ private System.Windows.Forms.CheckedListBox ClbOwners;
+ private System.Windows.Forms.CheckedListBox ClbTags;
+ private System.Windows.Forms.CheckedListBox ClbServers;
+ private System.Windows.Forms.CheckedListBox ClbTribes;
+ private System.Windows.Forms.CheckBox CbTagsAll;
+ private System.Windows.Forms.CheckBox CbServersAll;
+ private System.Windows.Forms.CheckBox CbTribesAll;
+ private System.Windows.Forms.Label LbStatus;
+ private System.Windows.Forms.Label LbTags;
+ private System.Windows.Forms.Label LbServers;
+ private System.Windows.Forms.Label LbTribes;
+ private System.Windows.Forms.Label LbOwners;
+ private System.Windows.Forms.CheckBox CbOwnersAll;
+ private System.Windows.Forms.FlowLayoutPanel FlpStatus;
+ private System.Windows.Forms.Panel panel1;
+ private System.Windows.Forms.CheckBox CbUseFilterInTopStatCalculation;
+ private System.Windows.Forms.Label LbColors;
+ private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
+ private System.Windows.Forms.Button BtColorFilter;
+ private System.Windows.Forms.Button BtClearColorFilters;
+ private System.Windows.Forms.CheckBox CbLibraryGroupSpecies;
+ private System.Windows.Forms.Button BtClearFlagFilter;
+ private System.Windows.Forms.Panel panel2;
+ private System.Windows.Forms.TextBox TbFilterByName;
+ private System.Windows.Forms.Label LbFilterByName;
+ }
+}
\ No newline at end of file
diff --git a/ARKBreedingStats/uiControls/LibraryFilter.cs b/ARKBreedingStats/uiControls/LibraryFilter.cs
new file mode 100644
index 00000000..f448f908
--- /dev/null
+++ b/ARKBreedingStats/uiControls/LibraryFilter.cs
@@ -0,0 +1,355 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Configuration;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using ARKBreedingStats.Library;
+using ARKBreedingStats.species;
+
+namespace ARKBreedingStats.uiControls
+{
+ public partial class LibraryFilter : Form
+ {
+ private CreatureCollection _cc;
+ private List