mirror of
https://github.com/sp-tarkov/assembly-tool.git
synced 2025-02-13 01:30:45 -05:00
Finish migration
This commit is contained in:
parent
572b3e037f
commit
664ff994cf
10567
Assets/mappings.jsonc
10567
Assets/mappings.jsonc
File diff suppressed because it is too large
Load Diff
@ -195,50 +195,53 @@ public partial class ReCodeItForm : Form
|
||||
UseForceRename = RemapperUseForceRename.Checked,
|
||||
SearchParams = new SearchParams
|
||||
{
|
||||
IsPublic = bool.Parse(IsPublicComboBox.GetSelectedItem<string>().AsSpan()),
|
||||
GenericParams =
|
||||
{
|
||||
IsPublic = bool.Parse(IsPublicComboBox.GetSelectedItem<string>().AsSpan()),
|
||||
|
||||
IsAbstract = IsAbstractComboBox.SelectedItem as string != "Disabled"
|
||||
? bool.Parse(IsAbstractComboBox.GetSelectedItem<string>().AsSpan())
|
||||
: null,
|
||||
IsAbstract = IsAbstractComboBox.SelectedItem as string != "Disabled"
|
||||
? bool.Parse(IsAbstractComboBox.GetSelectedItem<string>().AsSpan())
|
||||
: null,
|
||||
|
||||
IsSealed = IsSealedComboBox.SelectedItem as string != "Disabled"
|
||||
? bool.Parse(IsSealedComboBox.GetSelectedItem<string>().AsSpan())
|
||||
: null,
|
||||
IsSealed = IsSealedComboBox.SelectedItem as string != "Disabled"
|
||||
? bool.Parse(IsSealedComboBox.GetSelectedItem<string>().AsSpan())
|
||||
: null,
|
||||
|
||||
IsInterface = IsInterfaceComboBox.SelectedItem as string != "Disabled"
|
||||
? bool.Parse(IsInterfaceComboBox.GetSelectedItem<string>().AsSpan())
|
||||
: null,
|
||||
IsInterface = IsInterfaceComboBox.SelectedItem as string != "Disabled"
|
||||
? bool.Parse(IsInterfaceComboBox.GetSelectedItem<string>().AsSpan())
|
||||
: null,
|
||||
|
||||
IsStruct = IsStructComboBox.SelectedItem as string != "Disabled"
|
||||
? bool.Parse(IsStructComboBox.GetSelectedItem<string>().AsSpan())
|
||||
: null,
|
||||
IsStruct = IsStructComboBox.SelectedItem as string != "Disabled"
|
||||
? bool.Parse(IsStructComboBox.GetSelectedItem<string>().AsSpan())
|
||||
: null,
|
||||
|
||||
IsEnum = IsEnumComboBox.SelectedItem as string != "Disabled"
|
||||
? bool.Parse(IsEnumComboBox.GetSelectedItem<string>().AsSpan())
|
||||
: null,
|
||||
IsEnum = IsEnumComboBox.SelectedItem as string != "Disabled"
|
||||
? bool.Parse(IsEnumComboBox.GetSelectedItem<string>().AsSpan())
|
||||
: null,
|
||||
|
||||
HasAttribute = HasAttributeComboBox.SelectedItem as string != "Disabled"
|
||||
? bool.Parse(HasAttributeComboBox.GetSelectedItem<string>().AsSpan())
|
||||
: null,
|
||||
HasAttribute = HasAttributeComboBox.SelectedItem as string != "Disabled"
|
||||
? bool.Parse(HasAttributeComboBox.GetSelectedItem<string>().AsSpan())
|
||||
: null,
|
||||
|
||||
HasGenericParameters = HasGenericParamsComboBox.SelectedItem as string != "Disabled"
|
||||
? bool.Parse(HasGenericParamsComboBox.GetSelectedItem<string>().AsSpan())
|
||||
: null,
|
||||
HasGenericParameters = HasGenericParamsComboBox.SelectedItem as string != "Disabled"
|
||||
? bool.Parse(HasGenericParamsComboBox.GetSelectedItem<string>().AsSpan())
|
||||
: null,
|
||||
|
||||
IsNested = IsNestedUpDown.GetEnabled(),
|
||||
IsDerived = IsDerivedUpDown.GetEnabled(),
|
||||
IsNested = IsNestedUpDown.GetEnabled(),
|
||||
IsDerived = IsDerivedUpDown.GetEnabled(),
|
||||
|
||||
NTParentName = NestedTypeParentName.Text == string.Empty
|
||||
? null
|
||||
: NestedTypeParentName.Text,
|
||||
|
||||
NTParentName = NestedTypeParentName.Text == string.Empty
|
||||
? null
|
||||
: NestedTypeParentName.Text,
|
||||
MatchBaseClass = BaseClassIncludeTextFIeld.Text == string.Empty
|
||||
? null
|
||||
: BaseClassIncludeTextFIeld.Text,
|
||||
|
||||
MatchBaseClass = BaseClassIncludeTextFIeld.Text == string.Empty
|
||||
? null
|
||||
: BaseClassIncludeTextFIeld.Text,
|
||||
|
||||
IgnoreBaseClass = BaseClassExcludeTextField.Text == string.Empty
|
||||
? null
|
||||
: BaseClassExcludeTextField.Text,
|
||||
IgnoreBaseClass = BaseClassExcludeTextField.Text == string.Empty
|
||||
? null
|
||||
: BaseClassExcludeTextField.Text,
|
||||
},
|
||||
|
||||
Methods =
|
||||
{
|
||||
@ -825,9 +828,9 @@ public partial class ReCodeItForm : Form
|
||||
OriginalTypeName.Text = remap.OriginalTypeName;
|
||||
RemapperUseForceRename.Checked = remap.UseForceRename;
|
||||
|
||||
BaseClassIncludeTextFIeld.Text = remap.SearchParams.MatchBaseClass;
|
||||
BaseClassExcludeTextField.Text = remap.SearchParams.IgnoreBaseClass;
|
||||
NestedTypeParentName.Text = remap.SearchParams.NTParentName;
|
||||
BaseClassIncludeTextFIeld.Text = remap.SearchParams.GenericParams.MatchBaseClass;
|
||||
BaseClassExcludeTextField.Text = remap.SearchParams.GenericParams.IgnoreBaseClass;
|
||||
NestedTypeParentName.Text = remap.SearchParams.GenericParams.NTParentName;
|
||||
|
||||
ConstructorCountEnabled.Checked = remap.SearchParams.Methods.ConstructorParameterCount >= 0;
|
||||
|
||||
@ -849,38 +852,38 @@ public partial class ReCodeItForm : Form
|
||||
|
||||
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
|
||||
? remap.SearchParams.IsAbstract.ToString()
|
||||
IsAbstractComboBox.SelectedItem = remap.SearchParams.GenericParams.IsAbstract is not null
|
||||
? remap.SearchParams.GenericParams.IsAbstract.ToString()
|
||||
: "Disabled";
|
||||
|
||||
IsSealedComboBox.SelectedItem = remap.SearchParams.IsSealed is not null
|
||||
? remap.SearchParams.IsSealed.ToString()
|
||||
IsSealedComboBox.SelectedItem = remap.SearchParams.GenericParams.IsSealed is not null
|
||||
? remap.SearchParams.GenericParams.IsSealed.ToString()
|
||||
: "Disabled";
|
||||
|
||||
IsInterfaceComboBox.SelectedItem = remap.SearchParams.IsInterface is not null
|
||||
? remap.SearchParams.IsInterface.ToString()
|
||||
IsInterfaceComboBox.SelectedItem = remap.SearchParams.GenericParams.IsInterface is not null
|
||||
? remap.SearchParams.GenericParams.IsInterface.ToString()
|
||||
: "Disabled";
|
||||
|
||||
IsStructComboBox.SelectedItem = remap.SearchParams.IsStruct is not null
|
||||
? remap.SearchParams.IsStruct.ToString()
|
||||
IsStructComboBox.SelectedItem = remap.SearchParams.GenericParams.IsStruct is not null
|
||||
? remap.SearchParams.GenericParams.IsStruct.ToString()
|
||||
: "Disabled";
|
||||
|
||||
IsEnumComboBox.SelectedItem = remap.SearchParams.IsEnum is not null
|
||||
? remap.SearchParams.IsEnum.ToString()
|
||||
IsEnumComboBox.SelectedItem = remap.SearchParams.GenericParams.IsEnum is not null
|
||||
? remap.SearchParams.GenericParams.IsEnum.ToString()
|
||||
: "Disabled";
|
||||
|
||||
HasAttributeComboBox.SelectedItem = remap.SearchParams.HasAttribute is not null
|
||||
? remap.SearchParams.HasAttribute.ToString()
|
||||
HasAttributeComboBox.SelectedItem = remap.SearchParams.GenericParams.HasAttribute is not null
|
||||
? remap.SearchParams.GenericParams.HasAttribute.ToString()
|
||||
: "Disabled";
|
||||
|
||||
HasGenericParamsComboBox.SelectedItem = remap.SearchParams.HasGenericParameters is not null
|
||||
? remap.SearchParams.HasGenericParameters.ToString()
|
||||
HasGenericParamsComboBox.SelectedItem = remap.SearchParams.GenericParams.HasGenericParameters is not null
|
||||
? remap.SearchParams.GenericParams.HasGenericParameters.ToString()
|
||||
: "Disabled";
|
||||
|
||||
IsNestedUpDown.BuildStringList("IsNested", false, remap.SearchParams.IsNested);
|
||||
IsDerivedUpDown.BuildStringList("IsDerived", false, remap.SearchParams.IsDerived);
|
||||
IsNestedUpDown.BuildStringList("IsNested", false, remap.SearchParams.GenericParams.IsNested);
|
||||
IsDerivedUpDown.BuildStringList("IsDerived", false, remap.SearchParams.GenericParams.IsDerived);
|
||||
|
||||
foreach (var method in remap.SearchParams.Methods.IncludeMethods)
|
||||
{
|
||||
|
@ -101,16 +101,16 @@ internal static class GUIHelpers
|
||||
/// <returns></returns>
|
||||
public static TreeNode GenerateTreeNode(RemapModel model, ReCodeItForm gui)
|
||||
{
|
||||
var isPublic = model.SearchParams.IsPublic;
|
||||
var isAbstract = model.SearchParams.IsAbstract == null ? null : model.SearchParams.IsAbstract;
|
||||
var isInterface = model.SearchParams.IsInterface == null ? null : model.SearchParams.IsInterface;
|
||||
var isStruct = model.SearchParams.IsStruct == null ? null : model.SearchParams.IsStruct;
|
||||
var isEnum = model.SearchParams.IsEnum == null ? null : model.SearchParams.IsEnum;
|
||||
var isNested = model.SearchParams.IsNested == null ? null : model.SearchParams.IsNested;
|
||||
var isSealed = model.SearchParams.IsSealed == null ? null : model.SearchParams.IsSealed;
|
||||
var HasAttribute = model.SearchParams.HasAttribute == null ? null : model.SearchParams.HasAttribute;
|
||||
var IsDerived = model.SearchParams.IsDerived == null ? null : model.SearchParams.IsDerived;
|
||||
var HasGenericParameters = model.SearchParams.HasGenericParameters == null ? null : model.SearchParams.HasGenericParameters;
|
||||
var isPublic = model.SearchParams.GenericParams.IsPublic;
|
||||
var isAbstract = model.SearchParams.GenericParams.IsAbstract == null ? null : model.SearchParams.GenericParams.IsAbstract;
|
||||
var isInterface = model.SearchParams.GenericParams.IsInterface == null ? null : model.SearchParams.GenericParams.IsInterface;
|
||||
var isStruct = model.SearchParams.GenericParams.IsStruct == null ? null : model.SearchParams.GenericParams.IsStruct;
|
||||
var isEnum = model.SearchParams.GenericParams.IsEnum == null ? null : model.SearchParams.GenericParams.IsEnum;
|
||||
var isNested = model.SearchParams.GenericParams.IsNested == null ? null : model.SearchParams.GenericParams.IsNested;
|
||||
var isSealed = model.SearchParams.GenericParams.IsSealed == null ? null : model.SearchParams.GenericParams.IsSealed;
|
||||
var HasAttribute = model.SearchParams.GenericParams.HasAttribute == null ? null : model.SearchParams.GenericParams.HasAttribute;
|
||||
var IsDerived = model.SearchParams.GenericParams.IsDerived == null ? null : model.SearchParams.GenericParams.IsDerived;
|
||||
var HasGenericParameters = model.SearchParams.GenericParams.HasGenericParameters == null ? null : model.SearchParams.GenericParams.HasGenericParameters;
|
||||
|
||||
var remapTreeItem = new TreeNode($"{model.NewTypeName}");
|
||||
|
||||
|
@ -43,11 +43,16 @@ public class RemapModel
|
||||
/// </summary>
|
||||
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>
|
||||
/// Default to true, most types are public
|
||||
/// </summary>
|
||||
public class GenericParams
|
||||
{
|
||||
public bool IsPublic { get; set; } = true;
|
||||
|
||||
public bool? IsAbstract { get; set; } = null;
|
||||
@ -55,20 +60,15 @@ public class SearchParams
|
||||
public bool? IsStruct { get; set; } = null;
|
||||
public bool? IsEnum { 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>
|
||||
/// Name of the nested types parent
|
||||
/// </summary>
|
||||
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>
|
||||
/// Name of the derived classes declaring type
|
||||
/// </summary>
|
||||
@ -78,18 +78,7 @@ public class SearchParams
|
||||
/// Name of the derived classes declaring type we want to ignore
|
||||
/// </summary>
|
||||
public string? IgnoreBaseClass { 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 bool? HasGenericParameters { get; set; } = null;
|
||||
}
|
||||
|
||||
public class MethodParams
|
||||
|
@ -15,9 +15,9 @@ internal static class GenericTypeFilters
|
||||
public static IEnumerable<TypeDef> FilterPublic(IEnumerable<TypeDef> types, SearchParams parms)
|
||||
{
|
||||
// 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);
|
||||
|
||||
@ -30,7 +30,7 @@ internal static class GenericTypeFilters
|
||||
}
|
||||
else
|
||||
{
|
||||
if (parms.IsNested is true)
|
||||
if (parms.GenericParams.IsNested is true)
|
||||
{
|
||||
types = types.Where(t => t.IsNestedPrivate
|
||||
|| t.IsNestedFamily
|
||||
@ -50,9 +50,9 @@ internal static class GenericTypeFilters
|
||||
|
||||
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;
|
||||
@ -67,11 +67,11 @@ internal static class GenericTypeFilters
|
||||
public static IEnumerable<TypeDef> FilterAbstract(IEnumerable<TypeDef> types, SearchParams parms)
|
||||
{
|
||||
// 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);
|
||||
}
|
||||
else if (parms.IsAbstract is false)
|
||||
else if (parms.GenericParams.IsAbstract is false)
|
||||
{
|
||||
types = types.Where(t => !t.IsAbstract);
|
||||
}
|
||||
@ -88,11 +88,11 @@ internal static class GenericTypeFilters
|
||||
public static IEnumerable<TypeDef> FilterSealed(IEnumerable<TypeDef> types, SearchParams parms)
|
||||
{
|
||||
// Filter based on abstract or not
|
||||
if (parms.IsSealed is true)
|
||||
if (parms.GenericParams.IsSealed is true)
|
||||
{
|
||||
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);
|
||||
}
|
||||
@ -109,11 +109,11 @@ internal static class GenericTypeFilters
|
||||
public static IEnumerable<TypeDef> FilterInterface(IEnumerable<TypeDef> types, SearchParams parms)
|
||||
{
|
||||
// Filter based on interface or not
|
||||
if (parms.IsInterface is true)
|
||||
if (parms.GenericParams.IsInterface is true)
|
||||
{
|
||||
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);
|
||||
}
|
||||
@ -129,11 +129,11 @@ internal static class GenericTypeFilters
|
||||
/// <returns>Filtered list</returns>
|
||||
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);
|
||||
}
|
||||
else if (parms.IsStruct is false)
|
||||
else if (parms.GenericParams.IsStruct is false)
|
||||
{
|
||||
types = types.Where(t => !t.IsValueType);
|
||||
}
|
||||
@ -150,11 +150,11 @@ internal static class GenericTypeFilters
|
||||
public static IEnumerable<TypeDef> FilterEnum(IEnumerable<TypeDef> types, SearchParams parms)
|
||||
{
|
||||
// Filter based on enum or not
|
||||
if (parms.IsEnum is true)
|
||||
if (parms.GenericParams.IsEnum is true)
|
||||
{
|
||||
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);
|
||||
}
|
||||
@ -171,11 +171,11 @@ internal static class GenericTypeFilters
|
||||
public static IEnumerable<TypeDef> FilterAttributes(IEnumerable<TypeDef> types, SearchParams parms)
|
||||
{
|
||||
// Filter based on HasAttribute or not
|
||||
if (parms.HasAttribute is true)
|
||||
if (parms.GenericParams.HasAttribute is true)
|
||||
{
|
||||
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);
|
||||
}
|
||||
@ -192,21 +192,21 @@ internal static class GenericTypeFilters
|
||||
public static IEnumerable<TypeDef> FilterDerived(IEnumerable<TypeDef> types, SearchParams parms)
|
||||
{
|
||||
// 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");
|
||||
|
||||
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");
|
||||
}
|
||||
@ -222,9 +222,9 @@ internal static class GenericTypeFilters
|
||||
/// <returns>Filtered list</returns>
|
||||
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;
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ public class ReMapper
|
||||
}
|
||||
|
||||
// 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)));
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ internal static class RenameHelper
|
||||
|
||||
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.Name = remap.NewTypeName;
|
||||
|
@ -73,28 +73,8 @@ public static class DataProvider
|
||||
var jsonText = File.ReadAllText(path);
|
||||
|
||||
var remaps = JsonConvert.DeserializeObject<List<RemapModel>>(jsonText);
|
||||
|
||||
if (remaps is null) return [];
|
||||
|
||||
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;
|
||||
|
||||
return remaps ?? [];
|
||||
}
|
||||
|
||||
public static void SaveMapping()
|
||||
@ -130,7 +110,7 @@ public static class DataProvider
|
||||
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user