fixed a thing in DrawCard
This commit is contained in:
parent
ea21392df0
commit
4aa4dfb414
1 changed files with 27 additions and 1 deletions
|
|
@ -17,7 +17,7 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects
|
||||||
private static void Postfix_UpdateText(DrawCardManager __instance)
|
private static void Postfix_UpdateText(DrawCardManager __instance)
|
||||||
{
|
{
|
||||||
Il2CppSystem.Collections.Generic.List<TextMeshProUGUI> texts = __instance.texts;
|
Il2CppSystem.Collections.Generic.List<TextMeshProUGUI> texts = __instance.texts;
|
||||||
|
__instance.upName = StringStore.TranslateText(__instance.upName);
|
||||||
if (texts != null && texts.Count > 0)
|
if (texts != null && texts.Count > 0)
|
||||||
{
|
{
|
||||||
foreach (TextMeshProUGUI textComponent in texts)
|
foreach (TextMeshProUGUI textComponent in texts)
|
||||||
|
|
@ -32,5 +32,31 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[HarmonyPatch(nameof(DrawCardManager.Update))]
|
||||||
|
[HarmonyPostfix]
|
||||||
|
private static void Postfix_Update(DrawCardManager __instance)
|
||||||
|
{
|
||||||
|
Il2CppSystem.Collections.Generic.List<TextMeshProUGUI> texts = __instance.texts;
|
||||||
|
__instance.upName = StringStore.TranslateText(__instance.upName);
|
||||||
|
|
||||||
|
if (texts != null && texts.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (TextMeshProUGUI textComponent in texts)
|
||||||
|
{
|
||||||
|
if (textComponent != null)
|
||||||
|
{
|
||||||
|
string translatedText = StringStore.TranslateText(textComponent.text);
|
||||||
|
TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString());
|
||||||
|
textComponent.text = translatedText;
|
||||||
|
textComponent.font = fontAsset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue