more shovel

This commit is contained in:
SillyStar-Github 2025-10-20 16:28:59 -04:00
parent 204f45b629
commit 26490c8243
2 changed files with 79 additions and 27 deletions

View file

@ -47,5 +47,31 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
} }
} }
} }
[HarmonyPatch(nameof(InGameUI.Update))]
[HarmonyPostfix]
private static void Update(InGameUI __instance)
{
foreach(TextMeshProUGUI txt in __instance.ShovelBank.GetComponentsInChildren<TextMeshProUGUI>())
{
txt.text = StringStore.TranslateText(txt.text);
txt.font = FontStore.LoadTMPFont(Utils.Language.ToString());
}
}
}
[HarmonyPatch(typeof(InGameUI_IZ))]
public static class InGameUI_IZ_Patch
{
[HarmonyPatch(nameof(InGameUI_IZ.Update))]
[HarmonyPostfix]
private static void Update(InGameUI_IZ __instance)
{
foreach (TextMeshProUGUI txt in __instance.shovel.GetComponentsInChildren<TextMeshProUGUI>())
{
txt.text = StringStore.TranslateText(txt.text);
txt.font = FontStore.LoadTMPFont(Utils.Language.ToString());
}
}
} }
} }

View file

@ -48,5 +48,31 @@ namespace PvZ_Fusion_Translator.Patches.Managers
} }
} }
} }
[HarmonyPatch(nameof(InGameUI.Update))]
[HarmonyPostfix]
private static void Update(InGameUI __instance)
{
foreach (TextMeshProUGUI txt in __instance.ShovelBank.GetComponentsInChildren<TextMeshProUGUI>())
{
txt.text = StringStore.TranslateText(txt.text);
txt.font = FontStore.LoadTMPFont(Utils.Language.ToString());
}
}
}
[HarmonyPatch(typeof(InGameUI_IZ))]
public static class InGameUI_IZ_Patch
{
[HarmonyPatch(nameof(InGameUI_IZ.Update))]
[HarmonyPostfix]
private static void Update(InGameUI_IZ __instance)
{
foreach (TextMeshProUGUI txt in __instance.shovel.GetComponentsInChildren<TextMeshProUGUI>())
{
txt.text = StringStore.TranslateText(txt.text);
txt.font = FontStore.LoadTMPFont(Utils.Language.ToString());
}
}
} }
} }