public void loadFilesInFolder(string folderPath) { if (!String.IsNullOrWhiteSpace(folderPath)) { ClearControls(); string[] files = Directory.GetFiles(folderPath, "DinoExport*.ini"); foreach (string f in files) { ExportedCreatureControl ecc = new ExportedCreatureControl(ImportExported.importExportedCreature(f)); ecc.Dock = DockStyle.Top; ecc.CopyValuesToExtractor += CopyValuesToExtractor; ecc.CheckGuidInLibrary += CheckGuidInLibrary; ecc.DoCheckGuidInLibrary(); eccs.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 addCreatureValuesControl(CreatureValues cv) { ExportedCreatureControl ecc = new ExportedCreatureControl(cv); ecc.Dock = DockStyle.Top; ecc.CopyValuesToExtractor += CopyValuesToExtractor; ecc.CheckGuidInLibrary += CheckGuidInLibrary; ecc.DoCheckGuidInLibrary(); panel1.Controls.Add(ecc); }
public void loadFilesInFolder(string folderPath) { if (Directory.Exists(folderPath)) { string[] files = Directory.GetFiles(folderPath, "DinoExport*.ini"); // check if there are many files to import, then ask because that can take time if (files.Length > 40 && MessageBox.Show($"There are many files to import ({files.Length}) which can take some time.\n" + "Do you really want to read all these files?", "Many files to import", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.Yes) { return; } 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 } foreach (string f in files) { ExportedCreatureControl ecc = new ExportedCreatureControl(f); ecc.Dock = DockStyle.Top; ecc.CopyValuesToExtractor += CopyValuesToExtractor; ecc.CheckArkIdInLibrary += CheckArkIdInLibrary; ecc.DoCheckArkIdInLibrary(); eccs.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); } Text = "Exported creatures in " + Utils.shortPath(folderPath); } }
public void loadFilesInFolder(string 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) { ExportedCreatureControl ecc = new ExportedCreatureControl(f); ecc.Dock = DockStyle.Top; ecc.CopyValuesToExtractor += CopyValuesToExtractor; ecc.CheckGuidInLibrary += CheckGuidInLibrary; ecc.DoCheckGuidInLibrary(); eccs.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); } Text = "Exported creatures in " + Utils.shortPath(folderPath, 50); } }