Adjust settings for tphd path

This commit is contained in:
KillzXGaming 2019-06-11 21:03:17 -04:00
parent 0b87737eac
commit 29cee96d39
2 changed files with 23 additions and 0 deletions

Binary file not shown.

View file

@ -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;
}
}