diff --git a/AssemblyRemapper/AssemblyRemapper.csproj b/AssemblyRemapper/AssemblyRemapper.csproj
index b21798a..011673a 100644
--- a/AssemblyRemapper/AssemblyRemapper.csproj
+++ b/AssemblyRemapper/AssemblyRemapper.csproj
@@ -12,4 +12,8 @@
+
+
+
+
diff --git a/AssemblyRemapper/Models/ScoringModel.cs b/AssemblyRemapper/Models/ScoringModel.cs
index 49be8c1..353f2eb 100644
--- a/AssemblyRemapper/Models/ScoringModel.cs
+++ b/AssemblyRemapper/Models/ScoringModel.cs
@@ -6,9 +6,7 @@ namespace AssemblyRemapper.Models;
internal class ScoringModel
{
public string ProposedNewName { get; set; }
- public RemapModel Remap { get; set; }
public int Score { get; set; } = 0;
-
public TypeDefinition Definition { get; set; }
public RemapModel RemapModel { get; internal set; }
diff --git a/AssemblyRemapper/Reflection/Remapper.cs b/AssemblyRemapper/Reflection/Remapper.cs
index bd7fd1b..515a4cd 100644
--- a/AssemblyRemapper/Reflection/Remapper.cs
+++ b/AssemblyRemapper/Reflection/Remapper.cs
@@ -251,13 +251,10 @@ internal class Remapper
Logger.Log("-----------------------------------------------", ConsoleColor.Green);
Logger.Log($"Renaming {highestScore.Definition.Name} to {highestScore.ProposedNewName}", ConsoleColor.Green);
+ RenameService.RenameAllFields(highestScore.RemapModel, DataProvider.ModuleDefinition.Types);
+ RenameService.RenameAllProperties(highestScore.RemapModel, DataProvider.ModuleDefinition.Types);
highestScore.Definition.Name = highestScore.ProposedNewName;
- foreach (var score in nextHighestScores)
- {
- Logger.Log($"Alternative match `{score.Definition.Name}` for `{highestScore.ProposedNewName}`", ConsoleColor.Yellow);
- }
-
if (DataProvider.AppSettings.ScoringMode)
{
scores.Remove(highestScore);
diff --git a/AssemblyRemapper/Reflection/RenameService.cs b/AssemblyRemapper/Reflection/RenameService.cs
index e7c0df0..181f173 100644
--- a/AssemblyRemapper/Reflection/RenameService.cs
+++ b/AssemblyRemapper/Reflection/RenameService.cs
@@ -19,8 +19,12 @@ internal static class RenameService
{
if (field.FieldType.ToString() == remap.NewTypeName)
{
- Logger.Log($"Renaming Field: `{field.Name}` on Type `{type}`");
- field.Name = GetNewFieldName(remap.NewTypeName, field.IsPrivate, fieldCount);
+ var newFieldName = GetNewFieldName(remap.NewTypeName, field.IsPrivate, fieldCount);
+
+ Logger.Log($"Renaming: `{field.Name}` on Type `{type}` to {remap.NewTypeName}");
+
+ field.Name = newFieldName;
+
fieldCount++;
}
}
diff --git a/Templates/MappingTemplate.jsonc b/Templates/MappingTemplate.jsonc
new file mode 100644
index 0000000..39bed31
--- /dev/null
+++ b/Templates/MappingTemplate.jsonc
@@ -0,0 +1,46 @@
+[
+ // TEMPLATE
+ // NOTE: You only need to add the properties you need inside of `SearchParams`
+ {
+ "NewTypeName": "TEMPLATE", // This is the name we want to change it to
+ "OriginalTypeName": "", // This is the name of the object in the assembly, Can be used to store what type you're changing as its not read unless "UseDirectRename" is true, it is also written to after remapping
+ "UseForceRename": false, // If this is true, directly remap using the name in the assembly from the above property
+ "SearchParams": {
+ "IsPublic": true, // Is the Type public?
+ "IsAbstract": false, // Is the Type Abstract?
+ "IsInterface": false, // Is the Type an Interface?
+ "IsEnum": false, // Is the Type an Enum?
+ "IsNested": false, // Is the Type Nested?
+ "ParentName": "", // The Name of the parent type if it is nested, can be left empty
+ "IsSealed": false, // Is the Type Sealed?
+ "HasAttribute": false, // Does the Type have an attribute?
+ "IsDerived": true, // Does the Type inherit from another Type?
+ "HasGenericParameters": false, // Does the type have generic parameters?
+ "MethodNamesToMatch": [ // This is a list of methods we want to match
+ "Foo"
+ ],
+ "MethodNamesToIgnore": [ // This is a list of methods we want to ignore
+ "Foo",
+ "*" // Ignore all Types that have methods, this wildcard can be used on any ignore list
+ ],
+ "FieldNamesToMatch": [ // This is a list of fields we want to match
+ "_fooBar"
+ ],
+ "FieldNamesToIgnore": [ // This is a list of fields we want to ignore
+ "Foo"
+ ],
+ "PropertyNamesToMatch": [ // This is a list of properties we want to match
+ "FooBar"
+ ],
+ "PropertyNamesToIgnore": [ // This is a list of properties we want to ignore
+ "Foo"
+ ],
+ "NestedTypesToMatch": [ // This is a list of nested types we want to match
+ "FooBarFoo"
+ ],
+ "NestedTypesToIgnore": [ // This is a list of nested types we want to match ignore
+ "FooBarFoo"
+ ]
+ }
+ }
+]
\ No newline at end of file
diff --git a/Templates/Settings.jsonc b/Templates/Settings.jsonc
new file mode 100644
index 0000000..f01a656
--- /dev/null
+++ b/Templates/Settings.jsonc
@@ -0,0 +1,9 @@
+{
+ "Debug": false, // Enables extra debug logging, slows down the program by alot
+ "SilentMode": true, // The tool will stop and prompt you to continue on every remapping if disabled
+ "Publicize": true, // Publicize all types, methods, and properties : NOTE: Not run until after the remap has completed
+ "Unseal": true, // Unseal all types : NOTE: Not run until after the remap has completed
+ "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
+ "MappingPath": "./Data/Mappings.jsonc" // Path to the mapping file
+}