diff --git a/stardew-access/CustomCommands.cs b/stardew-access/CustomCommands.cs index d6d51b6..7f231ad 100644 --- a/stardew-access/CustomCommands.cs +++ b/stardew-access/CustomCommands.cs @@ -15,21 +15,14 @@ namespace stardew_access if (helper == null) return; + #region Read Tile helper.ConsoleCommands.Add("readtile", "Toggle read tile feature.", (string commmand, string[] args) => - { - MainClass.Config.ReadTile = !MainClass.Config.ReadTile; - helper.WriteConfig(MainClass.Config); + { + MainClass.Config.ReadTile = !MainClass.Config.ReadTile; + helper.WriteConfig(MainClass.Config); - MainClass.DebugLog("Read Tile is " + (MainClass.Config.ReadTile ? "on" : "off")); - }); - - helper.ConsoleCommands.Add("snapmouse", "Toggle snap mouse feature.", (string commmand, string[] args) => - { - MainClass.Config.SnapMouse = !MainClass.Config.SnapMouse; - helper.WriteConfig(MainClass.Config); - - MainClass.DebugLog("Snap Mouse is " + (MainClass.Config.SnapMouse ? "on" : "off")); - }); + MainClass.DebugLog("Read Tile is " + (MainClass.Config.ReadTile ? "on" : "off")); + }); helper.ConsoleCommands.Add("flooring", "Toggle flooring in read tile.", (string commmand, string[] args) => { @@ -46,6 +39,7 @@ namespace stardew_access MainClass.DebugLog("Watered toggle is " + (MainClass.Config.WateredToggle ? "on" : "off")); }); + #endregion #region Radar Feature helper.ConsoleCommands.Add("radar", "Toggle radar feature.", (string commmand, string[] args) => @@ -482,12 +476,13 @@ namespace stardew_access }); #endregion + #region Other helper.ConsoleCommands.Add("refsr", "Refresh screen reader", (string commmand, string[] args) => - { - MainClass.ScreenReader.InitializeScreenReader(); + { + MainClass.ScreenReader.InitializeScreenReader(); - MainClass.DebugLog("Screen Reader refreshed!"); - }); + MainClass.DebugLog("Screen Reader refreshed!"); + }); helper.ConsoleCommands.Add("refmc", "Refresh mod config", (string commmand, string[] args) => { @@ -510,6 +505,23 @@ namespace stardew_access MainClass.DebugLog("Speaking in percentage is " + (MainClass.Config.HealthNStaminaInPercentage ? "on" : "off")); }); + + helper.ConsoleCommands.Add("snapmouse", "Toggle snap mouse feature.", (string commmand, string[] args) => + { + MainClass.Config.SnapMouse = !MainClass.Config.SnapMouse; + helper.WriteConfig(MainClass.Config); + + MainClass.DebugLog("Snap Mouse is " + (MainClass.Config.SnapMouse ? "on" : "off")); + }); + + helper.ConsoleCommands.Add("warning", "Toggle warnings feature.", (string commmand, string[] args) => + { + MainClass.Config.Warning = !MainClass.Config.Warning; + helper.WriteConfig(MainClass.Config); + + MainClass.DebugLog("Warnings is " + (MainClass.Config.Warning ? "on" : "off")); + }); + #endregion } } } diff --git a/stardew-access/Features/ReadTile.cs b/stardew-access/Features/ReadTile.cs index 7cdb846..01121b3 100644 --- a/stardew-access/Features/ReadTile.cs +++ b/stardew-access/Features/ReadTile.cs @@ -28,9 +28,6 @@ namespace stardew_access.Features if (this.shouldPause) return; - if (!MainClass.Config.ReadTile) - return; - this.isBusy = true; this.run(); Task.Delay(delay).ContinueWith(_ => { this.isBusy = false; }); diff --git a/stardew-access/ModConfig.cs b/stardew-access/ModConfig.cs index 48e1490..76f057d 100644 --- a/stardew-access/ModConfig.cs +++ b/stardew-access/ModConfig.cs @@ -77,6 +77,7 @@ namespace stardew_access public KeybindList TimeNSeasonKey { get; set; } = KeybindList.Parse("Q"); // Narrate the time of day, day and date and season public Boolean VerboseCoordinates { get; set; } = true; public Boolean SnapMouse { get; set; } = true; // Toggles the snap mouse feature + public Boolean Warning { get; set; } = true; // Toggles the warnings feature // TODO add command to toggle warning feature #endregion diff --git a/stardew-access/ModEntry.cs b/stardew-access/ModEntry.cs index f9de5d3..03cdc36 100644 --- a/stardew-access/ModEntry.cs +++ b/stardew-access/ModEntry.cs @@ -168,9 +168,11 @@ namespace stardew_access //handle TileCursor update logic TileViewerFeature.update(); - WarningsFeature.update(); + if (Config.Warning) + WarningsFeature.update(); - ReadTileFeature.update(); + if (Config.ReadTile) + ReadTileFeature.update(); if (!RadarFeature.isRunning && Config.Radar) {