Merge pull request #12 from bradjrenshaw/master
added config and option to toggle coordinate verbosity
This commit is contained in:
7
stardew-access/ModConfig.cs
Normal file
7
stardew-access/ModConfig.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace stardew_access
|
||||||
|
{
|
||||||
|
class ModConfig
|
||||||
|
{
|
||||||
|
public Boolean VerboseCoordinates { get; set; } = true;
|
||||||
|
}
|
||||||
|
}
|
@@ -12,6 +12,7 @@ namespace stardew_access
|
|||||||
{
|
{
|
||||||
public class MainClass : Mod
|
public class MainClass : Mod
|
||||||
{
|
{
|
||||||
|
private ModConfig config;
|
||||||
private Harmony? harmony;
|
private Harmony? harmony;
|
||||||
public static bool readTile = true;
|
public static bool readTile = true;
|
||||||
public static bool snapMouse = true;
|
public static bool snapMouse = true;
|
||||||
@@ -54,7 +55,7 @@ namespace stardew_access
|
|||||||
public override void Entry(IModHelper helper)
|
public override void Entry(IModHelper helper)
|
||||||
{
|
{
|
||||||
#region Initializations
|
#region Initializations
|
||||||
|
this.config = helper.ReadConfig<ModConfig>();
|
||||||
SetMonitor(base.Monitor); // Inititalize monitor
|
SetMonitor(base.Monitor); // Inititalize monitor
|
||||||
modHelper = helper;
|
modHelper = helper;
|
||||||
|
|
||||||
@@ -177,7 +178,16 @@ namespace stardew_access
|
|||||||
// Narrate Position
|
// Narrate Position
|
||||||
if (Equals(e.Button, SButton.K) && !isLeftAltPressed)
|
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);
|
MainClass.GetScreenReader().Say(toSpeak, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user