PVZFusionTranslation/MelonLoader/Patches/Managers/Garden_Patch.cs
SillyStar-Github f2f5a87813 3.0 part 1
2025-09-27 20:11:02 -04:00

22 lines
639 B
C#

using HarmonyLib;
using Il2Cpp;
using Il2CppTMPro;
using PvZ_Fusion_Translator.AssetStore;
namespace PvZ_Fusion_Translator.Patches.Managers
{
[HarmonyPatch(typeof(Garden))]
public static class Garden_Patch
{
[HarmonyPatch(nameof(Garden.Awake))]
[HarmonyPostfix]
private static void Awake(Garden __instance)
{
foreach (TextMeshPro text in __instance.GetComponentsInChildren<TextMeshPro>())
{
text.text = StringStore.TranslateText(text.text);
text.font = FontStore.LoadTMPFont(Utils.Language.ToString());
}
}
}
}