mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-19 07:04:20 +01:00
Fix bug with shpk editing.
This commit is contained in:
parent
1364b39f65
commit
25cb46525a
2 changed files with 4 additions and 7 deletions
|
|
@ -26,7 +26,7 @@ public class FileEditor<T> where T : class, IWritable
|
|||
|
||||
public FileEditor(ModEditWindow owner, DataManager gameData, Configuration config, FileDialogService fileDialog, string tabName,
|
||||
string fileType, Func<IReadOnlyList<FileRegistry>> getFiles, Func<T, bool, bool> drawEdit, Func<string> getInitialPath,
|
||||
Func<byte[], T?>? parseFile)
|
||||
Func<byte[], T?> parseFile)
|
||||
{
|
||||
_owner = owner;
|
||||
_gameData = gameData;
|
||||
|
|
@ -35,7 +35,7 @@ public class FileEditor<T> where T : class, IWritable
|
|||
_fileType = fileType;
|
||||
_drawEdit = drawEdit;
|
||||
_getInitialPath = getInitialPath;
|
||||
_parseFile = parseFile ?? DefaultParseFile;
|
||||
_parseFile = parseFile;
|
||||
_combo = new Combo(config, getFiles);
|
||||
}
|
||||
|
||||
|
|
@ -170,9 +170,6 @@ public class FileEditor<T> where T : class, IWritable
|
|||
UpdateCurrentFile(_combo.CurrentSelection);
|
||||
}
|
||||
|
||||
private static T? DefaultParseFile(byte[] bytes)
|
||||
=> Activator.CreateInstance(typeof(T), bytes) as T;
|
||||
|
||||
private void UpdateCurrentFile(FileRegistry path)
|
||||
{
|
||||
if (ReferenceEquals(_currentPath, path))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue