Skip to content

Commit 7035324

Browse files
committed
Merge branch 'dev'
2 parents 0fc7e9f + 12c45e3 commit 7035324

12 files changed

+298
-225
lines changed

ARKBreedingStats/Extraction.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public void Clear()
9191
/// <param name="highPrecisionInputs">If true, the input is expected to be a float value from an export file.
9292
/// If false, it's assumed to be a displayed value from the game with one decimal digit.</param>
9393
/// <param name="imprintingChanged"></param>
94-
public void ExtractLevels(Species species, int level, List<StatIO> statIOs, double lowerTEBound, double upperTEBound,
94+
public void ExtractLevels(Species species, int level, StatIO[] statIOs, double lowerTEBound, double upperTEBound,
9595
bool tamed, bool bred, double imprintingBonusRounded, bool adjustImprinting, bool allowMoreThanHundredImprinting, double imprintingBonusMultiplier,
9696
bool considerWildLevelSteps, int wildLevelSteps, bool highPrecisionInputs, bool mutagenApplied, out bool imprintingChanged)
9797
{

ARKBreedingStats/Form1.Designer.cs

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ARKBreedingStats/Form1.cs

+42-42
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public partial class Form1 : Form
3333
private readonly Dictionary<Species, int[]> _topLevels = new Dictionary<Species, int[]>();
3434

3535
private readonly Dictionary<Species, int[]> _lowestLevels = new Dictionary<Species, int[]>();
36-
private readonly List<StatIO> _statIOs = new List<StatIO>();
37-
private readonly List<StatIO> _testingIOs = new List<StatIO>();
36+
private readonly StatIO[] _statIOs = new StatIO[Stats.StatsCount];
37+
private readonly StatIO[] _testingIOs = new StatIO[Stats.StatsCount];
3838
private int _activeStatIndex = -1;
3939

4040
private readonly bool[]
@@ -188,6 +188,46 @@ public Form1()
188188
openSettingsToolStripMenuItem.ShortcutKeyDisplayString = new KeysConverter()
189189
.ConvertTo(Keys.Control, typeof(string))?.ToString().Replace("None", ",");
190190

191+
for (int s = 0; s < Stats.StatsCount; s++)
192+
{
193+
var statIo = new StatIO
194+
{
195+
InputType = StatIOInputType.FinalValueInputType,
196+
Title = Utils.StatName(s),
197+
statIndex = s
198+
};
199+
var statIoTesting = new StatIO
200+
{
201+
InputType = StatIOInputType.LevelsInputType,
202+
Title = Utils.StatName(s),
203+
statIndex = s
204+
};
205+
206+
if (Utils.Precision(s) == 3)
207+
{
208+
statIo.Percent = true;
209+
statIoTesting.Percent = true;
210+
}
211+
212+
statIoTesting.LevelChanged += TestingStatIoValueUpdate;
213+
statIo.InputValueChanged += StatIOQuickWildLevelCheck;
214+
statIo.Click += StatIO_Click;
215+
_considerStatHighlight[s] = (Properties.Settings.Default.consideredStats & (1 << s)) != 0;
216+
217+
_statIOs[s] = statIo;
218+
_testingIOs[s] = statIoTesting;
219+
}
220+
221+
// add controls in the order they are shown in-game
222+
for (int s = 0; s < Stats.StatsCount; s++)
223+
{
224+
var displayIndex = Stats.DisplayOrder[s];
225+
flowLayoutPanelStatIOsExtractor.Controls.Add(_statIOs[displayIndex]);
226+
flowLayoutPanelStatIOsTester.Controls.Add(_testingIOs[displayIndex]);
227+
checkedListBoxConsiderStatTop.Items.Add(Utils.StatName(displayIndex),
228+
_considerStatHighlight[displayIndex]);
229+
}
230+
191231
_timerGlobal.Interval = 1000;
192232
_timerGlobal.Tick += TimerGlobal_Tick;
193233

@@ -251,46 +291,6 @@ private void Form1_Load(object sender, EventArgs e)
251291
tamingControl1.WeaponDamages = Properties.Settings.Default.weaponDamages;
252292
tamingControl1.WeaponDamagesEnabled = Properties.Settings.Default.weaponDamagesEnabled;
253293

254-
for (int s = 0; s < Stats.StatsCount; s++)
255-
{
256-
var statIO = new StatIO
257-
{
258-
InputType = StatIOInputType.FinalValueInputType,
259-
Title = Utils.StatName(s),
260-
statIndex = s
261-
};
262-
var statIoTesting = new StatIO
263-
{
264-
InputType = StatIOInputType.LevelsInputType,
265-
Title = Utils.StatName(s),
266-
statIndex = s
267-
};
268-
269-
if (Utils.Precision(s) == 3)
270-
{
271-
statIO.Percent = true;
272-
statIoTesting.Percent = true;
273-
}
274-
275-
statIoTesting.LevelChanged += TestingStatIoValueUpdate;
276-
statIO.InputValueChanged += StatIOQuickWildLevelCheck;
277-
statIO.Click += StatIO_Click;
278-
_considerStatHighlight[s] = (Properties.Settings.Default.consideredStats & (1 << s)) != 0;
279-
280-
_statIOs.Add(statIO);
281-
_testingIOs.Add(statIoTesting);
282-
}
283-
284-
// add controls in the order they are shown in-game
285-
for (int s = 0; s < Stats.StatsCount; s++)
286-
{
287-
var displayIndex = Stats.DisplayOrder[s];
288-
flowLayoutPanelStatIOsExtractor.Controls.Add(_statIOs[displayIndex]);
289-
flowLayoutPanelStatIOsTester.Controls.Add(_testingIOs[displayIndex]);
290-
checkedListBoxConsiderStatTop.Items.Add(Utils.StatName(displayIndex),
291-
_considerStatHighlight[displayIndex]);
292-
}
293-
294294
// torpor should not show bar, it get's too wide and is not interesting for breeding
295295
_statIOs[Stats.Torpidity].ShowBarAndLock = false;
296296
_testingIOs[Stats.Torpidity].ShowBarAndLock = false;

ARKBreedingStats/Form1.extractor.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ private void ShowSumOfChosenLevels()
120120
var checkLowLevels = _lowestLevels.TryGetValue(species, out int[] lowSpeciesLevels);
121121

122122
var customStatNames = species.statNames;
123-
var statWeights = breedingPlan1.StatWeighting.GetWeightingByPresetName(species.name);
123+
var statWeights = breedingPlan1.StatWeighting.GetWeightingForSpecies(species);
124124
if (statWeights.Item1 == null) checkLowLevels = false;
125125
var analysisState = LevelStatus.Neutral;
126126
var newTopStatsText = new List<string>();

ARKBreedingStats/Form1.l10n.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private void SetLocalizations(bool initialize = true)
109109
Loc.SetToolTip(lbExtractorDomLevel, "domLevelExplanation", _tt);
110110
Loc.SetToolTip(lbExtractorWildLevel, "wildLevelExplanation", _tt);
111111
var statNames = speciesSelector1.SelectedSpecies?.statNames;
112-
for (int si = 0; si < _statIOs.Count; si++)
112+
for (int si = 0; si < _statIOs.Length; si++)
113113
{
114114
_statIOs[si].Title = Utils.StatName(si, false, statNames);
115115
_testingIOs[si].Title = Utils.StatName(si, false, statNames);

ARKBreedingStats/Form1.library.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ private void CalculateTopStats(List<Creature> creatures)
354354
List<int> usedAndConsideredStatIndices = new List<int>(Stats.StatsCount);
355355
int[] bestStat = new int[Stats.StatsCount];
356356
int[] lowestStat = new int[Stats.StatsCount];
357-
var statWeights = breedingPlan1.StatWeighting.GetWeightingByPresetName(species.name);
357+
var statWeights = breedingPlan1.StatWeighting.GetWeightingForSpecies(species);
358358
for (int s = 0; s < Stats.StatsCount; s++)
359359
{
360360
bestStat[s] = -1;

0 commit comments

Comments
 (0)