TravelStore fix
This commit is contained in:
parent
4c15c96d0d
commit
311086a845
1 changed files with 19 additions and 28 deletions
|
|
@ -7,42 +7,33 @@ using UnityEngine;
|
|||
namespace PvZ_Fusion_Translator.Patches.GameObjects
|
||||
{
|
||||
[HarmonyPatch(typeof(TravelStore))]
|
||||
internal class TravelStore_Patch
|
||||
public static class TravelStore_Patch
|
||||
{
|
||||
[HarmonyPatch(nameof(TravelStore.Update))]
|
||||
[HarmonyPostfix]
|
||||
private static void Update(TravelStore __instance)
|
||||
{
|
||||
foreach (TextMeshProUGUI text in __instance.introduces)
|
||||
{
|
||||
text.text = StringStore.TranslateText(text.text);
|
||||
}
|
||||
|
||||
Transform moneyTransform = __instance.transform.Find("Money");
|
||||
if (moneyTransform != null)
|
||||
{
|
||||
StringStore.TranslateTextTransform(moneyTransform);
|
||||
}
|
||||
|
||||
foreach (TextMeshProUGUI text in __instance.points)
|
||||
{
|
||||
text.text = StringStore.TranslateText(text.text);
|
||||
}
|
||||
{
|
||||
foreach (TextMeshProUGUI intr in __instance.introduces)
|
||||
StringStore.TranslateTextUI(intr);
|
||||
foreach (var textMesh in __instance.points)
|
||||
StringStore.TranslateTextUI(textMesh);
|
||||
}
|
||||
|
||||
[HarmonyPatch(nameof(TravelStore.SetText), new Type[] { typeof(string)})]
|
||||
[HarmonyPostfix]
|
||||
private static void ShowText(TravelStore __instance)
|
||||
{
|
||||
foreach (TextMeshProUGUI text in __instance.introduces)
|
||||
{
|
||||
text.text = StringStore.TranslateText(text.text);
|
||||
}
|
||||
|
||||
foreach (TextMeshProUGUI text in __instance.points)
|
||||
[HarmonyPatch(nameof(TravelStore.RefreshBuff))]
|
||||
[HarmonyPostfix]
|
||||
private static void RefreshBuff(TravelStore __instance)
|
||||
{
|
||||
foreach (TravelBuff buff in __instance.travelBuffs)
|
||||
{
|
||||
text.text = StringStore.TranslateText(text.text);
|
||||
TextMeshProUGUI cost = buff.transform.GetChild(1).GetComponent<TextMeshProUGUI>();
|
||||
if (!cost.text.Contains('0'))
|
||||
StringStore.TranslateTextUI(cost);
|
||||
cost.font = Resources.Load<TMP_FontAsset>("fonts/Dynamic");
|
||||
}
|
||||
foreach (TextMeshProUGUI intr in __instance.introduces)
|
||||
StringStore.TranslateTextUI(intr);
|
||||
foreach (var textMesh in __instance.points)
|
||||
StringStore.TranslateTextUI(textMesh);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue