Merge branch 'cassidy'

This commit is contained in:
SillyStar-Github 2025-10-10 16:22:45 -04:00
commit bda9e61a68
2 changed files with 14 additions and 7 deletions

View file

@ -17,9 +17,12 @@ namespace PvZ_Fusion_Translator.Patches.BaseTextObjects
{ {
if (!string.IsNullOrEmpty(__instance.text)) if (!string.IsNullOrEmpty(__instance.text))
{ {
if(__instance.transform.parent.parent.name.Contains("AbyssBagMenu")) if(__instance.transform.parent.parent != null)
{
if (__instance.transform.parent.parent.name.Contains("AbyssBagMenu"))
{ {
return; return;
}
} }
__instance = StringStore.TranslateText(__instance); __instance = StringStore.TranslateText(__instance);
@ -50,10 +53,13 @@ namespace PvZ_Fusion_Translator.Patches.BaseTextObjects
{ {
if (!string.IsNullOrEmpty(__instance.text)) if (!string.IsNullOrEmpty(__instance.text))
{ {
if (__instance.transform.parent.parent != null)
{
if (__instance.transform.parent.parent.name.Contains("AbyssBagMenu")) if (__instance.transform.parent.parent.name.Contains("AbyssBagMenu"))
{ {
return; return;
} }
}
__instance = StringStore.TranslateText(__instance); __instance = StringStore.TranslateText(__instance);
__instance.autoSizeTextContainer = false; __instance.autoSizeTextContainer = false;

View file

@ -19,12 +19,13 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects
{ {
TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString());
PlantType thePlantType = __instance.plant.thePlantType; BigGardenPlant thePlant = __instance.plant;
foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren<TextMeshProUGUI>()) foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren<TextMeshProUGUI>())
{ {
if(txt.name.Contains("Introduce")) if (txt.name.Contains("Introduce") && thePlant != null)
{ {
PlantType thePlantType = thePlant.thePlantType;
txt.text = StringStore.TranslateText(txt.text); txt.text = StringStore.TranslateText(txt.text);
string text = txt.text; string text = txt.text;