mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-11 07:04:16 +00:00
Remove cgse fixed path
can restore behavior by adding it as a custom user path; cgse isn't very prevalent nowadays now the only registry key checks are for checking net framework version
This commit is contained in:
parent
8c05b9f391
commit
1b50e97934
4 changed files with 2 additions and 63 deletions
|
@ -137,21 +137,8 @@ namespace PKHeX.WinForms
|
|||
private static void FormLoadCustomBackupPaths()
|
||||
{
|
||||
SaveDetection.CustomBackupPaths.Clear();
|
||||
try
|
||||
{
|
||||
// cybergadget paths
|
||||
string pathCache = CyberGadgetUtil.GetCacheFolder();
|
||||
if (Directory.Exists(pathCache))
|
||||
SaveDetection.CustomBackupPaths.Add(Path.Combine(pathCache));
|
||||
string pathTemp = CyberGadgetUtil.GetTempFolder();
|
||||
if (Directory.Exists(pathTemp))
|
||||
SaveDetection.CustomBackupPaths.Add(Path.Combine(pathTemp));
|
||||
|
||||
// custom user paths
|
||||
if (File.Exists(SAVPaths))
|
||||
SaveDetection.CustomBackupPaths.AddRange(File.ReadAllLines(SAVPaths).Where(Directory.Exists));
|
||||
}
|
||||
catch { }
|
||||
if (File.Exists(SAVPaths)) // custom user paths
|
||||
SaveDetection.CustomBackupPaths.AddRange(File.ReadAllLines(SAVPaths).Where(Directory.Exists));
|
||||
}
|
||||
|
||||
private void FormLoadAddEvents()
|
||||
|
|
|
@ -627,7 +627,6 @@
|
|||
</Compile>
|
||||
<Compile Include="Subforms\Misc\SortableBindingList.cs" />
|
||||
<Compile Include="Util\ConfigUtil.cs" />
|
||||
<Compile Include="Util\CyberGadgetUtil.cs" />
|
||||
<Compile Include="Util\DevUtil.cs" />
|
||||
<Compile Include="Util\FontUtil.cs" />
|
||||
<Compile Include="Util\ImageUtil.cs" />
|
||||
|
|
|
@ -80,16 +80,8 @@ namespace PKHeX.WinForms
|
|||
new CustomFolderPath(Main.BackupPath, "PKHeX Backups")
|
||||
};
|
||||
locs.AddRange(GetUserPaths());
|
||||
|
||||
locs.AddRange(GetConsolePaths(drives));
|
||||
locs.AddRange(GetSwitchPaths(drives));
|
||||
addIfExists(CyberGadgetUtil.GetCacheFolder(), "CGSE Cache");
|
||||
addIfExists(CyberGadgetUtil.GetTempFolder(), "CGSE Temp");
|
||||
void addIfExists(string path, string text)
|
||||
{
|
||||
if (Directory.Exists(path))
|
||||
locs.Add(new CustomFolderPath(path, text));
|
||||
}
|
||||
return locs.GroupBy(z => z.Path).Select(z => z.First())
|
||||
.OrderByDescending(z => Directory.Exists(z.Path)).ToList();
|
||||
}
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace PKHeX.WinForms
|
||||
{
|
||||
public static class CyberGadgetUtil
|
||||
{
|
||||
public static string GetTempFolder() => Path.Combine(Path.GetTempPath(), "3DSSE");
|
||||
public static string GetCacheFolder() => Path.Combine(GetBackupLocation(), "cache");
|
||||
private static string GetRegistryBase() => @"SOFTWARE\CYBER Gadget\3DSSaveEditor";
|
||||
|
||||
private static string GetRegistryValue(string key)
|
||||
{
|
||||
Microsoft.Win32.RegistryKey currentUser = Microsoft.Win32.Registry.CurrentUser;
|
||||
Microsoft.Win32.RegistryKey key3 = currentUser.OpenSubKey(GetRegistryBase());
|
||||
if (key3 == null)
|
||||
return null;
|
||||
|
||||
string str = key3.GetValue(key) as string;
|
||||
key3.Close();
|
||||
currentUser.Close();
|
||||
return str;
|
||||
}
|
||||
|
||||
private static string GetBackupLocation()
|
||||
{
|
||||
string registryValue = GetRegistryValue("Location");
|
||||
if (!string.IsNullOrEmpty(registryValue))
|
||||
{
|
||||
Directory.CreateDirectory(registryValue);
|
||||
return registryValue;
|
||||
}
|
||||
string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "3DSSaveBank");
|
||||
if (Directory.Exists(GetRegistryBase()))
|
||||
Directory.CreateDirectory(path);
|
||||
return path;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue