Skip to content

Commit

Permalink
added pause/resume button for timers in the raising-tab. added statMu…
Browse files Browse the repository at this point in the history
…ltiplierTesting (enable via the dev-mode in the settings. fix for exception when editing bred creatures with set parents. breeding-plan gets automatically recalculated if tags are changed. import of exported creatures now uses the blueprintpath for the species determination. improved performance for changes of long breeding-plan-suggestions. added IgnoreSexInBreedingPlan for mods which enable offspring of all creatures, e.g. the S+ mutator. added level to possible stat-values in the raising-tab for the egg-timers. fixed importExported creatures with less than 100% damage or speed (#560). fix for overlay-taming-info wouldn't disappear. improved extraction process, resulting in less impossible combinations. fixed taming-food for nonViolents (don't eat veggies), added rockarrot for equus.
  • Loading branch information
cadaei committed Apr 8, 2018
1 parent 5095f4b commit c74979a
Show file tree
Hide file tree
Showing 49 changed files with 3,519 additions and 557 deletions.
29 changes: 25 additions & 4 deletions ARKBreedingStats/ARKBreedingStats.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@
</Compile>
<Compile Include="ImportExported.cs" />
<Compile Include="miscClasses\IssueNotes.cs" />
<Compile Include="multiplierTesting\StatMultiplierTestingControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="multiplierTesting\StatMultiplierTestingControl.Designer.cs">
<DependentUpon>StatMultiplierTestingControl.cs</DependentUpon>
</Compile>
<Compile Include="settings\ATImportFileLocation.cs" />
<Compile Include="settings\ATImportFileLocationDialog.cs">
<SubType>Form</SubType>
Expand All @@ -76,6 +82,12 @@
<DependentUpon>ATImportFileLocationDialog.cs</DependentUpon>
</Compile>
<Compile Include="species\CreatureColors.cs" />
<Compile Include="multiplierTesting\StatsMultiplierTesting.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="multiplierTesting\StatsMultiplierTesting.Designer.cs">
<DependentUpon>StatsMultiplierTesting.cs</DependentUpon>
</Compile>
<Compile Include="testCases\ExtractionTestCase.cs" />
<Compile Include="Importer.cs" />
<Compile Include="ocr\ArkOCR.cs" />
Expand Down Expand Up @@ -111,11 +123,11 @@
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Raising.cs" />
<Compile Include="RaisingControl.cs">
<Compile Include="raising\Raising.cs" />
<Compile Include="raising\RaisingControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="RaisingControl.Designer.cs">
<Compile Include="raising\RaisingControl.Designer.cs">
<DependentUpon>RaisingControl.cs</DependentUpon>
</Compile>
<Compile Include="BreedingInfo.cs">
Expand Down Expand Up @@ -395,13 +407,16 @@
<EmbeddedResource Include="ExportedCreatureList.resx">
<DependentUpon>ExportedCreatureList.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="multiplierTesting\StatMultiplierTestingControl.resx">
<DependentUpon>StatMultiplierTestingControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="NotesControl.resx">
<DependentUpon>NotesControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ocr\OCRControl.resx">
<DependentUpon>OCRControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="RaisingControl.resx">
<EmbeddedResource Include="raising\RaisingControl.resx">
<DependentUpon>RaisingControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BreedingInfo.resx">
Expand All @@ -425,6 +440,9 @@
<EmbeddedResource Include="SpeciesSelector.resx">
<DependentUpon>SpeciesSelector.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="multiplierTesting\StatsMultiplierTesting.resx">
<DependentUpon>StatsMultiplierTesting.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="testCases\ExtractionTestControl.resx">
<DependentUpon>ExtractionTestControl.cs</DependentUpon>
</EmbeddedResource>
Expand Down Expand Up @@ -479,6 +497,9 @@
<None Include="json\aliases.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="json\bps.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="json\classicFlyers.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
106 changes: 45 additions & 61 deletions ARKBreedingStats/ARKOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ namespace ARKBreedingStats
public partial class ARKOverlay : Form
{
private Control[] labels = new Control[10];
private Timer inventoryCheckTimer = new Timer();
private Timer timerUpdateTimer = new Timer();
public Form1 ExtractorForm;
public bool OCRing = false;
Expand All @@ -23,14 +22,15 @@ public partial class ARKOverlay : Form
private DateTime infoShownAt;
public int InfoDuration;
private bool currentlyInInventory;
private bool inventoryCheckTimerEnabled;
public bool checkInventoryStats;
private bool toggleInventoryCheck; // check inventory only every other time

public ARKOverlay()
{
InitializeComponent();
this.FormBorderStyle = FormBorderStyle.None;
this.ShowInTaskbar = false;
this.TopMost = true;
FormBorderStyle = FormBorderStyle.None;
ShowInTaskbar = false;
TopMost = true;

infoShownAt = DateTime.Now.AddMinutes(-10);

Expand All @@ -51,11 +51,9 @@ public ARKOverlay()
labelTimer.Text = "";
labelInfo.Text = "";

this.Location = Point.Empty;
this.Size = new Size(ArkOCR.OCR.ocrConfig.resolutionWidth, ArkOCR.OCR.ocrConfig.resolutionHeight);
Location = Point.Empty;
Size = new Size(ArkOCR.OCR.ocrConfig.resolutionWidth, ArkOCR.OCR.ocrConfig.resolutionHeight);

inventoryCheckTimer.Interval = 2000;
inventoryCheckTimer.Tick += inventoryCheckTimer_Tick;
timerUpdateTimer.Interval = 1000;
timerUpdateTimer.Tick += TimerUpdateTimer_Tick;
theOverlay = this;
Expand All @@ -80,72 +78,58 @@ public void initLabelPositions()
lblStatus.Location = new Point(50, 10);
}

public bool enableInventoryCheckTimer
{
set
{
inventoryCheckTimerEnabled = value;
inventoryCheckTimer.Enabled = value && timerUpdateTimer.Enabled;
}
get
{
return inventoryCheckTimerEnabled;
}
}
public bool enableOverlayTimer { set { timerUpdateTimer.Enabled = value; } }

public bool enableOverlayTimers
void inventoryCheckTimer_Tick(object sender, EventArgs e)
{
set
{
inventoryCheckTimer.Enabled = value && inventoryCheckTimerEnabled;
timerUpdateTimer.Enabled = value;
}


return;
}

void inventoryCheckTimer_Tick(object sender, EventArgs e)
private void TimerUpdateTimer_Tick(object sender, EventArgs e)
{
if (OCRing == true)
return;
lblStatus.Text = "…";
Application.DoEvents();
OCRing = true;
if (!ArkOCR.OCR.isDinoInventoryVisible())
if (timers.Count > 0)
setTimer();

toggleInventoryCheck = !toggleInventoryCheck;
if (checkInventoryStats && toggleInventoryCheck)
{
if (currentlyInInventory)
if (OCRing == true)
return;
lblStatus.Text = "…";
Application.DoEvents();
OCRing = true;
if (!ArkOCR.OCR.isDinoInventoryVisible())
{
for (int i = 0; i < labels.Count(); i++)
if (labels[i] != null)
labels[i].Text = "";
currentlyInInventory = false;
if (currentlyInInventory)
{
for (int i = 0; i < labels.Count(); i++)
if (labels[i] != null)
labels[i].Text = "";
currentlyInInventory = false;
}
}
}
else if (currentlyInInventory)
{
// assuming it's still the same inventory, don't do anything, assuming nothing changed
}
else
{
currentlyInInventory = true;
lblStatus.Text = "Reading Values";
else if (currentlyInInventory)
{
// assuming it's still the same inventory, don't do anything, assuming nothing changed
}
else
{
currentlyInInventory = true;
lblStatus.Text = "Reading Values";
Application.DoEvents();
if (ExtractorForm != null)
ExtractorForm.doOCR("", false);
}
OCRing = false;
lblStatus.Text = "";
Application.DoEvents();
if (ExtractorForm != null)
ExtractorForm.doOCR("", false);
}
OCRing = false;
lblStatus.Text = "";
Application.DoEvents();

// info
if (labelInfo.Text != "" && infoShownAt.AddSeconds(InfoDuration) < DateTime.Now)
labelInfo.Text = "";

return;
}

private void TimerUpdateTimer_Tick(object sender, EventArgs e)
{
if (timers.Count > 0)
setTimer();
}

public void setStatLevels(float[] wildValues, float[] tamedValues, Color[] colors = null)
Expand Down
3 changes: 3 additions & 0 deletions ARKBreedingStats/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@
<setting name="ExportCreatureFolder" serializeAs="String">
<value />
</setting>
<setting name="IgnoreSexInBreedingPlan" serializeAs="String">
<value>False</value>
</setting>
</ARKBreedingStats.Properties.Settings>
</userSettings>
</configuration>
23 changes: 12 additions & 11 deletions ARKBreedingStats/BreedingPlan.Designer.cs

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

Loading

0 comments on commit c74979a

Please sign in to comment.