mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-26 06:20:24 +00:00
Adjust settings for tphd path
This commit is contained in:
parent
0b87737eac
commit
29cee96d39
2 changed files with 23 additions and 0 deletions
Binary file not shown.
|
@ -625,7 +625,30 @@ namespace Toolbox
|
|||
return System.IO.File.Exists(RstbPath);
|
||||
}
|
||||
|
||||
private bool IsValidTPHDDirectory(string GamePath)
|
||||
{
|
||||
//This is the only file i care about
|
||||
string DecompressedSizeList = System.IO.Path.Combine($"{GamePath}", "DecompressedSizeList.txt");
|
||||
string FileSizeList = System.IO.Path.Combine($"{GamePath}", "FileSizeList.txt");
|
||||
|
||||
return System.IO.File.Exists(DecompressedSizeList) && System.IO.File.Exists(FileSizeList);
|
||||
}
|
||||
|
||||
private void chkTpFileTable_CheckedChanged(object sender, EventArgs e) {
|
||||
if (!System.IO.Directory.Exists(Runtime.TpGamePath) || !IsValidTPHDDirectory(Runtime.TpGamePath))
|
||||
{
|
||||
FolderSelectDialog sfd = new FolderSelectDialog();
|
||||
sfd.Title = "Select Modded Game Path!!!";
|
||||
if (sfd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
if (!IsValidTPHDDirectory(sfd.SelectedPath))
|
||||
throw new Exception($"Invalid path choosen. Make sure you have atleast a FileSizeList.txt and DecompressedSizeList.txt file in the path!");
|
||||
|
||||
tpGamePathTB.Text = sfd.SelectedPath;
|
||||
Runtime.TpGamePath = tpGamePathTB.Text;
|
||||
}
|
||||
}
|
||||
|
||||
Runtime.ResourceTables.TpTable = chkTpFileTable.Checked;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue