Merge branch 'cassidy'
This commit is contained in:
parent
dc01a905b0
commit
497170aa2c
3 changed files with 40 additions and 17 deletions
|
|
@ -4,6 +4,7 @@ using MelonLoader.Utils;
|
|||
using PvZ_Fusion_Translator.AssetStore;
|
||||
using PvZ_Fusion_Translator.Patches.Managers;
|
||||
using UnityEngine;
|
||||
using Il2Cpp;
|
||||
|
||||
[assembly: MelonInfo(typeof(PvZ_Fusion_Translator.Core), "PvZ Fusion Translator", "231.0.0", "dynaslash / arifrios1st / lancerx0 / JustNull / Dakosha / Mamoru-kun / cassidy / Teyliu", null)]
|
||||
[assembly: MelonGame("LanPiaoPiao", "PlantsVsZombiesRH")]
|
||||
|
|
@ -74,8 +75,11 @@ namespace PvZ_Fusion_Translator
|
|||
Utils.OpenTrello();
|
||||
}
|
||||
|
||||
TowerManager_Patch.UpdateText();
|
||||
}
|
||||
if(TowerManager.Instance != null)
|
||||
{
|
||||
TowerManager_Patch.UpdateText();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnGUI()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,24 +1,28 @@
|
|||
using HarmonyLib;
|
||||
using Il2Cpp;
|
||||
using PvZ_Fusion_Translator.AssetStore;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace PvZ_Fusion_Translator.Patches.GameObjects
|
||||
{
|
||||
[HarmonyPatch(typeof(GardenPlant))]
|
||||
public static class GardenPlant_Patch
|
||||
{
|
||||
[HarmonyPatch(nameof(GardenPlant.Update))]
|
||||
[HarmonyPostfix]
|
||||
private static void Update(GardenPlant __instance)
|
||||
{
|
||||
__instance.infoText = StringStore.TranslateText(__instance.infoText);
|
||||
}
|
||||
public static class GardenPlant_Patch
|
||||
{
|
||||
[HarmonyPatch(nameof(GardenPlant.Start))]
|
||||
[HarmonyPostfix]
|
||||
private static void Start(GardenPlant __instance)
|
||||
{
|
||||
__instance.infoText.font = FontStore.LoadTMPFont(Utils.Language.ToString());
|
||||
__instance.infoText.text = StringStore.TranslateText(__instance.infoText.text);
|
||||
}
|
||||
|
||||
[HarmonyPatch(nameof(GardenPlant.UpdateInfo))]
|
||||
[HarmonyPostfix]
|
||||
private static void UpdateInfo(GardenPlant __instance)
|
||||
{
|
||||
__instance.infoText = StringStore.TranslateText(__instance.infoText);
|
||||
}
|
||||
}
|
||||
[HarmonyPatch(nameof(GardenPlant.UpdateInfo))]
|
||||
[HarmonyPostfix]
|
||||
private static void UpdateInfo(GardenPlant __instance)
|
||||
{
|
||||
|
||||
__instance.infoText.font = FontStore.LoadTMPFont(Utils.Language.ToString());
|
||||
__instance.infoText.text = StringStore.TranslateText(__instance.infoText.text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -21,5 +21,20 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects
|
|||
txt.font = fontAsset;
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(nameof(PlayerShootingMenu.Refresh))]
|
||||
[HarmonyPostfix]
|
||||
private static void Refresh(PlayerShootingMenu __instance)
|
||||
{
|
||||
TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString());
|
||||
|
||||
Transform refreshTransform = __instance.transform.FindChild("Button");
|
||||
foreach (TextMeshProUGUI text in refreshTransform.GetComponentsInChildren<TextMeshProUGUI>())
|
||||
{
|
||||
text.text = StringStore.TranslateText(text.text);
|
||||
text.font = fontAsset;
|
||||
text.autoSizeTextContainer = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue