diff --git a/BepInEx.Core/BepInEx.Core.csproj b/BepInEx.Core/BepInEx.Core.csproj index cc30bec..72ac59f 100644 --- a/BepInEx.Core/BepInEx.Core.csproj +++ b/BepInEx.Core/BepInEx.Core.csproj @@ -21,9 +21,9 @@ - - - + + + diff --git a/BepInEx.Core/Bootstrap/BaseChainloader.cs b/BepInEx.Core/Bootstrap/BaseChainloader.cs index aa30561..00a786f 100644 --- a/BepInEx.Core/Bootstrap/BaseChainloader.cs +++ b/BepInEx.Core/Bootstrap/BaseChainloader.cs @@ -267,7 +267,7 @@ namespace BepInEx.Bootstrap var sortedPlugins = ModifyLoadOrder(plugins); var invalidPlugins = new HashSet(); - var processedPlugins = new Dictionary(); + var processedPlugins = new Dictionary(); var loadedAssemblies = new Dictionary(); foreach (var plugin in sortedPlugins) diff --git a/BepInEx.Core/Contract/Attributes.cs b/BepInEx.Core/Contract/Attributes.cs index 951b22b..5521bd0 100644 --- a/BepInEx.Core/Contract/Attributes.cs +++ b/BepInEx.Core/Contract/Attributes.cs @@ -5,8 +5,8 @@ using System.Linq; using System.Reflection; using BepInEx.Bootstrap; using Mono.Cecil; -using Version = SemVer.Version; -using Range = SemVer.Range; +using SemanticVersioning; +using Version = SemanticVersioning.Version; namespace BepInEx { @@ -70,9 +70,9 @@ namespace BepInEx if (attr == null) return null; - return new BepInPlugin((string) attr.ConstructorArguments[0].Value, - (string) attr.ConstructorArguments[1].Value, - (string) attr.ConstructorArguments[2].Value); + return new BepInPlugin((string)attr.ConstructorArguments[0].Value, + (string)attr.ConstructorArguments[1].Value, + (string)attr.ConstructorArguments[2].Value); } } @@ -145,14 +145,14 @@ namespace BepInEx void ICacheable.Save(BinaryWriter bw) { bw.Write(DependencyGUID); - bw.Write((int) Flags); + bw.Write((int)Flags); bw.Write(VersionRange?.ToString() ?? string.Empty); } void ICacheable.Load(BinaryReader br) { DependencyGUID = br.ReadString(); - Flags = (DependencyFlags) br.ReadInt32(); + Flags = (DependencyFlags)br.ReadInt32(); var versionRange = br.ReadString(); VersionRange = versionRange == string.Empty ? null : Range.Parse(versionRange); @@ -163,10 +163,10 @@ namespace BepInEx var attrs = MetadataHelper.GetCustomAttributes(td, true); return attrs.Select(customAttribute => { - var dependencyGuid = (string) customAttribute.ConstructorArguments[0].Value; + var dependencyGuid = (string)customAttribute.ConstructorArguments[0].Value; var secondArg = customAttribute.ConstructorArguments[1].Value; if (secondArg is string minVersion) return new BepInDependency(dependencyGuid, minVersion); - return new BepInDependency(dependencyGuid, (DependencyFlags) secondArg); + return new BepInDependency(dependencyGuid, (DependencyFlags)secondArg); }).ToList(); } } @@ -201,7 +201,7 @@ namespace BepInEx var attrs = MetadataHelper.GetCustomAttributes(td, true); return attrs.Select(customAttribute => { - var dependencyGuid = (string) customAttribute.ConstructorArguments[0].Value; + var dependencyGuid = (string)customAttribute.ConstructorArguments[0].Value; return new BepInIncompatibility(dependencyGuid); }).ToList(); } @@ -229,7 +229,7 @@ namespace BepInEx { var attrs = MetadataHelper.GetCustomAttributes(td, true); return attrs.Select(customAttribute => - new BepInProcess((string) customAttribute.ConstructorArguments[0].Value)).ToList(); + new BepInProcess((string)customAttribute.ConstructorArguments[0].Value)).ToList(); } } @@ -271,7 +271,7 @@ namespace BepInEx if (attributes.Length == 0) return null; - return (BepInPlugin) attributes[0]; + return (BepInPlugin)attributes[0]; } /// @@ -288,7 +288,7 @@ namespace BepInEx /// The plugin type. /// The attributes of the type, if existing. public static T[] GetAttributes(Type pluginType) where T : Attribute => - (T[]) pluginType.GetCustomAttributes(typeof(T), true); + (T[])pluginType.GetCustomAttributes(typeof(T), true); /// /// Gets the specified attributes of an assembly, if they exist. @@ -297,7 +297,7 @@ namespace BepInEx /// The attribute type to retrieve. /// The attributes of the type, if existing. public static T[] GetAttributes(Assembly assembly) where T : Attribute => - (T[]) assembly.GetCustomAttributes(typeof(T), true); + (T[])assembly.GetCustomAttributes(typeof(T), true); /// /// Gets the specified attributes of an instance, if they exist. @@ -315,7 +315,7 @@ namespace BepInEx /// The reflection metadata instance. /// The attributes of the instance, if existing. public static T[] GetAttributes(MemberInfo member) where T : Attribute => - (T[]) member.GetCustomAttributes(typeof(T), true); + (T[])member.GetCustomAttributes(typeof(T), true); /// /// Retrieves the dependencies of the specified plugin type. diff --git a/BepInEx.Core/Paths.cs b/BepInEx.Core/Paths.cs index 58f8d6b..1dddda7 100644 --- a/BepInEx.Core/Paths.cs +++ b/BepInEx.Core/Paths.cs @@ -2,7 +2,7 @@ using System.Linq; using System.Reflection; using MonoMod.Utils; -using SemVer; +using SemanticVersioning; namespace BepInEx { diff --git a/BepInEx.IL2CPP/BepInEx.IL2CPP.csproj b/BepInEx.IL2CPP/BepInEx.IL2CPP.csproj index 3b2f269..7df91c0 100644 --- a/BepInEx.IL2CPP/BepInEx.IL2CPP.csproj +++ b/BepInEx.IL2CPP/BepInEx.IL2CPP.csproj @@ -25,15 +25,15 @@ - + - - + + diff --git a/BepInEx.NetLauncher/BepInEx.NetLauncher.csproj b/BepInEx.NetLauncher/BepInEx.NetLauncher.csproj index 2cdf7fb..28ed1c4 100644 --- a/BepInEx.NetLauncher/BepInEx.NetLauncher.csproj +++ b/BepInEx.NetLauncher/BepInEx.NetLauncher.csproj @@ -26,7 +26,7 @@ - + diff --git a/BepInEx.Preloader.Core/BepInEx.Preloader.Core.csproj b/BepInEx.Preloader.Core/BepInEx.Preloader.Core.csproj index 0a74d92..651373e 100644 --- a/BepInEx.Preloader.Core/BepInEx.Preloader.Core.csproj +++ b/BepInEx.Preloader.Core/BepInEx.Preloader.Core.csproj @@ -22,8 +22,8 @@ - - - + + + diff --git a/BepInEx.Preloader.Core/Patching/Attributes.cs b/BepInEx.Preloader.Core/Patching/Attributes.cs index c269dd2..d676457 100644 --- a/BepInEx.Preloader.Core/Patching/Attributes.cs +++ b/BepInEx.Preloader.Core/Patching/Attributes.cs @@ -1,7 +1,7 @@ using System; using System.Linq; using Mono.Cecil; -using Version = SemVer.Version; +using Version = SemanticVersioning.Version; namespace BepInEx.Preloader.Core.Patching { @@ -90,16 +90,16 @@ namespace BepInEx.Preloader.Core.Patching /// public const string AllAssemblies = "_all"; - /// - /// The short filename of the assembly to target. - /// - public string TargetAssembly { get; } - /// The short filename of the assembly. Use to mark all possible assemblies as targets. public TargetAssemblyAttribute(string targetAssembly) { TargetAssembly = targetAssembly; } + + /// + /// The short filename of the assembly to target. + /// + public string TargetAssembly { get; } } /// @@ -108,6 +108,14 @@ namespace BepInEx.Preloader.Core.Patching [AttributeUsage(AttributeTargets.Method)] public class TargetTypeAttribute : Attribute { + /// The short filename of the assembly of which belongs to. + /// The full name of the type to target for patching. + public TargetTypeAttribute(string targetAssembly, string targetType) + { + TargetAssembly = targetAssembly; + TargetType = targetType; + } + /// /// The short filename of the assembly to target. /// @@ -117,13 +125,5 @@ namespace BepInEx.Preloader.Core.Patching /// The full name of the type to target for patching. /// public string TargetType { get; } - - /// The short filename of the assembly of which belongs to. - /// The full name of the type to target for patching. - public TargetTypeAttribute(string targetAssembly, string targetType) - { - TargetAssembly = targetAssembly; - TargetType = targetType; - } } } diff --git a/BepInEx.Preloader.Unity/BepInEx.Preloader.Unity.csproj b/BepInEx.Preloader.Unity/BepInEx.Preloader.Unity.csproj index 2c35150..106a682 100644 --- a/BepInEx.Preloader.Unity/BepInEx.Preloader.Unity.csproj +++ b/BepInEx.Preloader.Unity/BepInEx.Preloader.Unity.csproj @@ -20,7 +20,7 @@ - + diff --git a/BepInEx.Unity/BepInEx.Unity.csproj b/BepInEx.Unity/BepInEx.Unity.csproj index d1686d2..bd9391e 100644 --- a/BepInEx.Unity/BepInEx.Unity.csproj +++ b/BepInEx.Unity/BepInEx.Unity.csproj @@ -23,7 +23,7 @@ - +