Cleaned the code a bit

master
Mohammad Shoaib 2022-05-15 15:03:04 +05:30
parent 7f81d72771
commit af50fd114c
2 changed files with 15 additions and 12 deletions

View File

@ -13,14 +13,18 @@ namespace stardew_access.Patches
{ {
try try
{ {
if (MainClass.ModHelper == null)
return;
string toSpeak = " "; string toSpeak = " ";
if (___currentState == 3) if (___currentState == 3)
{ {
toSpeak = "Travelling to Stardew Valley bus stop"; toSpeak = MainClass.ModHelper.Translation.Get("intro.scene3");
} }
if (___currentState == 4) else if (___currentState == 4)
{ {
toSpeak = "Stardew valley 0.5 miles away"; toSpeak = MainClass.ModHelper.Translation.Get("intro.scene4");
} }
if (toSpeak != " " && introQuery != toSpeak) if (toSpeak != " " && introQuery != toSpeak)
@ -56,29 +60,26 @@ namespace stardew_access.Patches
{ {
toSpeak = MainClass.ModHelper.Translation.Get("grandpastory.scene0"); toSpeak = MainClass.ModHelper.Translation.Get("grandpastory.scene0");
} }
else if (___drawGrandpa)
if (___drawGrandpa)
{ {
if (___grandpaSpeech.Count > 0 && ___grandpaSpeechTimer > 3000) if (___grandpaSpeech.Count > 0 && ___grandpaSpeechTimer > 3000)
{ {
toSpeak = ___grandpaSpeech.Peek(); toSpeak = ___grandpaSpeech.Peek();
} }
} }
if (___scene == 3) else if (___scene == 3)
{ {
toSpeak = Game1.content.LoadString("Strings\\StringsFromCSFiles:GrandpaStory.cs.12059"); toSpeak = Game1.content.LoadString("Strings\\StringsFromCSFiles:GrandpaStory.cs.12059");
} }
else if (___scene == 4)
if (___scene == 4)
{ {
toSpeak = MainClass.ModHelper.Translation.Get("grandpastory.scene4"); toSpeak = MainClass.ModHelper.Translation.Get("grandpastory.scene4");
} }
if (___scene == 5) else if (___scene == 5)
{ {
toSpeak = MainClass.ModHelper.Translation.Get("grandpastory.scene5"); toSpeak = MainClass.ModHelper.Translation.Get("grandpastory.scene5");
} }
else if (___scene == 6)
if (___scene == 6)
{ {
if (___grandpaSpeechTimer > 3000) if (___grandpaSpeechTimer > 3000)
{ {

View File

@ -6,5 +6,7 @@
"grandpastory.scene4":"Employees working in JoJa corp.", "grandpastory.scene4":"Employees working in JoJa corp.",
"grandpastory.scene5":"Employees in their cubicals, some of them look exhausted including yourself.", "grandpastory.scene5":"Employees in their cubicals, some of them look exhausted including yourself.",
"grandpastory.scene6":"You reach your desk finding grandpa's letter.", "grandpastory.scene6":"You reach your desk finding grandpa's letter.",
"grandpastory.letteropen":"Left click to open grandpa's letter" "grandpastory.letteropen":"Left click to open grandpa's letter",
"intro.scene3":"Travelling to Stardew Valley bus stop",
"intro.scene4":"Stardew valley 0.5 miles away"
} }