PVZFusionTranslation/MelonLoader/Patches/GameObjects/GardenPlant_Patch.cs
2025-08-16 17:34:00 -04:00

28 lines
No EOL
955 B
C#

using HarmonyLib;
using Il2Cpp;
using PvZ_Fusion_Translator.AssetStore;
using System.Text.RegularExpressions;
namespace PvZ_Fusion_Translator.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);
}
}
}