using HarmonyLib; using System; using System.Text.RegularExpressions; using PvZ_Fusion_Translator__BepInEx_.AssetStore; namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects { [HarmonyPatch(typeof(GardenPlant))] public static class GardenPlant_Patch { [HarmonyPatch(nameof(GardenPlant.Start))] [HarmonyPostfix] private static void Start(GardenPlant __instance) { __instance.infoText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); __instance.infoText.text = StringStore.TranslateText(__instance.infoText.text); } [HarmonyPatch(nameof(GardenPlant.UpdateInfo))] [HarmonyPostfix] private static void UpdateInfo(GardenPlant __instance) { __instance.infoText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); __instance.infoText.text = StringStore.TranslateText(__instance.infoText.text); } } }