Skip to content

Commit

Permalink
fixed / improved server-dropdown for creature-input (#683). exported …
Browse files Browse the repository at this point in the history
…ini-files can be dropped on the extractor. fix for wrong color-determination if system uses comma for decimal-separation. added number of creatures in the server-list (#679). added import of mutation-counters of exported files. fixed culture-exception when using speech-recognition. fixed IwM-calculation in Multiplier-Tester on wild creatures. added button to import all exported creatures at once, creatures with multiple possible levels still need to be extracted and added manually. fixed unintentional species-changing when clicking between tab and tab-page (#687). fixed values import of plaintext from clipboard.
  • Loading branch information
cadaei committed May 13, 2018
1 parent 63bb937 commit b3b4fa1
Show file tree
Hide file tree
Showing 18 changed files with 546 additions and 367 deletions.
17 changes: 16 additions & 1 deletion ARKBreedingStats/CreatureInfoInput.Designer.cs

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

3 changes: 3 additions & 0 deletions ARKBreedingStats/CreatureInfoInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,9 @@ public string[] ServersList
var l = new AutoCompleteStringCollection();
l.AddRange(value);
cbServer.AutoCompleteCustomSource = l;
cbServer.Items.Clear();
foreach (string s in value)
cbServer.Items.Add(s);
}
}

Expand Down
36 changes: 28 additions & 8 deletions ARKBreedingStats/ExportedCreatureList.Designer.cs

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

58 changes: 46 additions & 12 deletions ARKBreedingStats/ExportedCreatureList.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using ARKBreedingStats.species;
using ARKBreedingStats.uiControls;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Windows.Forms;

namespace ARKBreedingStats
Expand All @@ -12,10 +14,16 @@ public partial class ExportedCreatureList : Form
public event ExportedCreatureControl.CheckGuidInLibraryEventHandler CheckGuidInLibrary;
public delegate void ReadyForCreatureUpdatesEventHandler();
public event ReadyForCreatureUpdatesEventHandler ReadyForCreatureUpdates;
private List<ExportedCreatureControl> eccs;

public ExportedCreatureList()
{
InitializeComponent();
eccs = new List<ExportedCreatureControl>();

// TODO implement
updateDataOfLibraryCreaturesToolStripMenuItem.Visible = false;
loadServerSettingsOfFolderToolStripMenuItem.Visible = false;
}

private void chooseFolderToolStripMenuItem_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -45,26 +53,28 @@ public void loadFilesInFolder(string folderPath)
{
ClearControls();

string[] files = Directory.GetFiles(folderPath, "*.ini");
string[] files = Directory.GetFiles(folderPath, "DinoExport*.ini");
foreach (string f in files)
{
addCreatureValuesControl(ImportExported.importExportedCreature(f));
ExportedCreatureControl ecc = new ExportedCreatureControl(ImportExported.importExportedCreature(f));
ecc.Dock = DockStyle.Top;
ecc.CopyValuesToExtractor += CopyValuesToExtractor;
ecc.CheckGuidInLibrary += CheckGuidInLibrary;
ecc.DoCheckGuidInLibrary();
eccs.Add(ecc);
}
}
}

private void addCreatureValuesControl(CreatureValues cv)
{
ExportedCreatureControl ecc = new ExportedCreatureControl(cv);
ecc.Dock = DockStyle.Top;
ecc.CopyValuesToExtractor += CopyValuesToExtractor;
ecc.CheckGuidInLibrary += CheckGuidInLibrary;
ecc.DoCheckGuidInLibrary();
panel1.Controls.Add(ecc);
// sort according to date and if already in library (order seems reversed here, because controls get added reversely)
eccs = eccs.OrderByDescending(e => e.Status).ThenBy(e => e.AddedToLibrary).ToList();

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

private void ClearControls()
{
eccs.Clear();
foreach (Control c in panel1.Controls)
((ExportedCreatureControl)c).Dispose();
}
Expand All @@ -78,5 +88,29 @@ public void UpdateCreatureData(CreatureCollection cc)
{
// TODO
}

private void loadServerSettingsOfFolderToolStripMenuItem_Click(object sender, EventArgs e)
{
// check if a game.ini and or gameuser.ini is available and set the settings accordingly

}

private void importAllUnimportedToolStripMenuItem_Click(object sender, EventArgs e)
{
importAllUnimported();
}

/// <summary>
/// Tries to import all listed creatures and adds them to the library if the extraction is unique.
/// </summary>
private void importAllUnimported()
{
foreach (var c in panel1.Controls)
{
var ecc = (ExportedCreatureControl)c;
if (ecc.Status == ExportedCreatureControl.ImportStatus.NotImported)
ecc.extractAndAddToLibrary();
}
}
}
}
2 changes: 2 additions & 0 deletions ARKBreedingStats/Extraction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class Extraction
public bool[] fixedResults;
public List<int> statsWithTE;
public bool validResults;
public bool uniqueResults;
public bool postTamed;
private bool bred;
private int[] lowerBoundWilds, lowerBoundDoms, upperBoundDoms; // lower/upper possible Bound of each stat (wild has no upper bound as wild-speed and sometimes oxygen is unknown, and could be up to levelWildSum, so no results could be filtered out)
Expand Down Expand Up @@ -51,6 +52,7 @@ public void Clear()
upperBoundDoms[s] = 0;
}
validResults = false;
uniqueResults = false;
statsWithTE.Clear();
imprintingBonusRange = new MinMaxDouble(0);
levelWildSum = 0;
Expand Down
Loading

0 comments on commit b3b4fa1

Please sign in to comment.