More project work

This commit is contained in:
Cj 2024-06-18 23:45:00 -04:00
parent a8f496d34e
commit 39c2180469
6 changed files with 150 additions and 80 deletions

View File

@ -262,7 +262,7 @@ partial class ReCodeItForm
ActiveProjectMappingsCheckbox.TabIndex = 39; ActiveProjectMappingsCheckbox.TabIndex = 39;
ActiveProjectMappingsCheckbox.Text = "Use Active Project Mappings"; ActiveProjectMappingsCheckbox.Text = "Use Active Project Mappings";
ActiveProjectMappingsCheckbox.UseVisualStyleBackColor = true; ActiveProjectMappingsCheckbox.UseVisualStyleBackColor = true;
ActiveProjectMappingsCheckbox.CheckedChanged += ActiveProjectMappingsCheckbox_CheckedChanged; ActiveProjectMappingsCheckbox.CheckedChanged += UseProjectAutoMapping_Clicked;
// //
// LoadedMappingFilePath // LoadedMappingFilePath
// //
@ -1433,7 +1433,6 @@ partial class ReCodeItForm
groupBox4.TabIndex = 22; groupBox4.TabIndex = 22;
groupBox4.TabStop = false; groupBox4.TabStop = false;
groupBox4.Text = "Cross Compiler"; groupBox4.Text = "Cross Compiler";
groupBox4.Enter += groupBox4_Enter;
// //
// label4 // label4
// //

View File

@ -11,12 +11,12 @@ namespace ReCodeIt.GUI;
public partial class ReCodeItForm : Form public partial class ReCodeItForm : Form
{ {
public static ReCodeItRemapper Remapper { get; private set; } = new(); private static ReCodeItRemapper Remapper { get; set; } = new();
public static ReCodeItAutoMapper AutoMapper { get; private set; } = new(); private static ReCodeItAutoMapper AutoMapper { get; set; } = new();
public static ReCodeItCrossCompiler CrossCompiler { get; private set; } private static ReCodeItCrossCompiler CrossCompiler { get; set; }
private RemapModel CurrentRemap { get; set; } private static Settings AppSettings => DataProvider.Settings;
private int _selectedRemapTreeIndex = 0; private int _selectedRemapTreeIndex = 0;
@ -26,22 +26,54 @@ public partial class ReCodeItForm : Form
CrossCompiler = new(); CrossCompiler = new();
DataProvider.LoadMappingFile(DataProvider.Settings.Remapper.MappingPath);
LoadedMappingFilePath.Text = DataProvider.Settings.Remapper.MappingPath;
PopulateDomainUpDowns(); PopulateDomainUpDowns();
RefreshSettingsPage(); RefreshSettingsPage();
RefreshAutoMapperPage(); RefreshAutoMapperPage();
RefreshCrossCompilerPage(); RefreshCrossCompilerPage();
LoadMappingFile();
RemapTreeView.NodeMouseDoubleClick += EditSelectedRemap; RemapTreeView.NodeMouseDoubleClick += EditSelectedRemap;
Remapper.OnComplete += ReloadTreeView; Remapper.OnComplete += ReloadTreeAfterMapping;
ReloadTreeView(this, EventArgs.Empty);
} }
#region MANUAL_REMAPPER #region MANUAL_REMAPPER
private void LoadMappingFile()
{
if (AppSettings.CrossCompiler.AutoLoadLastActiveProject
&& ActiveProjectMappingsCheckbox.Checked)
{
LoadedMappingFilePath.Text = $"Project Mode: ({CrossCompiler.ActiveProject.SolutionName})";
ReloadTreeView(CrossCompiler.ActiveProject.RemapModels);
return;
}
DataProvider.LoadMappingFile(AppSettings.Remapper.MappingPath);
LoadedMappingFilePath.Text = AppSettings.Remapper.MappingPath;
}
private void UseProjectAutoMapping_Clicked(object sender, EventArgs e)
{
bool enabled = ActiveProjectMappingsCheckbox.Checked;
AppSettings.Remapper.UseProjectMappings = enabled;
var remaps = enabled && CrossCompiler?.ActiveProject?.RemapModels != null
? CrossCompiler?.ActiveProject?.RemapModels
: DataProvider.Remaps;
if (enabled && CrossCompiler?.ActiveProject != null)
{
LoadedMappingFilePath.Text = $"Project Mode: ({CrossCompiler.ActiveProject.SolutionName})";
}
ReloadTreeView(remaps!);
DataProvider.SaveAppSettings();
}
#region BUTTONS #region BUTTONS
#region MAIN_BUTTONS #region MAIN_BUTTONS
@ -107,34 +139,54 @@ public partial class ReCodeItForm : Form
} }
}; };
var existingRemap = DataProvider.Remaps bool projectMode = AppSettings.Remapper.UseProjectMappings;
Logger.Log(projectMode);
var remaps = projectMode
? CrossCompiler.ActiveProject.RemapModels
: DataProvider.Remaps;
var existingRemap = remaps
.Where(remap => remap.NewTypeName == newRemap.NewTypeName) .Where(remap => remap.NewTypeName == newRemap.NewTypeName)
.FirstOrDefault(); .FirstOrDefault();
// Handle overwriting an existing remap // Handle overwriting an existing remap
if (existingRemap != null) if (existingRemap != null)
{ {
var index = DataProvider.Remaps.IndexOf(existingRemap); var index = remaps.IndexOf(existingRemap);
DataProvider.Remaps.Remove(existingRemap); remaps.Remove(existingRemap);
RemapTreeView.Nodes.RemoveAt(index); RemapTreeView.Nodes.RemoveAt(index);
DataProvider.Remaps.Insert(index, newRemap); remaps.Insert(index, newRemap);
RemapTreeView.Nodes.Insert(index, GUIHelpers.GenerateTreeNode(newRemap, this)); RemapTreeView.Nodes.Insert(index, GUIHelpers.GenerateTreeNode(newRemap, this));
if (projectMode)
{
ProjectManager.SaveCrossCompilerProjectModel(CrossCompiler.ActiveProject);
}
else
{
DataProvider.SaveMapping(); DataProvider.SaveMapping();
}
CurrentRemap = existingRemap;
ResetAll(); ResetAll();
return; return;
} }
CurrentRemap = newRemap; if (projectMode)
RemapTreeView.Nodes.Add(GUIHelpers.GenerateTreeNode(newRemap, this)); {
CrossCompiler.ActiveProject.RemapModels.Add(newRemap);
ProjectManager.SaveCrossCompilerProjectModel(CrossCompiler.ActiveProject);
}
else
{
DataProvider.Remaps.Add(newRemap); DataProvider.Remaps.Add(newRemap);
DataProvider.SaveMapping(); DataProvider.SaveMapping();
}
RemapTreeView.Nodes.Add(GUIHelpers.GenerateTreeNode(newRemap, this));
ResetAll(); ResetAll();
} }
@ -155,17 +207,32 @@ public partial class ReCodeItForm : Form
{ {
if (ReCodeItRemapper.IsRunning) { return; } if (ReCodeItRemapper.IsRunning) { return; }
if (string.IsNullOrEmpty(DataProvider.Settings.Remapper.AssemblyPath)) if (AppSettings.Remapper.UseProjectMappings)
{
Remapper.InitializeRemap(
CrossCompiler.ActiveProject.OriginalAssemblyPath,
CrossCompiler.ActiveProject.RemappedAssemblyPath);
ReloadTreeView(CrossCompiler.ActiveProject.RemapModels);
return;
}
if (string.IsNullOrEmpty(AppSettings.Remapper.AssemblyPath))
{ {
MessageBox.Show("Please select an assembly path", "Assembly not loaded"); MessageBox.Show("Please select an assembly path", "Assembly not loaded");
return; return;
} }
Console.Clear(); Remapper.InitializeRemap(AppSettings.Remapper.AssemblyPath, AppSettings.Remapper.OutputPath);
ReloadTreeView(DataProvider.Remaps);
}
var settings = DataProvider.Settings; /// <summary>
/// Only used by the manual remap process, not apart of the cross compiler process
Remapper.InitializeRemap(settings.Remapper.AssemblyPath, settings.Remapper.OutputPath); /// </summary>
private void ReloadTreeAfterMapping()
{
ReloadTreeView(DataProvider.Remaps);
} }
private void SaveMappingFileButton_Click(object sender, EventArgs e) private void SaveMappingFileButton_Click(object sender, EventArgs e)
@ -189,7 +256,7 @@ public partial class ReCodeItForm : Form
if (result == string.Empty) { return; } if (result == string.Empty) { return; }
DataProvider.LoadMappingFile(result); DataProvider.LoadMappingFile(result);
DataProvider.Settings.Remapper.MappingPath = result; AppSettings.Remapper.MappingPath = result;
DataProvider.SaveAppSettings(); DataProvider.SaveAppSettings();
LoadedMappingFilePath.Text = result; LoadedMappingFilePath.Text = result;
@ -209,7 +276,7 @@ public partial class ReCodeItForm : Form
if (result != string.Empty) if (result != string.Empty)
{ {
DataProvider.Settings.Remapper.AssemblyPath = result; AppSettings.Remapper.AssemblyPath = result;
TargetAssemblyPath.Text = result; TargetAssemblyPath.Text = result;
} }
} }
@ -220,7 +287,7 @@ public partial class ReCodeItForm : Form
if (result != string.Empty) if (result != string.Empty)
{ {
DataProvider.Settings.Remapper.OutputPath = result; AppSettings.Remapper.OutputPath = result;
RemapperOutputDirectoryPath.Text = result; RemapperOutputDirectoryPath.Text = result;
} }
} }
@ -405,16 +472,17 @@ public partial class ReCodeItForm : Form
public void RefreshSettingsPage() public void RefreshSettingsPage()
{ {
// Settings page // Settings page
DebugLoggingCheckbox.Checked = DataProvider.Settings.AppSettings.Debug; DebugLoggingCheckbox.Checked = AppSettings.AppSettings.Debug;
SilentModeCheckbox.Checked = DataProvider.Settings.AppSettings.SilentMode; SilentModeCheckbox.Checked = AppSettings.AppSettings.SilentMode;
// Remapper page // Remapper page
TargetAssemblyPath.Text = DataProvider.Settings.Remapper.AssemblyPath; TargetAssemblyPath.Text = AppSettings.Remapper.AssemblyPath;
RemapperOutputDirectoryPath.Text = DataProvider.Settings.Remapper.OutputPath; RemapperOutputDirectoryPath.Text = AppSettings.Remapper.OutputPath;
RenameFieldsCheckbox.Checked = DataProvider.Settings.Remapper.MappingSettings.RenameFields; RenameFieldsCheckbox.Checked = AppSettings.Remapper.MappingSettings.RenameFields;
RenamePropertiesCheckbox.Checked = DataProvider.Settings.Remapper.MappingSettings.RenameProperties; RenamePropertiesCheckbox.Checked = AppSettings.Remapper.MappingSettings.RenameProperties;
RemapperPublicicize.Checked = DataProvider.Settings.Remapper.MappingSettings.Publicize; RemapperPublicicize.Checked = AppSettings.Remapper.MappingSettings.Publicize;
RemapperUnseal.Checked = DataProvider.Settings.Remapper.MappingSettings.Unseal; RemapperUnseal.Checked = AppSettings.Remapper.MappingSettings.Unseal;
ActiveProjectMappingsCheckbox.Checked = AppSettings.Remapper.UseProjectMappings;
} }
#region CHECKBOXES #region CHECKBOXES
@ -477,30 +545,32 @@ public partial class ReCodeItForm : Form
AutoMapperTokensBox.Items.Clear(); AutoMapperTokensBox.Items.Clear();
AutoMapperFPBox.Items.Clear(); AutoMapperFPBox.Items.Clear();
AutoMapperRequiredMatchesUpDown.Value = DataProvider.Settings.AutoMapper.RequiredMatches; var settings = AppSettings.AutoMapper;
AutoMapperMinLengthUpDown.Value = DataProvider.Settings.AutoMapper.MinLengthToMatch;
AutoMapperSearchMethodsCheckBox.Checked = DataProvider.Settings.AutoMapper.SearchMethods;
AutoMapperRenameFields.Checked = DataProvider.Settings.AutoMapper.MappingSettings.RenameFields;
AutoMapperRenameProps.Checked = DataProvider.Settings.AutoMapper.MappingSettings.RenameProperties;
AutoMapperPublicize.Checked = DataProvider.Settings.AutoMapper.MappingSettings.Publicize;
AutoMapperUnseal.Checked = DataProvider.Settings.AutoMapper.MappingSettings.Unseal;
foreach (var type in DataProvider.Settings.AutoMapper.TypesToIgnore) AutoMapperRequiredMatchesUpDown.Value = settings.RequiredMatches;
AutoMapperMinLengthUpDown.Value = settings.MinLengthToMatch;
AutoMapperSearchMethodsCheckBox.Checked = settings.SearchMethods;
AutoMapperRenameFields.Checked = settings.MappingSettings.RenameFields;
AutoMapperRenameProps.Checked = settings.MappingSettings.RenameProperties;
AutoMapperPublicize.Checked = settings.MappingSettings.Publicize;
AutoMapperUnseal.Checked = settings.MappingSettings.Unseal;
foreach (var type in settings.TypesToIgnore)
{ {
AutoMapperTypesExcludeBox.Items.Add(type); AutoMapperTypesExcludeBox.Items.Add(type);
} }
foreach (var token in DataProvider.Settings.AutoMapper.TokensToMatch) foreach (var token in settings.TokensToMatch)
{ {
AutoMapperTokensBox.Items.Add(token); AutoMapperTokensBox.Items.Add(token);
} }
foreach (var fp in DataProvider.Settings.AutoMapper.PropertyFieldBlackList) foreach (var fp in settings.PropertyFieldBlackList)
{ {
AutoMapperFPBox.Items.Add(fp); AutoMapperFPBox.Items.Add(fp);
} }
foreach (var mp in DataProvider.Settings.AutoMapper.MethodParamaterBlackList) foreach (var mp in settings.MethodParamaterBlackList)
{ {
AutoMapperMethodBox.Items.Add(mp); AutoMapperMethodBox.Items.Add(mp);
} }
@ -513,7 +583,7 @@ public partial class ReCodeItForm : Form
if (result != string.Empty) if (result != string.Empty)
{ {
DataProvider.Settings.AutoMapper.AssemblyPath = result; AppSettings.AutoMapper.AssemblyPath = result;
TargetAssemblyPath.Text = result; TargetAssemblyPath.Text = result;
DataProvider.SaveAppSettings(); DataProvider.SaveAppSettings();
} }
@ -525,7 +595,7 @@ public partial class ReCodeItForm : Form
if (result != string.Empty) if (result != string.Empty)
{ {
DataProvider.Settings.AutoMapper.OutputPath = result; AppSettings.AutoMapper.OutputPath = result;
RemapperOutputDirectoryPath.Text = result; RemapperOutputDirectoryPath.Text = result;
DataProvider.SaveAppSettings(); DataProvider.SaveAppSettings();
} }
@ -533,13 +603,13 @@ public partial class ReCodeItForm : Form
private void AutoMapperRequiredMatchesUpDown_ValueChanged_1(object sender, EventArgs e) private void AutoMapperRequiredMatchesUpDown_ValueChanged_1(object sender, EventArgs e)
{ {
DataProvider.Settings.AutoMapper.RequiredMatches = (int)AutoMapperRequiredMatchesUpDown.Value; AppSettings.AutoMapper.RequiredMatches = (int)AutoMapperRequiredMatchesUpDown.Value;
DataProvider.SaveAppSettings(); DataProvider.SaveAppSettings();
} }
private void AutoMapperMinLengthUpDown_ValueChanged(object sender, EventArgs e) private void AutoMapperMinLengthUpDown_ValueChanged(object sender, EventArgs e)
{ {
DataProvider.Settings.AutoMapper.MinLengthToMatch = (int)AutoMapperMinLengthUpDown.Value; AppSettings.AutoMapper.MinLengthToMatch = (int)AutoMapperMinLengthUpDown.Value;
DataProvider.SaveAppSettings(); DataProvider.SaveAppSettings();
} }
@ -548,7 +618,7 @@ public partial class ReCodeItForm : Form
if (!AutoMapperTokensBox.Items.Contains(AutoMapperTokensTextField.Text)) if (!AutoMapperTokensBox.Items.Contains(AutoMapperTokensTextField.Text))
{ {
AutoMapperTokensBox.Items.Add(AutoMapperTokensTextField.Text); AutoMapperTokensBox.Items.Add(AutoMapperTokensTextField.Text);
DataProvider.Settings.AutoMapper.TokensToMatch.Add(AutoMapperTokensTextField.Text); AppSettings.AutoMapper.TokensToMatch.Add(AutoMapperTokensTextField.Text);
AutoMapperTokensTextField.Clear(); AutoMapperTokensTextField.Clear();
DataProvider.SaveAppSettings(); DataProvider.SaveAppSettings();
@ -560,7 +630,7 @@ public partial class ReCodeItForm : Form
if (AutoMapperTokensBox.SelectedItem != null) if (AutoMapperTokensBox.SelectedItem != null)
{ {
AutoMapperTokensBox.Items.Remove(AutoMapperTokensBox.SelectedItem); AutoMapperTokensBox.Items.Remove(AutoMapperTokensBox.SelectedItem);
DataProvider.Settings.AutoMapper.TokensToMatch.RemoveAt(AutoMapperTokensBox.SelectedIndex + 1); AppSettings.AutoMapper.TokensToMatch.RemoveAt(AutoMapperTokensBox.SelectedIndex + 1);
DataProvider.SaveAppSettings(); DataProvider.SaveAppSettings();
} }
} }
@ -570,7 +640,7 @@ public partial class ReCodeItForm : Form
if (!AutoMapperFPBox.Items.Contains(AutoMapperFPTextField.Text)) if (!AutoMapperFPBox.Items.Contains(AutoMapperFPTextField.Text))
{ {
AutoMapperFPBox.Items.Add(AutoMapperFPTextField.Text); AutoMapperFPBox.Items.Add(AutoMapperFPTextField.Text);
DataProvider.Settings.AutoMapper.PropertyFieldBlackList.Add(AutoMapperFPTextField.Text); AppSettings.AutoMapper.PropertyFieldBlackList.Add(AutoMapperFPTextField.Text);
AutoMapperFPTextField.Clear(); AutoMapperFPTextField.Clear();
DataProvider.SaveAppSettings(); DataProvider.SaveAppSettings();
@ -582,7 +652,7 @@ public partial class ReCodeItForm : Form
if (AutoMapperFPBox.SelectedItem != null) if (AutoMapperFPBox.SelectedItem != null)
{ {
AutoMapperFPBox.Items.Remove(AutoMapperFPBox.SelectedItem); AutoMapperFPBox.Items.Remove(AutoMapperFPBox.SelectedItem);
DataProvider.Settings.AutoMapper.PropertyFieldBlackList.RemoveAt(AutoMapperFPBox.SelectedIndex); AppSettings.AutoMapper.PropertyFieldBlackList.RemoveAt(AutoMapperFPBox.SelectedIndex);
DataProvider.SaveAppSettings(); DataProvider.SaveAppSettings();
} }
} }
@ -592,7 +662,7 @@ public partial class ReCodeItForm : Form
if (!AutoMapperMethodBox.Items.Contains(AutoMapperMethodTextBox.Text)) if (!AutoMapperMethodBox.Items.Contains(AutoMapperMethodTextBox.Text))
{ {
AutoMapperMethodBox.Items.Add(AutoMapperMethodTextBox.Text); AutoMapperMethodBox.Items.Add(AutoMapperMethodTextBox.Text);
DataProvider.Settings.AutoMapper.MethodParamaterBlackList.Add(AutoMapperMethodTextBox.Text); AppSettings.AutoMapper.MethodParamaterBlackList.Add(AutoMapperMethodTextBox.Text);
AutoMapperMethodTextBox.Clear(); AutoMapperMethodTextBox.Clear();
DataProvider.SaveAppSettings(); DataProvider.SaveAppSettings();
@ -604,38 +674,38 @@ public partial class ReCodeItForm : Form
if (AutoMapperMethodBox.SelectedItem != null) if (AutoMapperMethodBox.SelectedItem != null)
{ {
AutoMapperMethodBox.Items.Remove(AutoMapperMethodBox.SelectedItem); AutoMapperMethodBox.Items.Remove(AutoMapperMethodBox.SelectedItem);
DataProvider.Settings.AutoMapper.MethodParamaterBlackList.RemoveAt(AutoMapperMethodBox.SelectedIndex > 0 ? AutoMapperMethodBox.SelectedIndex : 0); AppSettings.AutoMapper.MethodParamaterBlackList.RemoveAt(AutoMapperMethodBox.SelectedIndex > 0 ? AutoMapperMethodBox.SelectedIndex : 0);
DataProvider.SaveAppSettings(); DataProvider.SaveAppSettings();
} }
} }
private void SearchMethodsCheckBox_CheckedChanged(object sender, EventArgs e) private void SearchMethodsCheckBox_CheckedChanged(object sender, EventArgs e)
{ {
DataProvider.Settings.AutoMapper.SearchMethods = AutoMapperSearchMethodsCheckBox.Checked; AppSettings.AutoMapper.SearchMethods = AutoMapperSearchMethodsCheckBox.Checked;
DataProvider.SaveAppSettings(); DataProvider.SaveAppSettings();
} }
private void AutoMapperRenameFields_CheckedChanged(object sender, EventArgs e) private void AutoMapperRenameFields_CheckedChanged(object sender, EventArgs e)
{ {
DataProvider.Settings.AutoMapper.MappingSettings.RenameFields = AutoMapperRenameFields.Checked; AppSettings.AutoMapper.MappingSettings.RenameFields = AutoMapperRenameFields.Checked;
DataProvider.SaveAppSettings(); DataProvider.SaveAppSettings();
} }
private void AutoMapperRenameProps_CheckedChanged(object sender, EventArgs e) private void AutoMapperRenameProps_CheckedChanged(object sender, EventArgs e)
{ {
DataProvider.Settings.AutoMapper.MappingSettings.RenameProperties = AutoMapperRenameProps.Checked; AppSettings.AutoMapper.MappingSettings.RenameProperties = AutoMapperRenameProps.Checked;
DataProvider.SaveAppSettings(); DataProvider.SaveAppSettings();
} }
private void AutoMapperPublicize_CheckedChanged(object sender, EventArgs e) private void AutoMapperPublicize_CheckedChanged(object sender, EventArgs e)
{ {
DataProvider.Settings.AutoMapper.MappingSettings.Publicize = AutoMapperPublicize.Checked; AppSettings.AutoMapper.MappingSettings.Publicize = AutoMapperPublicize.Checked;
DataProvider.SaveAppSettings(); DataProvider.SaveAppSettings();
} }
private void AutoMapperUnseal_CheckedChanged(object sender, EventArgs e) private void AutoMapperUnseal_CheckedChanged(object sender, EventArgs e)
{ {
DataProvider.Settings.AutoMapper.MappingSettings.Unseal = AutoMapperUnseal.Checked; AppSettings.AutoMapper.MappingSettings.Unseal = AutoMapperUnseal.Checked;
DataProvider.SaveAppSettings(); DataProvider.SaveAppSettings();
} }
@ -645,7 +715,7 @@ public partial class ReCodeItForm : Form
private void RefreshCrossCompilerPage() private void RefreshCrossCompilerPage()
{ {
var ccSettings = DataProvider.Settings.CrossCompiler; var ccSettings = AppSettings.CrossCompiler;
CCAutoLoadLastProj.Checked = ccSettings.AutoLoadLastActiveProject; CCAutoLoadLastProj.Checked = ccSettings.AutoLoadLastActiveProject;
@ -766,7 +836,7 @@ public partial class ReCodeItForm : Form
private void CCAutoLoadLastProj_CheckedChanged_1(object sender, EventArgs e) private void CCAutoLoadLastProj_CheckedChanged_1(object sender, EventArgs e)
{ {
DataProvider.Settings.CrossCompiler.AutoLoadLastActiveProject = CCAutoLoadLastProj.Checked; AppSettings.CrossCompiler.AutoLoadLastActiveProject = CCAutoLoadLastProj.Checked;
DataProvider.SaveAppSettings(); DataProvider.SaveAppSettings();
} }
@ -948,19 +1018,14 @@ public partial class ReCodeItForm : Form
/// <summary> /// <summary>
/// Subscribes the the remappers OnComplete event /// Subscribes the the remappers OnComplete event
/// </summary> /// </summary>
/// <param name="sender"></param> /// <param name="remaps"></param>
/// <param name="e"></param> private void ReloadTreeView(List<RemapModel> remaps)
private void ReloadTreeView(object sender, EventArgs e)
{ {
RemapTreeView.Nodes.Clear(); RemapTreeView.Nodes.Clear();
foreach (var remap in DataProvider.Remaps) foreach (var remap in remaps)
{ {
RemapTreeView.Nodes.Add(GUIHelpers.GenerateTreeNode(remap, this)); RemapTreeView.Nodes.Add(GUIHelpers.GenerateTreeNode(remap, this));
} }
} }
private void groupBox4_Enter(object sender, EventArgs e)
{
}
} }

View File

@ -123,7 +123,7 @@ public static class ProjectManager
} }
} }
private static void SaveCrossCompilerProjectModel(CrossCompilerProjectModel model) public static void SaveCrossCompilerProjectModel(CrossCompilerProjectModel model)
{ {
var path = Path.Combine(model.VisualStudioSolutionPath, "ReCodeItProj.json"); var path = Path.Combine(model.VisualStudioSolutionPath, "ReCodeItProj.json");

View File

@ -42,6 +42,11 @@ public class RemapperSettings
/// </summary> /// </summary>
public string MappingPath { get; set; } public string MappingPath { get; set; }
/// <summary>
/// Use the projects mappings instead of a standalone file
/// </summary>
public bool UseProjectMappings { get; set; }
public MappingSettings MappingSettings { get; set; } public MappingSettings MappingSettings { get; set; }
} }

View File

@ -22,7 +22,7 @@ public class ReCodeItRemapper
public static bool IsRunning { get; private set; } = false; public static bool IsRunning { get; private set; } = false;
public delegate void OnCompleteHandler(object sender, EventArgs e); public delegate void OnCompleteHandler();
public event OnCompleteHandler? OnComplete; public event OnCompleteHandler? OnComplete;
@ -281,7 +281,7 @@ public class ReCodeItRemapper
Reset(); Reset();
IsRunning = false; IsRunning = false;
OnComplete?.Invoke(this, EventArgs.Empty); OnComplete?.Invoke();
} }
private void Reset() private void Reset()

View File

@ -7,6 +7,7 @@
"AssemblyPath": "./Data/Managed/Assembly-CSharp.dll", // Path to the assembly we want to remap "AssemblyPath": "./Data/Managed/Assembly-CSharp.dll", // Path to the assembly we want to remap
"OutputPath": "./Data/Assembly-CSharp-Remapped.dll", // Path including the filename and extension we want to write the changes to "OutputPath": "./Data/Assembly-CSharp-Remapped.dll", // Path including the filename and extension we want to write the changes to
"MappingPath": "./Data/Mappings.jsonc", // Path to the mapping file "MappingPath": "./Data/Mappings.jsonc", // Path to the mapping file
"UseProjectMappings": true, // Use the active cross compiler projects mappings
"MappingSettings": { "MappingSettings": {
"RenameFields": true, // Names of fields of the matched type will be renamed to the type name with approproiate convention "RenameFields": true, // Names of fields of the matched type will be renamed to the type name with approproiate convention
"RenameProperties": true, // Names of properties of the matched type will be renamed to the type name with approproiate convention "RenameProperties": true, // Names of properties of the matched type will be renamed to the type name with approproiate convention
@ -67,6 +68,6 @@
}, },
"CrossCompiler": { "CrossCompiler": {
"AutoLoadLastActiveProject": true, // Autoload last active project "AutoLoadLastActiveProject": true, // Autoload last active project
"LastLoadedProject": "" // Last loaded project path "LastLoadedProject": "G:\\development\\SPT-MODS\\StashSearch\\ReCodeItProj.json" // Last loaded project path
} }
} }