From f9b4bc88db6348c0f84a7d226e5d8de502cb8e25 Mon Sep 17 00:00:00 2001 From: bradjrenshaw Date: Sun, 20 Mar 2022 16:26:30 -0400 Subject: [PATCH] added config and option to toggle coordinate verbosity; fixed coordinate formatting of comma. --- stardew-access/ModConfig.cs | 7 +++++++ stardew-access/ModEntry.cs | 14 ++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 stardew-access/ModConfig.cs diff --git a/stardew-access/ModConfig.cs b/stardew-access/ModConfig.cs new file mode 100644 index 0000000..e671468 --- /dev/null +++ b/stardew-access/ModConfig.cs @@ -0,0 +1,7 @@ +namespace stardew_access +{ + class ModConfig + { + public Boolean VerboseCoordinates { get; set; } = true; + } +} diff --git a/stardew-access/ModEntry.cs b/stardew-access/ModEntry.cs index 5558305..117524a 100644 --- a/stardew-access/ModEntry.cs +++ b/stardew-access/ModEntry.cs @@ -12,6 +12,7 @@ namespace stardew_access { public class MainClass : Mod { + private ModConfig config; private Harmony? harmony; public static bool readTile = true; public static bool snapMouse = true; @@ -54,7 +55,7 @@ namespace stardew_access public override void Entry(IModHelper helper) { #region Initializations - + this.config = helper.ReadConfig(); SetMonitor(base.Monitor); // Inititalize monitor modHelper = helper; @@ -177,7 +178,16 @@ namespace stardew_access // Narrate Position if (Equals(e.Button, SButton.K) && !isLeftAltPressed) { - string toSpeak = $"X: {CurrentPlayer.getPositionX()} , Y: {CurrentPlayer.getPositionY()}"; + string toSpeak; + if (this.config.VerboseCoordinates) + { + toSpeak = $"X: {CurrentPlayer.getPositionX()}, Y: {CurrentPlayer.getPositionY()}"; + } + else + { + toSpeak = $"{CurrentPlayer.getPositionX()}, {CurrentPlayer.getPositionY()}"; + } + MainClass.GetScreenReader().Say(toSpeak, true); }