From 867b2180635d3b7ded8431d10a834271f9982cdd Mon Sep 17 00:00:00 2001 From: Cj <161484149+CJ-SPT@users.noreply.github.com> Date: Fri, 14 Jun 2024 19:06:21 -0400 Subject: [PATCH] Rebrand --- AssemblyRemapperGUI/SettingsController.cs | 132 -------------- Assembly_Tool.sln | 37 ---- RecodeIt.sln | 37 ++++ .../Commands/CommandProcessor.cs | 6 +- .../Program.cs | 0 .../ReCodeItConsole.csproj | 2 +- .../GUI/Main.Designer.cs | 14 +- .../Form1.cs => RecodeItGUI/GUI/Main.cs | 170 +++++++++++++++--- .../Form1.resx => RecodeItGUI/GUI/Main.resx | 0 .../Program.cs | 7 +- .../ReCodeItGUI.csproj | 8 +- .../GUI.cs => RecodeItGUI/Utils/GUIHelpers.cs | 9 +- .../Enums/EFailureReason.cs | 2 +- .../Enums/ELogLevel.cs | 2 +- .../Enums/EMatchResult.cs | 2 +- .../Models/AppSettingsModel.cs | 2 +- .../Models/RemapModel.cs | 4 +- .../Models/ScoringModel.cs | 4 +- .../ReCodeItLib.csproj | 0 .../Remapper/Publicizer.cs | 4 +- .../Remapper/ReCodeItRemapper.cs | 14 +- .../Remapper/Renamer.cs | 6 +- .../Remapper/Search/Constructors.cs | 6 +- .../Remapper/Search/Fields.cs | 6 +- .../Remapper/Search/Methods.cs | 6 +- .../Remapper/Search/NestedTypes.cs | 6 +- .../Remapper/Search/Properties.cs | 6 +- .../Remapper/Search/TypeDefExtensions.cs | 8 +- .../Utils/DataProvider.cs | 4 +- .../Utils/EnumHelpers.cs | 4 +- .../Utils/ExtentionMethods.cs | 4 +- .../Utils/Logger.cs | 2 +- 32 files changed, 254 insertions(+), 260 deletions(-) delete mode 100644 AssemblyRemapperGUI/SettingsController.cs delete mode 100644 Assembly_Tool.sln create mode 100644 RecodeIt.sln rename {RemapperConsole => RecodeItConsole}/Commands/CommandProcessor.cs (91%) rename {RemapperConsole => RecodeItConsole}/Program.cs (100%) rename RemapperConsole/RemapperConsole.csproj => RecodeItConsole/ReCodeItConsole.csproj (81%) rename AssemblyRemapperGUI/Form1.Designer.cs => RecodeItGUI/GUI/Main.Designer.cs (99%) rename AssemblyRemapperGUI/Form1.cs => RecodeItGUI/GUI/Main.cs (64%) rename AssemblyRemapperGUI/Form1.resx => RecodeItGUI/GUI/Main.resx (100%) rename {AssemblyRemapperGUI => RecodeItGUI}/Program.cs (82%) rename AssemblyRemapperGUI/RemapperGUI.csproj => RecodeItGUI/ReCodeItGUI.csproj (88%) rename AssemblyRemapperGUI/Utils/GUI.cs => RecodeItGUI/Utils/GUIHelpers.cs (97%) rename {AssemblyRemapper => RecodeItLib}/Enums/EFailureReason.cs (92%) rename {AssemblyRemapper => RecodeItLib}/Enums/ELogLevel.cs (73%) rename {AssemblyRemapper => RecodeItLib}/Enums/EMatchResult.cs (73%) rename {AssemblyRemapper => RecodeItLib}/Models/AppSettingsModel.cs (96%) rename {AssemblyRemapper => RecodeItLib}/Models/RemapModel.cs (97%) rename {AssemblyRemapper => RecodeItLib}/Models/ScoringModel.cs (83%) rename AssemblyRemapper/MapLib.csproj => RecodeItLib/ReCodeItLib.csproj (100%) rename {AssemblyRemapper => RecodeItLib}/Remapper/Publicizer.cs (94%) rename AssemblyRemapper/Remapper/Remapper.cs => RecodeItLib/Remapper/ReCodeItRemapper.cs (97%) rename {AssemblyRemapper => RecodeItLib}/Remapper/Renamer.cs (96%) rename {AssemblyRemapper => RecodeItLib}/Remapper/Search/Constructors.cs (87%) rename {AssemblyRemapper => RecodeItLib}/Remapper/Search/Fields.cs (95%) rename {AssemblyRemapper => RecodeItLib}/Remapper/Search/Methods.cs (96%) rename {AssemblyRemapper => RecodeItLib}/Remapper/Search/NestedTypes.cs (94%) rename {AssemblyRemapper => RecodeItLib}/Remapper/Search/Properties.cs (94%) rename {AssemblyRemapper => RecodeItLib}/Remapper/Search/TypeDefExtensions.cs (98%) rename {AssemblyRemapper => RecodeItLib}/Utils/DataProvider.cs (98%) rename {AssemblyRemapper => RecodeItLib}/Utils/EnumHelpers.cs (91%) rename {AssemblyRemapper => RecodeItLib}/Utils/ExtentionMethods.cs (95%) rename {AssemblyRemapper => RecodeItLib}/Utils/Logger.cs (97%) diff --git a/AssemblyRemapperGUI/SettingsController.cs b/AssemblyRemapperGUI/SettingsController.cs deleted file mode 100644 index 27cb572..0000000 --- a/AssemblyRemapperGUI/SettingsController.cs +++ /dev/null @@ -1,132 +0,0 @@ -using AssemblyRemapper.Utils; - -namespace AssemblyRemapperGUI; - -using static DataProvider; - -public partial class AssemblyToolGUI -{ - private void RefreshSettingsPage() - { - AssemblyPathTextBox.Text = Settings.AppSettings.AssemblyPath; - OutputPathTextBox.Text = Settings.AppSettings.OutputPath; - MappingPathTextBox.Text = Settings.AppSettings.MappingPath; - - DebugLoggingCheckbox.Checked = Settings.AppSettings.Debug; - SilentModeCheckbox.Checked = Settings.AppSettings.SilentMode; - RenameFieldsCheckbox.Checked = Settings.AppSettings.RenameFields; - RenamePropertiesCheckbox.Checked = Settings.AppSettings.RenameProperties; - PublicizeCheckbox.Checked = Settings.AppSettings.Publicize; - UnsealCheckbox.Checked = Settings.AppSettings.Unseal; - - MaxMatchCountUpDown.Value = Settings.Remapper.MaxMatchCount; - AutoMapperRequiredMatchesUpDown.Value = Settings.AutoMapper.RequiredMatches; - } - - #region SETTINGS_BUTTONS - - private void PickAssemblyPathButton_Click(object sender, EventArgs e) - { - OpenFileDialog fDialog = new() - { - Title = "Select a DLL file", - Filter = "DLL Files (*.dll)|*.dll|All Files (*.*)|*.*", - Multiselect = false - }; - - if (fDialog.ShowDialog() == DialogResult.OK) - { - Settings.AppSettings.AssemblyPath = fDialog.FileName; - LoadAssemblyDefinition(); - AssemblyPathTextBox.Text = fDialog.FileName; - } - } - - private void OutputDirectoryButton_Click(object sender, EventArgs e) - { - using FolderBrowserDialog fDialog = new(); - - fDialog.Description = "Select a directory"; - fDialog.ShowNewFolderButton = true; - - if (fDialog.ShowDialog() == DialogResult.OK) - { - Settings.AppSettings.OutputPath = fDialog.SelectedPath; - OutputPathTextBox.Text = fDialog.SelectedPath; - } - } - - private void MappingChooseButton_Click(object sender, EventArgs e) - { - var fDialog = new OpenFileDialog - { - Title = "Select a mapping file", - Filter = "JSON Files (*.json)|*.json|JSONC Files (*.jsonc)|*.jsonc|All Files (*.*)|*.*", - Multiselect = false - }; - - if (fDialog.ShowDialog() == DialogResult.OK) - { - LoadMappingFile(fDialog.FileName); - MappingPathTextBox.Text = fDialog.FileName; - } - } - - #endregion SETTINGS_BUTTONS - - #region CHECKBOXES - - private void DebugLoggingCheckbox_CheckedChanged(object sender, EventArgs e) - { - Settings.AppSettings.Debug = DebugLoggingCheckbox.Checked; - SaveAppSettings(); - } - - private void SilentModeCheckbox_CheckedChanged(object sender, EventArgs e) - { - Settings.AppSettings.SilentMode = SilentModeCheckbox.Checked; - SaveAppSettings(); - } - - private void RenameFieldsCheckbox_CheckedChanged(object sender, EventArgs e) - { - Settings.AppSettings.RenameFields = RenameFieldsCheckbox.Checked; - SaveAppSettings(); - } - - private void RenamePropertiesCheckbox_CheckedChanged(object sender, EventArgs e) - { - Settings.AppSettings.RenameProperties = RenamePropertiesCheckbox.Checked; - SaveAppSettings(); - } - - private void PublicizeCheckbox_CheckedChanged(object sender, EventArgs e) - { - Settings.AppSettings.Publicize = PublicizeCheckbox.Checked; - SaveAppSettings(); - } - - private void UnsealCheckbox_CheckedChanged(object sender, EventArgs e) - { - Settings.AppSettings.Unseal = UnsealCheckbox.Checked; - SaveAppSettings(); - } - - #endregion CHECKBOXES - - #region UPDOWNS - - private void MaxMatchCountUpDown_ValueChanged(object sender, EventArgs e) - { - Settings.Remapper.MaxMatchCount = (int)MaxMatchCountUpDown.Value; - SaveAppSettings(); - } - - private void AutoMapperRequiredMatchesUpDown_ValueChanged(object sender, EventArgs e) - { - Settings.AutoMapper.RequiredMatches = (int)AutoMapperRequiredMatchesUpDown.Value; - SaveAppSettings(); - } - - #endregion UPDOWNS -} \ No newline at end of file diff --git a/Assembly_Tool.sln b/Assembly_Tool.sln deleted file mode 100644 index 7f817d9..0000000 --- a/Assembly_Tool.sln +++ /dev/null @@ -1,37 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.9.34728.123 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapLib", "AssemblyRemapper\MapLib.csproj", "{84BF5F6E-9EEC-4B08-BE72-9F419A369124}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RemapperGUI", "AssemblyRemapperGUI\RemapperGUI.csproj", "{A854A2C9-EB8B-4B70-BB79-17F689756F48}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RemapperConsole", "RemapperConsole\RemapperConsole.csproj", "{8D53FC01-49FD-47FB-9789-3DD6E53D6A7D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {84BF5F6E-9EEC-4B08-BE72-9F419A369124}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {84BF5F6E-9EEC-4B08-BE72-9F419A369124}.Debug|Any CPU.Build.0 = Debug|Any CPU - {84BF5F6E-9EEC-4B08-BE72-9F419A369124}.Release|Any CPU.ActiveCfg = Release|Any CPU - {84BF5F6E-9EEC-4B08-BE72-9F419A369124}.Release|Any CPU.Build.0 = Release|Any CPU - {A854A2C9-EB8B-4B70-BB79-17F689756F48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A854A2C9-EB8B-4B70-BB79-17F689756F48}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A854A2C9-EB8B-4B70-BB79-17F689756F48}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A854A2C9-EB8B-4B70-BB79-17F689756F48}.Release|Any CPU.Build.0 = Release|Any CPU - {8D53FC01-49FD-47FB-9789-3DD6E53D6A7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8D53FC01-49FD-47FB-9789-3DD6E53D6A7D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8D53FC01-49FD-47FB-9789-3DD6E53D6A7D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8D53FC01-49FD-47FB-9789-3DD6E53D6A7D}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {C2C7C51D-6773-404D-B51D-BC279AC9B923} - EndGlobalSection -EndGlobal diff --git a/RecodeIt.sln b/RecodeIt.sln new file mode 100644 index 0000000..8f38c79 --- /dev/null +++ b/RecodeIt.sln @@ -0,0 +1,37 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34728.123 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReCodeItConsole", "RecodeItConsole\ReCodeItConsole.csproj", "{2DFEF08F-6136-44F6-BF0D-93A2E9F9270C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReCodeItGUI", "RecodeItGUI\ReCodeItGUI.csproj", "{7C4A62CE-8072-454F-9D95-6CB4D837F485}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReCodeItLib", "RecodeItLib\ReCodeItLib.csproj", "{FDA58DB6-E114-4FE0-AAF1-C3DEE44AEF99}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2DFEF08F-6136-44F6-BF0D-93A2E9F9270C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2DFEF08F-6136-44F6-BF0D-93A2E9F9270C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2DFEF08F-6136-44F6-BF0D-93A2E9F9270C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2DFEF08F-6136-44F6-BF0D-93A2E9F9270C}.Release|Any CPU.Build.0 = Release|Any CPU + {7C4A62CE-8072-454F-9D95-6CB4D837F485}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7C4A62CE-8072-454F-9D95-6CB4D837F485}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7C4A62CE-8072-454F-9D95-6CB4D837F485}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7C4A62CE-8072-454F-9D95-6CB4D837F485}.Release|Any CPU.Build.0 = Release|Any CPU + {FDA58DB6-E114-4FE0-AAF1-C3DEE44AEF99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FDA58DB6-E114-4FE0-AAF1-C3DEE44AEF99}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FDA58DB6-E114-4FE0-AAF1-C3DEE44AEF99}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FDA58DB6-E114-4FE0-AAF1-C3DEE44AEF99}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {C2C7C51D-6773-404D-B51D-BC279AC9B923} + EndGlobalSection +EndGlobal diff --git a/RemapperConsole/Commands/CommandProcessor.cs b/RecodeItConsole/Commands/CommandProcessor.cs similarity index 91% rename from RemapperConsole/Commands/CommandProcessor.cs rename to RecodeItConsole/Commands/CommandProcessor.cs index 0ed70de..0c9fd89 100644 --- a/RemapperConsole/Commands/CommandProcessor.cs +++ b/RecodeItConsole/Commands/CommandProcessor.cs @@ -1,6 +1,6 @@ -using AssemblyRemapper.Utils; +using ReCodeIt.Utils; -namespace AssemblyRemapper.Commands +namespace ReCodeIt.Commands { internal class CommandProcessor { @@ -22,7 +22,7 @@ namespace AssemblyRemapper.Commands { if (command == "remap" || command == "Remap") { - var remapper = new Remapper.Remapper(); + var remapper = new ReMapper.ReCodeItRemapper(); Logger.ClearLog(); Console.Clear(); diff --git a/RemapperConsole/Program.cs b/RecodeItConsole/Program.cs similarity index 100% rename from RemapperConsole/Program.cs rename to RecodeItConsole/Program.cs diff --git a/RemapperConsole/RemapperConsole.csproj b/RecodeItConsole/ReCodeItConsole.csproj similarity index 81% rename from RemapperConsole/RemapperConsole.csproj rename to RecodeItConsole/ReCodeItConsole.csproj index 2c1e9a0..09e3992 100644 --- a/RemapperConsole/RemapperConsole.csproj +++ b/RecodeItConsole/ReCodeItConsole.csproj @@ -8,7 +8,7 @@ - + diff --git a/AssemblyRemapperGUI/Form1.Designer.cs b/RecodeItGUI/GUI/Main.Designer.cs similarity index 99% rename from AssemblyRemapperGUI/Form1.Designer.cs rename to RecodeItGUI/GUI/Main.Designer.cs index 8bf9908..3761dda 100644 --- a/AssemblyRemapperGUI/Form1.Designer.cs +++ b/RecodeItGUI/GUI/Main.Designer.cs @@ -1,6 +1,6 @@ -namespace AssemblyRemapperGUI; +namespace ReCodeIt.GUI; -partial class AssemblyToolGUI +partial class ReCodeItForm { /// /// Required designer variable. @@ -157,7 +157,7 @@ partial class AssemblyToolGUI TabPageRemapper.Padding = new Padding(3); TabPageRemapper.Size = new Size(1336, 953); TabPageRemapper.TabIndex = 1; - TabPageRemapper.Text = "Remapper"; + TabPageRemapper.Text = "ReCodeItRemapper"; // // RemapTreeView // @@ -885,7 +885,7 @@ partial class AssemblyToolGUI groupBox3.Size = new Size(259, 285); groupBox3.TabIndex = 1; groupBox3.TabStop = false; - groupBox3.Text = "Remapper Settings"; + groupBox3.Text = "ReCodeItRemapper Settings"; // // label1 // @@ -1095,7 +1095,7 @@ partial class AssemblyToolGUI fileSystemWatcher1.EnableRaisingEvents = true; fileSystemWatcher1.SynchronizingObject = this; // - // AssemblyToolGUI + // ReCodeItForm // AutoScaleDimensions = new SizeF(10F, 25F); AutoScaleMode = AutoScaleMode.Font; @@ -1103,8 +1103,8 @@ partial class AssemblyToolGUI ClientSize = new Size(1297, 966); Controls.Add(TabControlMain); FormBorderStyle = FormBorderStyle.FixedSingle; - Name = "AssemblyToolGUI"; - Text = "Cj's Assembly Tool V0.1.0"; + Name = "ReCodeItForm"; + Text = "ReCodeIt V0.1.0"; ((System.ComponentModel.ISupportInitialize)bindingSource1).EndInit(); TabPageRemapper.ResumeLayout(false); groupBox1.ResumeLayout(false); diff --git a/AssemblyRemapperGUI/Form1.cs b/RecodeItGUI/GUI/Main.cs similarity index 64% rename from AssemblyRemapperGUI/Form1.cs rename to RecodeItGUI/GUI/Main.cs index eec20ab..c4a9a0a 100644 --- a/AssemblyRemapperGUI/Form1.cs +++ b/RecodeItGUI/GUI/Main.cs @@ -1,20 +1,18 @@ -using AssemblyRemapper.Enums; -using AssemblyRemapper.Models; -using AssemblyRemapper.Remapper; -using AssemblyRemapper.Utils; -using RemapperGUI.Utils; +using ReCodeIt.Enums; +using ReCodeIt.Models; +using ReCodeIt.ReMapper; +using ReCodeIt.Utils; -namespace AssemblyRemapperGUI; +namespace ReCodeIt.GUI; -public partial class AssemblyToolGUI : Form +public partial class ReCodeItForm : Form { - public static Remapper Remapper { get; private set; } = new(); + public static ReCodeItRemapper Remapper { get; private set; } = new(); - public AssemblyToolGUI() + public ReCodeItForm() { InitializeComponent(); PopulateDomainUpDowns(); - RefreshSettingsPage(); Remapper.OnComplete += ReloadTreeView; ReloadTreeView(this, EventArgs.Empty); @@ -74,18 +72,18 @@ public partial class AssemblyToolGUI : Form FieldCount = FieldCountEnabled.GetCount(FieldCountUpDown), PropertyCount = PropertyCountEnabled.GetCount(PropertyCountUpDown), NestedTypeCount = NestedTypeCountEnabled.GetCount(NestedTypeCountUpDown), - IncludeMethods = GUI.GetAllEntriesFromListBox(MethodIncludeBox), - ExcludeMethods = GUI.GetAllEntriesFromListBox(MethodExcludeBox), - IncludeFields = GUI.GetAllEntriesFromListBox(FieldIncludeBox), - ExcludeFields = GUI.GetAllEntriesFromListBox(FieldExcludeBox), - IncludeProperties = GUI.GetAllEntriesFromListBox(PropertiesIncludeBox), - ExcludeProperties = GUI.GetAllEntriesFromListBox(PropertiesExcludeBox), - IncludeNestedTypes = GUI.GetAllEntriesFromListBox(NestedTypesIncludeBox), - ExcludeNestedTypes = GUI.GetAllEntriesFromListBox(NestedTypesExcludeBox), + IncludeMethods = GUIHelpers.GetAllEntriesFromListBox(MethodIncludeBox), + ExcludeMethods = GUIHelpers.GetAllEntriesFromListBox(MethodExcludeBox), + IncludeFields = GUIHelpers.GetAllEntriesFromListBox(FieldIncludeBox), + ExcludeFields = GUIHelpers.GetAllEntriesFromListBox(FieldExcludeBox), + IncludeProperties = GUIHelpers.GetAllEntriesFromListBox(PropertiesIncludeBox), + ExcludeProperties = GUIHelpers.GetAllEntriesFromListBox(PropertiesExcludeBox), + IncludeNestedTypes = GUIHelpers.GetAllEntriesFromListBox(NestedTypesIncludeBox), + ExcludeNestedTypes = GUIHelpers.GetAllEntriesFromListBox(NestedTypesExcludeBox), } }; - RemapTreeView.Nodes.Add(GUI.GenerateTreeNode(remap, this)); + RemapTreeView.Nodes.Add(GUIHelpers.GenerateTreeNode(remap, this)); DataProvider.Remaps.Add(remap); ResetAll(); } @@ -98,7 +96,7 @@ public partial class AssemblyToolGUI : Form private void RunRemapButton_Click(object sender, EventArgs e) { - if (Remapper.IsRunning) { return; } + if (ReCodeItRemapper.IsRunning) { return; } Console.Clear(); @@ -136,7 +134,7 @@ public partial class AssemblyToolGUI : Form foreach (var remap in DataProvider.Remaps) { - RemapTreeView.Nodes.Add(GUI.GenerateTreeNode(remap, this)); + RemapTreeView.Nodes.Add(GUIHelpers.GenerateTreeNode(remap, this)); } } @@ -276,6 +274,134 @@ public partial class AssemblyToolGUI : Form #endregion BUTTONS + #region SETTINGS_TAB + + public void RefreshSettingsPage() + { + AssemblyPathTextBox.Text = DataProvider.Settings.AppSettings.AssemblyPath; + OutputPathTextBox.Text = DataProvider.Settings.AppSettings.OutputPath; + MappingPathTextBox.Text = DataProvider.Settings.AppSettings.MappingPath; + + DebugLoggingCheckbox.Checked = DataProvider.Settings.AppSettings.Debug; + SilentModeCheckbox.Checked = DataProvider.Settings.AppSettings.SilentMode; + RenameFieldsCheckbox.Checked = DataProvider.Settings.AppSettings.RenameFields; + RenamePropertiesCheckbox.Checked = DataProvider.Settings.AppSettings.RenameProperties; + PublicizeCheckbox.Checked = DataProvider.Settings.AppSettings.Publicize; + UnsealCheckbox.Checked = DataProvider.Settings.AppSettings.Unseal; + + MaxMatchCountUpDown.Value = DataProvider.Settings.Remapper.MaxMatchCount; + AutoMapperRequiredMatchesUpDown.Value = DataProvider.Settings.AutoMapper.RequiredMatches; + } + + #region SETTINGS_BUTTONS + + private void PickAssemblyPathButton_Click(object sender, EventArgs e) + { + OpenFileDialog fDialog = new() + { + Title = "Select a DLL file", + Filter = "DLL Files (*.dll)|*.dll|All Files (*.*)|*.*", + Multiselect = false + }; + + if (fDialog.ShowDialog() == DialogResult.OK) + { + DataProvider.Settings.AppSettings.AssemblyPath = fDialog.FileName; + DataProvider.LoadAssemblyDefinition(); + AssemblyPathTextBox.Text = fDialog.FileName; + } + } + + private void OutputDirectoryButton_Click(object sender, EventArgs e) + { + using FolderBrowserDialog fDialog = new(); + + fDialog.Description = "Select a directory"; + fDialog.ShowNewFolderButton = true; + + if (fDialog.ShowDialog() == DialogResult.OK) + { + DataProvider.Settings.AppSettings.OutputPath = fDialog.SelectedPath; + OutputPathTextBox.Text = fDialog.SelectedPath; + } + } + + private void MappingChooseButton_Click(object sender, EventArgs e) + { + var fDialog = new OpenFileDialog + { + Title = "Select a mapping file", + Filter = "JSON Files (*.json)|*.json|JSONC Files (*.jsonc)|*.jsonc|All Files (*.*)|*.*", + Multiselect = false + }; + + if (fDialog.ShowDialog() == DialogResult.OK) + { + DataProvider.LoadMappingFile(fDialog.FileName); + MappingPathTextBox.Text = fDialog.FileName; + } + } + + #endregion SETTINGS_BUTTONS + + #region CHECKBOXES + + private void DebugLoggingCheckbox_CheckedChanged(object sender, EventArgs e) + { + DataProvider.Settings.AppSettings.Debug = DebugLoggingCheckbox.Checked; + DataProvider.SaveAppSettings(); + } + + private void SilentModeCheckbox_CheckedChanged(object sender, EventArgs e) + { + DataProvider.Settings.AppSettings.SilentMode = SilentModeCheckbox.Checked; + DataProvider.SaveAppSettings(); + } + + private void RenameFieldsCheckbox_CheckedChanged(object sender, EventArgs e) + { + DataProvider.Settings.AppSettings.RenameFields = RenameFieldsCheckbox.Checked; + DataProvider.SaveAppSettings(); + } + + private void RenamePropertiesCheckbox_CheckedChanged(object sender, EventArgs e) + { + DataProvider.Settings.AppSettings.RenameProperties = RenamePropertiesCheckbox.Checked; + DataProvider.SaveAppSettings(); + } + + private void PublicizeCheckbox_CheckedChanged(object sender, EventArgs e) + { + DataProvider.Settings.AppSettings.Publicize = PublicizeCheckbox.Checked; + DataProvider.SaveAppSettings(); + } + + private void UnsealCheckbox_CheckedChanged(object sender, EventArgs e) + { + DataProvider.Settings.AppSettings.Unseal = UnsealCheckbox.Checked; + DataProvider.SaveAppSettings(); + } + + #endregion CHECKBOXES + + #region UPDOWNS + + private void MaxMatchCountUpDown_ValueChanged(object sender, EventArgs e) + { + DataProvider.Settings.Remapper.MaxMatchCount = (int)MaxMatchCountUpDown.Value; + DataProvider.SaveAppSettings(); + } + + private void AutoMapperRequiredMatchesUpDown_ValueChanged(object sender, EventArgs e) + { + DataProvider.Settings.AutoMapper.RequiredMatches = (int)AutoMapperRequiredMatchesUpDown.Value; + DataProvider.SaveAppSettings(); + } + + #endregion UPDOWNS + + #endregion SETTINGS_TAB + // Reset All UI elements to default private void ResetAll() { @@ -349,7 +475,7 @@ public partial class AssemblyToolGUI : Form foreach (var remap in DataProvider.Remaps) { - RemapTreeView.Nodes.Add(GUI.GenerateTreeNode(remap, this)); + RemapTreeView.Nodes.Add(GUIHelpers.GenerateTreeNode(remap, this)); } } } \ No newline at end of file diff --git a/AssemblyRemapperGUI/Form1.resx b/RecodeItGUI/GUI/Main.resx similarity index 100% rename from AssemblyRemapperGUI/Form1.resx rename to RecodeItGUI/GUI/Main.resx diff --git a/AssemblyRemapperGUI/Program.cs b/RecodeItGUI/Program.cs similarity index 82% rename from AssemblyRemapperGUI/Program.cs rename to RecodeItGUI/Program.cs index 18fde83..8682433 100644 --- a/AssemblyRemapperGUI/Program.cs +++ b/RecodeItGUI/Program.cs @@ -1,6 +1,7 @@ -using AssemblyRemapper.Utils; +using ReCodeIt.GUI; +using ReCodeIt.Utils; -namespace AssemblyRemapperGUI; +namespace ReCodeIt; internal static class Program { @@ -16,6 +17,6 @@ internal static class Program // To customize application configuration such as set high DPI settings or default font, see https://aka.ms/applicationconfiguration. ApplicationConfiguration.Initialize(); - Application.Run(new AssemblyToolGUI()); + Application.Run(new ReCodeItForm()); } } \ No newline at end of file diff --git a/AssemblyRemapperGUI/RemapperGUI.csproj b/RecodeItGUI/ReCodeItGUI.csproj similarity index 88% rename from AssemblyRemapperGUI/RemapperGUI.csproj rename to RecodeItGUI/ReCodeItGUI.csproj index ea147a4..1903880 100644 --- a/AssemblyRemapperGUI/RemapperGUI.csproj +++ b/RecodeItGUI/ReCodeItGUI.csproj @@ -8,12 +8,12 @@ enable - - - - + + + + \ No newline at end of file diff --git a/AssemblyRemapperGUI/Utils/GUI.cs b/RecodeItGUI/Utils/GUIHelpers.cs similarity index 97% rename from AssemblyRemapperGUI/Utils/GUI.cs rename to RecodeItGUI/Utils/GUIHelpers.cs index c322880..5e2f98a 100644 --- a/AssemblyRemapperGUI/Utils/GUI.cs +++ b/RecodeItGUI/Utils/GUIHelpers.cs @@ -1,9 +1,8 @@ -using AssemblyRemapper.Models; -using AssemblyRemapperGUI; +using ReCodeIt.Models; -namespace RemapperGUI.Utils; +namespace ReCodeIt.GUI; -internal static class GUI +internal static class GUIHelpers { /// /// Returns the value of the count or null if disabled @@ -60,7 +59,7 @@ internal static class GUI /// /// /// - public static TreeNode GenerateTreeNode(RemapModel model, AssemblyToolGUI gui) + public static TreeNode GenerateTreeNode(RemapModel model, ReCodeItForm gui) { var isPublic = model.SearchParams.IsPublic == null ? null : model.SearchParams.IsPublic; var isAbstract = model.SearchParams.IsAbstract == null ? null : model.SearchParams.IsAbstract; diff --git a/AssemblyRemapper/Enums/EFailureReason.cs b/RecodeItLib/Enums/EFailureReason.cs similarity index 92% rename from AssemblyRemapper/Enums/EFailureReason.cs rename to RecodeItLib/Enums/EFailureReason.cs index a7894b0..de0082f 100644 --- a/AssemblyRemapper/Enums/EFailureReason.cs +++ b/RecodeItLib/Enums/EFailureReason.cs @@ -1,4 +1,4 @@ -namespace AssemblyRemapper.Enums; +namespace ReCodeIt.Enums; public enum EFailureReason { diff --git a/AssemblyRemapper/Enums/ELogLevel.cs b/RecodeItLib/Enums/ELogLevel.cs similarity index 73% rename from AssemblyRemapper/Enums/ELogLevel.cs rename to RecodeItLib/Enums/ELogLevel.cs index 6ca234a..aef2fa8 100644 --- a/AssemblyRemapper/Enums/ELogLevel.cs +++ b/RecodeItLib/Enums/ELogLevel.cs @@ -1,4 +1,4 @@ -namespace AssemblyRemapper.Enums; +namespace ReCodeIt.Enums; internal enum ELogLevel { diff --git a/AssemblyRemapper/Enums/EMatchResult.cs b/RecodeItLib/Enums/EMatchResult.cs similarity index 73% rename from AssemblyRemapper/Enums/EMatchResult.cs rename to RecodeItLib/Enums/EMatchResult.cs index f5b15ae..7063301 100644 --- a/AssemblyRemapper/Enums/EMatchResult.cs +++ b/RecodeItLib/Enums/EMatchResult.cs @@ -1,4 +1,4 @@ -namespace AssemblyRemapper.Enums; +namespace ReCodeIt.Enums; internal enum EMatchResult { diff --git a/AssemblyRemapper/Models/AppSettingsModel.cs b/RecodeItLib/Models/AppSettingsModel.cs similarity index 96% rename from AssemblyRemapper/Models/AppSettingsModel.cs rename to RecodeItLib/Models/AppSettingsModel.cs index e296488..d16ddd7 100644 --- a/AssemblyRemapper/Models/AppSettingsModel.cs +++ b/RecodeItLib/Models/AppSettingsModel.cs @@ -1,4 +1,4 @@ -namespace AssemblyRemapper.Models; +namespace ReCodeIt.Models; /// /// Remap config diff --git a/AssemblyRemapper/Models/RemapModel.cs b/RecodeItLib/Models/RemapModel.cs similarity index 97% rename from AssemblyRemapper/Models/RemapModel.cs rename to RecodeItLib/Models/RemapModel.cs index 4b14b96..1669dc8 100644 --- a/AssemblyRemapper/Models/RemapModel.cs +++ b/RecodeItLib/Models/RemapModel.cs @@ -1,7 +1,7 @@ -using AssemblyRemapper.Enums; +using ReCodeIt.Enums; using Newtonsoft.Json; -namespace AssemblyRemapper.Models; +namespace ReCodeIt.Models; /// /// Object to store linq statements in inside of json to search and remap classes diff --git a/AssemblyRemapper/Models/ScoringModel.cs b/RecodeItLib/Models/ScoringModel.cs similarity index 83% rename from AssemblyRemapper/Models/ScoringModel.cs rename to RecodeItLib/Models/ScoringModel.cs index cf69205..a3dc0a6 100644 --- a/AssemblyRemapper/Models/ScoringModel.cs +++ b/RecodeItLib/Models/ScoringModel.cs @@ -1,7 +1,7 @@ -using AssemblyRemapper.Enums; +using ReCodeIt.Enums; using Mono.Cecil; -namespace AssemblyRemapper.Models; +namespace ReCodeIt.Models; public class ScoringModel { diff --git a/AssemblyRemapper/MapLib.csproj b/RecodeItLib/ReCodeItLib.csproj similarity index 100% rename from AssemblyRemapper/MapLib.csproj rename to RecodeItLib/ReCodeItLib.csproj diff --git a/AssemblyRemapper/Remapper/Publicizer.cs b/RecodeItLib/Remapper/Publicizer.cs similarity index 94% rename from AssemblyRemapper/Remapper/Publicizer.cs rename to RecodeItLib/Remapper/Publicizer.cs index bb8da3a..f6dbe8c 100644 --- a/AssemblyRemapper/Remapper/Publicizer.cs +++ b/RecodeItLib/Remapper/Publicizer.cs @@ -1,6 +1,6 @@ -using AssemblyRemapper.Utils; +using ReCodeIt.Utils; -namespace AssemblyRemapper.Remapper; +namespace ReCodeIt.ReMapper; public static class Publicizer { diff --git a/AssemblyRemapper/Remapper/Remapper.cs b/RecodeItLib/Remapper/ReCodeItRemapper.cs similarity index 97% rename from AssemblyRemapper/Remapper/Remapper.cs rename to RecodeItLib/Remapper/ReCodeItRemapper.cs index 9c739cf..aa79489 100644 --- a/AssemblyRemapper/Remapper/Remapper.cs +++ b/RecodeItLib/Remapper/ReCodeItRemapper.cs @@ -1,13 +1,13 @@ -using AssemblyRemapper.Enums; -using AssemblyRemapper.Models; -using AssemblyRemapper.Remapper.Search; -using AssemblyRemapper.Utils; -using Mono.Cecil; +using Mono.Cecil; +using ReCodeIt.Enums; +using ReCodeIt.Models; +using ReCodeIt.ReMapper.Search; +using ReCodeIt.Utils; using System.Diagnostics; -namespace AssemblyRemapper.Remapper; +namespace ReCodeIt.ReMapper; -public class Remapper +public class ReCodeItRemapper { public static bool IsRunning { get; private set; } = false; diff --git a/AssemblyRemapper/Remapper/Renamer.cs b/RecodeItLib/Remapper/Renamer.cs similarity index 96% rename from AssemblyRemapper/Remapper/Renamer.cs rename to RecodeItLib/Remapper/Renamer.cs index 48b0c9b..8262a4a 100644 --- a/AssemblyRemapper/Remapper/Renamer.cs +++ b/RecodeItLib/Remapper/Renamer.cs @@ -1,9 +1,9 @@ -using AssemblyRemapper.Models; -using AssemblyRemapper.Utils; +using ReCodeIt.Models; +using ReCodeIt.Utils; using Mono.Cecil; using Mono.Collections.Generic; -namespace AssemblyRemapper.Remapper; +namespace ReCodeIt.ReMapper; internal static class Renamer { diff --git a/AssemblyRemapper/Remapper/Search/Constructors.cs b/RecodeItLib/Remapper/Search/Constructors.cs similarity index 87% rename from AssemblyRemapper/Remapper/Search/Constructors.cs rename to RecodeItLib/Remapper/Search/Constructors.cs index 7c7e719..a19bf3a 100644 --- a/AssemblyRemapper/Remapper/Search/Constructors.cs +++ b/RecodeItLib/Remapper/Search/Constructors.cs @@ -1,9 +1,9 @@ -using AssemblyRemapper.Enums; -using AssemblyRemapper.Models; +using ReCodeIt.Enums; +using ReCodeIt.Models; using Mono.Cecil; using Mono.Cecil.Rocks; -namespace AssemblyRemapper.Remapper.Search; +namespace ReCodeIt.ReMapper.Search; internal static class Constructors { diff --git a/AssemblyRemapper/Remapper/Search/Fields.cs b/RecodeItLib/Remapper/Search/Fields.cs similarity index 95% rename from AssemblyRemapper/Remapper/Search/Fields.cs rename to RecodeItLib/Remapper/Search/Fields.cs index d884df7..22e04a4 100644 --- a/AssemblyRemapper/Remapper/Search/Fields.cs +++ b/RecodeItLib/Remapper/Search/Fields.cs @@ -1,9 +1,9 @@ -using AssemblyRemapper.Enums; -using AssemblyRemapper.Models; +using ReCodeIt.Enums; +using ReCodeIt.Models; using Mono.Cecil; using MoreLinq; -namespace AssemblyRemapper.Remapper.Search; +namespace ReCodeIt.ReMapper.Search; internal static class Fields { diff --git a/AssemblyRemapper/Remapper/Search/Methods.cs b/RecodeItLib/Remapper/Search/Methods.cs similarity index 96% rename from AssemblyRemapper/Remapper/Search/Methods.cs rename to RecodeItLib/Remapper/Search/Methods.cs index 4f28780..90ad48a 100644 --- a/AssemblyRemapper/Remapper/Search/Methods.cs +++ b/RecodeItLib/Remapper/Search/Methods.cs @@ -1,9 +1,9 @@ -using AssemblyRemapper.Enums; -using AssemblyRemapper.Models; +using ReCodeIt.Enums; +using ReCodeIt.Models; using Mono.Cecil; using Mono.Cecil.Rocks; -namespace AssemblyRemapper.Remapper.Search; +namespace ReCodeIt.ReMapper.Search; internal static class Methods { diff --git a/AssemblyRemapper/Remapper/Search/NestedTypes.cs b/RecodeItLib/Remapper/Search/NestedTypes.cs similarity index 94% rename from AssemblyRemapper/Remapper/Search/NestedTypes.cs rename to RecodeItLib/Remapper/Search/NestedTypes.cs index c0467cb..a8bac25 100644 --- a/AssemblyRemapper/Remapper/Search/NestedTypes.cs +++ b/RecodeItLib/Remapper/Search/NestedTypes.cs @@ -1,9 +1,9 @@ -using AssemblyRemapper.Enums; -using AssemblyRemapper.Models; +using ReCodeIt.Enums; +using ReCodeIt.Models; using Mono.Cecil; using MoreLinq; -namespace AssemblyRemapper.Remapper.Search; +namespace ReCodeIt.ReMapper.Search; internal class NestedTypes { diff --git a/AssemblyRemapper/Remapper/Search/Properties.cs b/RecodeItLib/Remapper/Search/Properties.cs similarity index 94% rename from AssemblyRemapper/Remapper/Search/Properties.cs rename to RecodeItLib/Remapper/Search/Properties.cs index 3826e73..e9a98f6 100644 --- a/AssemblyRemapper/Remapper/Search/Properties.cs +++ b/RecodeItLib/Remapper/Search/Properties.cs @@ -1,9 +1,9 @@ -using AssemblyRemapper.Enums; -using AssemblyRemapper.Models; +using ReCodeIt.Enums; +using ReCodeIt.Models; using Mono.Cecil; using MoreLinq; -namespace AssemblyRemapper.Remapper.Search +namespace ReCodeIt.ReMapper.Search { internal class Properties { diff --git a/AssemblyRemapper/Remapper/Search/TypeDefExtensions.cs b/RecodeItLib/Remapper/Search/TypeDefExtensions.cs similarity index 98% rename from AssemblyRemapper/Remapper/Search/TypeDefExtensions.cs rename to RecodeItLib/Remapper/Search/TypeDefExtensions.cs index f8d18bf..820895d 100644 --- a/AssemblyRemapper/Remapper/Search/TypeDefExtensions.cs +++ b/RecodeItLib/Remapper/Search/TypeDefExtensions.cs @@ -1,10 +1,10 @@ -using AssemblyRemapper.Enums; -using AssemblyRemapper.Models; -using AssemblyRemapper.Utils; +using ReCodeIt.Enums; +using ReCodeIt.Models; +using ReCodeIt.Utils; using Mono.Cecil; using Mono.Cecil.Rocks; -namespace AssemblyRemapper.Remapper.Search; +namespace ReCodeIt.ReMapper.Search; internal static class TypeDefExtensions { diff --git a/AssemblyRemapper/Utils/DataProvider.cs b/RecodeItLib/Utils/DataProvider.cs similarity index 98% rename from AssemblyRemapper/Utils/DataProvider.cs rename to RecodeItLib/Utils/DataProvider.cs index 2b2bfaa..511bf35 100644 --- a/AssemblyRemapper/Utils/DataProvider.cs +++ b/RecodeItLib/Utils/DataProvider.cs @@ -1,8 +1,8 @@ -using AssemblyRemapper.Models; +using ReCodeIt.Models; using Mono.Cecil; using Newtonsoft.Json; -namespace AssemblyRemapper.Utils; +namespace ReCodeIt.Utils; public static class DataProvider { diff --git a/AssemblyRemapper/Utils/EnumHelpers.cs b/RecodeItLib/Utils/EnumHelpers.cs similarity index 91% rename from AssemblyRemapper/Utils/EnumHelpers.cs rename to RecodeItLib/Utils/EnumHelpers.cs index 5854f71..c9297f0 100644 --- a/AssemblyRemapper/Utils/EnumHelpers.cs +++ b/RecodeItLib/Utils/EnumHelpers.cs @@ -1,7 +1,7 @@ -using AssemblyRemapper.Enums; +using ReCodeIt.Enums; using MoreLinq.Extensions; -namespace AssemblyRemapper.Utils; +namespace ReCodeIt.Utils; internal static class EnumExtensions { diff --git a/AssemblyRemapper/Utils/ExtentionMethods.cs b/RecodeItLib/Utils/ExtentionMethods.cs similarity index 95% rename from AssemblyRemapper/Utils/ExtentionMethods.cs rename to RecodeItLib/Utils/ExtentionMethods.cs index bd496aa..97e565d 100644 --- a/AssemblyRemapper/Utils/ExtentionMethods.cs +++ b/RecodeItLib/Utils/ExtentionMethods.cs @@ -1,6 +1,6 @@ -using AssemblyRemapper.Models; +using ReCodeIt.Models; -namespace AssemblyRemapper.Utils; +namespace ReCodeIt.Utils; internal static class ExtentionMethods { diff --git a/AssemblyRemapper/Utils/Logger.cs b/RecodeItLib/Utils/Logger.cs similarity index 97% rename from AssemblyRemapper/Utils/Logger.cs rename to RecodeItLib/Utils/Logger.cs index b88ee36..c5112c5 100644 --- a/AssemblyRemapper/Utils/Logger.cs +++ b/RecodeItLib/Utils/Logger.cs @@ -1,4 +1,4 @@ -namespace AssemblyRemapper.Utils; +namespace ReCodeIt.Utils; public static class Logger {