diff --git a/MelonLoader/Patches/GameObjects/AbyssSettlementMenu_Patch.cs b/MelonLoader/Patches/GameObjects/AbyssSettlementMenu_Patch.cs index 9efa9ac..6017027 100644 --- a/MelonLoader/Patches/GameObjects/AbyssSettlementMenu_Patch.cs +++ b/MelonLoader/Patches/GameObjects/AbyssSettlementMenu_Patch.cs @@ -19,7 +19,7 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects { TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - string regexStr1 = "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n极限模式产出:(\\d+)\n非首胜无额外产出\n产出叶绿素总计:(\\d+)\n"; + string regexStr1 = "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n极限模式产出:(\\d+)\n非首胜无额外产出\n产出叶绿素总计:(\\d+)"; string regexStr2 = "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n极限模式产出:(\\d+)\n首胜产出:(\\d+)\n剩余小推车数量:(\\d+),获得叶绿素:(\\d+)\n产出叶绿素总计:(\\d+)"; Regex regex1 = new Regex(regexStr1); diff --git a/MelonLoader/Patches/GameObjects/TravelStore_Patch.cs b/MelonLoader/Patches/GameObjects/TravelStore_Patch.cs index 5c5b487..edbf166 100644 --- a/MelonLoader/Patches/GameObjects/TravelStore_Patch.cs +++ b/MelonLoader/Patches/GameObjects/TravelStore_Patch.cs @@ -23,7 +23,12 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects { StringStore.TranslateTextTransform(moneyTransform); } - } + + foreach (TextMeshProUGUI text in __instance.points) + { + text.text = StringStore.TranslateText(text.text); + } + } [HarmonyPatch(nameof(TravelStore.SetText), new Type[] { typeof(string)})] [HarmonyPostfix] @@ -33,6 +38,11 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects { text.text = StringStore.TranslateText(text.text); } - } + + foreach (TextMeshProUGUI text in __instance.points) + { + text.text = StringStore.TranslateText(text.text); + } + } } } diff --git a/MelonLoader/Patches/GameObjects/UIZombieNum_Patch.cs b/MelonLoader/Patches/GameObjects/UIZombieNum_Patch.cs index 399bafd..9401da2 100644 --- a/MelonLoader/Patches/GameObjects/UIZombieNum_Patch.cs +++ b/MelonLoader/Patches/GameObjects/UIZombieNum_Patch.cs @@ -15,8 +15,8 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects #if MULTI_LANGUAGE TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - string zombieText = StringStore.patchesStore["Zombies"][Utils.Language.ToString()]; - __instance.t.text = string.Format(zombieText + " {0}", Board.Instance.enermyCount); + string zombieText = StringStore.TranslateText(__instance.t.text); + __instance.t.text = zombieText; #else TMP_FontAsset fontAsset = FontStore.LoadTMPFont(); string zombieText = StringStore.patchesStore["Zombies"]["Spanish"];