Update ShootingSelectWindow_Patch.cs
This commit is contained in:
parent
c188f75c9d
commit
d49fae11bb
1 changed files with 37 additions and 1 deletions
|
|
@ -10,7 +10,7 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects
|
||||||
[HarmonyPatch(typeof(ShootingSelectWindow))]
|
[HarmonyPatch(typeof(ShootingSelectWindow))]
|
||||||
public static class ShootingSelectWindow_Patch
|
public static class ShootingSelectWindow_Patch
|
||||||
{
|
{
|
||||||
[HarmonyPatch(nameof(ShootingSelectWindow.SetUpgradePlantTypes))]
|
[HarmonyPatch(nameof(ShootingSelectWindow.InitPlantType))]
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
private static void InitCard(ShootingSelectWindow __instance)
|
private static void InitCard(ShootingSelectWindow __instance)
|
||||||
{
|
{
|
||||||
|
|
@ -33,5 +33,41 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects
|
||||||
introduceText.text = StringStore.TranslateText(introduceText.text);
|
introduceText.text = StringStore.TranslateText(introduceText.text);
|
||||||
introduceText.font = fontAsset;
|
introduceText.font = fontAsset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HarmonyPatch(nameof(ShootingSelectWindow.SetUpgradePlantTypes))]
|
||||||
|
[HarmonyPostfix]
|
||||||
|
private static void SetUpgradePlantTypes(ShootingSelectWindow __instance)
|
||||||
|
{
|
||||||
|
Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce");
|
||||||
|
TextMeshProUGUI introduceText = introduceTransform.GetComponent<TextMeshProUGUI>();
|
||||||
|
TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString());
|
||||||
|
|
||||||
|
introduceText.text = StringStore.TranslateText(introduceText.text);
|
||||||
|
introduceText.font = fontAsset;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HarmonyPatch(nameof(ShootingSelectWindow.GetMaxIndexInRoutes))]
|
||||||
|
[HarmonyPostfix]
|
||||||
|
private static void GetMaxIndexInRoutes(ShootingSelectWindow __instance)
|
||||||
|
{
|
||||||
|
Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce");
|
||||||
|
TextMeshProUGUI introduceText = introduceTransform.GetComponent<TextMeshProUGUI>();
|
||||||
|
TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString());
|
||||||
|
|
||||||
|
introduceText.text = StringStore.TranslateText(introduceText.text);
|
||||||
|
introduceText.font = fontAsset;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HarmonyPatch(nameof(ShootingSelectWindow.Start))]
|
||||||
|
[HarmonyPostfix]
|
||||||
|
private static void Start(ShootingSelectWindow __instance)
|
||||||
|
{
|
||||||
|
Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce");
|
||||||
|
TextMeshProUGUI introduceText = introduceTransform.GetComponent<TextMeshProUGUI>();
|
||||||
|
TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString());
|
||||||
|
|
||||||
|
introduceText.text = StringStore.TranslateText(introduceText.text);
|
||||||
|
introduceText.font = fontAsset;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue