Skip to content

Commit

Permalink
corrected procoptodon-weight-stat. added locking to dom-level-zero. m…
Browse files Browse the repository at this point in the history
…ade giganoto-extraction easier to handle. various fixes, performance-improvements.
  • Loading branch information
cadon committed Mar 13, 2016
1 parent c788a02 commit 98dfb75
Show file tree
Hide file tree
Showing 16 changed files with 145 additions and 107 deletions.
2 changes: 2 additions & 0 deletions ARKBreedingStats/ARKBreedingStats.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
</Compile>
<Compile Include="Utils.cs" />
<Content Include="lock.png" />
<Content Include="unlock.png" />
<Content Include="ver.txt" />
<EmbeddedResource Include="AboutBox1.resx">
<DependentUpon>AboutBox1.cs</DependentUpon>
Expand All @@ -131,6 +132,7 @@
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="StatDisplay.resx">
<DependentUpon>StatDisplay.cs</DependentUpon>
Expand Down
23 changes: 11 additions & 12 deletions ARKBreedingStats/CreatureBox.Designer.cs

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

5 changes: 5 additions & 0 deletions ARKBreedingStats/CreatureBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ private void initializeVars()
tt.SetToolTip(comboBoxMother, "Mother");
tt.SetToolTip(comboBoxFather, "Father");
tt.SetToolTip(textBoxNote, "Note");
tt.SetToolTip(labelParents, "Mother and Father (if bred and choosen)");
}

public void setCreature(Creature creature)
Expand All @@ -80,6 +81,7 @@ public void updateStat(int stat)

public void buttonEdit_Click(object sender, EventArgs e)
{
SuspendLayout();
if (creature != null)
{
if (panel1.Visible)
Expand Down Expand Up @@ -117,6 +119,7 @@ public void buttonEdit_Click(object sender, EventArgs e)
}
}
}
ResumeLayout();
}

private void populateParentsList()
Expand Down Expand Up @@ -188,6 +191,7 @@ private void closeSettings(bool save)
panel1.Visible = false;
if (save)
{
SuspendLayout();
creature.name = textBoxName.Text;
creature.gender = gender;
creature.owner = textBoxOwner.Text;
Expand Down Expand Up @@ -222,6 +226,7 @@ private void closeSettings(bool save)
creature.note = textBoxNote.Text;
Changed(this, indexInListView, creature);
updateLabel();
ResumeLayout();
}
}

Expand Down
8 changes: 0 additions & 8 deletions ARKBreedingStats/CreatureBox.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,4 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="buttonEdit.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAALGPC/xhBQAAAExJREFUKFN9
jQEKACAIA/2pT/Opq1ULIW1wUO1YBqDF3XGwUiAUIkJiLwnJpZSXCN9bKcmr+0rqyJVEKTEq01evxKhs
l2Z0/i7tO2wAw6XzgmZrymkAAAAASUVORK5CYII=
</value>
</data>
</root>
84 changes: 45 additions & 39 deletions ARKBreedingStats/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,14 @@ private void Form1_Load(object sender, EventArgs e)
testingIOs[s].LevelChanged += new LevelChangedEventHandler(this.statIOUpdateValue);
statIOs[s].InputValueChanged += new InputValueChangedEventHandler(this.statIOQuickWildLevelCheck);
}
statIOTorpor.ShowBar = false; // torpor should not show bar, it get's too wide and is not interesting for breeding
statTestingTorpor.ShowBar = false;
labelSumDomSB.Text = "";
updateTorporInTester = true;
statIOTorpor.ShowBarAndLock = false; // torpor should not show bar, it get's too wide and is not interesting for breeding
statTestingTorpor.ShowBarAndLock = false;

// fix dom-levels of oxygen, food to zero (most often they are not leveld up)
statIOs[2].DomLevelZero = true;
statIOs[3].DomLevelZero = true;

labelTE.Text = "Extracted: n/a";

// ToolTips
ToolTip tt = new ToolTip();
Expand All @@ -101,31 +105,28 @@ private void Form1_Load(object sender, EventArgs e)
else
{
MessageBox.Show("Creatures-File could not be loaded.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
Close();
}

// fix dom-levels of oxygen, food (most often they are not leveld up)
statIOs[2].DomLevelZero = true;
statIOs[3].DomLevelZero = true;

////// insert debug values. TODO: remove before release. It's only here to insert some working numbers to extract
//// insert debug values. TODO: remove before release. It's only here to insert some working numbers to extract
//statIOs[0].Input = 1596.1;
//statIOs[1].Input = 990;
//statIOs[2].Input = 495;
//statIOs[3].Input = 4278;
//statIOs[4].Input = 231;
//statIOs[5].Input = 3.304;
//statIOs[5].Input = 2.869;
//statIOs[6].Input = 1.365;
//statIOs[7].Input = 1430.9;
//numericUpDownLevel.Value = 183;
//comboBoxCreatures.SelectedIndex = 33;
//comboBoxCreatures.SelectedIndex = 35;

tabControl1.SelectedIndex = 1;

// load last save file:
if (Properties.Settings.Default.LastSaveFile != "")
loadCollectionFile(Properties.Settings.Default.LastSaveFile);

creatureBoxListView.Clear();
clearAll();
}

private void clearAll()
Expand All @@ -152,7 +153,6 @@ private void clearAll()
buttonCopyClipboard.Enabled = false;
buttonAdd2Library.Enabled = false;
activeStat = -1;
labelTE.Text = "Extracted: n/a";
labelSumDom.Text = "";
labelSumWild.Text = "";
labelSumWildSB.Text = "";
Expand All @@ -161,10 +161,13 @@ private void clearAll()
levelWildFromTorporRange[i] = 0;
levelDomFromTorporAndTotalRange[i] = 0;
}
labelSumDomSB.Text = "";
updateTorporInTester = true;
}

private void buttonExtract_Click(object sender, EventArgs e)
{
SuspendLayout();
int activeStatKeeper = activeStat;
clearAll();
bool resultsValid = true;
Expand Down Expand Up @@ -420,6 +423,7 @@ private void buttonExtract_Click(object sender, EventArgs e)
}
this.checkBoxAlreadyBred.BackColor = Color.LightSalmon;
this.checkBoxJustTamed.BackColor = Color.LightSalmon;
panelWildTamedAuto.BackColor = Color.LightSalmon;
}
}
}
Expand All @@ -443,6 +447,7 @@ private void buttonExtract_Click(object sender, EventArgs e)
{
labelFootnote.Text = "*Creature is not yet tamed and may get better values then.";
}
ResumeLayout();
}

private void setUniqueTE()
Expand All @@ -455,8 +460,15 @@ private void setUniqueTE()
}
else
{
labelTE.Text = "TE differs in chosen possibilities";
labelTE.BackColor = Color.LightSalmon;
if (eff == -1)
{
labelTE.Text = "TE differs in chosen possibilities";
labelTE.BackColor = Color.LightSalmon;
}
else
{
labelTE.Text = "TE unknown";
}
}
}

Expand Down Expand Up @@ -645,6 +657,14 @@ private void comboBoxCreatures_SelectedIndexChanged(object sender, EventArgs e)
activeStats[s] = (stats[cC][s].BaseValue > 0);
statIOs[s].Enabled = activeStats[s];
}
// if torpor has no tamed-add-bonus, the automatic tamed-recognition does not work => enable manual selection
if (stats[cC][7].AddWhenTamed == 0)
{
checkBoxWildTamedAuto.Checked = false;
radioButtonTamed.Checked = true;
}
else
checkBoxWildTamedAuto.Checked = true;
clearAll();
}
}
Expand All @@ -667,20 +687,23 @@ private void listBoxPossibilities_MouseClick(object sender, MouseEventArgs e)
int index = this.listBoxPossibilities.IndexFromPoint(e.Location);
if (index != System.Windows.Forms.ListBox.NoMatches && activeStat >= 0)
{
setPossibility(activeStat, index);
setPossibility(activeStat, index, true);
}
}

private void setPossibility(int s, int i)
private void setPossibility(int s, int i, bool setGlobals = false)
{
statIOs[s].LevelWild = (Int32)results[s][i][0];
statIOs[s].LevelDom = (Int32)results[s][i][1];
statIOs[s].TamingEfficiency = (Int32)results[s][i][2];
statIOs[s].BreedingValue = breedingValue(s, i);
chosenResults[s] = i;
setUniqueTE();
showSumOfChosenLevels();
setSpeedLevelAccordingToOthers();
if (setGlobals)
{
setUniqueTE();
showSumOfChosenLevels();
setSpeedLevelAccordingToOthers();
}
}

private void setSpeedLevelAccordingToOthers()
Expand Down Expand Up @@ -769,7 +792,7 @@ private void buttonCopyClipboard_Click(object sender, EventArgs e)

private double uniqueTE()
{
if (statsWithEff.Count > 0 && results[statsWithEff[0]].Count > chosenResults[statsWithEff[0]])
if (statsWithEff.Count > 0 && results.Count > statsWithEff[0] && results[statsWithEff[0]].Count > chosenResults[statsWithEff[0]])
{
double eff = results[statsWithEff[0]][chosenResults[statsWithEff[0]]][2];
for (int st = 1; st < statsWithEff.Count; st++)
Expand All @@ -782,7 +805,7 @@ private double uniqueTE()
}
return eff;
}
return -1;
return -2;
}

private double breedingValue(int s, int r)
Expand Down Expand Up @@ -1020,23 +1043,6 @@ private void loadCollectionFile(String fileName, bool keepCurrentCreatures = fal

if (creatureCollection.creatures.Count > 0)
tabControl1.SelectedIndex = 2;
//// this is to attain compatibility with older save-files. TODO remove before release
//updateParents(creatureCollection.creatures);
//foreach (Creature c in creatureCollection.creatures)
//{
// if (c.guid == Guid.Empty)
// c.guid = Guid.NewGuid();
// if (c.tamingEff == 1)
// c.isBred = true;

// if (c.tamingEff < 1)
// {
// c.motherGuid = Guid.Empty;
// c.fatherGuid = Guid.Empty;
// }
// c.recalculateAncestorGenerations();
//}
//// end of TODO remove before release

pedigree1.creatures = creatureCollection.creatures;
toolStripStatusLabel.Text = creatureCollection.creatures.Count() + " creatures loaded";
Expand Down
2 changes: 1 addition & 1 deletion ARKBreedingStats/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("0.16.8.0")]
[assembly: AssemblyFileVersion("0.16.9.0")]
Loading

0 comments on commit 98dfb75

Please sign in to comment.