Adjust file format to save changes for new generic archives.
This commit is contained in:
parent
bcd21b9e4f
commit
8b00b8430e
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -78,7 +78,7 @@ namespace FirstPlugin
|
|||||||
|
|
||||||
public bool TrySetSize(string Path, uint DecompSize, uint CompSize, Dictionary<string, uint> ArchiveFiles = null)
|
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))
|
if (FileSizes.ContainsKey(RelativePath))
|
||||||
{
|
{
|
||||||
@ -86,6 +86,8 @@ namespace FirstPlugin
|
|||||||
FileSizes[RelativePath] = CompSize;
|
FileSizes[RelativePath] = CompSize;
|
||||||
else
|
else
|
||||||
FileSizes[RelativePath] = DecompSize;
|
FileSizes[RelativePath] = DecompSize;
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -46,7 +46,7 @@ namespace Switch_Toolbox.Library
|
|||||||
return STMath.GetFileSize(FileData.Length, 4);
|
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;
|
protected byte[] _fileData = null;
|
||||||
|
|
||||||
@ -56,7 +56,10 @@ namespace Switch_Toolbox.Library
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return _fileData;
|
if (FileFormat != null && FileFormat.CanSave)
|
||||||
|
return FileFormat.Save();
|
||||||
|
else
|
||||||
|
return _fileData;
|
||||||
}
|
}
|
||||||
set { _fileData = value; }
|
set { _fileData = value; }
|
||||||
}
|
}
|
||||||
@ -265,6 +268,7 @@ namespace Switch_Toolbox.Library
|
|||||||
public override void OnDoubleMouseClick(TreeView treeview)
|
public override void OnDoubleMouseClick(TreeView treeview)
|
||||||
{
|
{
|
||||||
TreeNode node = STFileLoader.GetNodeFileFormat(Text, ArchiveFileInfo.FileData, true, this);
|
TreeNode node = STFileLoader.GetNodeFileFormat(Text, ArchiveFileInfo.FileData, true, this);
|
||||||
|
ArchiveFileInfo.FileFormat = (IFileFormat)node;
|
||||||
if (node != null)
|
if (node != null)
|
||||||
ReplaceNode(this.Parent, this, node);
|
ReplaceNode(this.Parent, this, node);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user