Moved game menu patch
parent
8d11cc6266
commit
911c93a555
|
@ -65,7 +65,7 @@ namespace stardew_access
|
||||||
#region Game Menu Patches
|
#region Game Menu Patches
|
||||||
harmony.Patch(
|
harmony.Patch(
|
||||||
original: AccessTools.Method(typeof(GameMenu), nameof(GameMenu.draw), new Type[] { typeof(SpriteBatch) }),
|
original: AccessTools.Method(typeof(GameMenu), nameof(GameMenu.draw), new Type[] { typeof(SpriteBatch) }),
|
||||||
postfix: new HarmonyMethod(typeof(GameMenuPatches), nameof(GameMenuPatches.GameMenuPatch))
|
postfix: new HarmonyMethod(typeof(GameMenuPatch), nameof(GameMenuPatch.DrawPatch))
|
||||||
);
|
);
|
||||||
|
|
||||||
harmony.Patch(
|
harmony.Patch(
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
using StardewValley;
|
using StardewValley;
|
||||||
using StardewValley.Menus;
|
using StardewValley.Menus;
|
||||||
using StardewValley.Objects;
|
|
||||||
|
|
||||||
namespace stardew_access.Patches
|
namespace stardew_access.Patches
|
||||||
{
|
{
|
||||||
internal class GameMenuPatches
|
internal class GameMenuPatch
|
||||||
{
|
{
|
||||||
internal static string gameMenuQueryKey = "";
|
internal static string gameMenuQueryKey = "";
|
||||||
|
|
||||||
internal static void GameMenuPatch(GameMenu __instance)
|
internal static void DrawPatch(GameMenu __instance)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -38,5 +37,10 @@ namespace stardew_access.Patches
|
||||||
MainClass.ErrorLog($"Unable to narrate Text:\n{e.Message}\n{e.StackTrace}");
|
MainClass.ErrorLog($"Unable to narrate Text:\n{e.Message}\n{e.StackTrace}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static void Cleanup()
|
||||||
|
{
|
||||||
|
gameMenuQueryKey = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -33,7 +33,7 @@ namespace stardew_access.Patches
|
||||||
}
|
}
|
||||||
else if (menu is GameMenu)
|
else if (menu is GameMenu)
|
||||||
{
|
{
|
||||||
GameMenuPatches.gameMenuQueryKey = "";
|
GameMenuPatch.Cleanup();
|
||||||
ExitPagePatch.Cleanup();
|
ExitPagePatch.Cleanup();
|
||||||
OptionsPagePatch.Cleanup();
|
OptionsPagePatch.Cleanup();
|
||||||
SocialPagePatch.Cleanup();
|
SocialPagePatch.Cleanup();
|
||||||
|
|
Loading…
Reference in New Issue