From 1559b663facfc6a5325cd6b8f34cdc525150a643 Mon Sep 17 00:00:00 2001
From: Cj <161484149+CJ-SPT@users.noreply.github.com>
Date: Tue, 18 Jun 2024 23:58:08 -0400
Subject: [PATCH] Make remapper run button cross compatible
---
RecodeItGUI/GUI/Main.cs | 7 ++++++-
RecodeItLib/Remapper/ReCodeItRemapper.cs | 8 ++++++--
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/RecodeItGUI/GUI/Main.cs b/RecodeItGUI/GUI/Main.cs
index d6afb7f..43f5ee9 100644
--- a/RecodeItGUI/GUI/Main.cs
+++ b/RecodeItGUI/GUI/Main.cs
@@ -223,6 +223,7 @@ public partial class ReCodeItForm : Form
if (AppSettings.Remapper.UseProjectMappings)
{
Remapper.InitializeRemap(
+ CrossCompiler.ActiveProject.RemapModels,
CrossCompiler.ActiveProject.OriginalAssemblyPath,
CrossCompiler.ActiveProject.RemappedAssemblyPath);
@@ -236,7 +237,11 @@ public partial class ReCodeItForm : Form
return;
}
- Remapper.InitializeRemap(AppSettings.Remapper.AssemblyPath, AppSettings.Remapper.OutputPath);
+ Remapper.InitializeRemap(
+ DataProvider.Remaps,
+ AppSettings.Remapper.AssemblyPath,
+ AppSettings.Remapper.OutputPath);
+
ReloadTreeView(DataProvider.Remaps);
}
diff --git a/RecodeItLib/Remapper/ReCodeItRemapper.cs b/RecodeItLib/Remapper/ReCodeItRemapper.cs
index 75c7f62..914de3c 100644
--- a/RecodeItLib/Remapper/ReCodeItRemapper.cs
+++ b/RecodeItLib/Remapper/ReCodeItRemapper.cs
@@ -37,7 +37,11 @@ public class ReCodeItRemapper
///
/// Start the remapping process
///
- public void InitializeRemap(string assemblyPath, string outPath, bool crossMapMode = false)
+ public void InitializeRemap(
+ List remapModels,
+ string assemblyPath,
+ string outPath,
+ bool crossMapMode = false)
{
DataProvider.LoadAssemblyDefinition(assemblyPath);
@@ -50,7 +54,7 @@ public class ReCodeItRemapper
Stopwatch.Start();
- foreach (var remap in DataProvider.Remaps)
+ foreach (var remap in remapModels)
{
Logger.Log($"Finding best match for {remap.NewTypeName}...", ConsoleColor.Gray);