added more scenes to grandpa story
parent
f9dd84efc8
commit
7f81d72771
|
@ -194,6 +194,7 @@ namespace stardew_access
|
||||||
|
|
||||||
bool isLeftAltPressed = Game1.input.GetKeyboardState().IsKeyDown(Microsoft.Xna.Framework.Input.Keys.LeftAlt);
|
bool isLeftAltPressed = Game1.input.GetKeyboardState().IsKeyDown(Microsoft.Xna.Framework.Input.Keys.LeftAlt);
|
||||||
|
|
||||||
|
#region Simulate left and right clicks
|
||||||
if (Game1.activeClickableMenu != null)
|
if (Game1.activeClickableMenu != null)
|
||||||
{
|
{
|
||||||
bool isLeftShiftPressed = Game1.input.GetKeyboardState().IsKeyDown(Microsoft.Xna.Framework.Input.Keys.LeftShift);
|
bool isLeftShiftPressed = Game1.input.GetKeyboardState().IsKeyDown(Microsoft.Xna.Framework.Input.Keys.LeftShift);
|
||||||
|
@ -223,6 +224,36 @@ namespace stardew_access
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Game1.currentMinigame != null)
|
||||||
|
{
|
||||||
|
bool isLeftShiftPressed = Game1.input.GetKeyboardState().IsKeyDown(Microsoft.Xna.Framework.Input.Keys.LeftShift);
|
||||||
|
bool isLeftControlPressed = Game1.input.GetKeyboardState().IsKeyDown(Microsoft.Xna.Framework.Input.Keys.LeftControl);
|
||||||
|
bool isCustomizingChrachter = Game1.activeClickableMenu is CharacterCustomization || (TitleMenu.subMenu != null && TitleMenu.subMenu is CharacterCustomization);
|
||||||
|
|
||||||
|
#region Mouse Click Simulation
|
||||||
|
// Main Keybinds
|
||||||
|
if (isLeftControlPressed && Config.LeftClickMainKey.JustPressed())
|
||||||
|
{
|
||||||
|
Game1.currentMinigame.receiveLeftClick(Game1.getMouseX(true), Game1.getMouseY(true));
|
||||||
|
}
|
||||||
|
if (isLeftShiftPressed && Config.RightClickMainKey.JustPressed())
|
||||||
|
{
|
||||||
|
Game1.currentMinigame.receiveRightClick(Game1.getMouseX(true), Game1.getMouseY(true));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Alternate Keybinds
|
||||||
|
if (Config.LeftClickAlternateKey.JustPressed())
|
||||||
|
{
|
||||||
|
Game1.currentMinigame.receiveLeftClick(Game1.getMouseX(true), Game1.getMouseY(true));
|
||||||
|
}
|
||||||
|
if (Config.RightClickAlternateKey.JustPressed())
|
||||||
|
{
|
||||||
|
Game1.currentMinigame.receiveRightClick(Game1.getMouseX(true), Game1.getMouseY(true));
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
if (!Context.IsPlayerFree)
|
if (!Context.IsPlayerFree)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -7,31 +7,27 @@ namespace stardew_access.Patches
|
||||||
public class MiniGamesPatches
|
public class MiniGamesPatches
|
||||||
{
|
{
|
||||||
public static string grandpaStoryQuery = " ";
|
public static string grandpaStoryQuery = " ";
|
||||||
|
public static string introQuery = " ";
|
||||||
|
|
||||||
internal static void IntroPatch(Intro __instance, int ___currentState)
|
internal static void IntroPatch(Intro __instance, int ___currentState)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
MainClass.DebugLog(___currentState + "\t intro");
|
string toSpeak = " ";
|
||||||
if (___currentState == 3)
|
if (___currentState == 3)
|
||||||
{
|
{
|
||||||
string text = "Travelling to Stardew Valley bus stop";
|
toSpeak = "Travelling to Stardew Valley bus stop";
|
||||||
if (grandpaStoryQuery != text)
|
|
||||||
{
|
|
||||||
grandpaStoryQuery = text;
|
|
||||||
MainClass.ScreenReader.Say(text, true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (___currentState == 4)
|
if (___currentState == 4)
|
||||||
{
|
{
|
||||||
string text = "Stardew valley 0.5 miles away";
|
toSpeak = "Stardew valley 0.5 miles away";
|
||||||
if (grandpaStoryQuery != text)
|
|
||||||
{
|
|
||||||
grandpaStoryQuery = text;
|
|
||||||
MainClass.ScreenReader.Say(text, true);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (toSpeak != " " && introQuery != toSpeak)
|
||||||
|
{
|
||||||
|
introQuery = toSpeak;
|
||||||
|
MainClass.ScreenReader.Say(toSpeak, false);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (System.Exception e)
|
catch (System.Exception e)
|
||||||
|
@ -45,46 +41,42 @@ namespace stardew_access.Patches
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int x = Game1.getMouseX(true), y = Game1.getMouseY(true); // Mouse x and y position
|
int x = Game1.getMouseX(true), y = Game1.getMouseY(true); // Mouse x and y position
|
||||||
|
string toSpeak = " ";
|
||||||
|
MainClass.DebugLog("" + ___scene);
|
||||||
|
|
||||||
// TODO add scene 0 explaination
|
if (___letterView != null)
|
||||||
// if(___scene == 0)
|
{
|
||||||
// {
|
DialoguePatches.NarrateLetterContent(___letterView);
|
||||||
//
|
}
|
||||||
// }
|
|
||||||
|
if (MainClass.ModHelper == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (___scene == 0)
|
||||||
|
{
|
||||||
|
toSpeak = MainClass.ModHelper.Translation.Get("grandpastory.scene0");
|
||||||
|
}
|
||||||
|
|
||||||
if (___drawGrandpa)
|
if (___drawGrandpa)
|
||||||
{
|
{
|
||||||
if (___grandpaSpeech.Count > 0 && ___grandpaSpeechTimer > 3000)
|
if (___grandpaSpeech.Count > 0 && ___grandpaSpeechTimer > 3000)
|
||||||
{
|
{
|
||||||
string text = ___grandpaSpeech.Peek();
|
toSpeak = ___grandpaSpeech.Peek();
|
||||||
if (grandpaStoryQuery != text)
|
|
||||||
{
|
|
||||||
grandpaStoryQuery = text;
|
|
||||||
MainClass.ScreenReader.Say(text, true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (___scene == 3)
|
if (___scene == 3)
|
||||||
{
|
{
|
||||||
string text = Game1.content.LoadString("Strings\\StringsFromCSFiles:GrandpaStory.cs.12059");
|
toSpeak = Game1.content.LoadString("Strings\\StringsFromCSFiles:GrandpaStory.cs.12059");
|
||||||
if (grandpaStoryQuery != text)
|
|
||||||
{
|
|
||||||
grandpaStoryQuery = text;
|
|
||||||
MainClass.ScreenReader.Say(text, true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO add scene 4 & 5 explaination
|
if (___scene == 4)
|
||||||
// if(___scene == 4)
|
{
|
||||||
// {
|
toSpeak = MainClass.ModHelper.Translation.Get("grandpastory.scene4");
|
||||||
//
|
}
|
||||||
// }
|
if (___scene == 5)
|
||||||
// if(___scene == 5)
|
{
|
||||||
// {
|
toSpeak = MainClass.ModHelper.Translation.Get("grandpastory.scene5");
|
||||||
//
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
if (___scene == 6)
|
if (___scene == 6)
|
||||||
{
|
{
|
||||||
|
@ -92,13 +84,7 @@ namespace stardew_access.Patches
|
||||||
{
|
{
|
||||||
if (clickableGrandpaLetterRect(___parallaxPan, ___grandpaSpeechTimer).Contains(x, y))
|
if (clickableGrandpaLetterRect(___parallaxPan, ___grandpaSpeechTimer).Contains(x, y))
|
||||||
{
|
{
|
||||||
string text = "Left click to open grandpa's letter";
|
toSpeak = MainClass.ModHelper.Translation.Get("grandpastory.letteropen");
|
||||||
if (grandpaStoryQuery != text)
|
|
||||||
{
|
|
||||||
grandpaStoryQuery = text;
|
|
||||||
MainClass.ScreenReader.Say(text, true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (___letterView == null)
|
else if (___letterView == null)
|
||||||
{
|
{
|
||||||
|
@ -107,10 +93,16 @@ namespace stardew_access.Patches
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
if (___letterView != null)
|
|
||||||
{
|
{
|
||||||
DialoguePatches.NarrateLetterContent(___letterView);
|
toSpeak = MainClass.ModHelper.Translation.Get("grandpastory.scene6");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (toSpeak != " " && grandpaStoryQuery != toSpeak)
|
||||||
|
{
|
||||||
|
grandpaStoryQuery = toSpeak;
|
||||||
|
MainClass.ScreenReader.Say(toSpeak, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (System.Exception e)
|
catch (System.Exception e)
|
||||||
|
@ -119,6 +111,7 @@ namespace stardew_access.Patches
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This method is taken from the game's source code
|
||||||
private static Rectangle clickableGrandpaLetterRect(int ___parallaxPan, int ___grandpaSpeechTimer)
|
private static Rectangle clickableGrandpaLetterRect(int ___parallaxPan, int ___grandpaSpeechTimer)
|
||||||
{
|
{
|
||||||
return new Rectangle((int)Utility.getTopLeftPositionForCenteringOnScreen(Game1.viewport, 1294, 730).X + (286 - ___parallaxPan) * 4, (int)Utility.getTopLeftPositionForCenteringOnScreen(Game1.viewport, 1294, 730).Y + 218 + Math.Max(0, Math.Min(60, (___grandpaSpeechTimer - 5000) / 8)), 524, 344);
|
return new Rectangle((int)Utility.getTopLeftPositionForCenteringOnScreen(Game1.viewport, 1294, 730).X + (286 - ___parallaxPan) * 4, (int)Utility.getTopLeftPositionForCenteringOnScreen(Game1.viewport, 1294, 730).Y + 218 + Math.Max(0, Math.Min(60, (___grandpaSpeechTimer - 5000) / 8)), 524, 344);
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
{
|
{
|
||||||
"warnings.health": "Warning! Health is at {{value}} percent!",
|
"warnings.health": "Warning! Health is at {{value}} percent!",
|
||||||
"warnings.stamina": "Warning! Stamina is at {{value}} percent!",
|
"warnings.stamina": "Warning! Stamina is at {{value}} percent!",
|
||||||
"warnings.time": "Warning! Time is {{value}}"
|
"warnings.time": "Warning! Time is {{value}}",
|
||||||
|
"grandpastory.scene0":"Grandpa, on his deathbed.",
|
||||||
|
"grandpastory.scene4":"Employees working in JoJa corp.",
|
||||||
|
"grandpastory.scene5":"Employees in their cubicals, some of them look exhausted including yourself.",
|
||||||
|
"grandpastory.scene6":"You reach your desk finding grandpa's letter.",
|
||||||
|
"grandpastory.letteropen":"Left click to open grandpa's letter"
|
||||||
}
|
}
|
Loading…
Reference in New Issue