PVZFusionTranslation/MelonLoader/Patches/GameObjects/PlantCardPackageBuilder_Patch.cs
SillyStar-Github f2e4e78750 3.8 code
2026-07-15 17:17:28 -04:00

22 lines
No EOL
693 B
C#

using HarmonyLib;
using Il2Cpp;
using Il2CppTMPro;
using PvZ_Fusion_Translator.AssetStore;
using UnityEngine;
namespace PvZ_Fusion_Translator.Patches.GameObjects
{
[HarmonyPatch(typeof(PlantCardPackageBuilder))]
public static class PlantCardPackageBuilder_Patch
{
[HarmonyPatch(nameof(PlantCardPackageBuilder.UpdateText))]
[HarmonyPostfix]
private static void UpdateText(PlantCardPackageBuilder __instance)
{
TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString());
__instance.text.text = StringStore.TranslateText(__instance.text.text);
__instance.text.font = fontAsset;
}
}
}