Skip to content

Commit

Permalink
extract saved values after selecting them
Browse files Browse the repository at this point in the history
  • Loading branch information
cadon committed Mar 13, 2021
1 parent e3a7154 commit 5ecd19b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ARKBreedingStats/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2642,7 +2642,7 @@ private void toolStripCBTempCreatures_SelectedIndexChanged(object sender, EventA
{
if (toolStripCBTempCreatures.SelectedIndex >= 0 && toolStripCBTempCreatures.SelectedIndex < _creatureCollection.creaturesValues.Count)
{
SetCreatureValuesToExtractor(_creatureCollection.creaturesValues[toolStripCBTempCreatures.SelectedIndex]);
ExtractValuesInExtractor(_creatureCollection.creaturesValues[toolStripCBTempCreatures.SelectedIndex], null, false, false);
toolStripButtonDeleteTempCreature.Visible = true;
}
else
Expand Down
11 changes: 6 additions & 5 deletions ARKBreedingStats/Form1.extractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -873,16 +873,16 @@ private void ExtractExportedFileInExtractor(importExported.ExportedCreatureContr
}



/// <summary>
/// Sets the values of a creature to the extractor and extracts its levels.
/// It returns if the creature is already present in the library.
/// </summary>
/// <param name="cv"></param>
/// <param name="filePath"></param>
/// <param name="filePath">If given, the file path will be displayed as info.</param>
/// <param name="autoExtraction"></param>
/// <param name="highPrecisionValues"></param>
/// <returns></returns>
private bool ExtractValuesInExtractor(CreatureValues cv, string filePath, bool autoExtraction)
private bool ExtractValuesInExtractor(CreatureValues cv, string filePath, bool autoExtraction, bool highPrecisionValues = true)
{
SetCreatureValuesToExtractor(cv, false);

Expand All @@ -891,11 +891,12 @@ private bool ExtractValuesInExtractor(CreatureValues cv, string filePath, bool a

bool creatureExists = IsCreatureAlreadyInLibrary(cv.guid, cv.ARKID, out Creature existingCreature);

ExtractLevels(autoExtraction: autoExtraction, statInputsHighPrecision: true, existingCreature: existingCreature);
ExtractLevels(autoExtraction, highPrecisionValues, existingCreature: existingCreature);
SetCreatureValuesToInfoInput(cv, creatureInfoInputExtractor);
UpdateParentListInput(creatureInfoInputExtractor); // this function is only used for single-creature extractions, e.g. LastExport
creatureInfoInputExtractor.UpdateExistingCreature = creatureExists;
SetMessageLabelText(Loc.S("creatureOfFile") + "\n" + filePath, path: filePath);
if (!string.IsNullOrEmpty(filePath))
SetMessageLabelText(Loc.S("creatureOfFile") + "\n" + filePath, path: filePath);
return creatureExists;
}

Expand Down

0 comments on commit 5ecd19b

Please sign in to comment.