Skip to content

Commit

Permalink
improved imprinting-extraction using food. changed messagebox in bree…
Browse files Browse the repository at this point in the history
…ding-planner to a label on the top, regarding top-creature already present. fixed update-check (TLS 1.2) (#634). improvement for some regexes for the OCR-recognition. fix for importing species (#635, #633). changed species-selector. fixed deselection of creature after color-selection (#637).
  • Loading branch information
cadaei committed Mar 3, 2018
1 parent b8d2f21 commit 7cc8d06
Show file tree
Hide file tree
Showing 23 changed files with 1,124 additions and 222 deletions.
15 changes: 15 additions & 0 deletions ARKBreedingStats/ARKBreedingStats.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@
<Compile Include="raising\ParentStatValues.Designer.cs">
<DependentUpon>ParentStatValues.cs</DependentUpon>
</Compile>
<Compile Include="SpeciesSelector.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="SpeciesSelector.Designer.cs">
<DependentUpon>SpeciesSelector.cs</DependentUpon>
</Compile>
<Compile Include="species\BreedingData.cs" />
<Compile Include="species\ColorRegion.cs" />
<Compile Include="Creature.cs" />
Expand Down Expand Up @@ -320,6 +326,9 @@
<Compile Include="uiControls\TagSelectorList.Designer.cs">
<DependentUpon>TagSelectorList.cs</DependentUpon>
</Compile>
<Compile Include="uiControls\TextBoxSuggest.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="uiControls\Trough.cs" />
<Compile Include="uiControls\TroughControl.cs">
<SubType>UserControl</SubType>
Expand Down Expand Up @@ -357,6 +366,9 @@
<EmbeddedResource Include="settings\customSoundChooser.resx">
<DependentUpon>customSoundChooser.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="SpeciesSelector.resx">
<DependentUpon>SpeciesSelector.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="uiControls\dhmsInput.resx">
<DependentUpon>dhmsInput.cs</DependentUpon>
</EmbeddedResource>
Expand Down Expand Up @@ -393,6 +405,9 @@
<EmbeddedResource Include="uiControls\TagSelectorList.resx">
<DependentUpon>TagSelectorList.cs</DependentUpon>
</EmbeddedResource>
<None Include="json\aliases.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="json\classicFlyers.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
3 changes: 0 additions & 3 deletions ARKBreedingStats/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@
<setting name="celsius" serializeAs="String">
<value>True</value>
</setting>
<setting name="lastSpecies" serializeAs="String">
<value />
</setting>
<setting name="oxygenForAll" serializeAs="String">
<value>False</value>
</setting>
Expand Down
9 changes: 5 additions & 4 deletions ARKBreedingStats/BreedingPlan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public partial class BreedingPlan : UserControl
public event PedigreeCreature.CreaturePartnerEventHandler BestBreedingPartners;
public event PedigreeCreature.ExportToClipboardEventHandler exportToClipboard;
public event Raising.createIncubationEventHandler createIncubationTimer;
public event Form1.setMessageLabelTextEventHandler setMessageLabelText;
private List<Creature> females = new List<Creature>();
private List<Creature> males = new List<Creature>();
private List<int>[] combinedTops = new List<int>[2];
Expand Down Expand Up @@ -418,11 +419,11 @@ public void drawBestParents(BreedingMode breedingMode, bool updateBreedingData =
}

if (bestCreatureAlreadyAvailable)
if (MessageBox.Show("There is already a creature in your library that has all the available top-stats ("
setMessageLabelText("There is already a creature in your library that has all the available top-stats ("
+ bestCreature.name + " " + Utils.sexSymbol(bestCreature.gender) + ")."
+ "\nThe currently selected conservative-breeding-mode might show some suggestions that may seem non-optimal.\n\n"
+ "Change the breeding-mode to \"High Stats\" for better suggestions.\nDo you want to change the breeding-mode to \"High Stats\"?",
"Top-creature already available", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) radioButtonBPHighStats.Checked = true;
+ "\nThe currently selected conservative-breeding-mode might show some suggestions that may seem non-optimal.\n"
+ "Change the breeding-mode to \"High Stats\" for better suggestions.");
else setMessageLabelText("");
}
}
else
Expand Down
3 changes: 2 additions & 1 deletion ARKBreedingStats/Extraction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ public void extractLevels(int speciesI, int level, List<StatIO> statIOs, double
// assuming food has no dom-levels, extract the exact imprinting from this stat. If the difference is less than 0.01, take this (probably more precise) value for the imprinting. (food has higher values and yields more precise results)
int wildLevelsFromImprintedFood = (int)Math.Round(((((statIOs[3].Input / (1 + stats[3].MultAffinity)) - stats[3].AddWhenTamed) / ((1 + imprintingBonusRounded * 0.2 * imprintingBonusMultiplier) * stats[3].BaseValue)) - 1) / stats[3].IncPerWildLevel);
double imprintingBonusFromFood = ((statIOs[3].Input / (1 + stats[3].MultAffinity) - stats[3].AddWhenTamed) / Stats.calculateValue(speciesI, 3, wildLevelsFromImprintedFood, 0, false, 0, 0) - 1) / (0.2 * imprintingBonusMultiplier);
if (Math.Abs(imprintingBonus - imprintingBonusFromFood) < 0.01)

if (Stats.calculateValue(speciesI, 7, wildLevelsFromImprintedTorpor, 0, true, 1, imprintingBonusFromFood) == statIOs[7].Input)
imprintingBonus = imprintingBonusFromFood;
}
else if (Values.V.species[speciesI].breeding != null && Values.V.species[speciesI].breeding.maturationTimeAdjusted > 0)
Expand Down
18 changes: 16 additions & 2 deletions ARKBreedingStats/FileSync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ class FileSync
FileSystemWatcher file_watcher;
DateTime lastUpdated;
Action callbackFunction;

public FileSync(string fileName, Action callback)
{
currentFile = fileName;
callbackFunction = callback;

file_watcher = new FileSystemWatcher();

// Add the handler for file changes
Expand Down Expand Up @@ -89,5 +89,19 @@ private void updateProperties()
file_watcher.EnableRaisingEvents = false;
}
}

public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}

protected virtual void Dispose(bool disposing)
{
if (disposing)
{
file_watcher.Dispose();
}
}
}
}
Loading

0 comments on commit 7cc8d06

Please sign in to comment.