Skip to content

Commit

Permalink
folders can be dropped on the importExported form to load the contain…
Browse files Browse the repository at this point in the history
…ing exported files. import-form and settings-form open on the same screen as the application. changed mutations-input-bounds to bounds of signed int32. fixed color-region-choser in library. fixed that the importExportedControl was not vanishing after deleting the file. added transfering of the old settings to an updated version (finally). fix for mature-percentage display when editing a creature. fix for column-index when resetting the cooldown in the library. Event-checkbox will be shown always. grown-countdown will be imported from exported-files. fixed feeding-time for mantis and added immobilized-info for griffin (#706). added French translation, done by Vykan, thank you very much! fix that ids of parents are saved regardless if they are already present in the library.
  • Loading branch information
cadaei committed Jun 7, 2018
1 parent 8e7b27c commit ed93a47
Show file tree
Hide file tree
Showing 27 changed files with 1,189 additions and 60 deletions.
10 changes: 10 additions & 0 deletions ARKBreedingStats/ARKBreedingStats.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@
<DependentUpon>ExportedCreatureList.cs</DependentUpon>
</Compile>
<Compile Include="ImportExported.cs" />
<Compile Include="local\strings.fr.Designer.cs">
<DependentUpon>strings.fr.resx</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="local\strings.de.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
Expand Down Expand Up @@ -418,6 +423,11 @@
<EmbeddedResource Include="ExportedCreatureList.resx">
<DependentUpon>ExportedCreatureList.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="local\strings.fr.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>strings.fr.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="local\strings.de.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>strings.de.Designer.cs</LastGenOutput>
Expand Down
3 changes: 3 additions & 0 deletions ARKBreedingStats/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@
<setting name="language" serializeAs="String">
<value />
</setting>
<setting name="UpgradeRequired" serializeAs="String">
<value>True</value>
</setting>
</ARKBreedingStats.Properties.Settings>
</userSettings>
</configuration>
5 changes: 3 additions & 2 deletions ARKBreedingStats/BreedingPlan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public partial class BreedingPlan : UserControl
public CreatureCollection creatureCollection;
private CancellationTokenSource cancelSource;
private ToolTip tt = new ToolTip();
private double probHigherLvl = 0.55, probLowerLvl = 0.45; // probability of inheriting the higher level-stat

public BreedingPlan()
{
Expand Down Expand Up @@ -274,7 +275,7 @@ private void AsyncCalculateBreedingScoresAndDisplayPairs(BreedingMode breedingMo
if (higherLevel < 0) higherLevel = 0;
if (lowerlevel < 0) lowerlevel = 0;

tt = statWeights[s] * (0.7 * higherLevel + 0.3 * lowerlevel) / 40;
tt = statWeights[s] * (probHigherLvl * higherLevel + probLowerLvl * lowerlevel) / 40;
if (tt > 0)
{
if (breedingMode == BreedingMode.TopStatsLucky)
Expand All @@ -294,7 +295,7 @@ private void AsyncCalculateBreedingScoresAndDisplayPairs(BreedingMode breedingMo
if (female.levelsWild[s] == topStats[s] || male.levelsWild[s] == topStats[s])
{
nrTS++;
eTS += ((female.levelsWild[s] == topStats[s] && male.levelsWild[s] == topStats[s]) ? 1 : 0.7);
eTS += ((female.levelsWild[s] == topStats[s] && male.levelsWild[s] == topStats[s]) ? 1 : probHigherLvl);
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions ARKBreedingStats/Creature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ public Creature(string species, string name, string owner, string tribe, Sex sex
calculateLevelFound(levelStep);
}

public Creature(Guid guid)
{
this.guid = guid;
levelsWild = new int[] { -1, -1, -1, -1, -1, -1, -1, -1 }; // unknown wild levels
}

public bool Equals(Creature other)
{
if (other.guid == guid)
Expand Down
1 change: 1 addition & 0 deletions ARKBreedingStats/CreatureBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ private void checkBoxIsBred_CheckedChanged(object sender, EventArgs e)

private void RegionColorChooser1_RegionColorChosen()
{
creature.colors = regionColorChooser1.colorIDs;
pictureBox1.Image = CreatureColored.getColoredCreature(creature.colors, creature.species, colorRegionUseds);
renewLargeImage = true;
Changed(creature, false);
Expand Down
16 changes: 14 additions & 2 deletions ARKBreedingStats/CreatureInfoInput.Designer.cs

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

14 changes: 7 additions & 7 deletions ARKBreedingStats/CreatureInfoInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,11 @@ private void nudMaturation_ValueChanged(object sender, EventArgs e)

public DateTime Cooldown
{
set { dhmsInputCooldown.Timespan = value - DateTime.Now; }
set
{
dhmsInputCooldown.Timespan = value - DateTime.Now;
dhmsInputGrown_ValueChanged(dhmsInputGrown, dhmsInputGrown.Timespan);
}
get { return dhmsInputCooldown.changed ? DateTime.Now.Add(dhmsInputCooldown.Timespan) : DateTime.Now; }
}

Expand Down Expand Up @@ -297,9 +301,7 @@ public int MutationCounterMother
{
set
{
int v = value;
if (v > nudMutationsMother.Maximum || v < 0) v = (int)nudMutationsMother.Maximum;
nudMutationsMother.Value = v;
nudMutationsMother.ValueSave = value;
mutationManuallyChanged = false;
}
get { return (int)nudMutationsMother.Value; }
Expand All @@ -309,9 +311,7 @@ public int MutationCounterFather
{
set
{
int v = value;
if (v > nudMutationsFather.Maximum || v < 0) v = (int)nudMutationsFather.Maximum;
nudMutationsFather.Value = v;
nudMutationsFather.ValueSave = value;
mutationManuallyChanged = false;
}
get { return (int)nudMutationsFather.Value; }
Expand Down
32 changes: 23 additions & 9 deletions ARKBreedingStats/ExportedCreatureList.Designer.cs

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

63 changes: 62 additions & 1 deletion ARKBreedingStats/ExportedCreatureList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,19 @@ public void chooseFolderAndImport()

public void loadFilesInFolder(string folderPath)
{
if (!String.IsNullOrWhiteSpace(folderPath))
if (Directory.Exists(folderPath))
{
ClearControls();

// load game.ini and gameusersettings.ini if available and use the settings.
if (File.Exists(folderPath + @"\game.ini") || File.Exists(folderPath + @"\gameusersettings.ini"))
{
// set multipliers to default
// TODO
// set settings to values of files
// TODO
}

string[] files = Directory.GetFiles(folderPath, "DinoExport*.ini");
foreach (string f in files)
{
Expand All @@ -69,6 +78,8 @@ public void loadFilesInFolder(string folderPath)

foreach (var ecc in eccs)
panel1.Controls.Add(ecc);

Text = "Exported creatures in " + Utils.shortPath(folderPath, 50);
}
}

Expand Down Expand Up @@ -112,5 +123,55 @@ private void importAllUnimported()
ecc.extractAndAddToLibrary();
}
}

private void deleteAllImportedFilesToolStripMenuItem_Click(object sender, EventArgs e)
{
deleteAllImportedFiles();
}

private void deleteAllImportedFiles()
{
SuspendLayout();
if (MessageBox.Show("Delete all exported files in the current folder that are already imported in this library?\nThis cannot be undone!",
"Delete imported files?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
{
int deletedFilesCount = 0;
foreach (var ecc in eccs)
{
if (ecc.Status == ExportedCreatureControl.ImportStatus.JustImported || ecc.Status == ExportedCreatureControl.ImportStatus.OldImported)
{
if (ecc.removeFile(false))
{
deletedFilesCount++;
ecc.Dispose();
}
}
}
if (deletedFilesCount > 0) MessageBox.Show(deletedFilesCount.ToString() + " imported files deleted.", "Deleted Files", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
ResumeLayout();
}

private void ExportedCreatureList_DragEnter(object sender, DragEventArgs e)
{
DragDropEffects effects = DragDropEffects.None;
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{
var path = ((string[])e.Data.GetData(DataFormats.FileDrop))[0];
if (Directory.Exists(path))
effects = DragDropEffects.Copy;
}
e.Effect = effects;
}

private void ExportedCreatureList_DragDrop(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{
var path = ((string[])e.Data.GetData(DataFormats.FileDrop))[0];
if (Directory.Exists(path))
loadFilesInFolder(path);
}
}
}
}
10 changes: 5 additions & 5 deletions ARKBreedingStats/Form1.Designer.cs

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

Loading

0 comments on commit ed93a47

Please sign in to comment.