Skip to content

Commit

Permalink
crash-fix related to null-pointer in overlay. fix for out-of-index-er…
Browse files Browse the repository at this point in the history
…ror on 1680 ocr. made sum-display in extractor clearer. added edit-more-button in library-edit for full edit-options. updated values to v254. changed values-file-format a bit (preparing for more flexibility).
  • Loading branch information
cadaei committed Jan 31, 2017
1 parent f825ab1 commit ca485cf
Show file tree
Hide file tree
Showing 18 changed files with 353 additions and 202 deletions.
15 changes: 9 additions & 6 deletions ARKBreedingStats/ARKOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,17 @@ public void setValues(float[] wildValues, float[] tamedValues, Color[] colors =

internal void setExtraText(string p)
{
//Point loc = this.PointToClient(ArkOCR.OCR.lastLetterPositions["NameAndLevel"]);
Point loc = this.PointToClient(ArkOCR.OCR.statPositions["NameAndLevel"]);
if (ArkOCR.OCR.lastLetterPositions.ContainsKey("NameAndLevel"))
{
//Point loc = this.PointToClient(ArkOCR.OCR.lastLetterPositions["NameAndLevel"]);
Point loc = this.PointToClient(ArkOCR.OCR.statPositions["NameAndLevel"]);

loc.Offset(0, 30);
loc.Offset(0, 30);

extraText = p;
lblExtraText.Text = p;
lblExtraText.Location = loc;
extraText = p;
lblExtraText.Text = p;
lblExtraText.Location = loc;
}
}

private void ARKOverlay_Load(object sender, EventArgs e)
Expand Down
13 changes: 13 additions & 0 deletions ARKBreedingStats/CreatureBox.Designer.cs

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

6 changes: 6 additions & 0 deletions ARKBreedingStats/CreatureBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public partial class CreatureBox : UserControl
public event ChangedEventHandler Changed;
public delegate void EventHandler(object sender, Creature creature);
public event EventHandler GiveParents;
public event EventHandler EditCreature;
private Sex sex;
private CreatureStatus status;
public List<Creature>[] parentList; // all creatures that could be parents (i.e. same species, separated by sex)
Expand Down Expand Up @@ -367,5 +368,10 @@ private void pictureBox1_Click(object sender, EventArgs e)
renewLargeImage = false;
}
}

private void buttonEditMore_Click(object sender, EventArgs e)
{
EditCreature?.Invoke(this, creature);
}
}
}
1 change: 1 addition & 0 deletions ARKBreedingStats/CreatureCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ namespace ARKBreedingStats
public List<Player> players = new List<Player>();
[XmlArray]
public List<Tribe> tribes = new List<Tribe>();
public string additionalValues = "";

public bool mergeCreatureList(List<Creature> creaturesToMerge)
{
Expand Down
24 changes: 12 additions & 12 deletions ARKBreedingStats/CreatureInfoInput.Designer.cs

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

2 changes: 2 additions & 0 deletions ARKBreedingStats/CreatureInfoInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ public int SpeciesIndex
label5.Visible = breedingPossible;
label6.Visible = breedingPossible;
labelGrownPercent.Visible = breedingPossible;
numericUpDownMutations.Visible = breedingPossible;
labelMutations.Visible = breedingPossible;
if (!breedingPossible)
{
numericUpDownWeight.Value = 0;
Expand Down
9 changes: 4 additions & 5 deletions ARKBreedingStats/Extraction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,14 @@ public void extractLevels(int speciesI, int level, List<StatIO> statIOs, double
validResults = true;
if (autoDetectTamed)
{
// torpor is directly proportional to wild level. Check if creature is wild or tamed (doesn't work with Giganotosaurus because it has no additional bonus on torpor)
// torpor is directly proportional to wild level. Check if creature is wild or tamed (doesn't work with creatures that have no additive bonus on torpor, e.g. the Giganotosaurus)
postTamed = (Math.Round(Values.V.species[speciesI].stats[7].BaseValue * (1 + Values.V.species[speciesI].stats[7].IncPerWildLevel * Math.Round((statIOs[7].Input - Values.V.species[speciesI].stats[7].BaseValue) / (Values.V.species[speciesI].stats[7].BaseValue * Values.V.species[speciesI].stats[7].IncPerWildLevel))), 3) != statIOs[7].Input);
}
else
{
postTamed = tamed;
}

// needed to handle Torpor-bug
this.justTamed = justTamed;

imprintingBonus = 0;
if (bred)
{
Expand All @@ -190,9 +187,11 @@ public void extractLevels(int speciesI, int level, List<StatIO> statIOs, double
imprintingBonus = 1;
}
}

double imprintingMultiplier = (1 + imprintingBonus * imprintingBonusMultiplier * .2);

// needed to handle Torpor-bug
this.justTamed = justTamed;

// Torpor-bug: if bonus levels are added due to taming-effectiveness, torpor is too high
// instead of giving only the TE-bonus, the original wild levels W are added a second time to the torporlevels
// the game does this after taming: toLvl = (Math.Floor(W*TE/2) > 0 ? 2*W + Math.Min(W*TE/2) : W);
Expand Down
Loading

0 comments on commit ca485cf

Please sign in to comment.