Skip to content

Commit

Permalink
if file is not saveable (e.g. in use by another application like a cl…
Browse files Browse the repository at this point in the history
…oud-service), it will not now try again after a while. the extractor now shows if a level is top or even better. added inputs for multiple preset savegame-files for one-click extraction&import. fixed another rounding-issue with imprinted creatures. added import of exported creatures. added color-selection to creatureInput. fixed issue with overlay that prevented extracted levels to disappear. fixed issue with camelCase species-names (#651).
  • Loading branch information
cadaei committed Mar 25, 2018
1 parent c0b9be2 commit 9fe38cf
Show file tree
Hide file tree
Showing 48 changed files with 2,906 additions and 1,252 deletions.
38 changes: 38 additions & 0 deletions ARKBreedingStats/ARKBreedingStats.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@
<Compile Include="AboutBox1.Designer.cs">
<DependentUpon>AboutBox1.cs</DependentUpon>
</Compile>
<Compile Include="ExportedCreatureList.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ExportedCreatureList.Designer.cs">
<DependentUpon>ExportedCreatureList.cs</DependentUpon>
</Compile>
<Compile Include="ImportExported.cs" />
<Compile Include="species\CreatureColors.cs" />
<Compile Include="testCases\ExtractionTestCase.cs" />
<Compile Include="Importer.cs" />
<Compile Include="ocr\ArkOCR.cs" />
Expand Down Expand Up @@ -194,6 +202,18 @@
<Compile Include="uiControls\dhmsInput.Designer.cs">
<DependentUpon>dhmsInput.cs</DependentUpon>
</Compile>
<Compile Include="uiControls\ExportedCreatureControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="uiControls\ExportedCreatureControl.Designer.cs">
<DependentUpon>ExportedCreatureControl.cs</DependentUpon>
</Compile>
<Compile Include="uiControls\FileSelector.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="uiControls\FileSelector.Designer.cs">
<DependentUpon>FileSelector.cs</DependentUpon>
</Compile>
<Compile Include="uiControls\MultiSetterTag.cs">
<SubType>UserControl</SubType>
</Compile>
Expand All @@ -210,6 +230,12 @@
<Compile Include="uiControls\PatternEditor.Designer.cs">
<DependentUpon>PatternEditor.cs</DependentUpon>
</Compile>
<Compile Include="uiControls\RegionColorChooser.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="uiControls\RegionColorChooser.Designer.cs">
<DependentUpon>RegionColorChooser.cs</DependentUpon>
</Compile>
<Compile Include="uiControls\StatGraphs.cs">
<SubType>Component</SubType>
</Compile>
Expand Down Expand Up @@ -357,6 +383,9 @@
<EmbeddedResource Include="ARKOverlay.resx">
<DependentUpon>ARKOverlay.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ExportedCreatureList.resx">
<DependentUpon>ExportedCreatureList.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="NotesControl.resx">
<DependentUpon>NotesControl.cs</DependentUpon>
</EmbeddedResource>
Expand Down Expand Up @@ -393,12 +422,21 @@
<EmbeddedResource Include="uiControls\dhmsInput.resx">
<DependentUpon>dhmsInput.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="uiControls\ExportedCreatureControl.resx">
<DependentUpon>ExportedCreatureControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="uiControls\FileSelector.resx">
<DependentUpon>FileSelector.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="uiControls\MultiSetterTag.resx">
<DependentUpon>MultiSetterTag.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="uiControls\PatternEditor.resx">
<DependentUpon>PatternEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="uiControls\RegionColorChooser.resx">
<DependentUpon>RegionColorChooser.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="uiControls\StatPotential.resx">
<DependentUpon>StatPotential.cs</DependentUpon>
</EmbeddedResource>
Expand Down
4 changes: 4 additions & 0 deletions ARKBreedingStats/ARKOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ public bool enableInventoryCheckTimer
inventoryCheckTimerEnabled = value;
inventoryCheckTimer.Enabled = value && timerUpdateTimer.Enabled;
}
get
{
return inventoryCheckTimerEnabled;
}
}

public bool enableOverlayTimers
Expand Down
6 changes: 3 additions & 3 deletions ARKBreedingStats/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@
<setting name="showColorsInLibrary" serializeAs="String">
<value>True</value>
</setting>
<setting name="arkSavegamePath" serializeAs="String">
<value />
</setting>
<setting name="arkToolsPath" serializeAs="String">
<value />
</setting>
Expand All @@ -115,6 +112,9 @@
<setting name="LastSaveFileTestCases" serializeAs="String">
<value />
</setting>
<setting name="ExportCreatureFolder" serializeAs="String">
<value />
</setting>
</ARKBreedingStats.Properties.Settings>
</userSettings>
</configuration>
34 changes: 27 additions & 7 deletions ARKBreedingStats/BreedingPlan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Windows.Forms;
using ARKBreedingStats.species;
using System.Threading;
using System.Threading.Tasks;

namespace ARKBreedingStats
{
Expand All @@ -31,6 +32,7 @@ public partial class BreedingPlan : UserControl
public StatWeighting statWeighting;
public bool breedingPlanNeedsUpdate;
public CreatureCollection creatureCollection;
CancellationTokenSource cancelSource;

public BreedingPlan()
{
Expand All @@ -56,7 +58,7 @@ public BreedingPlan()
tt.SetToolTip(radioButtonBPHighStats, "Check for best next-generation-results.\nThe chance for an overall good creature is better.\nCheck if it's not important to have a Top-Stats-Offspring.");
tt.SetToolTip(buttonJustMated, "Click to create an incubation-entry in the Raising-tab");
tt.SetToolTip(nudMutationLimit, "Consider only creatures with at most this many mutations.\nSet to -1 for any number of mutation.");
tt.SetToolTip(cbTagExcludeDefault, "Check if all creatures should be excluded and only be included when have the include-mark on their tag.\nIf this checkbox is unchecked, all creatures will be included by default.");
tt.SetToolTip(cbTagExcludeDefault, "Check if all creatures should be excluded and only be included when have the include-mark on their tag.\nIf this checkbox is unchecked, all creatures will be included by default, and only excluded if one of their tags has the exclude-mark and none has the include-mark.");

statWeighting = statWeighting1;
breedingPlanNeedsUpdate = false;
Expand Down Expand Up @@ -113,7 +115,7 @@ public void determineBestBreeding(Creature chosenCreature = null, bool forceUpda
bm = BreedingMode.BestNextGen;

this.chosenCreature = chosenCreature;
drawBestParents(bm, newSpecies);
calculateBreedingScoresAndDisplayPairs(bm, newSpecies);
breedingPlanNeedsUpdate = false;
}

Expand Down Expand Up @@ -162,7 +164,25 @@ public List<Creature> filterByTags(List<Creature> cl)
}
}

public void drawBestParents(BreedingMode breedingMode, bool updateBreedingData = false)
public async void calculateBreedingScoresAndDisplayPairs(BreedingMode breedingMode, bool updateBreedingData = false)
{
cancelSource?.Cancel();
using (cancelSource = new CancellationTokenSource())
{
try
{
await Task.Delay(400, cancelSource.Token); // recalculate breedingplan at most a certain interval
AsyncCalculateBreedingScoresAndDisplayPairs(breedingMode, updateBreedingData);
}
catch (TaskCanceledException)
{
return;
}
}
cancelSource = null;
}

private void AsyncCalculateBreedingScoresAndDisplayPairs(BreedingMode breedingMode, bool updateBreedingData = false)
{
SuspendLayout();
Cursor.Current = Cursors.WaitCursor;
Expand Down Expand Up @@ -194,7 +214,7 @@ public void drawBestParents(BreedingMode breedingMode, bool updateBreedingData =

breedingPairs.Clear();
double t = 0, tt = 0, eTS;
int o = 0, nrTS;
int nrTS;
Int16[] bestPossLevels = new Int16[7]; // best possible levels

foreach (Creature female in choosenF)
Expand Down Expand Up @@ -723,19 +743,19 @@ private void nudMutationLimit_ValueChanged(object sender, EventArgs e)
private void radioButtonBPTopStatsCn_CheckedChanged(object sender, EventArgs e)
{
if (radioButtonBPTopStatsCn.Checked)
drawBestParents(BreedingMode.TopStatsConservative);
calculateBreedingScoresAndDisplayPairs(BreedingMode.TopStatsConservative);
}

private void radioButtonBPTopStats_CheckedChanged(object sender, EventArgs e)
{
if (radioButtonBPTopStats.Checked)
drawBestParents(BreedingMode.TopStatsLucky);
calculateBreedingScoresAndDisplayPairs(BreedingMode.TopStatsLucky);
}

private void radioButtonBPHighStats_CheckedChanged(object sender, EventArgs e)
{
if (radioButtonBPHighStats.Checked)
drawBestParents(BreedingMode.BestNextGen);
calculateBreedingScoresAndDisplayPairs(BreedingMode.BestNextGen);
}

public void setSpeciesList(List<string> speciesNames, List<Creature> creatures)
Expand Down
1 change: 1 addition & 0 deletions ARKBreedingStats/Creature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class Creature : IEquatable<Creature>
[XmlIgnore]
public Int16 topness; // permille of mean of wildlevels compared to toplevels
public string owner = "";
public string imprinterName = ""; // todo implement in creatureInfoInbox
public string tribe = "";
public string server = "";
public string note; // user defined note about that creature
Expand Down
111 changes: 22 additions & 89 deletions ARKBreedingStats/CreatureBox.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9fe38cf

Please sign in to comment.