Fixed stuttering in animal menu

master
Mohammad Shoaib 2022-04-23 15:34:33 +05:30
parent d051e4359c
commit 49ec3fc85b
1 changed files with 5 additions and 2 deletions

View File

@ -15,6 +15,7 @@ namespace stardew_access.Patches
internal static string currentLevelUpTitle = " "; internal static string currentLevelUpTitle = " ";
internal static bool firstTimeInNamingMenu = true; internal static bool firstTimeInNamingMenu = true;
internal static bool isNarratingPondInfo = false; internal static bool isNarratingPondInfo = false;
internal static bool isNarratingAnimalInfo = false;
internal static string animalQueryMenuQuery = " "; internal static string animalQueryMenuQuery = " ";
internal static string tailoringMenuQuery = " "; internal static string tailoringMenuQuery = " ";
internal static string pondQueryMenuQuery = " "; internal static string pondQueryMenuQuery = " ";
@ -214,7 +215,6 @@ namespace stardew_access.Patches
{ {
pondQueryMenuQuery = toSpeak; pondQueryMenuQuery = toSpeak;
MainClass.ScreenReader.Say(extra + " \n\t" + toSpeak, true); MainClass.ScreenReader.Say(extra + " \n\t" + toSpeak, true);
MainClass.DebugLog(extra + " \n\t" + toSpeak);
} }
} }
catch (System.Exception e) catch (System.Exception e)
@ -373,7 +373,7 @@ namespace stardew_access.Patches
} }
else else
{ {
if (isCPressed) if (isCPressed & !isNarratingAnimalInfo)
{ {
string name = ___animal.displayName; string name = ___animal.displayName;
string type = ___animal.displayType; string type = ___animal.displayType;
@ -391,6 +391,9 @@ namespace stardew_access.Patches
details = $"Name: {name} Type: {type} \n\t Age: {ageText} {parent}"; details = $"Name: {name} Type: {type} \n\t Age: {ageText} {parent}";
animalQueryMenuQuery = " "; animalQueryMenuQuery = " ";
isNarratingAnimalInfo = true;
Task.Delay(200).ContinueWith(_ => { isNarratingAnimalInfo = false; });
} }
if (__instance.okButton != null && __instance.okButton.containsPoint(x, y)) if (__instance.okButton != null && __instance.okButton.containsPoint(x, y))