PVZFusionTranslation/MelonLoader/Patches/GameObjects/TowerUpgradeMenu_Patch.cs
SillyStar-Github 9db378c57e 2.8 stuff
2025-08-09 00:21:52 -04:00

23 lines
No EOL
709 B
C#

using HarmonyLib;
using Il2Cpp;
using Il2CppTMPro;
using PvZ_Fusion_Translator.AssetStore;
using UnityEngine;
namespace PvZ_Fusion_Translator.Patches.GameObjects
{
[HarmonyPatch(typeof(TowerUpgradeMenu))]
public static class TowerUpgradeMenu_Patch
{
[HarmonyPatch(nameof(TowerUpgradeMenu.Update))]
[HarmonyPostfix]
private static void Update(TowerUpgradeMenu __instance)
{
foreach(TextMeshProUGUI text in __instance.GetComponentsInChildren<TextMeshProUGUI>())
{
text.text = StringStore.TranslateText(text.text);
text.font = FontStore.LoadTMPFont(Utils.Language.ToString());
}
}
}
}