PVZFusionTranslation/Source/Patches/GameObjects/GardenPlant_Patch.cs

22 lines
807 B
C#

using HarmonyLib;
using PvZ_Fusion_Translator.AssetStore;
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);
}
}