-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix icons rendering over menu and refactor structure
- Loading branch information
Showing
9 changed files
with
116 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using HarmonyLib; | ||
using Microsoft.Xna.Framework.Graphics; | ||
using StardewModdingAPI; | ||
using StardewValley.Menus; | ||
|
||
namespace HaveIDonated.Patches; | ||
|
||
internal class InventoryPatches { | ||
private static IMonitor monitor; | ||
|
||
internal static void Initialize(IMonitor Monitor, Harmony harmony) { | ||
monitor = Monitor; | ||
|
||
harmony.Patch( | ||
original: AccessTools.Method( | ||
typeof(InventoryMenu), | ||
nameof(InventoryMenu.draw), | ||
new Type[] { typeof(SpriteBatch) } | ||
), | ||
postfix: new HarmonyMethod(typeof(InventoryPatches), nameof(InventoryDraw_postfix)) | ||
); | ||
|
||
harmony.Patch( | ||
original: AccessTools.Method( | ||
typeof(Bundle), | ||
nameof(Bundle.draw), | ||
new Type[] { typeof(SpriteBatch) } | ||
), | ||
postfix: new HarmonyMethod(typeof(InventoryPatches), nameof(InventoryDraw_postfix)) | ||
); | ||
} | ||
|
||
internal static void InventoryDraw_postfix(SpriteBatch b) { | ||
try { | ||
ModEntry.inventoryIcons?.Draw(b); | ||
} catch (Exception ex) { | ||
monitor.Log($"Failed drawing HaveIDonated.InventoryIcons {nameof(InventoryDraw_postfix)}\n{ex}", LogLevel.Error); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using System; | ||
|
||
public class Class1 | ||
{ | ||
public Class1() | ||
{ | ||
} | ||
} |
00349dd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes issue #1