idk but add some cassidy's stuffs too. You can check her branch commit
This commit is contained in:
parent
012256f59f
commit
d41aa4f42c
4 changed files with 27 additions and 28 deletions
|
|
@ -18,10 +18,12 @@ namespace PvZ_Fusion_Translator.Patches.BaseTextObjects
|
||||||
__instance = StringStore.TranslateText(__instance);
|
__instance = StringStore.TranslateText(__instance);
|
||||||
__instance.autoSizeTextContainer = false;
|
__instance.autoSizeTextContainer = false;
|
||||||
return;
|
return;
|
||||||
}
|
} else if (!(__instance.transform.name.Contains("AlmanacZombie") || __instance.transform.name.Contains("AlmanacPlant")))
|
||||||
|
{
|
||||||
__instance = StringStore.TranslateText(__instance);
|
__instance = StringStore.TranslateText(__instance);
|
||||||
__instance.autoSizeTextContainer = true;
|
__instance.autoSizeTextContainer = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
@ -13,9 +13,10 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects
|
||||||
[HarmonyPatch(nameof(NormalBtn.OnMouseUpAsButton))]
|
[HarmonyPatch(nameof(NormalBtn.OnMouseUpAsButton))]
|
||||||
public static void OnMouseUpAsButton(NormalBtn __instance)
|
public static void OnMouseUpAsButton(NormalBtn __instance)
|
||||||
{
|
{
|
||||||
foreach (TextMeshPro textMeshPro in __instance.GetComponentsInChildren<TextMeshPro>())
|
Transform banTransform = __instance.transform.GetChild(0);
|
||||||
|
if (banTransform != null)
|
||||||
{
|
{
|
||||||
textMeshPro.text = StringStore.TranslateText(textMeshPro.text);
|
banTransform.GetComponent<TextMeshPro>().text = StringStore.TranslateText(banTransform.GetComponent<TextMeshPro>().text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using Il2Cpp;
|
using Il2Cpp;
|
||||||
using Il2CppTMPro;
|
using Il2CppTMPro;
|
||||||
|
using MelonLoader;
|
||||||
using PvZ_Fusion_Translator.AssetStore;
|
using PvZ_Fusion_Translator.AssetStore;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator.Patches.GameObjects
|
namespace PvZ_Fusion_Translator.Patches.GameObjects
|
||||||
{
|
{
|
||||||
|
|
@ -12,18 +14,11 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
private static void Update(UIDifficulty __instance)
|
private static void Update(UIDifficulty __instance)
|
||||||
{
|
{
|
||||||
|
|
||||||
#if MULTI_LANGUAGE
|
|
||||||
TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString());
|
|
||||||
__instance.t.text = StringStore.TranslateText(__instance.t.text);
|
__instance.t.text = StringStore.TranslateText(__instance.t.text);
|
||||||
#else
|
foreach(TextMeshProUGUI text in __instance.GetComponentsInChildren<TextMeshProUGUI>())
|
||||||
TMP_FontAsset fontAsset = FontStore.LoadTMPFont();
|
{
|
||||||
string difficultyText = StringStore.patchesStore["Difficulty"]["Spanish"];
|
text.text = StringStore.TranslateText(text.text);
|
||||||
__instance.t.text = string.Format("Difficulty: {0}", GameAPP.difficulty);
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
__instance.t.autoSizeTextContainer = false;
|
|
||||||
__instance.t.font = fontAsset;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -146,11 +146,6 @@ namespace PvZ_Fusion_Translator.Patches.Managers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(TextMeshPro textMeshPro in __instance.GetComponentsInChildren<TextMeshPro>())
|
|
||||||
{
|
|
||||||
textMeshPro.text = StringStore.TranslateText(textMeshPro.text);
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -176,6 +171,12 @@ namespace PvZ_Fusion_Translator.Patches.Managers
|
||||||
{
|
{
|
||||||
component.autoSizeTextContainer = false;
|
component.autoSizeTextContainer = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Transform banTransform = __instance.transform.FindChild("Ban").GetChild(0);
|
||||||
|
if (banTransform != null)
|
||||||
|
{
|
||||||
|
banTransform.GetComponent<TextMeshPro>().text = StringStore.TranslateText(banTransform.GetComponent<TextMeshPro>().text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Reference in a new issue