diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-05-05 21:45:53 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-05-05 21:45:53 -0400 |
commit | 499cd8ab317080096c373c6ed6649bd51fb01c7d (patch) | |
tree | 0ecd704f094c131e00e5e72a7c5ff0315a3875f9 /src/SMAPI/Framework | |
parent | f4192663d78c7a45418f07f0bf4acb67b11291fe (diff) | |
download | SMAPI-499cd8ab317080096c373c6ed6649bd51fb01c7d.tar.gz SMAPI-499cd8ab317080096c373c6ed6649bd51fb01c7d.tar.bz2 SMAPI-499cd8ab317080096c373c6ed6649bd51fb01c7d.zip |
combine Harmony 1.x rewrite logs (#711)
Diffstat (limited to 'src/SMAPI/Framework')
-rw-r--r-- | src/SMAPI/Framework/ModLoading/Rewriters/Harmony1AssemblyRewriter.cs | 9 | ||||
-rw-r--r-- | src/SMAPI/Framework/ModLoading/Rewriters/MethodParentRewriter.cs | 5 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/SMAPI/Framework/ModLoading/Rewriters/Harmony1AssemblyRewriter.cs b/src/SMAPI/Framework/ModLoading/Rewriters/Harmony1AssemblyRewriter.cs index 29e44bfe..9faca235 100644 --- a/src/SMAPI/Framework/ModLoading/Rewriters/Harmony1AssemblyRewriter.cs +++ b/src/SMAPI/Framework/ModLoading/Rewriters/Harmony1AssemblyRewriter.cs @@ -19,11 +19,18 @@ namespace StardewModdingAPI.Framework.ModLoading.Rewriters /********* + ** Accessors + *********/ + /// <summary>A brief noun phrase indicating what the rewriter matches.</summary> + public const string DefaultNounPhrase = "Harmony 1.x"; + + + /********* ** Public methods *********/ /// <summary>Construct an instance.</summary> public Harmony1AssemblyRewriter() - : base(new TypeAssemblyFinder(Harmony1AssemblyRewriter.FromAssemblyName, InstructionHandleResult.None), "Harmony 1.x types") + : base(new TypeAssemblyFinder(Harmony1AssemblyRewriter.FromAssemblyName, InstructionHandleResult.None), Harmony1AssemblyRewriter.DefaultNounPhrase) { } diff --git a/src/SMAPI/Framework/ModLoading/Rewriters/MethodParentRewriter.cs b/src/SMAPI/Framework/ModLoading/Rewriters/MethodParentRewriter.cs index 0984dc44..c4c740b3 100644 --- a/src/SMAPI/Framework/ModLoading/Rewriters/MethodParentRewriter.cs +++ b/src/SMAPI/Framework/ModLoading/Rewriters/MethodParentRewriter.cs @@ -35,11 +35,12 @@ namespace StardewModdingAPI.Framework.ModLoading.Rewriters /// <param name="fromType">The type whose methods to remap.</param> /// <param name="toType">The type with methods to map to.</param> /// <param name="onlyIfPlatformChanged">Whether to only rewrite references if loading the assembly on a different platform than it was compiled on.</param> - public MethodParentRewriter(string fromType, Type toType, bool onlyIfPlatformChanged = false) + /// <param name="nounPhrase">A brief noun phrase indicating what the instruction finder matches (or <c>null</c> to generate one).</param> + public MethodParentRewriter(string fromType, Type toType, bool onlyIfPlatformChanged = false, string nounPhrase = null) { this.FromType = fromType; this.ToType = toType; - this.NounPhrase = $"{fromType.Split('.').Last()} methods"; + this.NounPhrase = nounPhrase ?? $"{fromType.Split('.').Last()} methods"; this.OnlyIfPlatformChanged = onlyIfPlatformChanged; } |