Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
cadon committed Feb 28, 2024
2 parents 752a9a9 + 91780df commit 4412144
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ARKBreedingStats/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ private void UpdateCreatureListings(Species species = null, bool keepCurrentlySe
}

UpdateOwnerServerTagLists();
CalculateTopStats(creatures);
CalculateTopStats(creatures, species);
UpdateSpeciesLists(_creatureCollection.creatures, keepCurrentlySelectedSpecies);
FilterLibRecalculate();
UpdateStatusBar();
Expand Down
24 changes: 18 additions & 6 deletions ARKBreedingStats/Form1.library.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,24 @@ private static void ApplySpeciesObjectsToCollection(CreatureCollection cc)
/// Calculates the top-stats in each species, sets the top-stat-flags in the creatures
/// </summary>
/// <param name="creatures">creatures to consider</param>
private void CalculateTopStats(List<Creature> creatures)
/// <param name="onlySpecies">If not null, it's assumed only creatures of this species are recalculated</param>
private void CalculateTopStats(List<Creature> creatures, Species onlySpecies = null)
{
_highestSpeciesLevels.Clear();
_lowestSpeciesLevels.Clear();
_highestSpeciesMutationLevels.Clear();
_lowestSpeciesMutationLevels.Clear();
if (onlySpecies == null)
{
// if all creatures are recalculated, clear all
_highestSpeciesLevels.Clear();
_lowestSpeciesLevels.Clear();
_highestSpeciesMutationLevels.Clear();
_lowestSpeciesMutationLevels.Clear();
}
else
{
_highestSpeciesLevels.Remove(onlySpecies);
_lowestSpeciesLevels.Remove(onlySpecies);
_highestSpeciesMutationLevels.Remove(onlySpecies);
_lowestSpeciesMutationLevels.Remove(onlySpecies);
}

var filteredCreaturesHash = Properties.Settings.Default.useFiltersInTopStatCalculation ? new HashSet<Creature>(ApplyLibraryFilterSettings(creatures)) : null;

Expand Down Expand Up @@ -929,7 +941,7 @@ private void UpdateDisplayedCreatureValues(Creature cr, bool creatureStatusChang
// 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(), cr.Species);
FilterLibRecalculate();
UpdateStatusBar();
}
Expand Down
2 changes: 1 addition & 1 deletion ARKBreedingStats/Form1.tester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ private void creatureInfoInputTester_Save2Library_Clicked(CreatureInfoInput send
creatureInfoInputTester.SetCreatureData(_creatureTesterEdit);

if (wildChanged)
CalculateTopStats(_creatureCollection.creatures.Where(c => c.Species == _creatureTesterEdit.Species).ToList());
CalculateTopStats(_creatureCollection.creatures.Where(c => c.Species == _creatureTesterEdit.Species).ToList(), _creatureTesterEdit.Species);
UpdateDisplayedCreatureValues(_creatureTesterEdit, statusChanged, true);

if (parentsChanged)
Expand Down
2 changes: 1 addition & 1 deletion ARKBreedingStats/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("0.60.2.0")]
[assembly: AssemblyFileVersion("0.60.2.1")]
[assembly: NeutralResourcesLanguage("en")]

2 changes: 1 addition & 1 deletion ARKBreedingStats/_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"ARK Smart Breeding": {
"Id": "ARK Smart Breeding",
"Category": "main",
"version": "0.60.2.0"
"version": "0.60.2.1"
},
"SpeciesColorImages": {
"Id": "SpeciesColorImages",
Expand Down

0 comments on commit 4412144

Please sign in to comment.