Skip to content

Commit

Permalink
Separated ARK-ID and the ASB-internal Guid, which will be invisible f…
Browse files Browse the repository at this point in the history
…or the user now. placeholder creatures are not considered in the counting in the statusbar anymore. if there are many exported files to import, a messagebox warns and asks if the import should continue. fix for Jerboa extraction if "consider wild-steps" was enabled. In the Breeding-planner, stat-weightings that are equal to a species-name are applied automatically when changing species; if there is a preset with the name "Default", this will be applied if no species-preset is available; if this preset is not set, the statWeighting will not change. Increased extracting tolerance a bit as a workaround to rounding-issues. tweaked mutation-counter display in the breending-planner, added total mutations to tooltip. species are now sorted alphabetically in the library (#779). if the file json/sortNames.txt is available, species in the library are sorted according to the sortNames in that file, one line per species in the format [speciesName]:[sortName]. added Tek Quetzal. button to delete all exported files of creatures that are already imported (#791).
  • Loading branch information
cadaei committed Oct 31, 2018
1 parent 6256ad1 commit fb24e4b
Show file tree
Hide file tree
Showing 46 changed files with 2,064 additions and 791 deletions.
38 changes: 33 additions & 5 deletions ARKBreedingStats/ARKBreedingStats.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ARKBreedingStats</RootNamespace>
<AssemblyName>ARK Smart Breeding</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
Expand Down Expand Up @@ -60,6 +60,19 @@
<Compile Include="AboutBox1.Designer.cs">
<DependentUpon>AboutBox1.cs</DependentUpon>
</Compile>
<Compile Include="duplicates\MergingDuplicates.cs" />
<Compile Include="duplicates\MergingDuplicatesUI.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="duplicates\MergingDuplicatesUI.Designer.cs">
<DependentUpon>MergingDuplicatesUI.cs</DependentUpon>
</Compile>
<Compile Include="duplicates\MergingDuplicatesWindow.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="duplicates\MergingDuplicatesWindow.Designer.cs">
<DependentUpon>MergingDuplicatesWindow.cs</DependentUpon>
</Compile>
<Compile Include="ExportedCreatureList.cs">
<SubType>Form</SubType>
</Compile>
Expand Down Expand Up @@ -272,6 +285,12 @@
<Compile Include="uiControls\RegionColorChooser.Designer.cs">
<DependentUpon>RegionColorChooser.cs</DependentUpon>
</Compile>
<Compile Include="uiControls\StatsDisplay.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="uiControls\StatsDisplay.Designer.cs">
<DependentUpon>StatsDisplay.cs</DependentUpon>
</Compile>
<Compile Include="uiControls\StatGraphs.cs">
<SubType>Component</SubType>
</Compile>
Expand Down Expand Up @@ -314,7 +333,7 @@
<Compile Include="uiControls\MyColorPicker.Designer.cs">
<DependentUpon>MyColorPicker.cs</DependentUpon>
</Compile>
<Compile Include="ParentComboBox.cs">
<Compile Include="uiControls\ParentComboBox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Pedigree.cs">
Expand Down Expand Up @@ -357,10 +376,10 @@
</Compile>
<Compile Include="StatResult.cs" />
<Compile Include="Stats.cs" />
<Compile Include="StatWeighting.cs">
<Compile Include="uiControls\StatWeighting.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="StatWeighting.Designer.cs">
<Compile Include="uiControls\StatWeighting.Designer.cs">
<DependentUpon>StatWeighting.cs</DependentUpon>
</Compile>
<Compile Include="Taming.cs" />
Expand Down Expand Up @@ -420,6 +439,12 @@
<EmbeddedResource Include="ARKOverlay.resx">
<DependentUpon>ARKOverlay.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="duplicates\MergingDuplicatesUI.resx">
<DependentUpon>MergingDuplicatesUI.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="duplicates\MergingDuplicatesWindow.resx">
<DependentUpon>MergingDuplicatesWindow.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ExportedCreatureList.resx">
<DependentUpon>ExportedCreatureList.cs</DependentUpon>
</EmbeddedResource>
Expand Down Expand Up @@ -497,10 +522,13 @@
<EmbeddedResource Include="uiControls\RegionColorChooser.resx">
<DependentUpon>RegionColorChooser.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="uiControls\StatsDisplay.resx">
<DependentUpon>StatsDisplay.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="uiControls\StatPotential.resx">
<DependentUpon>StatPotential.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="StatWeighting.resx">
<EmbeddedResource Include="uiControls\StatWeighting.resx">
<DependentUpon>StatWeighting.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="TamingControl.resx">
Expand Down
32 changes: 16 additions & 16 deletions ARKBreedingStats/App.config
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="ARKBreedingStats.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="ARKBreedingStats.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1"/>
</startup>
<userSettings>
<ARKBreedingStats.Properties.Settings>
<setting name="LastSaveFile" serializeAs="String">
<value />
<value/>
</setting>
<setting name="consideredStats" serializeAs="String">
<value>51</value>
Expand Down Expand Up @@ -50,13 +50,13 @@
<value>ShooterGame</value>
</setting>
<setting name="soundStarving" serializeAs="String">
<value />
<value/>
</setting>
<setting name="soundWakeup" serializeAs="String">
<value />
<value/>
</setting>
<setting name="soundBirth" serializeAs="String">
<value />
<value/>
</setting>
<setting name="SpeechRecognition" serializeAs="String">
<value>False</value>
Expand All @@ -80,7 +80,7 @@
<value>{species} {sex_short}{n}</value>
</setting>
<setting name="soundCustom" serializeAs="String">
<value />
<value/>
</setting>
<setting name="playAlarmTimes" serializeAs="String">
<value>60,0</value>
Expand All @@ -89,16 +89,16 @@
<value>True</value>
</setting>
<setting name="LastImportFile" serializeAs="String">
<value />
<value/>
</setting>
<setting name="showColorsInLibrary" serializeAs="String">
<value>True</value>
</setting>
<setting name="arkToolsPath" serializeAs="String">
<value />
<value/>
</setting>
<setting name="savegameExtractionPath" serializeAs="String">
<value />
<value/>
</setting>
<setting name="importChangeCreatureStatus" serializeAs="String">
<value>True</value>
Expand All @@ -110,22 +110,22 @@
<value>False</value>
</setting>
<setting name="LastSaveFileTestCases" serializeAs="String">
<value />
<value/>
</setting>
<setting name="ExportCreatureFolder" serializeAs="String">
<value />
<value/>
</setting>
<setting name="IgnoreSexInBreedingPlan" serializeAs="String">
<value>False</value>
</setting>
<setting name="DefaultOwnerName" serializeAs="String">
<value />
<value/>
</setting>
<setting name="OwnerNameLocked" serializeAs="String">
<value>False</value>
</setting>
<setting name="DefaultTribeName" serializeAs="String">
<value />
<value/>
</setting>
<setting name="TribeNameLocked" serializeAs="String">
<value>False</value>
Expand All @@ -134,7 +134,7 @@
<value>False</value>
</setting>
<setting name="language" serializeAs="String">
<value />
<value/>
</setting>
<setting name="UpgradeRequired" serializeAs="String">
<value>True</value>
Expand Down
13 changes: 11 additions & 2 deletions ARKBreedingStats/BreedingPlan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public partial class BreedingPlan : UserControl
private BreedingMode breedingMode;
public StatWeighting statWeighting;
public bool breedingPlanNeedsUpdate;
private bool dontUpdateBreedingPlan; // set to true if settings are changed and update should only performed after that
public CreatureCollection creatureCollection;
private CancellationTokenSource cancelSource;
private ToolTip tt = new ToolTip();
Expand Down Expand Up @@ -60,6 +61,7 @@ public BreedingPlan()

statWeighting = statWeighting1;
breedingPlanNeedsUpdate = false;
dontUpdateBreedingPlan = false;

tagSelectorList1.OnTagChanged += TagSelectorList1_OnTagChanged;
}
Expand Down Expand Up @@ -160,7 +162,8 @@ public List<Creature> filterByTags(List<Creature> cl)

public void calculateBreedingScoresAndDisplayPairs()
{
calculateBreedingScoresAndDisplayPairs(breedingMode);
if (!dontUpdateBreedingPlan)
calculateBreedingScoresAndDisplayPairs(breedingMode);
}

public async void calculateBreedingScoresAndDisplayPairs(BreedingMode breedingMode, bool updateBreedingData = false)
Expand Down Expand Up @@ -769,14 +772,20 @@ private void listViewSpeciesBP_SelectedIndexChanged(object sender, EventArgs e)
{
if (listViewSpeciesBP.SelectedIndices.Count > 0)
{
// automatically set preset if preset with the speciesname exists
dontUpdateBreedingPlan = true;
if (!statWeighting1.SelectPresetByName(listViewSpeciesBP.SelectedItems[0].Text))
statWeighting1.SelectPresetByName("Default");
dontUpdateBreedingPlan = false;

determineBestBreeding();

if (bestLevels.Count > 6)
{
// display top levels in species
int? levelStep = creatureCollection.getWildLevelStep();
Creature crB = new Creature(currentSpecies, "", "", "", 0, new int[8], null, 100, true, levelStep: levelStep);
crB.name = "Best possible levels (" + currentSpecies + ")";
crB.name = "Best possible " + currentSpecies + " in this library";
bool totalLevelUnknown = false;
for (int s = 0; s < 7; s++)
{
Expand Down
39 changes: 24 additions & 15 deletions ARKBreedingStats/Creature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public class Creature : IEquatable<Creature>
{
public string species;
public string name;
public Sex gender; // remove on 07/2018
public Sex sex;
public CreatureStatus status;
// order of the stats is Health, Stamina, Oxygen, Food, Weight, MeleeDamage, Speed, Torpor
Expand All @@ -25,31 +24,36 @@ public class Creature : IEquatable<Creature>
[XmlIgnore]
public bool[] topBreedingStats = new bool[8]; // indexes of stats that are top for that species in the creaturecollection
[XmlIgnore]
public Int16 topStatsCount;
public short topStatsCount;
[XmlIgnore]
public Int16 topStatsCountBP; // topstatcount with all stats (regardless of considerStatHighlight[]) and without torpor (for breedingplanner)
public short topStatsCountBP; // topstatcount with all stats (regardless of considerStatHighlight[]) and without torpor (for breedingplanner)
[XmlIgnore]
public bool topBreedingCreature; // true if it has some topBreedingStats and if it's male, no other male has more topBreedingStats
[XmlIgnore]
public Int16 topness; // permille of mean of wildlevels compared to toplevels
public short topness; // permille of mean of wildlevels compared to toplevels
public string owner = "";
public string imprinterName = ""; // todo implement in creatureInfoInbox
public string tribe = "";
public string server = "";
public string note; // user defined note about that creature
public Guid guid; // the id used in ASB for parent-linking. if ARKID is available from import, it's created using that
public long ARKID; // the creature's id in ARK
public Guid guid; // the id used in ASB for parent-linking. The user cannot change it
public long ArkId; // the creature's id in ARK. This id is shown to the user ingame, but it's not always unique. (It's build from two int, which are concatenated as strings).
public bool ArkIdImported; // if true it's assumed the ArkId is correct (ingame visualization can be wrong). This field should only be true if the ArkId was imported.
public bool isBred;
public Guid fatherGuid;
public Guid motherGuid;
[XmlIgnore]
public string fatherName; // only used during import for missing ancestors
public long motherArkId; // only set if the id is imported
[XmlIgnore]
public string motherName; // only used during import for missing ancestors
public long fatherArkId; // only set if the id is imported
[XmlIgnore]
private Creature father;
public string fatherName; // only used during import to create placeholder ancestors
[XmlIgnore]
private Creature mother;
public string motherName; // only used during import to create placeholder ancestors
[XmlIgnore]
private Creature father; // only the parent-guid is saved in the xml, not the parent-object
[XmlIgnore]
private Creature mother; // only the parent-guid is saved in the xml, not the parent-object
[XmlIgnore]
public int levelFound;
public int generation; // number of generations from the oldest wild creature
Expand All @@ -59,11 +63,10 @@ public class Creature : IEquatable<Creature>
public DateTime domesticatedAt = new DateTime(0);
public DateTime addedToLibrary = new DateTime(0);
public bool neutered = false;
public int mutationCounter; // TODO. remove this field on 07-2018
public int mutationsMaternal;
public int mutationsPaternal;
public List<string> tags = new List<string>();
public bool placeholder; // if a creature has unknown parents, they are placeholders until they are imported. placeholders are not shown in the library
public bool IsPlaceholder; // if a creature has unknown parents, they are placeholders until they are imported. placeholders are not shown in the library

public Creature()
{
Expand All @@ -89,10 +92,17 @@ public Creature(string species, string name, string owner, string tribe, Sex sex
calculateLevelFound(levelStep);
}

public Creature(Guid guid)
/// <summary>
/// Creates a placeholder creature with the given ArkId, which have to be imported
/// </summary>
/// <param name="arkId">ArkId from an imported source (no user input)</param>
public Creature(long arkId)
{
this.guid = guid;
this.ArkId = arkId;
ArkIdImported = true;
guid = Utils.ConvertArkIdToGuid(arkId);
levelsWild = new int[] { -1, -1, -1, -1, -1, -1, -1, -1 }; // unknown wild levels
IsPlaceholder = true;
}

public bool Equals(Creature other)
Expand Down Expand Up @@ -227,7 +237,6 @@ public int Mutations
}
}


public enum Sex
{
Unknown = 0,
Expand Down
Loading

0 comments on commit fb24e4b

Please sign in to comment.