mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Reuse same list for warnings and exceptions.
This commit is contained in:
parent
e9628afaf8
commit
076dab924f
1 changed files with 16 additions and 14 deletions
|
|
@ -28,8 +28,8 @@ public partial class ModEditWindow
|
||||||
|
|
||||||
private bool _dirty;
|
private bool _dirty;
|
||||||
public bool PendingIo { get; private set; }
|
public bool PendingIo { get; private set; }
|
||||||
public List<Exception> IoExceptions { get; private set; } = [];
|
public List<Exception> IoExceptions { get; } = [];
|
||||||
public List<string> IoWarnings { get; private set; } = [];
|
public List<string> IoWarnings { get; } = [];
|
||||||
|
|
||||||
public MdlTab(ModEditWindow edit, byte[] bytes, string path)
|
public MdlTab(ModEditWindow edit, byte[] bytes, string path)
|
||||||
{
|
{
|
||||||
|
|
@ -92,10 +92,7 @@ public partial class ModEditWindow
|
||||||
.ToList();
|
.ToList();
|
||||||
});
|
});
|
||||||
|
|
||||||
task.ContinueWith(t =>
|
task.ContinueWith(t => { GamePaths = FinalizeIo(task); });
|
||||||
{
|
|
||||||
GamePaths = FinalizeIo(task);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private EstManipulation[] GetCurrentEstManipulations()
|
private EstManipulation[] GetCurrentEstManipulations()
|
||||||
|
|
@ -246,8 +243,8 @@ public partial class ModEditWindow
|
||||||
private void BeginIo()
|
private void BeginIo()
|
||||||
{
|
{
|
||||||
PendingIo = true;
|
PendingIo = true;
|
||||||
IoWarnings = [];
|
IoWarnings.Clear();
|
||||||
IoExceptions = [];
|
IoExceptions.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FinalizeIo(Task<IoNotifier> task)
|
private void FinalizeIo(Task<IoNotifier> task)
|
||||||
|
|
@ -264,8 +261,9 @@ public partial class ModEditWindow
|
||||||
{
|
{
|
||||||
result = getResult(task.Result);
|
result = getResult(task.Result);
|
||||||
if (getNotifier != null)
|
if (getNotifier != null)
|
||||||
IoWarnings = getNotifier(task.Result).GetWarnings().ToList();
|
IoWarnings.AddRange(getNotifier(task.Result).GetWarnings());
|
||||||
}
|
}
|
||||||
|
|
||||||
PendingIo = false;
|
PendingIo = false;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
@ -273,12 +271,16 @@ public partial class ModEditWindow
|
||||||
|
|
||||||
private void RecordIoExceptions(Exception? exception)
|
private void RecordIoExceptions(Exception? exception)
|
||||||
{
|
{
|
||||||
IoExceptions = exception switch
|
switch (exception)
|
||||||
{
|
{
|
||||||
null => [],
|
case null: break;
|
||||||
AggregateException ae => [.. ae.Flatten().InnerExceptions],
|
case AggregateException ae:
|
||||||
_ => [exception],
|
IoExceptions.AddRange(ae.Flatten().InnerExceptions);
|
||||||
};
|
break;
|
||||||
|
default:
|
||||||
|
IoExceptions.Add(exception);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Read a file from the active collection or game. </summary>
|
/// <summary> Read a file from the active collection or game. </summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue