Delay pkm file loading via cmd args to end

Closes #828
This commit is contained in:
Kurt 2017-02-05 13:24:39 -08:00
parent 80d81f92de
commit ac818424f2

View File

@ -172,9 +172,16 @@ public Main()
#endregion
#region Load Initial File(s)
if (args.Length > 1) // Load the arguments
string pkmArg = null;
foreach (string arg in args.Skip(1)) // skip .exe
{
foreach (string arg in args.Skip(1).Where(a => a.Length > 4))
var fi = new FileInfo(arg);
if (!fi.Exists)
continue;
if (PKX.getIsPKM(fi.Length))
pkmArg = arg;
else
openQuick(arg, force: true);
}
if (!SAV.Exportable) // No SAV loaded from exe args
@ -203,6 +210,8 @@ public Main()
SAV.Edited = false; // Prevents form close warning from showing until changes are made
}
}
if (pkmArg != null)
openQuick(pkmArg, force: true);
// Splash Screen closes on its own.
BringToFront();