Only load certain supported formats for sdf for faster loading. (Can still be extracted as all normally)
This commit is contained in:
parent
285eb3a028
commit
54e88cdef5
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -105,9 +105,15 @@ namespace FirstPlugin
|
||||
endId = new SDFTOC_ID(reader);
|
||||
|
||||
for (int i = 0; i < FileEntries.Count; i++)
|
||||
{
|
||||
FileEntries[i].CanLoadFile = SupportedExtensions.Contains(Utils.GetExtension(FileEntries[i].FileName));
|
||||
files.Add(FileEntries[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<string> SupportedExtensions = new List<string>()
|
||||
{ ".dds", ".tga" ,".mmb", ".png", ".jpg" };
|
||||
|
||||
private TreeNode GetNodes(TreeNode parent, string[] fileList)
|
||||
{
|
||||
|
Binary file not shown.
Binary file not shown.
@ -42,8 +42,17 @@ namespace Switch_Toolbox.Library.Forms
|
||||
int I = 0;
|
||||
foreach (var node in nodeFiles)
|
||||
{
|
||||
if (!node.CanLoadFile)
|
||||
continue;
|
||||
|
||||
if (I++ == MAX_TREENODE_VALUE)
|
||||
{
|
||||
var result = MessageBox.Show($"The amount of treenodes has reached over {MAX_TREENODE_VALUE} nodes. To prevent memory loss this is put in place. Do you want to continue loading all of them?",
|
||||
"", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
|
||||
|
||||
if (result != DialogResult.Yes)
|
||||
break;
|
||||
}
|
||||
|
||||
string nodeString = node.FileName;
|
||||
|
||||
|
@ -54,6 +54,10 @@ namespace Switch_Toolbox.Library
|
||||
[Browsable(false)]
|
||||
public virtual object DisplayProperties { get; set; }
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual bool CanLoadFile { get; set; } = true;
|
||||
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual IFileFormat OpenFile()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user