mirror of
https://github.com/sp-tarkov/assembly-tool.git
synced 2025-02-13 05:10:46 -05:00
Finish migration
This commit is contained in:
parent
572b3e037f
commit
664ff994cf
File diff suppressed because it is too large
Load Diff
@ -194,6 +194,8 @@ public partial class ReCodeItForm : Form
|
|||||||
OriginalTypeName = OriginalTypeName.Text == string.Empty ? null : OriginalTypeName.Text,
|
OriginalTypeName = OriginalTypeName.Text == string.Empty ? null : OriginalTypeName.Text,
|
||||||
UseForceRename = RemapperUseForceRename.Checked,
|
UseForceRename = RemapperUseForceRename.Checked,
|
||||||
SearchParams = new SearchParams
|
SearchParams = new SearchParams
|
||||||
|
{
|
||||||
|
GenericParams =
|
||||||
{
|
{
|
||||||
IsPublic = bool.Parse(IsPublicComboBox.GetSelectedItem<string>().AsSpan()),
|
IsPublic = bool.Parse(IsPublicComboBox.GetSelectedItem<string>().AsSpan()),
|
||||||
|
|
||||||
@ -239,6 +241,7 @@ public partial class ReCodeItForm : Form
|
|||||||
IgnoreBaseClass = BaseClassExcludeTextField.Text == string.Empty
|
IgnoreBaseClass = BaseClassExcludeTextField.Text == string.Empty
|
||||||
? null
|
? null
|
||||||
: BaseClassExcludeTextField.Text,
|
: BaseClassExcludeTextField.Text,
|
||||||
|
},
|
||||||
|
|
||||||
Methods =
|
Methods =
|
||||||
{
|
{
|
||||||
@ -825,9 +828,9 @@ public partial class ReCodeItForm : Form
|
|||||||
OriginalTypeName.Text = remap.OriginalTypeName;
|
OriginalTypeName.Text = remap.OriginalTypeName;
|
||||||
RemapperUseForceRename.Checked = remap.UseForceRename;
|
RemapperUseForceRename.Checked = remap.UseForceRename;
|
||||||
|
|
||||||
BaseClassIncludeTextFIeld.Text = remap.SearchParams.MatchBaseClass;
|
BaseClassIncludeTextFIeld.Text = remap.SearchParams.GenericParams.MatchBaseClass;
|
||||||
BaseClassExcludeTextField.Text = remap.SearchParams.IgnoreBaseClass;
|
BaseClassExcludeTextField.Text = remap.SearchParams.GenericParams.IgnoreBaseClass;
|
||||||
NestedTypeParentName.Text = remap.SearchParams.NTParentName;
|
NestedTypeParentName.Text = remap.SearchParams.GenericParams.NTParentName;
|
||||||
|
|
||||||
ConstructorCountEnabled.Checked = remap.SearchParams.Methods.ConstructorParameterCount >= 0;
|
ConstructorCountEnabled.Checked = remap.SearchParams.Methods.ConstructorParameterCount >= 0;
|
||||||
|
|
||||||
@ -849,38 +852,38 @@ public partial class ReCodeItForm : Form
|
|||||||
|
|
||||||
NestedTypeCountUpDown.Value = remap.SearchParams.NestedTypes.NestedTypeCount;
|
NestedTypeCountUpDown.Value = remap.SearchParams.NestedTypes.NestedTypeCount;
|
||||||
|
|
||||||
IsPublicComboBox.SelectedItem = remap.SearchParams.IsPublic.ToString();
|
IsPublicComboBox.SelectedItem = remap.SearchParams.GenericParams.IsPublic.ToString();
|
||||||
|
|
||||||
IsAbstractComboBox.SelectedItem = remap.SearchParams.IsAbstract is not null
|
IsAbstractComboBox.SelectedItem = remap.SearchParams.GenericParams.IsAbstract is not null
|
||||||
? remap.SearchParams.IsAbstract.ToString()
|
? remap.SearchParams.GenericParams.IsAbstract.ToString()
|
||||||
: "Disabled";
|
: "Disabled";
|
||||||
|
|
||||||
IsSealedComboBox.SelectedItem = remap.SearchParams.IsSealed is not null
|
IsSealedComboBox.SelectedItem = remap.SearchParams.GenericParams.IsSealed is not null
|
||||||
? remap.SearchParams.IsSealed.ToString()
|
? remap.SearchParams.GenericParams.IsSealed.ToString()
|
||||||
: "Disabled";
|
: "Disabled";
|
||||||
|
|
||||||
IsInterfaceComboBox.SelectedItem = remap.SearchParams.IsInterface is not null
|
IsInterfaceComboBox.SelectedItem = remap.SearchParams.GenericParams.IsInterface is not null
|
||||||
? remap.SearchParams.IsInterface.ToString()
|
? remap.SearchParams.GenericParams.IsInterface.ToString()
|
||||||
: "Disabled";
|
: "Disabled";
|
||||||
|
|
||||||
IsStructComboBox.SelectedItem = remap.SearchParams.IsStruct is not null
|
IsStructComboBox.SelectedItem = remap.SearchParams.GenericParams.IsStruct is not null
|
||||||
? remap.SearchParams.IsStruct.ToString()
|
? remap.SearchParams.GenericParams.IsStruct.ToString()
|
||||||
: "Disabled";
|
: "Disabled";
|
||||||
|
|
||||||
IsEnumComboBox.SelectedItem = remap.SearchParams.IsEnum is not null
|
IsEnumComboBox.SelectedItem = remap.SearchParams.GenericParams.IsEnum is not null
|
||||||
? remap.SearchParams.IsEnum.ToString()
|
? remap.SearchParams.GenericParams.IsEnum.ToString()
|
||||||
: "Disabled";
|
: "Disabled";
|
||||||
|
|
||||||
HasAttributeComboBox.SelectedItem = remap.SearchParams.HasAttribute is not null
|
HasAttributeComboBox.SelectedItem = remap.SearchParams.GenericParams.HasAttribute is not null
|
||||||
? remap.SearchParams.HasAttribute.ToString()
|
? remap.SearchParams.GenericParams.HasAttribute.ToString()
|
||||||
: "Disabled";
|
: "Disabled";
|
||||||
|
|
||||||
HasGenericParamsComboBox.SelectedItem = remap.SearchParams.HasGenericParameters is not null
|
HasGenericParamsComboBox.SelectedItem = remap.SearchParams.GenericParams.HasGenericParameters is not null
|
||||||
? remap.SearchParams.HasGenericParameters.ToString()
|
? remap.SearchParams.GenericParams.HasGenericParameters.ToString()
|
||||||
: "Disabled";
|
: "Disabled";
|
||||||
|
|
||||||
IsNestedUpDown.BuildStringList("IsNested", false, remap.SearchParams.IsNested);
|
IsNestedUpDown.BuildStringList("IsNested", false, remap.SearchParams.GenericParams.IsNested);
|
||||||
IsDerivedUpDown.BuildStringList("IsDerived", false, remap.SearchParams.IsDerived);
|
IsDerivedUpDown.BuildStringList("IsDerived", false, remap.SearchParams.GenericParams.IsDerived);
|
||||||
|
|
||||||
foreach (var method in remap.SearchParams.Methods.IncludeMethods)
|
foreach (var method in remap.SearchParams.Methods.IncludeMethods)
|
||||||
{
|
{
|
||||||
|
@ -101,16 +101,16 @@ internal static class GUIHelpers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static TreeNode GenerateTreeNode(RemapModel model, ReCodeItForm gui)
|
public static TreeNode GenerateTreeNode(RemapModel model, ReCodeItForm gui)
|
||||||
{
|
{
|
||||||
var isPublic = model.SearchParams.IsPublic;
|
var isPublic = model.SearchParams.GenericParams.IsPublic;
|
||||||
var isAbstract = model.SearchParams.IsAbstract == null ? null : model.SearchParams.IsAbstract;
|
var isAbstract = model.SearchParams.GenericParams.IsAbstract == null ? null : model.SearchParams.GenericParams.IsAbstract;
|
||||||
var isInterface = model.SearchParams.IsInterface == null ? null : model.SearchParams.IsInterface;
|
var isInterface = model.SearchParams.GenericParams.IsInterface == null ? null : model.SearchParams.GenericParams.IsInterface;
|
||||||
var isStruct = model.SearchParams.IsStruct == null ? null : model.SearchParams.IsStruct;
|
var isStruct = model.SearchParams.GenericParams.IsStruct == null ? null : model.SearchParams.GenericParams.IsStruct;
|
||||||
var isEnum = model.SearchParams.IsEnum == null ? null : model.SearchParams.IsEnum;
|
var isEnum = model.SearchParams.GenericParams.IsEnum == null ? null : model.SearchParams.GenericParams.IsEnum;
|
||||||
var isNested = model.SearchParams.IsNested == null ? null : model.SearchParams.IsNested;
|
var isNested = model.SearchParams.GenericParams.IsNested == null ? null : model.SearchParams.GenericParams.IsNested;
|
||||||
var isSealed = model.SearchParams.IsSealed == null ? null : model.SearchParams.IsSealed;
|
var isSealed = model.SearchParams.GenericParams.IsSealed == null ? null : model.SearchParams.GenericParams.IsSealed;
|
||||||
var HasAttribute = model.SearchParams.HasAttribute == null ? null : model.SearchParams.HasAttribute;
|
var HasAttribute = model.SearchParams.GenericParams.HasAttribute == null ? null : model.SearchParams.GenericParams.HasAttribute;
|
||||||
var IsDerived = model.SearchParams.IsDerived == null ? null : model.SearchParams.IsDerived;
|
var IsDerived = model.SearchParams.GenericParams.IsDerived == null ? null : model.SearchParams.GenericParams.IsDerived;
|
||||||
var HasGenericParameters = model.SearchParams.HasGenericParameters == null ? null : model.SearchParams.HasGenericParameters;
|
var HasGenericParameters = model.SearchParams.GenericParams.HasGenericParameters == null ? null : model.SearchParams.GenericParams.HasGenericParameters;
|
||||||
|
|
||||||
var remapTreeItem = new TreeNode($"{model.NewTypeName}");
|
var remapTreeItem = new TreeNode($"{model.NewTypeName}");
|
||||||
|
|
||||||
|
@ -43,11 +43,16 @@ public class RemapModel
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class SearchParams
|
public class SearchParams
|
||||||
{
|
{
|
||||||
#region BOOL_PARAMS
|
public GenericParams GenericParams { get; set; } = new();
|
||||||
|
public MethodParams Methods { get; set; } = new();
|
||||||
|
public FieldParams Fields { get; set; } = new();
|
||||||
|
public PropertyParams Properties { get; set; } = new();
|
||||||
|
public NestedTypeParams NestedTypes { get; set; } = new();
|
||||||
|
public EventParams Events { get; set; } = new();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
public class GenericParams
|
||||||
/// Default to true, most types are public
|
{
|
||||||
/// </summary>
|
|
||||||
public bool IsPublic { get; set; } = true;
|
public bool IsPublic { get; set; } = true;
|
||||||
|
|
||||||
public bool? IsAbstract { get; set; } = null;
|
public bool? IsAbstract { get; set; } = null;
|
||||||
@ -55,19 +60,14 @@ public class SearchParams
|
|||||||
public bool? IsStruct { get; set; } = null;
|
public bool? IsStruct { get; set; } = null;
|
||||||
public bool? IsEnum { get; set; } = null;
|
public bool? IsEnum { get; set; } = null;
|
||||||
public bool? IsNested { get; set; } = null;
|
public bool? IsNested { get; set; } = null;
|
||||||
public bool? IsSealed { get; set; } = null;
|
|
||||||
public bool? HasAttribute { get; set; } = null;
|
|
||||||
public bool? IsDerived { get; set; } = null;
|
|
||||||
public bool? HasGenericParameters { get; set; } = null;
|
|
||||||
|
|
||||||
#endregion BOOL_PARAMS
|
|
||||||
|
|
||||||
#region STR_PARAMS
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Name of the nested types parent
|
/// Name of the nested types parent
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? NTParentName { get; set; } = null;
|
public string? NTParentName { get; set; } = null;
|
||||||
|
public bool? IsSealed { get; set; } = null;
|
||||||
|
public bool? HasAttribute { get; set; } = null;
|
||||||
|
public bool? IsDerived { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Name of the derived classes declaring type
|
/// Name of the derived classes declaring type
|
||||||
@ -78,18 +78,7 @@ public class SearchParams
|
|||||||
/// Name of the derived classes declaring type we want to ignore
|
/// Name of the derived classes declaring type we want to ignore
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? IgnoreBaseClass { get; set; } = null;
|
public string? IgnoreBaseClass { get; set; } = null;
|
||||||
|
public bool? HasGenericParameters { get; set; } = null;
|
||||||
#endregion STR_PARAMS
|
|
||||||
|
|
||||||
#region LISTS
|
|
||||||
|
|
||||||
public MethodParams Methods { get; set; } = new();
|
|
||||||
public FieldParams Fields { get; set; } = new();
|
|
||||||
public PropertyParams Properties { get; set; } = new();
|
|
||||||
public NestedTypeParams NestedTypes { get; set; } = new();
|
|
||||||
public EventParams Events { get; set; } = new();
|
|
||||||
|
|
||||||
#endregion LISTS
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class MethodParams
|
public class MethodParams
|
||||||
|
@ -15,9 +15,9 @@ internal static class GenericTypeFilters
|
|||||||
public static IEnumerable<TypeDef> FilterPublic(IEnumerable<TypeDef> types, SearchParams parms)
|
public static IEnumerable<TypeDef> FilterPublic(IEnumerable<TypeDef> types, SearchParams parms)
|
||||||
{
|
{
|
||||||
// REQUIRED PROPERTY
|
// REQUIRED PROPERTY
|
||||||
if (parms.IsPublic)
|
if (parms.GenericParams.IsPublic)
|
||||||
{
|
{
|
||||||
if (parms.IsNested is true)
|
if (parms.GenericParams.IsNested is true)
|
||||||
{
|
{
|
||||||
types = types.Where(t => t.IsNestedPublic);
|
types = types.Where(t => t.IsNestedPublic);
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ internal static class GenericTypeFilters
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (parms.IsNested is true)
|
if (parms.GenericParams.IsNested is true)
|
||||||
{
|
{
|
||||||
types = types.Where(t => t.IsNestedPrivate
|
types = types.Where(t => t.IsNestedPrivate
|
||||||
|| t.IsNestedFamily
|
|| t.IsNestedFamily
|
||||||
@ -50,9 +50,9 @@ internal static class GenericTypeFilters
|
|||||||
|
|
||||||
private static IEnumerable<TypeDef> FilterNestedByName(IEnumerable<TypeDef> types, SearchParams parms)
|
private static IEnumerable<TypeDef> FilterNestedByName(IEnumerable<TypeDef> types, SearchParams parms)
|
||||||
{
|
{
|
||||||
if (parms.NTParentName is not null)
|
if (parms.GenericParams.NTParentName is not null)
|
||||||
{
|
{
|
||||||
types = types.Where(t => t.DeclaringType.Name.String == parms.NTParentName);
|
types = types.Where(t => t.DeclaringType.Name.String == parms.GenericParams.NTParentName);
|
||||||
}
|
}
|
||||||
|
|
||||||
return types;
|
return types;
|
||||||
@ -67,11 +67,11 @@ internal static class GenericTypeFilters
|
|||||||
public static IEnumerable<TypeDef> FilterAbstract(IEnumerable<TypeDef> types, SearchParams parms)
|
public static IEnumerable<TypeDef> FilterAbstract(IEnumerable<TypeDef> types, SearchParams parms)
|
||||||
{
|
{
|
||||||
// Filter based on abstract or not
|
// Filter based on abstract or not
|
||||||
if (parms.IsAbstract is true)
|
if (parms.GenericParams.IsAbstract is true)
|
||||||
{
|
{
|
||||||
types = types.Where(t => t.IsAbstract && !t.IsInterface);
|
types = types.Where(t => t.IsAbstract && !t.IsInterface);
|
||||||
}
|
}
|
||||||
else if (parms.IsAbstract is false)
|
else if (parms.GenericParams.IsAbstract is false)
|
||||||
{
|
{
|
||||||
types = types.Where(t => !t.IsAbstract);
|
types = types.Where(t => !t.IsAbstract);
|
||||||
}
|
}
|
||||||
@ -88,11 +88,11 @@ internal static class GenericTypeFilters
|
|||||||
public static IEnumerable<TypeDef> FilterSealed(IEnumerable<TypeDef> types, SearchParams parms)
|
public static IEnumerable<TypeDef> FilterSealed(IEnumerable<TypeDef> types, SearchParams parms)
|
||||||
{
|
{
|
||||||
// Filter based on abstract or not
|
// Filter based on abstract or not
|
||||||
if (parms.IsSealed is true)
|
if (parms.GenericParams.IsSealed is true)
|
||||||
{
|
{
|
||||||
types = types.Where(t => t.IsSealed);
|
types = types.Where(t => t.IsSealed);
|
||||||
}
|
}
|
||||||
else if (parms.IsSealed is false)
|
else if (parms.GenericParams.IsSealed is false)
|
||||||
{
|
{
|
||||||
types = types.Where(t => !t.IsSealed);
|
types = types.Where(t => !t.IsSealed);
|
||||||
}
|
}
|
||||||
@ -109,11 +109,11 @@ internal static class GenericTypeFilters
|
|||||||
public static IEnumerable<TypeDef> FilterInterface(IEnumerable<TypeDef> types, SearchParams parms)
|
public static IEnumerable<TypeDef> FilterInterface(IEnumerable<TypeDef> types, SearchParams parms)
|
||||||
{
|
{
|
||||||
// Filter based on interface or not
|
// Filter based on interface or not
|
||||||
if (parms.IsInterface is true)
|
if (parms.GenericParams.IsInterface is true)
|
||||||
{
|
{
|
||||||
types = types.Where(t => t.IsInterface);
|
types = types.Where(t => t.IsInterface);
|
||||||
}
|
}
|
||||||
else if (parms.IsInterface is false)
|
else if (parms.GenericParams.IsInterface is false)
|
||||||
{
|
{
|
||||||
types = types.Where(t => !t.IsInterface);
|
types = types.Where(t => !t.IsInterface);
|
||||||
}
|
}
|
||||||
@ -129,11 +129,11 @@ internal static class GenericTypeFilters
|
|||||||
/// <returns>Filtered list</returns>
|
/// <returns>Filtered list</returns>
|
||||||
public static IEnumerable<TypeDef> FilterStruct(IEnumerable<TypeDef> types, SearchParams parms)
|
public static IEnumerable<TypeDef> FilterStruct(IEnumerable<TypeDef> types, SearchParams parms)
|
||||||
{
|
{
|
||||||
if (parms.IsStruct is true)
|
if (parms.GenericParams.IsStruct is true)
|
||||||
{
|
{
|
||||||
types = types.Where(t => t.IsValueType && !t.IsEnum);
|
types = types.Where(t => t.IsValueType && !t.IsEnum);
|
||||||
}
|
}
|
||||||
else if (parms.IsStruct is false)
|
else if (parms.GenericParams.IsStruct is false)
|
||||||
{
|
{
|
||||||
types = types.Where(t => !t.IsValueType);
|
types = types.Where(t => !t.IsValueType);
|
||||||
}
|
}
|
||||||
@ -150,11 +150,11 @@ internal static class GenericTypeFilters
|
|||||||
public static IEnumerable<TypeDef> FilterEnum(IEnumerable<TypeDef> types, SearchParams parms)
|
public static IEnumerable<TypeDef> FilterEnum(IEnumerable<TypeDef> types, SearchParams parms)
|
||||||
{
|
{
|
||||||
// Filter based on enum or not
|
// Filter based on enum or not
|
||||||
if (parms.IsEnum is true)
|
if (parms.GenericParams.IsEnum is true)
|
||||||
{
|
{
|
||||||
types = types.Where(t => t.IsEnum);
|
types = types.Where(t => t.IsEnum);
|
||||||
}
|
}
|
||||||
else if (parms.IsEnum is false)
|
else if (parms.GenericParams.IsEnum is false)
|
||||||
{
|
{
|
||||||
types = types.Where(t => !t.IsEnum);
|
types = types.Where(t => !t.IsEnum);
|
||||||
}
|
}
|
||||||
@ -171,11 +171,11 @@ internal static class GenericTypeFilters
|
|||||||
public static IEnumerable<TypeDef> FilterAttributes(IEnumerable<TypeDef> types, SearchParams parms)
|
public static IEnumerable<TypeDef> FilterAttributes(IEnumerable<TypeDef> types, SearchParams parms)
|
||||||
{
|
{
|
||||||
// Filter based on HasAttribute or not
|
// Filter based on HasAttribute or not
|
||||||
if (parms.HasAttribute is true)
|
if (parms.GenericParams.HasAttribute is true)
|
||||||
{
|
{
|
||||||
types = types.Where(t => t.HasCustomAttributes);
|
types = types.Where(t => t.HasCustomAttributes);
|
||||||
}
|
}
|
||||||
else if (parms.HasAttribute is false)
|
else if (parms.GenericParams.HasAttribute is false)
|
||||||
{
|
{
|
||||||
types = types.Where(t => !t.HasCustomAttributes);
|
types = types.Where(t => !t.HasCustomAttributes);
|
||||||
}
|
}
|
||||||
@ -192,21 +192,21 @@ internal static class GenericTypeFilters
|
|||||||
public static IEnumerable<TypeDef> FilterDerived(IEnumerable<TypeDef> types, SearchParams parms)
|
public static IEnumerable<TypeDef> FilterDerived(IEnumerable<TypeDef> types, SearchParams parms)
|
||||||
{
|
{
|
||||||
// Filter based on IsDerived or not
|
// Filter based on IsDerived or not
|
||||||
if (parms.IsDerived is true)
|
if (parms.GenericParams.IsDerived is true)
|
||||||
{
|
{
|
||||||
types = types.Where(t => t.GetBaseType()?.Name?.String != "Object");
|
types = types.Where(t => t.GetBaseType()?.Name?.String != "Object");
|
||||||
|
|
||||||
if (parms.MatchBaseClass is not null and not "")
|
if (parms.GenericParams.MatchBaseClass is not null and not "")
|
||||||
{
|
{
|
||||||
types = types.Where(t => t.GetBaseType()?.Name?.String == parms.MatchBaseClass);
|
types = types.Where(t => t.GetBaseType()?.Name?.String == parms.GenericParams.MatchBaseClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parms.IgnoreBaseClass is not null and not "")
|
if (parms.GenericParams.IgnoreBaseClass is not null and not "")
|
||||||
{
|
{
|
||||||
types = types.Where(t => t.GetBaseType()?.Name?.String != parms.IgnoreBaseClass);
|
types = types.Where(t => t.GetBaseType()?.Name?.String != parms.GenericParams.IgnoreBaseClass);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (parms.IsDerived is false)
|
else if (parms.GenericParams.IsDerived is false)
|
||||||
{
|
{
|
||||||
types = types.Where(t => t.GetBaseType()?.Name?.String is "Object");
|
types = types.Where(t => t.GetBaseType()?.Name?.String is "Object");
|
||||||
}
|
}
|
||||||
@ -222,9 +222,9 @@ internal static class GenericTypeFilters
|
|||||||
/// <returns>Filtered list</returns>
|
/// <returns>Filtered list</returns>
|
||||||
public static IEnumerable<TypeDef> FilterByGenericParameters(IEnumerable<TypeDef> types, SearchParams parms)
|
public static IEnumerable<TypeDef> FilterByGenericParameters(IEnumerable<TypeDef> types, SearchParams parms)
|
||||||
{
|
{
|
||||||
if (parms.HasGenericParameters is null) return types;
|
if (parms.GenericParams.HasGenericParameters is null) return types;
|
||||||
|
|
||||||
types = types.Where(t => t.HasGenericParameters == parms.HasGenericParameters);
|
types = types.Where(t => t.HasGenericParameters == parms.GenericParams.HasGenericParameters);
|
||||||
|
|
||||||
return types;
|
return types;
|
||||||
}
|
}
|
||||||
|
@ -197,7 +197,7 @@ public class ReMapper
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Filter down nested objects
|
// Filter down nested objects
|
||||||
if (mapping.SearchParams.IsNested is false or null)
|
if (mapping.SearchParams.GenericParams.IsNested is false or null)
|
||||||
{
|
{
|
||||||
types = types.Where(type => tokens!.Any(token => type.Name.StartsWith(token)));
|
types = types.Where(type => tokens!.Any(token => type.Name.StartsWith(token)));
|
||||||
}
|
}
|
||||||
|
@ -187,7 +187,7 @@ internal static class RenameHelper
|
|||||||
|
|
||||||
if (remap?.TypePrimeCandidate?.Name is null) { continue; }
|
if (remap?.TypePrimeCandidate?.Name is null) { continue; }
|
||||||
|
|
||||||
if (remap.SearchParams.IsNested is true &&
|
if (remap.SearchParams.GenericParams.IsNested is true &&
|
||||||
type.IsNested && type.Name == remap.TypePrimeCandidate.Name)
|
type.IsNested && type.Name == remap.TypePrimeCandidate.Name)
|
||||||
{
|
{
|
||||||
type.Name = remap.NewTypeName;
|
type.Name = remap.NewTypeName;
|
||||||
|
@ -74,27 +74,7 @@ public static class DataProvider
|
|||||||
|
|
||||||
var remaps = JsonConvert.DeserializeObject<List<RemapModel>>(jsonText);
|
var remaps = JsonConvert.DeserializeObject<List<RemapModel>>(jsonText);
|
||||||
|
|
||||||
if (remaps is null) return [];
|
return remaps ?? [];
|
||||||
|
|
||||||
MigrateMappings(remaps);
|
|
||||||
|
|
||||||
return remaps;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void MigrateMappings(List<RemapModel> models)
|
|
||||||
{
|
|
||||||
foreach (var model in models)
|
|
||||||
{
|
|
||||||
MigrateMapping(model);
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateMapping(Path.Combine(DataPath, "Mappings-migrated.jsonc"), models);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void MigrateMapping(RemapModel model)
|
|
||||||
{
|
|
||||||
var searchParams = model.SearchParams;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SaveMapping()
|
public static void SaveMapping()
|
||||||
@ -130,7 +110,7 @@ public static class DataProvider
|
|||||||
|
|
||||||
File.WriteAllText(path, jsonText);
|
File.WriteAllText(path, jsonText);
|
||||||
|
|
||||||
Logger.Log($"Mapping file updated with new type names and saved to {path}", ConsoleColor.Yellow);
|
Logger.Log($"Mapping file updated with new type names and saved to {path}", ConsoleColor.Green);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ModuleDefMD LoadModule(string path)
|
public static ModuleDefMD LoadModule(string path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user