PVZFusionTranslation/BepInEx/Patches/GameObjects/GardenPlant_Patch.cs
2025-08-20 21:50:36 +07:00

28 lines
No EOL
963 B
C#

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);
}
}
}