2024-06-14 19:06:21 -04:00
|
|
|
|
namespace ReCodeIt.Models;
|
2024-06-11 19:18:48 -04:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-06-17 18:19:17 -04:00
|
|
|
|
/// All settings container
|
2024-06-11 19:18:48 -04:00
|
|
|
|
/// </summary>
|
2024-06-13 18:15:52 -04:00
|
|
|
|
public class Settings
|
2024-06-13 17:55:06 -04:00
|
|
|
|
{
|
|
|
|
|
public AppSettings AppSettings { get; set; }
|
2024-06-13 20:25:11 -04:00
|
|
|
|
public RemapperSettings Remapper { get; set; }
|
|
|
|
|
public AutoMapperSettings AutoMapper { get; set; }
|
2024-06-17 18:19:17 -04:00
|
|
|
|
public CrossPatchingSettings CrossPatching { get; set; }
|
2024-06-13 17:55:06 -04:00
|
|
|
|
}
|
|
|
|
|
|
2024-06-17 18:19:17 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// These are settings for the application
|
|
|
|
|
/// </summary>
|
2024-06-13 18:15:52 -04:00
|
|
|
|
public class AppSettings
|
2024-06-11 19:18:48 -04:00
|
|
|
|
{
|
2024-06-15 16:21:12 -04:00
|
|
|
|
public bool Debug { get; set; }
|
|
|
|
|
public bool SilentMode { get; set; }
|
2024-06-17 17:29:26 -04:00
|
|
|
|
public bool RenameFields { get; set; }
|
|
|
|
|
public bool RenameProperties { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-17 18:19:17 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// These are settings for the manual remapper
|
|
|
|
|
/// </summary>
|
2024-06-17 17:29:26 -04:00
|
|
|
|
public class RemapperSettings
|
|
|
|
|
{
|
2024-06-17 19:14:47 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Path to the assembly we want to remap
|
|
|
|
|
/// </summary>
|
2024-06-15 16:21:12 -04:00
|
|
|
|
public string AssemblyPath { get; set; }
|
2024-06-17 19:14:47 -04:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Path including the filename and extension we want to write the changes to
|
|
|
|
|
/// </summary>
|
2024-06-15 16:21:12 -04:00
|
|
|
|
public string OutputPath { get; set; }
|
2024-06-17 19:14:47 -04:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Path to the mapping file
|
|
|
|
|
/// </summary>
|
2024-06-15 16:21:12 -04:00
|
|
|
|
public string MappingPath { get; set; }
|
2024-06-17 19:14:47 -04:00
|
|
|
|
|
2024-06-17 18:19:17 -04:00
|
|
|
|
public MappingSettings MappingSettings { get; set; }
|
2024-06-14 18:07:01 -04:00
|
|
|
|
}
|
2024-06-11 19:18:48 -04:00
|
|
|
|
|
2024-06-17 18:19:17 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// These are settings for the auto mapping
|
|
|
|
|
/// </summary>
|
2024-06-13 18:15:52 -04:00
|
|
|
|
public class AutoMapperSettings
|
2024-06-13 17:55:06 -04:00
|
|
|
|
{
|
2024-06-17 19:14:47 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Path to the assembly we want to remap
|
|
|
|
|
/// </summary>
|
2024-06-17 17:29:26 -04:00
|
|
|
|
public string AssemblyPath { get; set; }
|
2024-06-17 19:14:47 -04:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Path including the filename and extension we want to write the changes to
|
|
|
|
|
/// </summary>
|
2024-06-17 17:29:26 -04:00
|
|
|
|
public string OutputPath { get; set; }
|
2024-06-17 19:14:47 -04:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Minimum number of times a member must have this name in the assembly before considering it
|
|
|
|
|
/// for remapping
|
|
|
|
|
/// </summary>
|
2024-06-15 16:21:12 -04:00
|
|
|
|
public int RequiredMatches { get; set; }
|
2024-06-17 19:14:47 -04:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Minimum length of the field/property name in code before it will be considered for a rename
|
|
|
|
|
/// </summary>
|
2024-06-15 16:21:12 -04:00
|
|
|
|
public int MinLengthToMatch { get; set; }
|
2024-06-17 19:14:47 -04:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Will attempt to map types from method meta data and parameters
|
|
|
|
|
/// </summary>
|
2024-06-16 16:21:42 -04:00
|
|
|
|
public bool SearchMethods { get; set; }
|
2024-06-17 19:14:47 -04:00
|
|
|
|
|
2024-06-17 18:19:17 -04:00
|
|
|
|
public MappingSettings MappingSettings { get; set; }
|
2024-06-17 19:14:47 -04:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Any member name you want to ignore while iterating through the assembly
|
|
|
|
|
/// </summary>
|
2024-06-15 16:21:12 -04:00
|
|
|
|
public List<string> TypesToIgnore { get; set; }
|
|
|
|
|
|
2024-06-17 19:14:47 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The auto mapper will look for these tokens in class names and prioritize those
|
|
|
|
|
/// </summary>
|
2024-06-15 16:21:12 -04:00
|
|
|
|
public List<string> TokensToMatch { get; set; }
|
2024-06-15 16:45:34 -04:00
|
|
|
|
|
2024-06-17 19:14:47 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Property or fields names to ignore in the automap, these are case sanitized so case does not matter
|
|
|
|
|
/// </summary>
|
2024-06-15 16:45:34 -04:00
|
|
|
|
public List<string> PropertyFieldBlackList { get; set; }
|
2024-06-16 16:21:42 -04:00
|
|
|
|
|
2024-06-17 19:14:47 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// method parameter names to ignore in the automap, these are case sanitized so case does not matter
|
|
|
|
|
/// </summary>
|
2024-06-16 16:21:42 -04:00
|
|
|
|
public List<string> MethodParamaterBlackList { get; set; }
|
2024-06-17 18:19:17 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// These are settings for the cross patching module
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class CrossPatchingSettings
|
|
|
|
|
{
|
2024-06-17 19:14:47 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The path to the original assembly to use as a reference, for unity games its
|
|
|
|
|
/// 'Assembly-CSharp.dll' from the games Data/Managed Folder
|
|
|
|
|
/// </summary>
|
2024-06-17 18:19:17 -04:00
|
|
|
|
public string OriginalAssemblyPath { get; set; }
|
2024-06-17 19:14:47 -04:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-06-17 20:25:53 -04:00
|
|
|
|
/// The output path of the remapped assembly
|
2024-06-17 19:14:47 -04:00
|
|
|
|
/// </summary>
|
2024-06-17 20:25:53 -04:00
|
|
|
|
public string RemappedOutput { get; set; }
|
2024-06-17 19:14:47 -04:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-06-17 20:25:53 -04:00
|
|
|
|
/// The input path of the assembly referenced by the remapped dll
|
2024-06-17 19:14:47 -04:00
|
|
|
|
/// </summary>
|
2024-06-17 20:25:53 -04:00
|
|
|
|
public string ReversePatchInputPath { get; set; }
|
2024-06-17 19:14:47 -04:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-06-17 20:25:53 -04:00
|
|
|
|
/// Where should the de-patched dll be placed? (This is the one you test/distribute with)
|
2024-06-17 19:14:47 -04:00
|
|
|
|
/// </summary>
|
2024-06-17 20:25:53 -04:00
|
|
|
|
public string ReversePatchOutputPath { get; set; }
|
2024-06-17 18:19:17 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// These are settings that all versions of the remappers use
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class MappingSettings
|
|
|
|
|
{
|
2024-06-17 19:14:47 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Names of fields of the matched type will be renamed to the type name with approproiate convention
|
|
|
|
|
/// </summary>
|
2024-06-17 18:19:17 -04:00
|
|
|
|
public bool RenameFields { get; set; }
|
2024-06-17 19:14:47 -04:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Names of properties of the matched type will be renamed to the type name with approproiate convention
|
|
|
|
|
/// </summary>
|
2024-06-17 18:19:17 -04:00
|
|
|
|
public bool RenameProperties { get; set; }
|
2024-06-17 19:14:47 -04:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Publicize all types, methods, and properties : NOTE: Not run until after the remap has completed
|
|
|
|
|
/// </summary>
|
2024-06-17 18:19:17 -04:00
|
|
|
|
public bool Publicize { get; set; }
|
2024-06-17 19:14:47 -04:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Unseal all types : NOTE: Not run until after the remap has completed
|
|
|
|
|
/// </summary>
|
2024-06-17 18:19:17 -04:00
|
|
|
|
public bool Unseal { get; set; }
|
2024-06-11 19:18:48 -04:00
|
|
|
|
}
|