Skip to content

Commit 4412144

Browse files
committed
Merge branch 'dev'
2 parents 752a9a9 + 91780df commit 4412144

File tree

5 files changed

+22
-10
lines changed

5 files changed

+22
-10
lines changed

ARKBreedingStats/Form1.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ private void UpdateCreatureListings(Species species = null, bool keepCurrentlySe
984984
}
985985

986986
UpdateOwnerServerTagLists();
987-
CalculateTopStats(creatures);
987+
CalculateTopStats(creatures, species);
988988
UpdateSpeciesLists(_creatureCollection.creatures, keepCurrentlySelectedSpecies);
989989
FilterLibRecalculate();
990990
UpdateStatusBar();

ARKBreedingStats/Form1.library.cs

+18-6
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,24 @@ private static void ApplySpeciesObjectsToCollection(CreatureCollection cc)
277277
/// Calculates the top-stats in each species, sets the top-stat-flags in the creatures
278278
/// </summary>
279279
/// <param name="creatures">creatures to consider</param>
280-
private void CalculateTopStats(List<Creature> creatures)
280+
/// <param name="onlySpecies">If not null, it's assumed only creatures of this species are recalculated</param>
281+
private void CalculateTopStats(List<Creature> creatures, Species onlySpecies = null)
281282
{
282-
_highestSpeciesLevels.Clear();
283-
_lowestSpeciesLevels.Clear();
284-
_highestSpeciesMutationLevels.Clear();
285-
_lowestSpeciesMutationLevels.Clear();
283+
if (onlySpecies == null)
284+
{
285+
// if all creatures are recalculated, clear all
286+
_highestSpeciesLevels.Clear();
287+
_lowestSpeciesLevels.Clear();
288+
_highestSpeciesMutationLevels.Clear();
289+
_lowestSpeciesMutationLevels.Clear();
290+
}
291+
else
292+
{
293+
_highestSpeciesLevels.Remove(onlySpecies);
294+
_lowestSpeciesLevels.Remove(onlySpecies);
295+
_highestSpeciesMutationLevels.Remove(onlySpecies);
296+
_lowestSpeciesMutationLevels.Remove(onlySpecies);
297+
}
286298

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

@@ -929,7 +941,7 @@ private void UpdateDisplayedCreatureValues(Creature cr, bool creatureStatusChang
929941
// if creatureStatus (available/dead) changed, recalculate topStats (dead creatures are not considered there)
930942
if (creatureStatusChanged)
931943
{
932-
CalculateTopStats(_creatureCollection.creatures.Where(c => c.Species == cr.Species).ToList());
944+
CalculateTopStats(_creatureCollection.creatures.Where(c => c.Species == cr.Species).ToList(), cr.Species);
933945
FilterLibRecalculate();
934946
UpdateStatusBar();
935947
}

ARKBreedingStats/Form1.tester.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ private void creatureInfoInputTester_Save2Library_Clicked(CreatureInfoInput send
216216
creatureInfoInputTester.SetCreatureData(_creatureTesterEdit);
217217

218218
if (wildChanged)
219-
CalculateTopStats(_creatureCollection.creatures.Where(c => c.Species == _creatureTesterEdit.Species).ToList());
219+
CalculateTopStats(_creatureCollection.creatures.Where(c => c.Species == _creatureTesterEdit.Species).ToList(), _creatureTesterEdit.Species);
220220
UpdateDisplayedCreatureValues(_creatureTesterEdit, statusChanged, true);
221221

222222
if (parentsChanged)

ARKBreedingStats/Properties/AssemblyInfo.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
// Revision
3131
//
3232
[assembly: AssemblyVersion("1.0.0.0")]
33-
[assembly: AssemblyFileVersion("0.60.2.0")]
33+
[assembly: AssemblyFileVersion("0.60.2.1")]
3434
[assembly: NeutralResourcesLanguage("en")]
3535

ARKBreedingStats/_manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"ARK Smart Breeding": {
55
"Id": "ARK Smart Breeding",
66
"Category": "main",
7-
"version": "0.60.2.0"
7+
"version": "0.60.2.1"
88
},
99
"SpeciesColorImages": {
1010
"Id": "SpeciesColorImages",

0 commit comments

Comments
 (0)