mirror of
https://github.com/kwsch/pkNX.git
synced 2026-10-02 06:06:38 -05:00
Port over some bug fixes from the other branch
This commit is contained in:
@@ -41,7 +41,7 @@ public void AddFile(string file, byte[]? data = null)
|
||||
{
|
||||
Paths.Add(file);
|
||||
Data.Add(data);
|
||||
TrackModify.Add(false);
|
||||
TrackModify.Add(data != null);
|
||||
}
|
||||
|
||||
public void AddFiles(IEnumerable<string> files)
|
||||
@@ -90,7 +90,7 @@ public void ResetIndex(int index)
|
||||
public bool Modified
|
||||
{
|
||||
get => TrackModify.Contains(true);
|
||||
set => CancelEdits();
|
||||
set { if (!value) CancelEdits(); }
|
||||
}
|
||||
|
||||
public int Count => Paths.Count;
|
||||
|
||||
@@ -128,7 +128,11 @@ public byte[] GetDataFileName(string name)
|
||||
return DecompressedFiles[index];
|
||||
}
|
||||
|
||||
public byte[] GetDataFull(ulong hash) => DecompressedFiles[GetIndexFull(hash)];
|
||||
public byte[] GetDataFull(ulong hash)
|
||||
{
|
||||
var fileId = GetIndexFull(hash);
|
||||
return fileId < 0 ? Array.Empty<byte>() : DecompressedFiles[fileId];
|
||||
}
|
||||
|
||||
public byte[] GetDataFullPath(string path) => GetDataFull(FnvHash.HashFnv1a_64(path));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user