Skip to content

Commit ff40fb2

Browse files
committed
Merge branch 'dev'
2 parents 3ec4e1b + 22d64a2 commit ff40fb2

File tree

9 files changed

+38
-22
lines changed

9 files changed

+38
-22
lines changed

ARKBreedingStats/FileSync.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@ public FileSync(string fileName, Action callback)
2929
UpdateProperties();
3030
}
3131

32+
/// <summary>
33+
/// Update the FileSystemWatcher properties
34+
/// </summary>
3235
public void ChangeFile(string newFileName)
3336
{
3437
_currentFile = newFileName;
35-
36-
// Update the FileSystemWatcher properties
3738
UpdateProperties();
3839
}
3940

ARKBreedingStats/Form1.collection.cs

+13-3
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,13 @@ private void NewCollection(bool resetCollection = false)
6767
serverMultipliers = oldMultipliers,
6868
ModList = new List<Mod>()
6969
};
70+
_currentFileName = null;
71+
_fileSync?.ChangeFile(_currentFileName);
7072

7173
if (asaMode)
7274
{
7375
_creatureCollection.Game = Ark.Asa;
74-
ReloadModValuesOfCollectionIfNeeded(true, false, false);
76+
ReloadModValuesOfCollectionIfNeeded(true, false, false, false);
7577
}
7678

7779
pedigree1.Clear();
@@ -84,8 +86,6 @@ private void NewCollection(bool resetCollection = false)
8486
UpdateCreatureListings();
8587
creatureBoxListView.Clear();
8688
Properties.Settings.Default.LastSaveFile = null;
87-
_currentFileName = null;
88-
_fileSync?.ChangeFile(_currentFileName);
8989
SetCollectionChanged(false);
9090
}
9191

@@ -877,6 +877,16 @@ private bool ImportExportGunFiles(string[] filePaths, out bool creatureAdded, ou
877877
+ serverImportResult);
878878

879879
SetMessageLabelText(resultText, importFailedCounter > 0 || multipliersImportSuccessful == false ? MessageBoxIcon.Error : MessageBoxIcon.Information, lastCreatureFilePath);
880+
881+
if (lastAddedCreature != null)
882+
{
883+
tabControlMain.SelectedTab = tabPageLibrary;
884+
if (listBoxSpeciesLib.SelectedItem != null &&
885+
listBoxSpeciesLib.SelectedItem != lastAddedCreature.Species)
886+
listBoxSpeciesLib.SelectedItem = lastAddedCreature.Species;
887+
SelectCreatureInLibrary(lastAddedCreature);
888+
}
889+
880890
return creatureAlreadyExists;
881891
}
882892

ARKBreedingStats/Form1.cs

+15-8
Original file line numberDiff line numberDiff line change
@@ -1991,7 +1991,7 @@ private void OpenSettingsDialog(SettingsTabPages page = SettingsTabPages.Unknown
19911991
{
19921992
// ASA setting changed
19931993
var loadAsa = gameSettingBefore != Ark.Asa;
1994-
ReloadModValuesOfCollectionIfNeeded(loadAsa, false, false);
1994+
ReloadModValuesOfCollectionIfNeeded(loadAsa, false, false, false);
19951995
}
19961996

19971997
ApplySettingsToValues();
@@ -2757,7 +2757,7 @@ private void loadAdditionalValuesToolStripMenuItem_Click(object sender, EventArg
27572757
/// Loads mod value files according to the ModList of the library.
27582758
/// </summary>
27592759
/// <param name="onlyAdd">If true the values are not reset to the default first.</param>
2760-
private void ReloadModValuesOfCollectionIfNeeded(bool onlyAdd = false, bool showResult = true, bool applySettings = true)
2760+
private void ReloadModValuesOfCollectionIfNeeded(bool onlyAdd = false, bool showResult = true, bool applySettings = true, bool setCollectionChanged = true)
27612761
{
27622762
// if the mods for the library changed,
27632763
// first check if all mod value files are available and load missing files if possible,
@@ -2774,7 +2774,8 @@ private void ReloadModValuesOfCollectionIfNeeded(bool onlyAdd = false, bool show
27742774
else
27752775
UpdateAsaIndicator();
27762776

2777-
SetCollectionChanged(true);
2777+
if (setCollectionChanged)
2778+
SetCollectionChanged(true);
27782779
}
27792780
}
27802781

@@ -3226,11 +3227,17 @@ private void tsBtAddAsExtractionTest_Click(object sender, EventArgs e)
32263227

32273228
private void copyToMultiplierTesterToolStripButton_Click(object sender, EventArgs e)
32283229
{
3230+
bool fromExtractor = tabControlMain.SelectedTab == tabPageExtractor;
3231+
var tamed = fromExtractor ? rbTamedExtractor.Checked : rbTamedTester.Checked;
3232+
var bred = fromExtractor ? rbBredExtractor.Checked : rbBredTester.Checked;
3233+
32293234
double[] statValues = new double[Stats.StatsCount];
32303235
for (int s = 0; s < Stats.StatsCount; s++)
3231-
statValues[s] = _statIOs[s].Input;
3232-
3233-
bool fromExtractor = tabControlMain.SelectedTab == tabPageExtractor;
3236+
{
3237+
statValues[s] = _statIOs[s].IsActive
3238+
? _statIOs[s].Input
3239+
: StatValueCalculation.CalculateValue(speciesSelector1.SelectedSpecies, s, 0, 0, tamed || bred);
3240+
}
32343241

32353242
var wildLevels = GetCurrentWildLevels(false);
32363243
// the torpor level of the tester is only the sum of the recognized stats. Use the level of the extractor, if that value was recognized.
@@ -3245,8 +3252,8 @@ private void copyToMultiplierTesterToolStripButton_Click(object sender, EventArg
32453252
(double)(fromExtractor
32463253
? numericUpDownImprintingBonusExtractor.Value
32473254
: numericUpDownImprintingBonusTester.Value) / 100,
3248-
fromExtractor ? rbTamedExtractor.Checked : rbTamedTester.Checked,
3249-
fromExtractor ? rbBredExtractor.Checked : rbBredTester.Checked,
3255+
tamed,
3256+
bred,
32503257
speciesSelector1.SelectedSpecies);
32513258
tabControlMain.SelectedTab = tabPageMultiplierTesting;
32523259
}

ARKBreedingStats/Form1.importExported.cs

-3
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,6 @@ private Creature ImportExportedAddIfPossible(string filePath)
244244
copiedNameToClipboard = true;
245245
}
246246
}
247-
248-
SelectCreatureInLibrary(creature);
249-
250247
break;
251248
default: return null;
252249
}

ARKBreedingStats/Properties/AssemblyInfo.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
// Revision
3131
//
3232
[assembly: AssemblyVersion("1.0.0.0")]
33-
[assembly: AssemblyFileVersion("0.58.0.0")]
33+
[assembly: AssemblyFileVersion("0.58.1.0")]
3434
[assembly: NeutralResourcesLanguage("en")]
3535

ARKBreedingStats/Stats.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public static class StatValueCalculation
99
{
1010
//private const double ROUND_UP_DELTA = 0.0001; // remove for now. Rounding issues should be handled during extraction with value-ranges.
1111

12-
public static double CalculateValue(Species species, int stat, int levelWild, int levelDom, bool dom, double tamingEff, double imprintingBonus, bool roundToIngamePrecision = true)
12+
public static double CalculateValue(Species species, int stat, int levelWild, int levelDom, bool dom, double tamingEff = 0, double imprintingBonus = 0, bool roundToIngamePrecision = true)
1313
{
1414
if (species == null)
1515
return 0;
@@ -71,8 +71,8 @@ public static float DisplayedAberration(double displayedStatValue, int displayed
7171
// always consider at least an error of. When using only the float-precision often the stat-calculations increase the resulting error to be much larger.
7272
const float minValueError = 0.001f;
7373

74-
// the error can increase due to the stat-calculation. Assume a factor of 10 for now, values lower than 6 were too low.
75-
const float calculationErrorFactor = 11;
74+
// the error can increase due to the stat-calculation. Assume a factor of 10 for now, values lower than 6 were too low. ASA needs it set to at least 18, using 20 for now.
75+
const float calculationErrorFactor = 20;
7676

7777
return highPrecisionInput || displayedStatValue * (displayedDecimals == 3 ? 100 : 1) > 1e6
7878
? Math.Max(minValueError, ((float)displayedStatValue).FloatPrecision() * calculationErrorFactor)

ARKBreedingStats/_manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"ARK Smart Breeding": {
55
"Id": "ARK Smart Breeding",
66
"Category": "main",
7-
"version": "0.58.0.0"
7+
"version": "0.58.1.0"
88
},
99
"SpeciesColorImages": {
1010
"Id": "SpeciesColorImages",

ARKBreedingStats/json/values/_manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"mod": { "id": "1139775728", "tag": "Confuciusornis", "title": "Confuciusornis" }
3131
},
3232
"1169020368-Trex.json": {
33-
"version": "357.11.1680434574",
33+
"version": "358.17.1700597183",
3434
"mod": { "id": "1169020368", "tag": "Trex", "title": "Ark Creature Rebalance (AG Reborn)" }
3535
},
3636
"1178308359-ShadDragon.json": {

ARKBreedingStats/uiControls/StatIO.cs

+1
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ public bool IsActive
253253
Height = value ? 50 : 16;
254254
Enabled = value;
255255
}
256+
get => Enabled;
256257
}
257258

258259
public void Clear()

0 commit comments

Comments
 (0)