mirror of
https://github.com/kwsch/pkNX.git
synced 2026-08-28 13:24:30 -05:00
Track modification for single file edits
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -24,7 +25,16 @@ public void CancelEdits()
|
||||
Data = (byte[]) Backup.Clone();
|
||||
}
|
||||
|
||||
public byte[] this[int index] { get => Data; set => Data = value; }
|
||||
public byte[] this[int index]
|
||||
{
|
||||
get => (byte[])Data.Clone();
|
||||
set
|
||||
{
|
||||
Modified |= Data.SequenceEqual(value);
|
||||
Data = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Task<byte[][]> GetFiles() => Task.FromResult(new[] {Data});
|
||||
public Task<byte[]> GetFile(int file, int subFile = 0) => Task.FromResult(Data);
|
||||
public Task SetFile(int file, byte[] value, int subFile = 0) => Task.FromResult(Data = value);
|
||||
|
||||
Reference in New Issue
Block a user