Added command to toggle tts
parent
452bbdf86c
commit
b600eda78e
|
@ -521,6 +521,14 @@ namespace stardew_access
|
||||||
|
|
||||||
MainClass.DebugLog("Warnings is " + (MainClass.Config.Warning ? "on" : "off"));
|
MainClass.DebugLog("Warnings is " + (MainClass.Config.Warning ? "on" : "off"));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
helper.ConsoleCommands.Add("tts", "Toggles the screen reader/tts", (string commmand, string[] args) =>
|
||||||
|
{
|
||||||
|
MainClass.Config.TTS = !MainClass.Config.TTS;
|
||||||
|
helper.WriteConfig(MainClass.Config);
|
||||||
|
|
||||||
|
MainClass.DebugLog("TTS is " + (MainClass.Config.TTS ? "on" : "off"));
|
||||||
|
});
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,6 +78,7 @@ namespace stardew_access
|
||||||
public Boolean VerboseCoordinates { get; set; } = true;
|
public Boolean VerboseCoordinates { get; set; } = true;
|
||||||
public Boolean SnapMouse { get; set; } = true; // Toggles the snap mouse feature
|
public Boolean SnapMouse { get; set; } = true; // Toggles the snap mouse feature
|
||||||
public Boolean Warning { get; set; } = true; // Toggles the warnings feature
|
public Boolean Warning { get; set; } = true; // Toggles the warnings feature
|
||||||
|
public Boolean TTS { get; set; } = true; // Toggles the screen reader/tts.
|
||||||
// TODO add command to toggle warning feature
|
// TODO add command to toggle warning feature
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
@ -62,11 +62,14 @@ namespace stardew_access.ScreenReader
|
||||||
if (text == null)
|
if (text == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (initialized)
|
if (!initialized)
|
||||||
{
|
return;
|
||||||
GoString str = new GoString(text, text.Length);
|
|
||||||
Speak(str, interrupt);
|
if (!MainClass.Config.TTS)
|
||||||
}
|
return;
|
||||||
|
|
||||||
|
GoString str = new GoString(text, text.Length);
|
||||||
|
Speak(str, interrupt);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SayWithChecker(string text, bool interrupt)
|
public void SayWithChecker(string text, bool interrupt)
|
||||||
|
|
|
@ -62,6 +62,9 @@ namespace stardew_access.ScreenReader
|
||||||
if (screenReader == null)
|
if (screenReader == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!MainClass.Config.TTS)
|
||||||
|
return;
|
||||||
|
|
||||||
screenReader.Speak(text, interrupt);
|
screenReader.Speak(text, interrupt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue