using HarmonyLib; using Il2Cpp; using Il2CppTMPro; using PvZ_Fusion_Translator.AssetStore; using UnityEngine; namespace PvZ_Fusion_Translator.Patches.Modes.Harvest { [HarmonyPatch(typeof(TreasureMainMenu))] public static class TreasureMainMenu_Patch { [HarmonyPatch(nameof(TreasureMainMenu.Update))] [HarmonyPostfix] private static void Update(TreasureMainMenu __instance) { TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) { txt.text = StringStore.TranslateText(txt.text); txt.font = fontAsset; } } } }