From 2049ed2b9eb9dea6ea1cf02e501d3ba560b3309b Mon Sep 17 00:00:00 2001 From: shoaib11120 Date: Wed, 5 Jan 2022 19:03:31 +0530 Subject: [PATCH] Added quality narratrion to items --- stardew-access/Patches/DialoguePatches.cs | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/stardew-access/Patches/DialoguePatches.cs b/stardew-access/Patches/DialoguePatches.cs index 254353c..1a1b86e 100644 --- a/stardew-access/Patches/DialoguePatches.cs +++ b/stardew-access/Patches/DialoguePatches.cs @@ -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); } } }