diff --git a/MelonLoader/Patches/GameObjects/AbyssMenu2_Patch.cs b/MelonLoader/Patches/GameObjects/AbyssMenu2_Patch.cs index a410739..c9f5e66 100644 --- a/MelonLoader/Patches/GameObjects/AbyssMenu2_Patch.cs +++ b/MelonLoader/Patches/GameObjects/AbyssMenu2_Patch.cs @@ -50,6 +50,12 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects textMesh.text = StringStore.TranslateText(textMesh.text); } } + + foreach(TextMeshProUGUI text in __instance.GetComponentsInChildren()) + { + text.text = StringStore.TranslateText(text.text); + text.font = fontAsset; + } } [HarmonyPatch(nameof(AbyssMenu2.Start))] @@ -58,7 +64,6 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects { UpdateAbyss2Text(__instance); - Utils.ConvertButtonText(__instance.transform, "Goback"); Utils.ConvertButtonText(__instance.transform, "Help"); Utils.ConvertButtonText(__instance.transform, "Bag"); } diff --git a/MelonLoader/Patches/GameObjects/AbyssMenu_Patch.cs b/MelonLoader/Patches/GameObjects/AbyssMenu_Patch.cs index 49ee31f..a197572 100644 --- a/MelonLoader/Patches/GameObjects/AbyssMenu_Patch.cs +++ b/MelonLoader/Patches/GameObjects/AbyssMenu_Patch.cs @@ -26,7 +26,11 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects txt.font = fontAsset; } - Utils.ConvertButtonText(__instance.transform, "Goback"); + foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) + { + text.text = StringStore.TranslateText(text.text); + text.font = fontAsset; + } } [HarmonyPatch(nameof(AbyssMenu.UpdateLevelInfo))] diff --git a/MelonLoader/Patches/GameObjects/BaseMenu_Patch.cs b/MelonLoader/Patches/GameObjects/BaseMenu_Patch.cs index 00b21a0..c16d0c2 100644 --- a/MelonLoader/Patches/GameObjects/BaseMenu_Patch.cs +++ b/MelonLoader/Patches/GameObjects/BaseMenu_Patch.cs @@ -116,7 +116,6 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects foreach (TextMeshProUGUI txt in mainTransform.GetComponentsInChildren()) { - FileLoader.DumpUntranslatedStrings(txt.text); txt.text = StringStore.TranslateText(txt.text); } } diff --git a/MelonLoader/Patches/GameObjects/MinorObjects/UIProgress2_Patch.cs b/MelonLoader/Patches/GameObjects/MinorObjects/UIProgress2_Patch.cs new file mode 100644 index 0000000..4e66a7d --- /dev/null +++ b/MelonLoader/Patches/GameObjects/MinorObjects/UIProgress2_Patch.cs @@ -0,0 +1,17 @@ +using HarmonyLib; +using Il2Cpp; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects +{ + [HarmonyPatch(typeof(UIProgress2))] + public static class UIProgress2_Patch + { + [HarmonyPatch(nameof(UIProgress2.Update))] + [HarmonyPostfix] + private static void Update(UIProgress2 __instance) + { + __instance.t.text = StringStore.TranslateText(__instance.t.text); + } + } +} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/TravelBuffMenu_Patch.cs b/MelonLoader/Patches/GameObjects/TravelBuffMenu_Patch.cs new file mode 100644 index 0000000..08dc32f --- /dev/null +++ b/MelonLoader/Patches/GameObjects/TravelBuffMenu_Patch.cs @@ -0,0 +1,22 @@ +using HarmonyLib; +using Il2Cpp; +using Il2CppTMPro; +using PvZ_Fusion_Translator.AssetStore; +using UnityEngine; + +namespace PvZ_Fusion_Translator.Patches.GameObjects +{ + [HarmonyPatch(typeof(TravelBuffMenu))] + public static class TravelBuffMenu_Patch + { + [HarmonyPatch(nameof(TravelBuffMenu.RefeshOptions))] + [HarmonyPostfix] + private static void RefeshOptions(TravelBuffMenu __instance) + { + foreach(TravelBuffOptionButton button in __instance.options) + { + button.introduce.text = StringStore.TranslateText(button.introduce.text); + } + } + } +} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/TravelBuffOptionButton_Patch.cs b/MelonLoader/Patches/GameObjects/TravelBuffOptionButton_Patch.cs index dbdeeb2..0f6b6c6 100644 --- a/MelonLoader/Patches/GameObjects/TravelBuffOptionButton_Patch.cs +++ b/MelonLoader/Patches/GameObjects/TravelBuffOptionButton_Patch.cs @@ -10,7 +10,7 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects { [HarmonyPatch(nameof(TravelBuffOptionButton.SetBuff))] [HarmonyPostfix] - private static void Start(TravelBuffOptionButton __instance) + private static void SetBuff(TravelBuffOptionButton __instance) { __instance.introduce.text = StringStore.TranslateText(__instance.introduce.text); } diff --git a/MelonLoader/PvZ Fusion Translator [MelonLoader].csproj b/MelonLoader/PvZ Fusion Translator [MelonLoader].csproj index bc11b36..fb4bfab 100644 --- a/MelonLoader/PvZ Fusion Translator [MelonLoader].csproj +++ b/MelonLoader/PvZ Fusion Translator [MelonLoader].csproj @@ -13,7 +13,7 @@ latest enable Debug;DebugEnglish;ReleaseMulti;ReleaseEnglish;DebugTesting;ReleaseOther;DebugObfuscate;ReleaseObfuscate - C:\Users\rainb\Desktop\PC_PVZ-Fusion-2.8 + C:\Users\rainb\Desktop\PC_PVZ-Fusion-2.8.1 AnyCPU;ARM64;x64 @@ -401,6 +401,7 @@ + @@ -434,6 +435,7 @@ +