Added new chat message narration

This commit is contained in:
shoaib11120
2021-12-29 18:43:56 +05:30
parent 655794fd17
commit b9c29f1fed
3 changed files with 37 additions and 1 deletions

View File

@@ -15,6 +15,26 @@ namespace stardew_access.Patches
private static string currentLetterText = " ";
private static string currentDailyQuestText = " ";
internal static void ChatBoxPatch(ChatBox __instance, List<ChatMessage> ___messages)
{
try
{
if (___messages.Count - 1 < 0)
return;
string toSpeak = "";
___messages[___messages.Count - 1].message.ForEach(message =>
{
toSpeak += $"{message.message}, ";
});
ScreenReader.sayWithChatChecker(toSpeak, false);
}
catch (Exception e)
{
MainClass.monitor.Log($"Unable to narrate Text:\n{e.Message}\n{e.StackTrace}", LogLevel.Error);
}
}
internal static void CoopMenuPatch(CoopMenu __instance, CoopMenu.Tab ___currentTab)
{