Skip to content

Commit

Permalink
warning in Tester if level is 255 or higher
Browse files Browse the repository at this point in the history
  • Loading branch information
cadon committed Nov 27, 2022
1 parent ea2d6f1 commit 844551d
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 15 deletions.
17 changes: 15 additions & 2 deletions ARKBreedingStats/Form1.Designer.cs

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

6 changes: 4 additions & 2 deletions ARKBreedingStats/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ private void Form1_Load(object sender, EventArgs e)
statIoTesting.Percent = true;
}

statIoTesting.LevelChanged += testingStatIOValueUpdate;
statIoTesting.LevelChanged += TestingStatIoValueUpdate;
statIO.InputValueChanged += StatIOQuickWildLevelCheck;
statIO.Click += StatIO_Click;
_considerStatHighlight[s] = (Properties.Settings.Default.consideredStats & (1 << s)) != 0;
Expand Down Expand Up @@ -293,6 +293,8 @@ private void Form1_Load(object sender, EventArgs e)
_statIOs[Stats.Oxygen].DomLevelLockedZero = true;
_statIOs[Stats.Food].DomLevelLockedZero = true;

LbWarningLevel255.Visible = false;

InitializeCollection();

CreatureColored.InitializeSpeciesImageLocation();
Expand Down Expand Up @@ -2384,7 +2386,7 @@ private void toolStripButtonCopy2Tester_Click(object sender, EventArgs e)
{
_testingIOs[s].LevelWild = _statIOs[s].LevelWild;
_testingIOs[s].LevelDom = _statIOs[s].LevelDom;
testingStatIOValueUpdate(_testingIOs[s]);
TestingStatIoValueUpdate(_testingIOs[s]);
}

// set the data in the creatureInfoInput
Expand Down
6 changes: 3 additions & 3 deletions ARKBreedingStats/Form1.resx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ The TE can differ 0.1% due to ingame-rounding.</value>
<data name="radarChart1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAGQAAAAyCAYAAACqNX6+AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vQAADr0BR/uQrQAACDpJREFUeF7tWX9slOUdf3AkVocTN/7ossVgYlznjMFNLL01GzFu8Z85M8jSKTka
vAAADrwBlbxySQAACDpJREFUeF7tWX9slOUdf3AkVocTN/7ossVgYlznjMFNLL01GzFu8Z85M8jSKTka
rICWUX5bqNy6gsMB0pq48aMy/3FjIwtmgwsNw9SMLXS4ecgEpVavqUKr5frDg7Z34H32+dzdM98dveu1
9Mi4vp/mm+f98dz7vO/383x/1rhw4eIq4luUfYnD/8J5TcdIkRcpUygucoBsCHHeFxEiZF78zMW4Y7SE
CA9RRIqLHGC0hLgWkmNI4akxQuIkJPXeOoqLHGG0FuIix3AJ+T+DS0iOoCBrfXwrpZKSDa6UkLGum9eQ
Expand Down Expand Up @@ -170,7 +170,7 @@ The TE can differ 0.1% due to ingame-rounding.</value>
<data name="radarChartExtractor.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAGQAAAAyCAYAAACqNX6+AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vQAADr0BR/uQrQAACDpJREFUeF7tWX9slOUdf3AkVocTN/7ossVgYlznjMFNLL01GzFu8Z85M8jSKTka
vAAADrwBlbxySQAACDpJREFUeF7tWX9slOUdf3AkVocTN/7ossVgYlznjMFNLL01GzFu8Z85M8jSKTka
rICWUX5bqNy6gsMB0pq48aMy/3FjIwtmgwsNw9SMLXS4ecgEpVavqUKr5frDg7Z34H32+dzdM98dveu1
9Mi4vp/mm+f98dz7vO/383x/1rhw4eIq4luUfYnD/8J5TcdIkRcpUygucoBsCHHeFxEiZF78zMW4Y7SE
CA9RRIqLHGC0hLgWkmNI4akxQuIkJPXeOoqLHGG0FuIix3AJ+T+DS0iOoCBrfXwrpZKSDa6UkLGum9eQ
Expand Down Expand Up @@ -245,7 +245,7 @@ It's recommended to first create a backup file of you library.</value>
<data name="radarChartLibrary.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAGQAAAAyCAYAAACqNX6+AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vQAADr0BR/uQrQAACDpJREFUeF7tWX9slOUdf3AkVocTN/7ossVgYlznjMFNLL01GzFu8Z85M8jSKTka
vAAADrwBlbxySQAACDpJREFUeF7tWX9slOUdf3AkVocTN/7ossVgYlznjMFNLL01GzFu8Z85M8jSKTka
rICWUX5bqNy6gsMB0pq48aMy/3FjIwtmgwsNw9SMLXS4ecgEpVavqUKr5frDg7Z34H32+dzdM98dveu1
9Mi4vp/mm+f98dz7vO/383x/1rhw4eIq4luUfYnD/8J5TcdIkRcpUygucoBsCHHeFxEiZF78zMW4Y7SE
CA9RRIqLHGC0hLgWkmNI4akxQuIkJPXeOoqLHGG0FuIix3AJ+T+DS0iOoCBrfXwrpZKSDa6UkLGum9eQ
Expand Down
36 changes: 28 additions & 8 deletions ARKBreedingStats/Form1.tester.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using ARKBreedingStats.Library;
using ARKBreedingStats.species;
using ARKBreedingStats.values;
using System;
using System.Drawing;
using System.Linq;
Expand All @@ -17,7 +16,7 @@ public partial class Form1
/// </summary>
private void UpdateTesterDetails()
{
setTesterInputsTamed(!rbWildTester.Checked);
SetTesterInputsTamed(!rbWildTester.Checked);
NumericUpDownTestingTE.Enabled = rbTamedTester.Checked;
labelTesterTE.Enabled = rbTamedTester.Checked;
numericUpDownImprintingBonusTester.Enabled = rbBredTester.Checked;
Expand Down Expand Up @@ -74,12 +73,12 @@ private void UpdateAllTesterValues()
continue;
if (s == Stats.StatsCount - 2) // update torpor after last stat-update
_updateTorporInTester = true;
testingStatIOsRecalculateValue(_testingIOs[s]);
TestingStatIOsRecalculateValue(_testingIOs[s]);
}
testingStatIOsRecalculateValue(_testingIOs[Stats.Torpidity]);
TestingStatIOsRecalculateValue(_testingIOs[Stats.Torpidity]);
}

private void setTesterInputsTamed(bool tamed)
private void SetTesterInputsTamed(bool tamed)
{
for (int s = 0; s < Stats.StatsCount; s++)
_testingIOs[s].postTame = tamed;
Expand All @@ -90,9 +89,9 @@ private void setTesterInputsTamed(bool tamed)
/// Updates the values in the testing-statIOs
/// </summary>
/// <param name="sIo"></param>
private void testingStatIOValueUpdate(StatIO sIo)
private void TestingStatIoValueUpdate(StatIO sIo)
{
testingStatIOsRecalculateValue(sIo);
TestingStatIOsRecalculateValue(sIo);

// update Torpor-level if changed value is not from torpor-StatIO
if (_updateTorporInTester && sIo.statIndex != Stats.Torpidity)
Expand All @@ -106,10 +105,18 @@ private void testingStatIOValueUpdate(StatIO sIo)
_testingIOs[Stats.Torpidity].LevelWild = torporLvl + _hiddenLevelsCreatureTester;
}

var wildLevel255 = false;
var levelGreaterThan255 = false;

int domLevels = 0;
for (int s = 0; s < Stats.StatsCount; s++)
{
domLevels += _testingIOs[s].LevelDom;
if (_testingIOs[s].LevelWild == 255)
wildLevel255 = true;
if (_testingIOs[s].LevelWild > 255
|| _testingIOs[s].LevelDom > 255)
levelGreaterThan255 = true;
}
labelDomLevelSum.Text = $"Dom Levels: {domLevels}/{_creatureCollection.maxDomLevel}";
labelDomLevelSum.BackColor = domLevels > _creatureCollection.maxDomLevel ? Color.LightSalmon : Color.Transparent;
Expand All @@ -125,9 +132,22 @@ private void testingStatIOValueUpdate(StatIO sIo)

if (sIo.statIndex == Stats.Torpidity)
lbWildLevelTester.Text = "PreTame Level: " + Math.Ceiling(Math.Round((_testingIOs[Stats.Torpidity].LevelWild + 1) / (1 + NumericUpDownTestingTE.Value / 200), 6));

var levelWarning = string.Empty;
if (wildLevel255)
levelWarning += "A stat with a wild level of 255 cannot be leveled anymore. ";
if (levelGreaterThan255)
levelWarning += "A level higher than 255 will not be saved correctly in ARK and may be reset to a lower level than 256 after loading.";
if (string.IsNullOrEmpty(levelWarning))
LbWarningLevel255.Visible = false;
else
{
LbWarningLevel255.Text = levelWarning;
LbWarningLevel255.Visible = true;
}
}

private void testingStatIOsRecalculateValue(StatIO sIo)
private void TestingStatIOsRecalculateValue(StatIO sIo)
{
sIo.BreedingValue = StatValueCalculation.CalculateValue(speciesSelector1.SelectedSpecies, sIo.statIndex, sIo.LevelWild, 0, true, 1, 0);
sIo.Input = StatValueCalculation.CalculateValue(speciesSelector1.SelectedSpecies, sIo.statIndex, sIo.LevelWild, sIo.LevelDom,
Expand Down

0 comments on commit 844551d

Please sign in to comment.