Merge pull request #94 from khanshoaib3/Issue90

Speak year and season on day 1
master
Mohammad Shoaib Khan 2023-04-04 16:01:55 +05:30 committed by GitHub
commit 7bb4819601
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -18,7 +18,7 @@ namespace stardew_access.Patches
} }
else else
{ {
narrateCallendar(__instance); narrateCalendar(__instance);
} }
} }
catch (Exception e) catch (Exception e)
@ -27,7 +27,7 @@ namespace stardew_access.Patches
} }
} }
private static void narrateCallendar(Billboard __instance) private static void narrateCalendar(Billboard __instance)
{ {
for (int i = 0; i < __instance.calendarDays.Count; i++) for (int i = 0; i < __instance.calendarDays.Count; i++)
{ {
@ -35,6 +35,7 @@ namespace stardew_access.Patches
continue; continue;
string toSpeak = $"Day {i + 1}"; string toSpeak = $"Day {i + 1}";
string currentYearNMonth = $"of {Game1.CurrentSeasonDisplayName}, {Game1.content.LoadString("Strings\\UI:Billboard_Year", Game1.year)}";
if (__instance.calendarDays[i].name.Length > 0) if (__instance.calendarDays[i].name.Length > 0)
{ {
@ -46,13 +47,16 @@ namespace stardew_access.Patches
} }
if (Game1.dayOfMonth == i + 1) if (Game1.dayOfMonth == i + 1)
toSpeak += $", Current"; toSpeak = $"Current {toSpeak}";
if (billboardQueryKey != toSpeak) if (billboardQueryKey != toSpeak)
{ {
billboardQueryKey = toSpeak; billboardQueryKey = toSpeak;
if (i == 0) toSpeak = $"{toSpeak} {currentYearNMonth}";
MainClass.ScreenReader.Say(toSpeak, true); MainClass.ScreenReader.Say(toSpeak, true);
} }
return;
} }
} }