PVZFusionTranslation/MelonLoader/Patches/GameObjects/ShootingMenu_Patch.cs
SillyStar-Github 790fc4c66c fixes idk
2025-07-15 00:51:48 -04:00

25 lines
No EOL
740 B
C#

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