Added command to enable/diable read tile feature

This commit is contained in:
shoaib11120
2021-12-15 19:30:25 +05:30
parent 222a679a03
commit 2dc1b81480

View File

@@ -16,7 +16,7 @@ namespace stardew_access
public class MainClass : Mod public class MainClass : Mod
{ {
private Harmony? harmony; private Harmony? harmony;
private static bool isReadingTile = false; private static bool isReadingTile = false, readTile = false;
private static Vector2 prevTile; private static Vector2 prevTile;
public static IMonitor? monitor; public static IMonitor? monitor;
AutoHotkeyEngine ahk; AutoHotkeyEngine ahk;
@@ -106,6 +106,10 @@ namespace stardew_access
#endregion #endregion
helper.ConsoleCommands.Add("read_tile", "Toggle read tile feature", (string arg1, string[] arg2) => {
readTile = !readTile;
});
helper.Events.Input.ButtonPressed += this.OnButtonPressed; helper.Events.Input.ButtonPressed += this.OnButtonPressed;
helper.Events.GameLoop.UpdateTicked += this.onUpdateTicked; helper.Events.GameLoop.UpdateTicked += this.onUpdateTicked;
} }
@@ -117,7 +121,7 @@ namespace stardew_access
MenuPatch.resetGlobalVars(); MenuPatch.resetGlobalVars();
if(!isReadingTile) if(!isReadingTile && readTile)
ReadTile(); ReadTile();
} }