From 2dc1b81480bf99fda2840eaa0a508e0f3805d5fc Mon Sep 17 00:00:00 2001 From: shoaib11120 Date: Wed, 15 Dec 2021 19:30:25 +0530 Subject: [PATCH] Added command to enable/diable read tile feature --- stardew-access/ModEntry.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stardew-access/ModEntry.cs b/stardew-access/ModEntry.cs index 025348a..9b6e936 100644 --- a/stardew-access/ModEntry.cs +++ b/stardew-access/ModEntry.cs @@ -16,7 +16,7 @@ namespace stardew_access public class MainClass : Mod { private Harmony? harmony; - private static bool isReadingTile = false; + private static bool isReadingTile = false, readTile = false; private static Vector2 prevTile; public static IMonitor? monitor; AutoHotkeyEngine ahk; @@ -106,6 +106,10 @@ namespace stardew_access #endregion + helper.ConsoleCommands.Add("read_tile", "Toggle read tile feature", (string arg1, string[] arg2) => { + readTile = !readTile; + }); + helper.Events.Input.ButtonPressed += this.OnButtonPressed; helper.Events.GameLoop.UpdateTicked += this.onUpdateTicked; } @@ -117,7 +121,7 @@ namespace stardew_access MenuPatch.resetGlobalVars(); - if(!isReadingTile) + if(!isReadingTile && readTile) ReadTile(); }