From fab44b24dddda34723fc6959ddeb3a457e686f4e Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Mon, 25 Nov 2019 00:54:11 -0500 Subject: [PATCH] play nice with CRI Extensions for FileSystemEditor --- .../FileSystem/CPK/CPKDataFormat.cs | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/CSharp/Plugins/UniversalEditor.Plugins.CRI/DataFormats/FileSystem/CPK/CPKDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.CRI/DataFormats/FileSystem/CPK/CPKDataFormat.cs index 5c345156..99f560fa 100755 --- a/CSharp/Plugins/UniversalEditor.Plugins.CRI/DataFormats/FileSystem/CPK/CPKDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.CRI/DataFormats/FileSystem/CPK/CPKDataFormat.cs @@ -47,19 +47,50 @@ namespace UniversalEditor.Plugins.CRI.DataFormats.FileSystem.CPK public string VersionString { get; set; } = "CPKMC2.14.00, DLL2.74.00"; public int FileAlignment { get; set; } = 2048; + // these are mainly for the benefit of the CRI Extensions for FileSystemEditor + private byte[] _HeaderData = null; + /// + /// Returns the raw data from the initial "CPK " chunk of this file, or NULL if this chunk does not exist. + /// + /// The raw data from the "CPK " chunk. + public byte[] HeaderData { get { return _HeaderData; } } + private byte[] _TocData = null; + /// + /// Returns the raw data from the "TOC " chunk of this file, or NULL if this chunk does not exist. + /// + /// The raw data from the "TOC " chunk. + public byte[] TocData { get { return _TocData; } } + private byte[] _ITocData = null; + /// + /// Returns the raw data from the "ITOC" chunk of this file, or NULL if this chunk does not exist. + /// + /// The raw data from the "ITOC" chunk. + public byte[] ITocData { get { return _ITocData; } } + private byte[] _GTocData = null; + /// + /// Returns the raw data from the "GTOC" chunk of this file, or NULL if this chunk does not exist. + /// + /// The raw data from the "GTOC" chunk. + public byte[] GTocData { get { return _GTocData; } } + private byte[] _ETocData = null; + /// + /// Returns the raw data from the final "ETOC" chunk of this file, or NULL if this chunk does not exist. + /// + /// The raw data from the "ETOC" chunk. + public byte[] ETocData { get { return _ETocData; } } protected override void LoadInternal (ref ObjectModel objectModel) { - ObjectModels.FileSystem.FileSystemObjectModel fsom = (objectModel as ObjectModels.FileSystem.FileSystemObjectModel); + FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); if (fsom == null) throw new ObjectModelNotSupportedException(); - IO.Reader br = Accessor.Reader; + Reader br = Accessor.Reader; // Rebuilt based on cpk_unpack // Rebuilt AGAIN based on github.com/esperknight/CriPakTools