From 222385daf9fb7e868f3580b8a301c7fe8fe22292 Mon Sep 17 00:00:00 2001 From: shoaib11120 Date: Wed, 19 Jan 2022 12:59:29 +0530 Subject: [PATCH] Added command to exclude a key from exclusions --- stardew-access/ModEntry.cs | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/stardew-access/ModEntry.cs b/stardew-access/ModEntry.cs index 405aa16..c5bf429 100644 --- a/stardew-access/ModEntry.cs +++ b/stardew-access/ModEntry.cs @@ -243,7 +243,7 @@ namespace stardew_access monitor.Log("Radar " + (snapMouse ? "on" : "off"), LogLevel.Info); }); - helper.ConsoleCommands.Add("r_in", "Include an object to radar", (string commmand, string[] args) => + helper.ConsoleCommands.Add("r_ex", "Exclude an object key to radar", (string commmand, string[] args) => { string? keyToAdd = null; @@ -261,6 +261,31 @@ namespace stardew_access } }); + helper.ConsoleCommands.Add("r_in", "Inlcude an object key to radar", (string commmand, string[] args) => + { + string? keyToAdd = null; + + for (int i = 0; i < args.Count(); i++) { keyToAdd += " " + args[i]; } + + if (keyToAdd != null) + { + keyToAdd = keyToAdd.Trim().ToLower(); + if (radarFeature.exclusions.Contains(keyToAdd)) + { + radarFeature.exclusions.Remove(keyToAdd); + monitor.Log($"Removed {keyToAdd} key from exclusions.", LogLevel.Info); + } + else + { + monitor.Log($"Cannot find{keyToAdd} key in exclusions.", LogLevel.Info); + } + } + else + { + monitor.Log("Unable to remove the key from exclusions.", LogLevel.Info); + } + }); + helper.ConsoleCommands.Add("ref_sr", "Refresh screen reader", (string commmand, string[] args) => { ScreenReader.initializeScreenReader();