Minor clean

This commit is contained in:
Kurt 2022-06-11 09:51:43 -07:00
parent bf8d47c52b
commit 15a84d9d7e
5 changed files with 20 additions and 5 deletions

View file

@ -6,4 +6,3 @@ public sealed record SlotGroup(string GroupName, PKM[] Slots)
public override string ToString() => $"{GroupName}: {Slots.Length} {Slots.GetType().Name}";
#endif
}

View file

@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFrameworks>net6.0;net46</TargetFrameworks>
<NeutralLanguage>en</NeutralLanguage>
<LangVersion>10</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>

View file

@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFrameworks>net6.0;net46</TargetFrameworks>
<NeutralLanguage>en</NeutralLanguage>
<LangVersion>10</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>

View file

@ -117,17 +117,30 @@ namespace PKHeX.WinForms
showChangelog = false;
BAKprompt = false;
HaX = args.Any(x => string.Equals(x.Trim('-'), nameof(HaX), StringComparison.CurrentCultureIgnoreCase))
|| Path.GetFileNameWithoutExtension(Process.GetCurrentProcess().MainModule!.FileName!).EndsWith(nameof(HaX));
FormLoadConfig(out BAKprompt, out showChangelog);
HaX |= Settings.Startup.ForceHaXOnLaunch;
HaX = Settings.Startup.ForceHaXOnLaunch || GetIsHaX(args);
WinFormsUtil.AddSaveFileExtensions(Settings.Backup.OtherSaveFileExtensions);
SaveFinder.CustomBackupPaths.Clear();
SaveFinder.CustomBackupPaths.AddRange(Settings.Backup.OtherBackupPaths.Where(Directory.Exists));
}
private static bool GetIsHaX(IEnumerable<string> args)
{
foreach (var x in args)
{
if (string.Equals(x.Trim('-'), nameof(HaX), StringComparison.CurrentCultureIgnoreCase))
return true;
}
#if !NET6_0_OR_GREATER
var path = Process.GetCurrentProcess().MainModule!.FileName!;
#else
var path = Environment.ProcessPath!;
#endif
return Path.GetFileNameWithoutExtension(path).EndsWith(nameof(HaX));
}
private void FormLoadAddEvents()
{
C_SAV.Menu_Redo = Menu_Redo;

View file

@ -4,6 +4,7 @@
<OutputType>WinExe</OutputType>
<TargetFrameworks>net46;net6.0-windows</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<NeutralLanguage>en</NeutralLanguage>
<PackageId>PKHeX</PackageId>
<Company>Project Pokémon</Company>
<Authors>Kaphotics</Authors>