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 baa0f7b + 9a390e9 commit 752a9a9
Show file tree
Hide file tree
Showing 26 changed files with 547 additions and 389 deletions.
3 changes: 0 additions & 3 deletions ARKBreedingStats/ARKBreedingStats.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -670,9 +670,6 @@
<Compile Include="values\Values.cs" />
<Compile Include="utils\Win32API.cs" />
<Compile Include="values\ValuesFile.cs" />
<None Include="json\equalColorIds.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="json\values\ASA-values.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
1 change: 0 additions & 1 deletion ARKBreedingStats/Ark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ public static class Ark
public static void SetUndefinedColorId(bool asa)
{
UndefinedColorId = asa ? UndefinedColorIdAsa : UndefinedColorIdAse;
Values.V.Colors.SetUndefinedColorId(UndefinedColorId);
}

/// <summary>
Expand Down
9 changes: 8 additions & 1 deletion ARKBreedingStats/BreedingPlanning/BreedingPlan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,14 @@ private void NoPossiblePairingsFound(bool creaturesMutationsFilteredOut)
}
lbBreedingPlanInfo.Text = string.Format(Loc.S("NoPossiblePairingForSpeciesFound"), _currentSpecies);
lbBreedingPlanInfo.Visible = true;
if (!cbBPIncludeCryoCreatures.Checked)
if (!cbBPIncludeCryoCreatures.Checked
&& CreatureCollection.creatures.Any(c
=> c.Species == _currentSpecies
&& !c.flags.HasFlag(CreatureFlags.Neutered)
&& !c.flags.HasFlag(CreatureFlags.Placeholder)
&& c.Status == CreatureStatus.Cryopod
)
)
cbBPIncludeCryoCreatures.BackColor = Color.LightSalmon;
if (creaturesMutationsFilteredOut)
nudBPMutationLimit.BackColor = Color.LightSalmon;
Expand Down
30 changes: 18 additions & 12 deletions ARKBreedingStats/Form1.collection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,31 +51,36 @@ private void NewCollection(bool resetCollection = false)
}
}

// use previously used multipliers again in the new file
var oldMultipliers = _creatureCollection.serverMultipliers;
var asaMode = _creatureCollection.Game == Ark.Asa;
ServerMultipliers oldMultipliers = null;
ServerMultipliers oldEventMultipliers = null;
bool asaMode;

if (!Properties.Settings.Default.KeepMultipliersForNewLibrary)
if (Properties.Settings.Default.KeepMultipliersForNewLibrary)
{
oldMultipliers = null; // use default
// use previously used multipliers again in the new file
oldMultipliers = _creatureCollection.serverMultipliers;
oldEventMultipliers = _creatureCollection.serverMultipliersEvents;
}

// ask which game version if no default is set
switch (Properties.Settings.Default.NewLibraryGame)
{
case Ark.Game.Unknown:
var gameVersionDialog = new ArkVersionDialog(this);
gameVersionDialog.ShowDialog();
if (gameVersionDialog.UseSelectionAsDefault)
Properties.Settings.Default.NewLibraryGame = gameVersionDialog.GameVersion;
asaMode = gameVersionDialog.GameVersion == Ark.Game.Asa;
break;
case Ark.Game.Ase:
asaMode = false;
break;
case Ark.Game.Asa:
asaMode = true;
break;
case Ark.Game.SameAsBefore:
asaMode = _creatureCollection.Game == Ark.Asa;
break;
default:
var gameVersionDialog = new ArkVersionDialog(this);
gameVersionDialog.ShowDialog();
if (gameVersionDialog.UseSelectionAsDefault)
Properties.Settings.Default.NewLibraryGame = gameVersionDialog.GameVersion;
asaMode = gameVersionDialog.GameVersion == Ark.Game.Asa;
break;
}

if (oldMultipliers == null)
Expand All @@ -84,6 +89,7 @@ private void NewCollection(bool resetCollection = false)
_creatureCollection = new CreatureCollection
{
serverMultipliers = oldMultipliers,
serverMultipliersEvents = oldEventMultipliers,
ModList = new List<Mod>()
};
_currentFileName = null;
Expand Down
11 changes: 4 additions & 7 deletions ARKBreedingStats/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3261,8 +3261,6 @@ private void LoadMultipliersFromTestCase(testCases.ExtractionTestCase etc)
{
// set all stat-multipliers from testCase
_creatureCollection.serverMultipliers = etc.serverMultipliers.Copy(true);
_creatureCollection.singlePlayerSettings = etc.singleplayerSettings;
_creatureCollection.AtlasSettings = etc.AtlasSettings;
_creatureCollection.allowMoreThanHundredImprinting = etc.allowMoreThanHundredPercentImprinting;
_creatureCollection.maxWildLevel = etc.maxWildLevel;

Expand Down Expand Up @@ -3293,10 +3291,8 @@ private void tsBtAddAsExtractionTest_Click(object sender, EventArgs e)
etc.levelsDom = GetCurrentDomLevels(false);
etc.levelsWild = GetCurrentWildLevels(false);
etc.ModIDs = _creatureCollection.modIDs?.ToList();
etc.serverMultipliers = _creatureCollection.serverMultipliers;
etc.serverMultipliers = _creatureCollection.serverMultipliers.Copy(true);
etc.Species = speciesSelector1.SelectedSpecies;
etc.singleplayerSettings = _creatureCollection.singlePlayerSettings;
etc.AtlasSettings = _creatureCollection.AtlasSettings;
etc.allowMoreThanHundredPercentImprinting = _creatureCollection.allowMoreThanHundredImprinting;
etc.maxWildLevel = _creatureCollection.maxWildLevel;

Expand Down Expand Up @@ -3831,8 +3827,9 @@ private void addRandomCreaturesToolStripMenuItem_Click(object sender, EventArgs
var s = addRandomCreatureDialog.Settings;
selectedSpecies = s.OnlySelectedSpecies ? speciesSelector1.SelectedSpecies : null;
_creatureCollection.MergeCreatureList(DummyCreatures.CreateCreatures(s.CreatureCount,
selectedSpecies, s.SpeciesCount,
s.Generations, s.PairsPerGeneration, _creatureCollection.Game == Ark.Asa, s.ProbabilityHigherStat, s.RandomMutationChance, s.MaxWildLevel,
selectedSpecies, s.SpeciesCount, s.Tamed,
s.Generations, s.PairsPerGeneration, _creatureCollection.Game == Ark.Asa, s.ProbabilityHigherStat, s.RandomMutationChance,
s.MaxWildLevel, s.MaxStatLevel,
s.SetOwner, s.SetTribe, s.SetServer, true));
}

Expand Down
Loading

0 comments on commit 752a9a9

Please sign in to comment.