Added command to toggle warnings feature

master
Mohammad Shoaib Khan 2022-08-18 12:37:32 +05:30
parent 895f329b8b
commit 3083ebca84
4 changed files with 34 additions and 22 deletions

View File

@ -15,6 +15,7 @@ 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;
@ -23,14 +24,6 @@ namespace stardew_access
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"));
});
helper.ConsoleCommands.Add("flooring", "Toggle flooring in read tile.", (string commmand, string[] args) =>
{
MainClass.Config.ReadFlooring = !MainClass.Config.ReadFlooring;
@ -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,6 +476,7 @@ namespace stardew_access
});
#endregion
#region Other
helper.ConsoleCommands.Add("refsr", "Refresh screen reader", (string commmand, string[] args) =>
{
MainClass.ScreenReader.InitializeScreenReader();
@ -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
}
}
}

View File

@ -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; });

View File

@ -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

View File

@ -168,8 +168,10 @@ namespace stardew_access
//handle TileCursor update logic
TileViewerFeature.update();
if (Config.Warning)
WarningsFeature.update();
if (Config.ReadTile)
ReadTileFeature.update();
if (!RadarFeature.isRunning && Config.Radar)