Merge pull request #12 from bradjrenshaw/master

added config and option to toggle coordinate verbosity
master
Mohammad Shoaib 2022-03-21 10:58:05 +05:30 committed by GitHub
commit 3b4bea69f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 2 deletions

View File

@ -0,0 +1,7 @@
namespace stardew_access
{
class ModConfig
{
public Boolean VerboseCoordinates { get; set; } = true;
}
}

View File

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