Fixed bug for more than 1 text boxes in a menu

In this bug, if there were amore than 1 text boxes, then the textBoxQuery was resets to ' '
even if a text box is selected because of the other unselected text boxes
master
Mohammad Shoaib Khan 2023-02-21 21:41:45 +05:30
parent 5296c4cabe
commit e595a03be6
No known key found for this signature in database
GPG Key ID: D8040D966320B620
1 changed files with 12 additions and 13 deletions

View File

@ -8,22 +8,21 @@ namespace stardew_access.Patches
{
try
{
bool isEscPressed = StardewValley.Game1.input.GetKeyboardState().IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Escape); // For escaping/unselecting from the animal name text box
string toSpeak = " ";
if (__instance.Selected)
if (!__instance.Selected)
{
MainClass.isAnyTextBoxActive = false;
return;
}
MainClass.isAnyTextBoxActive = true;
toSpeak = __instance.Text;
bool isEscPressed = StardewValley.Game1.input.GetKeyboardState().IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Escape);
string toSpeak = __instance.Text;
if (isEscPressed)
{
__instance.Selected = false;
}
}
else
{
MainClass.isAnyTextBoxActive = false;
}
if (textBoxQuery != toSpeak)
{