just pushing these as the final 3.6.1 changes

This commit is contained in:
SillyStar-Github 2026-06-02 13:09:42 -04:00
parent 5a923186f2
commit 44909e1df4
3 changed files with 17 additions and 3 deletions

View file

@ -69,6 +69,11 @@ namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey
{ {
string res = investText; string res = investText;
if(!Utils.CheckForUntranslatedText(res))
{
return res;
}
string[] investStats = investText.Split("\n\n"); string[] investStats = investText.Split("\n\n");
List<string> translatedInvestStats = new List<string>(); List<string> translatedInvestStats = new List<string>();
foreach(string investStat in investStats) foreach(string investStat in investStats)

View file

@ -45,7 +45,7 @@ namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor.GameLevel.EventNodes
{ {
RuntimeNodeUI nodeUI = node.value; 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"); Transform buttonTransform = nodeUI.transform.Find("Header/ValueEditContainer/Button(Clone)/Label");
TextMeshProUGUI txt = buttonTransform.GetComponent<TextMeshProUGUI>(); TextMeshProUGUI txt = buttonTransform.GetComponent<TextMeshProUGUI>();
@ -53,7 +53,16 @@ namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor.GameLevel.EventNodes
if (!txt.gameObject.name.Contains("Label")) continue; if (!txt.gameObject.name.Contains("Label")) continue;
if (!Utils.CheckForUntranslatedText(txt.text)) continue; if (!Utils.CheckForUntranslatedText(txt.text)) continue;
string plantName = Utils.GetPlantNameFromAlmanac(nodeUI.Node.GetPortValue<PlantType>(nodeUI.Node.GetOutputPorts()[0].portName, PlantType.Nothing)); string plantName = "";
if(nodeUI.Node.nodeType == "PlantTypeValueNode")
{
plantName = Utils.GetPlantNameFromAlmanac(nodeUI.Node.GetPortValue<PlantType>(nodeUI.Node.GetOutputPorts()[0].portName, PlantType.Nothing));
}
else if(nodeUI.Node.nodeType == "SinglePlantTypeListNode")
{
SinglePlantTypeListNode tempNode = nodeUI.Node.TryCast<SinglePlantTypeListNode>();
plantName = Utils.GetPlantNameFromAlmanac(tempNode.plantType);
}
txt.text = (plantName != "") ? plantName : StringStore.TranslateText(txt.text); txt.text = (plantName != "") ? plantName : StringStore.TranslateText(txt.text);
txt.font = fontAsset; txt.font = fontAsset;
} }

View file

@ -62,7 +62,7 @@ namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor.GameLevel.EventNodes
TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); 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<TextMeshProUGUI>()) foreach(TextMeshProUGUI txt in __instance.GetComponentsInChildren<TextMeshProUGUI>())
{ {