mirror of
https://github.com/ZuneDev/ZuneUIXTools.git
synced 2026-07-27 13:11:59 -07:00
Save decomp results even when there are errors
This commit is contained in:
@@ -1,30 +1,19 @@
|
||||
using ICSharpCode.AvalonEdit;
|
||||
using ICSharpCode.AvalonEdit.Document;
|
||||
using ICSharpCode.AvalonEdit.Highlighting;
|
||||
using ICSharpCode.AvalonEdit.Highlighting.Xshd;
|
||||
using ICSharpCode.AvalonEdit.Rendering;
|
||||
using Microsoft.Iris;
|
||||
using Microsoft.Iris.Data;
|
||||
using Microsoft.Iris.Markup;
|
||||
using Microsoft.Iris.OS;
|
||||
using Microsoft.Iris.Session;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using ZuneUIXTools.ViewModels;
|
||||
using Application = Microsoft.Iris.Application;
|
||||
using Window = System.Windows.Window;
|
||||
@@ -124,7 +113,7 @@ namespace ZuneUIXTools
|
||||
{
|
||||
TextBlock errBlock = new TextBlock
|
||||
{
|
||||
Text = $"Ln {err.Line}, Col {err.Column}: {err.Message}",
|
||||
Text = $"{err.Context}, Ln {err.Line}, Col {err.Column}: {err.Message}",
|
||||
Margin = new Thickness(0, 0, 0, 4)
|
||||
};
|
||||
|
||||
@@ -273,6 +262,19 @@ namespace ZuneUIXTools
|
||||
ErrorPanel.Children.Add(errBlock);
|
||||
});
|
||||
}
|
||||
finally
|
||||
{
|
||||
// Even if there were errors, save the decomp results.
|
||||
var results = InterpreterContext.DecompileResults;
|
||||
if (results != null && results.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < results.Count; i++)
|
||||
{
|
||||
var result = results[i];
|
||||
File.WriteAllText(Path.ChangeExtension(compiledFile, $"{i}.decomp.uix"), result.InnerXml);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Build_Click(object sender, RoutedEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user