Skip to content

Commit

Permalink
if no export folder is set when starting the app, it will try to dete…
Browse files Browse the repository at this point in the history
…ct it automatically
  • Loading branch information
cadaei committed Aug 16, 2020
1 parent 6b516c9 commit 5e52ea8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ARKBreedingStats/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using System.Text.RegularExpressions;
using System.Threading;
using System.Windows.Forms;
using ARKBreedingStats.utils;
using static ARKBreedingStats.settings.Settings;

namespace ARKBreedingStats
Expand Down Expand Up @@ -378,6 +379,15 @@ private void Form1_Load(object sender, EventArgs e)
createNewCollection = true;
}

// if no export folder is set, try to detect it
if ((Properties.Settings.Default.ExportCreatureFolders == null
|| Properties.Settings.Default.ExportCreatureFolders.Length == 0)
&& ExportFolderLocation.GetListOfExportFolders(out (string path, string steamPlayerName)[] arkInstallFolders, out _))
{
Properties.Settings.Default.ExportCreatureFolders = arkInstallFolders
.Select(f => $"default ({f.steamPlayerName})||{f.path}").ToArray();
}

if (createNewCollection)
NewCollection();

Expand Down
1 change: 1 addition & 0 deletions ARKBreedingStats/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ public static string ShortPath(string longPath, int maxLength = 50)
public static bool GetFirstImportExportFolder(out string folder)
{
folder = null;

if (Properties.Settings.Default.ExportCreatureFolders != null
&& Properties.Settings.Default.ExportCreatureFolders.Length > 0)
{
Expand Down

0 comments on commit 5e52ea8

Please sign in to comment.