From 20d088239a88e98f59414de01887f6f50e9ee706 Mon Sep 17 00:00:00 2001 From: SillyStar-Github <90102598+SillyStar-Github@users.noreply.github.com> Date: Sat, 24 Jan 2026 19:07:34 -0500 Subject: [PATCH] zombie spawn info + shadow popup fix --- .../Patches/BaseTextObjects/InGameText_Patch.cs | 11 ++++++++++- .../GameObjects/AlmanacZombieWindow_Patch.cs | 16 +++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/MelonLoader/Patches/BaseTextObjects/InGameText_Patch.cs b/MelonLoader/Patches/BaseTextObjects/InGameText_Patch.cs index 46e55f0..3e396ef 100644 --- a/MelonLoader/Patches/BaseTextObjects/InGameText_Patch.cs +++ b/MelonLoader/Patches/BaseTextObjects/InGameText_Patch.cs @@ -21,7 +21,7 @@ namespace PvZ_Fusion_Translator.Patches.BaseTextObjects foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) { string travelMatch = TravelMgr_Patch.MatchTravelBuff(txt.text); - string originalText = ""; + string originalText = txt.text; if (txt.gameObject.name.Contains("shadow")) { @@ -31,6 +31,15 @@ namespace PvZ_Fusion_Translator.Patches.BaseTextObjects if (travelMatch != "") { txt.text = travelMatch; + if (txt.gameObject.name.Contains("main")) + { + originalText = txt.text; + Transform shadowText = txt.transform.parent.Find("Text_shadow"); + if (shadowText != null) + { + shadowText.GetComponent().text = Utils.RemoveColorTags(originalText); + } + } } else if(Regex.Match(txt.text, @"(]*>.*?)", RegexOptions.Singleline).Success) { diff --git a/MelonLoader/Patches/GameObjects/AlmanacZombieWindow_Patch.cs b/MelonLoader/Patches/GameObjects/AlmanacZombieWindow_Patch.cs index 57c475a..3f8179e 100644 --- a/MelonLoader/Patches/GameObjects/AlmanacZombieWindow_Patch.cs +++ b/MelonLoader/Patches/GameObjects/AlmanacZombieWindow_Patch.cs @@ -35,9 +35,10 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects TMP_FontAsset fontAsset = (hasAlmanacFont) ? FontStore.LoadTMPFontAlmanac(Utils.Language.ToString()) : FontStore.LoadTMPFont(Utils.Language.ToString()); - ZombieAlmanacData zombieData = JsonUtility.FromJson(json); + ZombieAlmanacData zombieAlmanacData = JsonUtility.FromJson(json); + var zombieDataDic = ZombieDataManager.zombieDataDic; - foreach (ZombieInfo zombieInfo in zombieData.zombies) + foreach (ZombieInfo zombieInfo in zombieAlmanacData.zombies) { if (zombieInfo.theZombieType == __instance.currentZombieType) { @@ -49,7 +50,16 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects text.fontSizeMax = 21; } - __instance.showedZombieIntroduce.text = Utils.RemoveSizeTags(zombieInfo.info) + "\n\n" + Utils.RemoveSizeTags(zombieInfo.introduce) + "\n\n"; + ZombieDataManager.ZombieData zombieData = zombieDataDic[__instance.currentZombieType]; + + string spawnInfo = ""; + string spawnInfoFormat = StringStore.translationStringRegex["出怪等级: (\\d+)\n出怪权重: (\\d+)"]; + if(spawnInfoFormat != null) + { + spawnInfo = string.Format(spawnInfoFormat, [zombieData.summonLevel, zombieData.summonWeight]) + "\n\n"; + } + + __instance.showedZombieIntroduce.text = Utils.RemoveSizeTags(zombieInfo.info) + "\n\n" + spawnInfo + Utils.RemoveSizeTags(zombieInfo.introduce) + "\n\n"; __instance.showedZombieIntroduce.font = fontAsset; __instance.showedZombieIntroduce.fontSizeMax = 21; __instance.showedZombieIntroduce.margin = new Vector4(3, 2, 12, 0);