Minor remapper fixes

This commit is contained in:
Cj 2024-06-21 17:01:07 -04:00
parent 6fae190b6e
commit 5e71f13100
3 changed files with 13 additions and 9 deletions

View File

@ -286,6 +286,7 @@ public class ReCodeItRemapper
}
// Rename type and all associated type members
RenameHelper.RenameAll(highestScore);
Logger.Log("-----------------------------------------------", ConsoleColor.Green);
@ -296,10 +297,7 @@ public class ReCodeItRemapper
/// </summary>
private void WriteAssembly()
{
var fileName = Path.GetFileName(AssemblyPath);
var path = Path.Combine(OutPath, fileName);
path = DataProvider.WriteAssemblyDefinition(path);
var path = DataProvider.WriteAssemblyDefinition(OutPath);
Logger.Log("-----------------------------------------------", ConsoleColor.Green);
Logger.Log($"Complete: Assembly written to `{path}`", ConsoleColor.Green);

View File

@ -18,8 +18,15 @@ internal static class RenameHelper
var types = DataProvider.ModuleDefinition.Types;
// Rename all fields and properties first
RenameAllFields(score.Definition.Name, score.ReMap.NewTypeName, types);
RenameAllProperties(score.Definition.Name, score.ReMap.NewTypeName, types);
if (DataProvider.Settings.Remapper.MappingSettings.RenameFields)
{
RenameAllFields(score.Definition.Name, score.ReMap.NewTypeName, types);
}
if (DataProvider.Settings.Remapper.MappingSettings.RenameProperties)
{
RenameAllProperties(score.Definition.Name, score.ReMap.NewTypeName, types);
}
if (!direct)
{

View File

@ -1,5 +1,4 @@
using Mono.Cecil;
using Mono.Cecil.Rocks;
using ReCodeIt.Enums;
using ReCodeIt.Models;
using ReCodeIt.Utils;
@ -15,8 +14,8 @@ internal static class TypeDefExtensions
return EMatchResult.Disabled;
}
// Interfaces cannot be abstract, and abstract cannot be static
if (type.IsInterface || type.GetStaticConstructor() is not null)
// Interfaces cannot be abstract
if (type.IsInterface)
{
score.FailureReason = EFailureReason.IsAbstract;
return EMatchResult.NoMatch;