get patcher names automatically if needed

This commit is contained in:
Jesse Plamondon-Willard 2021-03-07 19:48:47 -05:00
parent 0ed46c0910
commit 7914734375
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
11 changed files with 4 additions and 67 deletions

View File

@ -29,13 +29,6 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches
private static IReflectionHelper Reflection; private static IReflectionHelper Reflection;
/*********
** Accessors
*********/
/// <inheritdoc />
public string Name => nameof(DialogueErrorPatch);
/********* /*********
** Public methods ** Public methods
*********/ *********/

View File

@ -23,13 +23,6 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches
private static IMonitor MonitorForGame; private static IMonitor MonitorForGame;
/*********
** Accessors
*********/
/// <inheritdoc />
public string Name => nameof(EventPatches);
/********* /*********
** Public methods ** Public methods
*********/ *********/

View File

@ -24,13 +24,6 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches
private static IMonitor MonitorForGame; private static IMonitor MonitorForGame;
/*********
** Accessors
*********/
/// <inheritdoc />
public string Name => nameof(GameLocationPatches);
/********* /*********
** Public methods ** Public methods
*********/ *********/

View File

@ -31,13 +31,6 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches
private static Action OnContentRemoved; private static Action OnContentRemoved;
/*********
** Accessors
*********/
/// <inheritdoc />
public string Name => nameof(LoadErrorPatch);
/********* /*********
** Public methods ** Public methods
*********/ *********/

View File

@ -20,13 +20,6 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches
[SuppressMessage("ReSharper", "IdentifierTypo", Justification = "Argument names are defined by Harmony and methods are named for clarity.")] [SuppressMessage("ReSharper", "IdentifierTypo", Justification = "Argument names are defined by Harmony and methods are named for clarity.")]
internal class ObjectErrorPatch : IHarmonyPatch internal class ObjectErrorPatch : IHarmonyPatch
{ {
/*********
** Accessors
*********/
/// <inheritdoc />
public string Name => nameof(ObjectErrorPatch);
/********* /*********
** Public methods ** Public methods
*********/ *********/

View File

@ -26,13 +26,6 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches
private static IMonitor MonitorForGame; private static IMonitor MonitorForGame;
/*********
** Accessors
*********/
/// <inheritdoc />
public string Name => nameof(ScheduleErrorPatch);
/********* /*********
** Public methods ** Public methods
*********/ *********/

View File

@ -16,13 +16,6 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches
[SuppressMessage("ReSharper", "IdentifierTypo", Justification = "Argument names are defined by Harmony and methods are named for clarity.")] [SuppressMessage("ReSharper", "IdentifierTypo", Justification = "Argument names are defined by Harmony and methods are named for clarity.")]
internal class SpriteBatchValidationPatches : IHarmonyPatch internal class SpriteBatchValidationPatches : IHarmonyPatch
{ {
/*********
** Accessors
*********/
/// <inheritdoc />
public string Name => nameof(SpriteBatchValidationPatches);
/********* /*********
** Public methods ** Public methods
*********/ *********/

View File

@ -18,13 +18,6 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches
[SuppressMessage("ReSharper", "IdentifierTypo", Justification = "Argument names are defined by Harmony and methods are named for clarity.")] [SuppressMessage("ReSharper", "IdentifierTypo", Justification = "Argument names are defined by Harmony and methods are named for clarity.")]
internal class UtilityErrorPatches : IHarmonyPatch internal class UtilityErrorPatches : IHarmonyPatch
{ {
/*********
** Accessors
*********/
/// <inheritdoc />
public string Name => nameof(UtilityErrorPatches);
/********* /*********
** Public methods ** Public methods
*********/ *********/

View File

@ -44,7 +44,7 @@ namespace StardewModdingAPI.Framework.Patching
} }
catch (Exception ex) catch (Exception ex)
{ {
this.Monitor.Log($"Couldn't apply runtime patch '{patch.Name}' to the game. Some SMAPI features may not work correctly. See log file for details.", LogLevel.Error); this.Monitor.Log($"Couldn't apply runtime patch '{patch.GetType().Name}' to the game. Some SMAPI features may not work correctly. See log file for details.", LogLevel.Error);
this.Monitor.Log(ex.GetLogSummary(), LogLevel.Trace); this.Monitor.Log(ex.GetLogSummary(), LogLevel.Trace);
} }
} }

View File

@ -9,9 +9,9 @@ namespace StardewModdingAPI.Framework.Patching
/// <summary>A Harmony patch to apply.</summary> /// <summary>A Harmony patch to apply.</summary>
internal interface IHarmonyPatch internal interface IHarmonyPatch
{ {
/// <summary>A unique name for this patch.</summary> /*********
string Name { get; } ** Methods
*********/
/// <summary>Apply the Harmony patch.</summary> /// <summary>Apply the Harmony patch.</summary>
/// <param name="harmony">The Harmony instance.</param> /// <param name="harmony">The Harmony instance.</param>
#if HARMONY_2 #if HARMONY_2

View File

@ -33,13 +33,6 @@ namespace StardewModdingAPI.Patches
private static bool IsInLoadForNewGame; private static bool IsInLoadForNewGame;
/*********
** Accessors
*********/
/// <inheritdoc />
public string Name => nameof(LoadContextPatch);
/********* /*********
** Public methods ** Public methods
*********/ *********/