Added quality narratrion to items

master
shoaib11120 2022-01-05 19:03:31 +05:30
parent f0f299b384
commit 2049ed2b9e
1 changed files with 21 additions and 2 deletions
stardew-access/Patches

View File

@ -97,7 +97,7 @@ namespace stardew_access.Patches
}
catch (Exception e)
{
MainClass.monitor.Log($"Unable to narrate dialog:\n{e.StackTrace}", LogLevel.Error);
MainClass.monitor.Log($"Unable to narrate dialog:\n{e.StackTrace}\n{e.Message}", LogLevel.Error);
}
}
@ -138,6 +138,25 @@ namespace stardew_access.Patches
toSpeak.Append($"{boldTitleText}\n");
#endregion
#region Add quality of item
if (hoveredItem is StardewValley.Object && (hoveredItem as StardewValley.Object).quality>0)
{
int quality = (hoveredItem as StardewValley.Object).quality;
if (quality == 1)
{
toSpeak.Append("Silver quality");
}
else if (quality == 2 || quality == 3)
{
toSpeak.Append("Gold quality");
}
else if (quality >= 4)
{
toSpeak.Append("Iridium quality");
}
}
#endregion
#region Add money
if (moneyAmountToDisplayAtBottom != -1)
toSpeak.Append($"\nCost: {moneyAmountToDisplayAtBottom}g\n");
@ -213,7 +232,7 @@ namespace stardew_access.Patches
}
catch (Exception e)
{
MainClass.monitor.Log($"Unable to narrate dialog:\n{e.StackTrace}", LogLevel.Error);
MainClass.monitor.Log($"Unable to narrate dialog:\n{e.StackTrace}\n{e.Message}", LogLevel.Error);
}
}
}