diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-07-30 00:34:53 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-07-30 00:34:53 -0400 |
commit | aa65b2e2f6ae2578f9d1f81d6fc1f4c5a261d90f (patch) | |
tree | faccc161af30557a38c80d266f257124af068af7 /src/SMAPI.Mods.ErrorHandler/Patches/ObjectErrorPatch.cs | |
parent | 737a434ad6704d22776f463c192b9a9748ce2a21 (diff) | |
download | SMAPI-aa65b2e2f6ae2578f9d1f81d6fc1f4c5a261d90f.tar.gz SMAPI-aa65b2e2f6ae2578f9d1f81d6fc1f4c5a261d90f.tar.bz2 SMAPI-aa65b2e2f6ae2578f9d1f81d6fc1f4c5a261d90f.zip |
split patch classes which target multiple types
Diffstat (limited to 'src/SMAPI.Mods.ErrorHandler/Patches/ObjectErrorPatch.cs')
-rw-r--r-- | src/SMAPI.Mods.ErrorHandler/Patches/ObjectErrorPatch.cs | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/SMAPI.Mods.ErrorHandler/Patches/ObjectErrorPatch.cs b/src/SMAPI.Mods.ErrorHandler/Patches/ObjectErrorPatch.cs index a68e359c..7a4b3cfa 100644 --- a/src/SMAPI.Mods.ErrorHandler/Patches/ObjectErrorPatch.cs +++ b/src/SMAPI.Mods.ErrorHandler/Patches/ObjectErrorPatch.cs @@ -4,7 +4,6 @@ using System.Diagnostics.CodeAnalysis; using HarmonyLib; using StardewModdingAPI.Framework.Patching; using StardewValley; -using StardewValley.Menus; using SObject = StardewValley.Object; namespace StardewModdingAPI.Mods.ErrorHandler.Patches @@ -32,12 +31,6 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches original: AccessTools.Method(typeof(SObject), "loadDisplayName"), finalizer: new HarmonyMethod(this.GetType(), nameof(ObjectErrorPatch.Finalize_Object_loadDisplayName)) ); - - // IClickableMenu.drawToolTip - harmony.Patch( - original: AccessTools.Method(typeof(IClickableMenu), nameof(IClickableMenu.drawToolTip)), - prefix: new HarmonyMethod(this.GetType(), nameof(ObjectErrorPatch.Before_IClickableMenu_DrawTooltip)) - ); } @@ -74,17 +67,5 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches return __exception; } - - /// <summary>The method to call instead of <see cref="IClickableMenu.drawToolTip"/>.</summary> - /// <param name="hoveredItem">The item for which to draw a tooltip.</param> - /// <returns>Returns whether to execute the original method.</returns> - private static bool Before_IClickableMenu_DrawTooltip(Item hoveredItem) - { - // invalid edible item cause crash when drawing tooltips - if (hoveredItem is SObject obj && obj.Edibility != -300 && !Game1.objectInformation.ContainsKey(obj.ParentSheetIndex)) - return false; - - return true; - } } } |