1
0
mirror of synced 2025-01-31 04:13:51 +01:00

Adjust file format to save changes for new generic archives.

This commit is contained in:
KillzXGaming 2019-05-18 13:36:39 -04:00
parent bcd21b9e4f
commit 8b00b8430e
7 changed files with 9 additions and 3 deletions

Binary file not shown.

View File

@ -78,7 +78,7 @@ namespace FirstPlugin
public bool TrySetSize(string Path, uint DecompSize, uint CompSize, Dictionary<string, uint> ArchiveFiles = null)
{
string RelativePath = Path.Replace(Runtime.TpGamePath, "");
string RelativePath = Path.Replace(Runtime.TpGamePath, string.Empty);
if (FileSizes.ContainsKey(RelativePath))
{
@ -86,6 +86,8 @@ namespace FirstPlugin
FileSizes[RelativePath] = CompSize;
else
FileSizes[RelativePath] = DecompSize;
return true;
}
return false;

View File

@ -46,7 +46,7 @@ namespace Switch_Toolbox.Library
return STMath.GetFileSize(FileData.Length, 4);
}
IFileFormat FileFormat = null; //Format attached for saving
public IFileFormat FileFormat = null; //Format attached for saving
protected byte[] _fileData = null;
@ -56,7 +56,10 @@ namespace Switch_Toolbox.Library
{
get
{
return _fileData;
if (FileFormat != null && FileFormat.CanSave)
return FileFormat.Save();
else
return _fileData;
}
set { _fileData = value; }
}
@ -265,6 +268,7 @@ namespace Switch_Toolbox.Library
public override void OnDoubleMouseClick(TreeView treeview)
{
TreeNode node = STFileLoader.GetNodeFileFormat(Text, ArchiveFileInfo.FileData, true, this);
ArchiveFileInfo.FileFormat = (IFileFormat)node;
if (node != null)
ReplaceNode(this.Parent, this, node);
}