Issue#56 Other currency narration

master
Mohammad Shoaib Khan 2022-10-23 12:00:30 +05:30
parent 9d1c6f95dd
commit 950ab21d61
1 changed files with 27 additions and 7 deletions

View File

@ -917,7 +917,6 @@ namespace stardew_access.Patches
MainClass.ScreenReader.Say(toSpeak, true); MainClass.ScreenReader.Say(toSpeak, true);
Game1.playSound("drop_item"); Game1.playSound("drop_item");
} }
return;
} }
if (__instance.organizeButton != null && __instance.organizeButton.containsPoint(x, y)) if (__instance.organizeButton != null && __instance.organizeButton.containsPoint(x, y))
@ -930,7 +929,6 @@ namespace stardew_access.Patches
hoveredItemQueryKey = ""; hoveredItemQueryKey = "";
MainClass.ScreenReader.Say(toSpeak, true); MainClass.ScreenReader.Say(toSpeak, true);
} }
return;
} }
if (__instance.trashCan != null && __instance.trashCan.containsPoint(x, y)) if (__instance.trashCan != null && __instance.trashCan.containsPoint(x, y))
@ -943,7 +941,6 @@ namespace stardew_access.Patches
hoveredItemQueryKey = ""; hoveredItemQueryKey = "";
MainClass.ScreenReader.Say(toSpeak, true); MainClass.ScreenReader.Say(toSpeak, true);
} }
return;
} }
if (__instance.organizeButton != null && __instance.organizeButton.containsPoint(x, y)) if (__instance.organizeButton != null && __instance.organizeButton.containsPoint(x, y))
@ -956,7 +953,6 @@ namespace stardew_access.Patches
hoveredItemQueryKey = ""; hoveredItemQueryKey = "";
MainClass.ScreenReader.Say(toSpeak, true); MainClass.ScreenReader.Say(toSpeak, true);
} }
return;
} }
if (__instance.junimoNoteIcon != null && __instance.junimoNoteIcon.containsPoint(x, y)) if (__instance.junimoNoteIcon != null && __instance.junimoNoteIcon.containsPoint(x, y))
@ -970,7 +966,6 @@ namespace stardew_access.Patches
hoveredItemQueryKey = ""; hoveredItemQueryKey = "";
MainClass.ScreenReader.Say(toSpeak, true); MainClass.ScreenReader.Say(toSpeak, true);
} }
return;
} }
#endregion #endregion
@ -1066,7 +1061,6 @@ namespace stardew_access.Patches
hoveredItemQueryKey = ""; hoveredItemQueryKey = "";
MainClass.ScreenReader.Say(toSpeak, true); MainClass.ScreenReader.Say(toSpeak, true);
} }
return;
} }
} }
#endregion #endregion
@ -1076,9 +1070,35 @@ namespace stardew_access.Patches
{ {
gameMenuQueryKey = ""; gameMenuQueryKey = "";
inventoryPageQueryKey = ""; inventoryPageQueryKey = "";
return;
} }
#endregion #endregion
if (MainClass.Config.MoneyKey.JustPressed())
{
string farmName = Game1.content.LoadString("Strings\\UI:Inventory_FarmName", Game1.player.farmName.Value);
string currentFunds = Game1.content.LoadString("Strings\\UI:Inventory_CurrentFunds" + (Game1.player.useSeparateWallets ? "_Separate" : ""), Utility.getNumberWithCommas(Game1.player.Money));
string totalEarnings = Game1.content.LoadString("Strings\\UI:Inventory_TotalEarnings" + (Game1.player.useSeparateWallets ? "_Separate" : ""), Utility.getNumberWithCommas((int)Game1.player.totalMoneyEarned));
int festivalScore = Game1.player.festivalScore;
int walnut = Game1.netWorldState.Value.GoldenWalnuts.Value;
int qiGems = Game1.player.QiGems;
int qiCoins = Game1.player.clubCoins;
string toSpeak = $"{farmName}\n{currentFunds}\n{totalEarnings}";
if (festivalScore > 0)
toSpeak = $"{toSpeak}\nFestival Score: {festivalScore}";
if (walnut > 0)
toSpeak = $"{toSpeak}\nGolden Walnut: {walnut}";
if (qiGems > 0)
toSpeak = $"{toSpeak}\nQi Gems: {qiGems}";
if (qiCoins > 0)
toSpeak = $"{toSpeak}\nQi Club Coins: {qiCoins}";
MainClass.ScreenReader.Say(toSpeak, true);
}
} }
catch (Exception e) catch (Exception e)
{ {