From c892bb7900ca768fa4de2a4b4c6a14320610c0e0 Mon Sep 17 00:00:00 2001 From: SillyStar-Github <90102598+SillyStar-Github@users.noreply.github.com> Date: Sun, 5 Oct 2025 00:43:10 -0400 Subject: [PATCH 1/2] Update TextMeshProUGUI_Patch.cs --- .../BaseTextObjects/TextMeshProUGUI_Patch.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/MelonLoader/Patches/BaseTextObjects/TextMeshProUGUI_Patch.cs b/MelonLoader/Patches/BaseTextObjects/TextMeshProUGUI_Patch.cs index 39e8b0f..fc3d48d 100644 --- a/MelonLoader/Patches/BaseTextObjects/TextMeshProUGUI_Patch.cs +++ b/MelonLoader/Patches/BaseTextObjects/TextMeshProUGUI_Patch.cs @@ -17,10 +17,13 @@ namespace PvZ_Fusion_Translator.Patches.BaseTextObjects { if (!string.IsNullOrEmpty(__instance.text)) { - if(__instance.transform.parent.parent.name.Contains("AbyssBagMenu")) + if(__instance.transform.parent.parent != null) { - return; - } + if (__instance.transform.parent.parent.name.Contains("AbyssBagMenu")) + { + return; + } + } __instance = StringStore.TranslateText(__instance); __instance.autoSizeTextContainer = false; @@ -50,9 +53,12 @@ namespace PvZ_Fusion_Translator.Patches.BaseTextObjects { if (!string.IsNullOrEmpty(__instance.text)) { - if (__instance.transform.parent.parent.name.Contains("AbyssBagMenu")) + if (__instance.transform.parent.parent != null) { - return; + if (__instance.transform.parent.parent.name.Contains("AbyssBagMenu")) + { + return; + } } __instance = StringStore.TranslateText(__instance); From bba157d5e99ae46b571ebe13461d8fa9cb79435f Mon Sep 17 00:00:00 2001 From: SillyStar-Github <90102598+SillyStar-Github@users.noreply.github.com> Date: Sun, 5 Oct 2025 11:23:28 -0400 Subject: [PATCH 2/2] Update PlantInfoWindow_Patch.cs --- MelonLoader/Patches/GameObjects/PlantInfoWindow_Patch.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MelonLoader/Patches/GameObjects/PlantInfoWindow_Patch.cs b/MelonLoader/Patches/GameObjects/PlantInfoWindow_Patch.cs index c723490..f749978 100644 --- a/MelonLoader/Patches/GameObjects/PlantInfoWindow_Patch.cs +++ b/MelonLoader/Patches/GameObjects/PlantInfoWindow_Patch.cs @@ -19,12 +19,13 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects { TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - PlantType thePlantType = __instance.plant.thePlantType; + BigGardenPlant thePlant = __instance.plant; foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) { - if(txt.name.Contains("Introduce")) + if (txt.name.Contains("Introduce") && thePlant != null) { + PlantType thePlantType = thePlant.thePlantType; txt.text = StringStore.TranslateText(txt.text); string text = txt.text;