public string loadDescriptionElement() { DescriptionElement descriptionElement = new DescriptionElement(this.xmlKey, this.param); for (int i = 0; i < descriptionElement.param.Count; i++) { if (descriptionElement.param[i].GetType() == typeof(DescriptionElement)) { DescriptionElement descriptionElement2 = descriptionElement.param[i] as DescriptionElement; descriptionElement.param[i] = descriptionElement2.loadDescriptionElement(); } if (descriptionElement.param[i].GetType() == typeof(StardewValley.Object)) { string text; Game1.objectInformation.TryGetValue((descriptionElement.param[i] as StardewValley.Object).parentSheetIndex, out text); descriptionElement.param[i] = text.Split(new char[] { '/' })[4]; } if (descriptionElement.param[i].GetType() == typeof(Monster)) { DescriptionElement descriptionElement3; if ((descriptionElement.param[i] as Monster).name.Equals("Frost Jelly")) { descriptionElement3 = new DescriptionElement("Strings\\StringsFromCSFiles:SlayMonsterQuest.cs.13772"); descriptionElement.param[i] = descriptionElement3.loadDescriptionElement(); } else { descriptionElement3 = new DescriptionElement("Data\\Monsters:" + (descriptionElement.param[i] as Monster).name); descriptionElement.param[i] = ((LocalizedContentManager.CurrentLanguageCode == LocalizedContentManager.LanguageCode.en) ? (descriptionElement3.loadDescriptionElement().Split(new char[] { '/' }).Last <string>() + "s") : descriptionElement3.loadDescriptionElement().Split(new char[] { '/' }).Last <string>()); } descriptionElement.param[i] = descriptionElement3.loadDescriptionElement().Split(new char[] { '/' }).Last <string>(); } if (descriptionElement.param[i].GetType() == typeof(NPC)) { DescriptionElement descriptionElement4 = new DescriptionElement("Data\\NPCDispositions:" + (descriptionElement.param[i] as NPC).name); descriptionElement.param[i] = descriptionElement4.loadDescriptionElement().Split(new char[] { '/' }).Last <string>(); } } if (descriptionElement.xmlKey == "") { return(string.Empty); } switch (descriptionElement.param.Count) { case 0: { IL_29E: string text2 = Game1.content.LoadString(descriptionElement.xmlKey, new object[0]); if (this.xmlKey.Contains("Dialogue.cs.7") || this.xmlKey.Contains("Dialogue.cs.8")) { text2 = Game1.content.LoadString(descriptionElement.xmlKey, new object[0]).Replace("/", " "); text2 = ((text2[0] == ' ') ? text2.Substring(1) : text2); return(text2); } return(text2); } case 1: { string text2 = Game1.content.LoadString(descriptionElement.xmlKey, new object[] { descriptionElement.param[0] }); return(text2); } case 2: { string text2 = Game1.content.LoadString(descriptionElement.xmlKey, new object[] { descriptionElement.param[0], descriptionElement.param[1] }); return(text2); } case 3: { string text2 = Game1.content.LoadString(descriptionElement.xmlKey, new object[] { descriptionElement.param[0], descriptionElement.param[1], descriptionElement.param[2] }); return(text2); } case 4: { string text2 = Game1.content.LoadString(descriptionElement.xmlKey, new object[] { descriptionElement.param[0], descriptionElement.param[1], descriptionElement.param[2], descriptionElement.param[3] }); return(text2); } } goto IL_29E; }
public string loadDescriptionElement() { DescriptionElement temp = new DescriptionElement(xmlKey, param); string returnString3 = ""; for (int i = 0; i < temp.param.Count; i++) { if (temp.param[i] is DescriptionElement) { DescriptionElement d3 = temp.param[i] as DescriptionElement; temp.param[i] = d3.loadDescriptionElement(); } if (temp.param[i] is Object) { Game1.objectInformation.TryGetValue((temp.param[i] as Object).parentSheetIndex, out string objectInformation); temp.param[i] = objectInformation.Split('/')[4]; } if (temp.param[i] is Monster) { DescriptionElement d2; if ((temp.param[i] as Monster).name.Equals("Frost Jelly")) { d2 = new DescriptionElement("Strings\\StringsFromCSFiles:SlayMonsterQuest.cs.13772"); temp.param[i] = d2.loadDescriptionElement(); } else { d2 = new DescriptionElement("Data\\Monsters:" + (temp.param[i] as Monster).name); temp.param[i] = ((LocalizedContentManager.CurrentLanguageCode == LocalizedContentManager.LanguageCode.en) ? (d2.loadDescriptionElement().Split('/').Last() + "s") : d2.loadDescriptionElement().Split('/').Last()); } temp.param[i] = d2.loadDescriptionElement().Split('/').Last(); } if (temp.param[i] is NPC) { DescriptionElement d = new DescriptionElement("Data\\NPCDispositions:" + (temp.param[i] as NPC).name); temp.param[i] = d.loadDescriptionElement().Split('/').Last(); } } if (temp.xmlKey == "") { return(string.Empty); } switch (temp.param.Count) { default: returnString3 = Game1.content.LoadString(temp.xmlKey); if (xmlKey.Contains("Dialogue.cs.7") || xmlKey.Contains("Dialogue.cs.8")) { returnString3 = Game1.content.LoadString(temp.xmlKey).Replace("/", " "); returnString3 = ((returnString3[0] == ' ') ? returnString3.Substring(1) : returnString3); } break; case 1: returnString3 = Game1.content.LoadString(temp.xmlKey, temp.param[0]); break; case 2: returnString3 = Game1.content.LoadString(temp.xmlKey, temp.param[0], temp.param[1]); break; case 3: returnString3 = Game1.content.LoadString(temp.xmlKey, temp.param[0], temp.param[1], temp.param[2]); break; case 4: returnString3 = Game1.content.LoadString(temp.xmlKey, temp.param[0], temp.param[1], temp.param[2], temp.param[3]); break; } return(returnString3); }
public string loadDescriptionElement() { DescriptionElement descriptionElement1 = new DescriptionElement(this.xmlKey, this.param); for (int index1 = 0; index1 < descriptionElement1.param.Count; ++index1) { if (descriptionElement1.param[index1].GetType() == typeof(DescriptionElement)) { DescriptionElement descriptionElement2 = descriptionElement1.param[index1] as DescriptionElement; descriptionElement1.param[index1] = (object)descriptionElement2.loadDescriptionElement(); } if (descriptionElement1.param[index1].GetType() == typeof(Object)) { string str; Game1.objectInformation.TryGetValue((descriptionElement1.param[index1] as Object).parentSheetIndex, out str); descriptionElement1.param[index1] = (object)str.Split('/')[4]; } if (descriptionElement1.param[index1].GetType() == typeof(Monster)) { DescriptionElement descriptionElement2; if ((descriptionElement1.param[index1] as Monster).name.Equals("Frost Jelly")) { descriptionElement2 = new DescriptionElement("Strings\\StringsFromCSFiles:SlayMonsterQuest.cs.13772"); descriptionElement1.param[index1] = (object)descriptionElement2.loadDescriptionElement(); } else { descriptionElement2 = new DescriptionElement("Data\\Monsters:" + (descriptionElement1.param[index1] as Monster).name); List <object> objectList = descriptionElement1.param; int index2 = index1; string str; if (LocalizedContentManager.CurrentLanguageCode != LocalizedContentManager.LanguageCode.en) { str = ((IEnumerable <string>)descriptionElement2.loadDescriptionElement().Split('/')).Last <string>(); } else { str = ((IEnumerable <string>)descriptionElement2.loadDescriptionElement().Split('/')).Last <string>() + "s"; } objectList[index2] = (object)str; } descriptionElement1.param[index1] = (object)((IEnumerable <string>)descriptionElement2.loadDescriptionElement().Split('/')).Last <string>(); } if (descriptionElement1.param[index1].GetType() == typeof(NPC)) { DescriptionElement descriptionElement2 = new DescriptionElement("Data\\NPCDispositions:" + (descriptionElement1.param[index1] as NPC).name); descriptionElement1.param[index1] = (object)((IEnumerable <string>)descriptionElement2.loadDescriptionElement().Split('/')).Last <string>(); } } if (descriptionElement1.xmlKey == "") { return(string.Empty); } string str1; switch (descriptionElement1.param.Count) { case 1: str1 = Game1.content.LoadString(descriptionElement1.xmlKey, descriptionElement1.param[0]); break; case 2: str1 = Game1.content.LoadString(descriptionElement1.xmlKey, descriptionElement1.param[0], descriptionElement1.param[1]); break; case 3: str1 = Game1.content.LoadString(descriptionElement1.xmlKey, descriptionElement1.param[0], descriptionElement1.param[1], descriptionElement1.param[2]); break; case 4: str1 = Game1.content.LoadString(descriptionElement1.xmlKey, descriptionElement1.param[0], descriptionElement1.param[1], descriptionElement1.param[2], descriptionElement1.param[3]); break; default: str1 = Game1.content.LoadString(descriptionElement1.xmlKey); if (this.xmlKey.Contains("Dialogue.cs.7") || this.xmlKey.Contains("Dialogue.cs.8")) { string str2 = Game1.content.LoadString(descriptionElement1.xmlKey).Replace("/", " "); str1 = (int)str2[0] == 32 ? str2.Substring(1) : str2; break; } break; } return(str1); }