Added keybind for money and time narration
parent
8fe6d37d4b
commit
329154bea6
|
@ -52,7 +52,28 @@ namespace stardew_access.Game
|
|||
public static string getTimeOfDay()
|
||||
{
|
||||
int timeOfDay = Game1.timeOfDay;
|
||||
return timeOfDay.ToString();
|
||||
|
||||
int minutes = timeOfDay % 100;
|
||||
int hours = timeOfDay / 100;
|
||||
string amOrpm = "A M";
|
||||
if(hours>=12)
|
||||
{
|
||||
amOrpm = "P M";
|
||||
if (hours > 12)
|
||||
hours -= 12;
|
||||
}
|
||||
|
||||
return $"{hours}:{minutes} {amOrpm}";
|
||||
}
|
||||
|
||||
public static string getSeason()
|
||||
{
|
||||
return Game1.CurrentSeasonDisplayName;
|
||||
}
|
||||
|
||||
public static int getDay()
|
||||
{
|
||||
return Game1.dayOfMonth;
|
||||
}
|
||||
|
||||
public static int getMoney()
|
||||
|
|
|
@ -159,32 +159,45 @@ namespace stardew_access
|
|||
|
||||
private void OnButtonPressed(object sender, ButtonPressedEventArgs e)
|
||||
{
|
||||
if (Game1.activeClickableMenu == null)
|
||||
if (!Context.IsPlayerFree)
|
||||
return;
|
||||
|
||||
// Narrate health and stamina
|
||||
if (Equals(e.Button, SButton.H))
|
||||
{
|
||||
// Narrate health and stamina
|
||||
if (Equals(e.Button, SButton.H))
|
||||
{
|
||||
string toSpeak = $"Health is {CurrentPlayer.getHealth()} and Stamina is {CurrentPlayer.getStamina()}";
|
||||
ScreenReader.say(toSpeak, true);
|
||||
}
|
||||
string toSpeak = $"Health is {CurrentPlayer.getHealth()} and Stamina is {CurrentPlayer.getStamina()}";
|
||||
ScreenReader.say(toSpeak, true);
|
||||
}
|
||||
|
||||
// Narrate Position
|
||||
if (Equals(e.Button, SButton.K))
|
||||
{
|
||||
string toSpeak = $"X: {CurrentPlayer.getPositionX()} , Y: {CurrentPlayer.getPositionY()}";
|
||||
ScreenReader.say(toSpeak, true);
|
||||
}
|
||||
// Narrate Position
|
||||
if (Equals(e.Button, SButton.K))
|
||||
{
|
||||
string toSpeak = $"X: {CurrentPlayer.getPositionX()} , Y: {CurrentPlayer.getPositionY()}";
|
||||
ScreenReader.say(toSpeak, true);
|
||||
}
|
||||
|
||||
if (Equals(e.Button, SButton.J))
|
||||
{
|
||||
Game1.pressActionButton(Game1.input.GetKeyboardState(), Game1.input.GetMouseState(), Game1.input.GetGamePadState());
|
||||
}
|
||||
// Narrate money at hand
|
||||
if (Equals(e.Button, SButton.R))
|
||||
{
|
||||
string toSpeak = $"You have {CurrentPlayer.getMoney()}g";
|
||||
ScreenReader.say(toSpeak, true);
|
||||
}
|
||||
|
||||
if (Equals(e.Button, SButton.L))
|
||||
{
|
||||
Game1.pressUseToolButton();
|
||||
}
|
||||
|
||||
// Narrate time and season
|
||||
if (Equals(e.Button, SButton.Q))
|
||||
{
|
||||
string toSpeak = $"Time is {CurrentPlayer.getTimeOfDay()} and season is {CurrentPlayer.getSeason()}";
|
||||
ScreenReader.say(toSpeak, true);
|
||||
}
|
||||
|
||||
if (Equals(e.Button, SButton.J))
|
||||
{
|
||||
Game1.pressActionButton(Game1.input.GetKeyboardState(), Game1.input.GetMouseState(), Game1.input.GetGamePadState());
|
||||
}
|
||||
|
||||
if (Equals(e.Button, SButton.L))
|
||||
{
|
||||
Game1.pressUseToolButton();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"Name": "Stardew Access",
|
||||
"Author": "Mohammad Shoaib",
|
||||
"Version": "1.0.6-beta",
|
||||
"Version": "1.0.7-beta",
|
||||
"Description": "An accessibility mod with screen reader support!",
|
||||
"UniqueID": "shoaib.stardewaccess",
|
||||
"EntryDll": "stardew-access.dll",
|
||||
|
|
Loading…
Reference in New Issue