Adjustments for limiting the size
This commit is contained in:
parent
b8aad096ff
commit
99883c9a5b
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -55,9 +55,6 @@ namespace FirstPlugin
|
||||
byte[] DecompressedBlock;
|
||||
SDFTOC_ID endId;
|
||||
|
||||
//Temp but just for now as this is expeirmental. Need to optmize tree loading
|
||||
private readonly int MAX_FILE_DISPLAY = 4000;
|
||||
|
||||
//Thanks to https://github.com/GoldFarmer/rouge_sdf/blob/master/main.cpp for docs/structs
|
||||
public void Load(System.IO.Stream stream)
|
||||
{
|
||||
@ -110,7 +107,6 @@ namespace FirstPlugin
|
||||
MessageBox.Show("Note! Support for this format is experimental. The tool will only load < 4000 files atm due to slow loading");
|
||||
|
||||
for (int i = 0; i < FileEntries.Count; i++)
|
||||
if (i < MAX_FILE_DISPLAY)
|
||||
files.Add(FileEntries[i]);
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
@ -32,25 +32,20 @@ namespace Switch_Toolbox.Library.Forms
|
||||
}
|
||||
|
||||
//The process takes awhile atm so limit splitting if there's a high amount
|
||||
private readonly int MAX_FILE_PATH_SPLIT = 5000;
|
||||
private readonly int MAX_FILE_LOAD = 5000;
|
||||
|
||||
void FillTreeNodes(TreeNode root, IArchiveFile archiveFile)
|
||||
{
|
||||
var rootText = root.Text;
|
||||
var rootTextLength = rootText.Length;
|
||||
var nodeFiles = archiveFile.Files;
|
||||
if (nodeFiles.Count() > MAX_FILE_PATH_SPLIT)
|
||||
{
|
||||
foreach (var node in nodeFiles)
|
||||
{
|
||||
ArchiveFileWrapper wrapperFile = new ArchiveFileWrapper(node.FileName, node, archiveFile);
|
||||
root.Nodes.Add(wrapperFile);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
int I = 0;
|
||||
foreach (var node in nodeFiles)
|
||||
{
|
||||
if (I++ > MAX_FILE_LOAD)
|
||||
break;
|
||||
|
||||
string nodeString = node.FileName;
|
||||
|
||||
var roots = nodeString.Split(new char[] { '/' },
|
||||
@ -97,7 +92,6 @@ namespace Switch_Toolbox.Library.Forms
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void AddNodeCollection(TreeNodeCollection nodes, bool ClearNodes)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user