diff --git a/MelonLoader/Patches/Modes/Odyssey/TravelStore_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/TravelStore_Patch.cs index 3bcb5ef..dc07b75 100644 --- a/MelonLoader/Patches/Modes/Odyssey/TravelStore_Patch.cs +++ b/MelonLoader/Patches/Modes/Odyssey/TravelStore_Patch.cs @@ -69,6 +69,11 @@ namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey { string res = investText; + if(!Utils.CheckForUntranslatedText(res)) + { + return res; + } + string[] investStats = investText.Split("\n\n"); List translatedInvestStats = new List(); foreach(string investStat in investStats) diff --git a/MelonLoader/Patches/Modes/Super Editor/GameLevel/EventNodes/RuntimeEventNodeEditor_Patch.cs b/MelonLoader/Patches/Modes/Super Editor/GameLevel/EventNodes/RuntimeEventNodeEditor_Patch.cs index 217e2c7..97278d9 100644 --- a/MelonLoader/Patches/Modes/Super Editor/GameLevel/EventNodes/RuntimeEventNodeEditor_Patch.cs +++ b/MelonLoader/Patches/Modes/Super Editor/GameLevel/EventNodes/RuntimeEventNodeEditor_Patch.cs @@ -45,7 +45,7 @@ namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor.GameLevel.EventNodes { RuntimeNodeUI nodeUI = node.value; - if(nodeUI.Node.nodeType == "PlantTypeValueNode") + if(nodeUI.Node.nodeType == "PlantTypeValueNode" || nodeUI.Node.nodeType == "SinglePlantTypeListNode") { Transform buttonTransform = nodeUI.transform.Find("Header/ValueEditContainer/Button(Clone)/Label"); TextMeshProUGUI txt = buttonTransform.GetComponent(); @@ -53,7 +53,16 @@ namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor.GameLevel.EventNodes if (!txt.gameObject.name.Contains("Label")) continue; if (!Utils.CheckForUntranslatedText(txt.text)) continue; - string plantName = Utils.GetPlantNameFromAlmanac(nodeUI.Node.GetPortValue(nodeUI.Node.GetOutputPorts()[0].portName, PlantType.Nothing)); + string plantName = ""; + if(nodeUI.Node.nodeType == "PlantTypeValueNode") + { + plantName = Utils.GetPlantNameFromAlmanac(nodeUI.Node.GetPortValue(nodeUI.Node.GetOutputPorts()[0].portName, PlantType.Nothing)); + } + else if(nodeUI.Node.nodeType == "SinglePlantTypeListNode") + { + SinglePlantTypeListNode tempNode = nodeUI.Node.TryCast(); + plantName = Utils.GetPlantNameFromAlmanac(tempNode.plantType); + } txt.text = (plantName != "") ? plantName : StringStore.TranslateText(txt.text); txt.font = fontAsset; } diff --git a/MelonLoader/Patches/Modes/Super Editor/GameLevel/EventNodes/RuntimeNodeUI_Patch.cs b/MelonLoader/Patches/Modes/Super Editor/GameLevel/EventNodes/RuntimeNodeUI_Patch.cs index bcf303d..fc31045 100644 --- a/MelonLoader/Patches/Modes/Super Editor/GameLevel/EventNodes/RuntimeNodeUI_Patch.cs +++ b/MelonLoader/Patches/Modes/Super Editor/GameLevel/EventNodes/RuntimeNodeUI_Patch.cs @@ -62,7 +62,7 @@ namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor.GameLevel.EventNodes TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - if(__instance.Node.nodeType == "PlantTypeValueNode") + if(__instance.Node.nodeType == "PlantTypeValueNode" || __instance.Node.nodeType == "SinglePlantTypeListNode") { foreach(TextMeshProUGUI txt in __instance.GetComponentsInChildren()) {