From 604f59a2e586f409d6ff64037d03873ae2aaa920 Mon Sep 17 00:00:00 2001 From: Cj <161484149+CJ-SPT@users.noreply.github.com> Date: Tue, 18 Jun 2024 23:54:02 -0400 Subject: [PATCH] Fix removing and editing --- RecodeItGUI/GUI/Main.cs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/RecodeItGUI/GUI/Main.cs b/RecodeItGUI/GUI/Main.cs index be997b6..d6afb7f 100644 --- a/RecodeItGUI/GUI/Main.cs +++ b/RecodeItGUI/GUI/Main.cs @@ -196,9 +196,18 @@ public partial class ReCodeItForm : Form private void RemoveRemapButton_Click(object sender, EventArgs e) { - DataProvider.Remaps?.RemoveAt(RemapTreeView.SelectedNode.Index); + if (AppSettings.Remapper.UseProjectMappings) + { + CrossCompiler.ActiveProject.RemapModels.RemoveAt(RemapTreeView.SelectedNode.Index); + ProjectManager.SaveCrossCompilerProjectModel(CrossCompiler.ActiveProject); + } + else + { + DataProvider.Remaps?.RemoveAt(RemapTreeView.SelectedNode.Index); + DataProvider.SaveMapping(); + } + RemapTreeView.SelectedNode?.Remove(); - DataProvider.SaveMapping(); } private void EditRemapButton_Click(object sender, EventArgs e) @@ -913,7 +922,9 @@ public partial class ReCodeItForm : Form ResetAll(); - var remap = DataProvider.Remaps.ElementAt(_selectedRemapTreeIndex); + var remap = AppSettings.Remapper.UseProjectMappings + ? CrossCompiler.ActiveProject.RemapModels.ElementAt(_selectedRemapTreeIndex) + : DataProvider.Remaps.ElementAt(_selectedRemapTreeIndex); NewTypeName.Text = remap.NewTypeName; OriginalTypeName.Text = remap.OriginalTypeName;