Merge pull request #6 from Teyliu/JustNull
Add some missing patches from the BIE csproj
This commit is contained in:
commit
f949d46a24
84 changed files with 315 additions and 312 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -10,3 +10,4 @@
|
||||||
/BepInEx/obj/Debug/net6.0
|
/BepInEx/obj/Debug/net6.0
|
||||||
/BepInEx/obj
|
/BepInEx/obj
|
||||||
/BepInEx/bin/ReleaseMulti/net6.0
|
/BepInEx/bin/ReleaseMulti/net6.0
|
||||||
|
/AlmanacPlantBank_Patch.cs
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using System;
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
@ -17,11 +17,11 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.BaseTextObjects
|
||||||
private static void ShowText(InGameText __instance)
|
private static void ShowText(InGameText __instance)
|
||||||
{
|
{
|
||||||
|
|
||||||
#if MULTI_LANGUAGE
|
#if MULTI_LANGUAGE
|
||||||
TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString());
|
TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString());
|
||||||
#else
|
#else
|
||||||
TMP_FontAsset fontAsset = FontStore.LoadTMPFont();
|
TMP_FontAsset fontAsset = FontStore.LoadTMPFont();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
foreach (TextMeshProUGUI txt in __instance.textMeshes)
|
foreach (TextMeshProUGUI txt in __instance.textMeshes)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
@ -50,7 +51,7 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.BaseTextObjects
|
||||||
__instance.fontSize = 12;
|
__instance.fontSize = 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (__instance.text == "Полный Хаос" && __instance.transform.parent.parent.Find("Image").GetComponent<Image>().activeSprite.name == "Present")
|
if (__instance.text == "Полный Хаосs" && __instance.transform.parent.parent.Find("Image").GetComponent<Image>().activeSprite.name == "Present")
|
||||||
{
|
{
|
||||||
__instance.text += "\nБесконечно";
|
__instance.text += "\nБесконечно";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
|
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.TextCore.Text;
|
using UnityEngine.TextCore.Text;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
|
||||||
|
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.TextCore.Text;
|
using UnityEngine.TextCore.Text;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine.TextCore.Text;
|
using UnityEngine.TextCore.Text;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
|
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.TextCore.Text;
|
using UnityEngine.TextCore.Text;
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,13 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
|
||||||
using TMPro;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using Unity.VisualScripting;
|
using Unity.VisualScripting;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
using PvZ_Fusion_Translator__BepInEx_;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using TMPro;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using Unity.VisualScripting;
|
using Unity.VisualScripting;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
@ -108,12 +108,8 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||||
|
|
||||||
foreach(TextMeshProUGUI txt in mainTransform.GetComponentsInChildren<TextMeshProUGUI>())
|
foreach(TextMeshProUGUI txt in mainTransform.GetComponentsInChildren<TextMeshProUGUI>())
|
||||||
{
|
{
|
||||||
#if DEBUG
|
|
||||||
FileLoader.DumpUntranslatedStrings(txt.text);
|
FileLoader.DumpUntranslatedStrings(txt.text);
|
||||||
txt.text = StringStore.TranslateText(txt.text);
|
txt.text = StringStore.TranslateText(txt.text);
|
||||||
#else
|
|
||||||
txt.text = StringStore.TranslateText(txt.text, true);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using TMPro;
|
using System;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
#if FIX
|
#if FIX
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects
|
||||||
{
|
{
|
||||||
[HarmonyPatch(typeof(AbyssBuffButton))]
|
[HarmonyPatch(typeof(AbyssBuffButton))]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
|
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,8 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects
|
||||||
{
|
{
|
||||||
|
|
@ -16,9 +13,10 @@ namespace PvZ_Fusion_Translator__BepInEx_.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,4 +1,4 @@
|
||||||
#if MULTI_LANGUAGE
|
#if MULTI_LANGUAGE
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System;
|
using System;
|
||||||
|
|
@ -246,7 +246,7 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects
|
||||||
{
|
{
|
||||||
if (type != "Textures" && type != "Audio") return;
|
if (type != "Textures" && type != "Audio") return;
|
||||||
|
|
||||||
if(type == "Textures")
|
if (type == "Textures")
|
||||||
{
|
{
|
||||||
Utils.customTextures = !Utils.customTextures;
|
Utils.customTextures = !Utils.customTextures;
|
||||||
ConfigEntry<bool> customTexturesEntry;
|
ConfigEntry<bool> customTexturesEntry;
|
||||||
|
|
@ -318,7 +318,7 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects
|
||||||
ToggleCustomAssets(toggleType);
|
ToggleCustomAssets(toggleType);
|
||||||
if (toggleType == "Textures")
|
if (toggleType == "Textures")
|
||||||
{
|
{
|
||||||
FlashMessage(toggleData.Button, "<size=10>Toggled custom textures!\nRestart your game for everything to apply.", 0.1f);
|
FlashMessage(toggleData.Button, "<size=10>Toggled custom textures!", 0.1f);
|
||||||
}
|
}
|
||||||
else if (toggleType == "Audio")
|
else if (toggleType == "Audio")
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#if FIX
|
#if FIX
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||||
{
|
{
|
||||||
[HarmonyPatch(typeof(UIButton))]
|
[HarmonyPatch(typeof(UIButton))]
|
||||||
public static class UIButton_Patch
|
public static class UIButton_Patch
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
|
@ -11,15 +11,14 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||||
private static bool _warningShown = false;
|
private static bool _warningShown = false;
|
||||||
|
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
[HarmonyPatch("AnimOver")]
|
[HarmonyPatch(nameof(MainMenu.AnimOver))]
|
||||||
private static void AnimOver(MainMenu __instance)
|
private static void AnimOver(MainMenu __instance)
|
||||||
{
|
{
|
||||||
bool flag = _warningShown || NoticeMenu.Instance == null;
|
if (_warningShown || NoticeMenu.Instance == null)
|
||||||
if (!flag)
|
return;
|
||||||
{
|
|
||||||
WarningStore.WarningReload(Utils.Language, NoticeMenu.Instance);
|
WarningStore.WarningReload(Utils.Language, NoticeMenu.Instance);
|
||||||
_warningShown = true;
|
_warningShown = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
// using Il2Cpp;
|
using System;
|
||||||
using TMPro;
|
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
||||||
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
|
||||||
{
|
{
|
||||||
[HarmonyPatch(typeof(JigsawClip))]
|
[HarmonyPatch(typeof(JigsawClip))]
|
||||||
public static class JigsawClip_Patch
|
public static class JigsawClip_Patch
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
#if FIX
|
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
||||||
{
|
{
|
||||||
|
|
@ -47,4 +46,3 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using TMPro;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,10 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
// using Il2Cpp;
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
// using MelonLoader;
|
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.TextCore.Text;
|
using UnityEngine.TextCore.Text;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
// using static MelonLoader.MelonLogger;
|
|
||||||
// using static BepInEx.BepInEx;
|
|
||||||
using static System.Net.Mime.MediaTypeNames;
|
using static System.Net.Mime.MediaTypeNames;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
// using Il2Cpp;
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
using System;
|
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using System;
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
@ -7,42 +7,33 @@ using UnityEngine;
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||||
{
|
{
|
||||||
[HarmonyPatch(typeof(TravelStore))]
|
[HarmonyPatch(typeof(TravelStore))]
|
||||||
internal class TravelStore_Patch
|
public static class TravelStore_Patch
|
||||||
{
|
{
|
||||||
[HarmonyPatch(nameof(TravelStore.Update))]
|
[HarmonyPatch(nameof(TravelStore.Update))]
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
private static void Update(TravelStore __instance)
|
private static void Update(TravelStore __instance)
|
||||||
{
|
{
|
||||||
foreach (TextMeshProUGUI text in __instance.introduces)
|
foreach (TextMeshProUGUI intr in __instance.introduces)
|
||||||
{
|
StringStore.TranslateTextUI(intr);
|
||||||
text.text = StringStore.TranslateText(text.text);
|
foreach (var textMesh in __instance.points)
|
||||||
|
StringStore.TranslateTextUI(textMesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
Transform moneyTransform = __instance.transform.Find("Money");
|
[HarmonyPatch(nameof(TravelStore.RefreshBuff))]
|
||||||
if (moneyTransform != null)
|
|
||||||
{
|
|
||||||
StringStore.TranslateTextTransform(moneyTransform);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (TextMeshProUGUI text in __instance.points)
|
|
||||||
{
|
|
||||||
text.text = StringStore.TranslateText(text.text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[HarmonyPatch(nameof(TravelStore.SetText), new Type[] { typeof(string)})]
|
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
private static void ShowText(TravelStore __instance)
|
private static void RefreshBuff(TravelStore __instance)
|
||||||
{
|
{
|
||||||
foreach (TextMeshProUGUI text in __instance.introduces)
|
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);
|
||||||
foreach (TextMeshProUGUI text in __instance.points)
|
cost.font = Resources.Load<TMP_FontAsset>("fonts/Dynamic");
|
||||||
{
|
|
||||||
text.text = StringStore.TranslateText(text.text);
|
|
||||||
}
|
}
|
||||||
|
foreach (TextMeshProUGUI intr in __instance.introduces)
|
||||||
|
StringStore.TranslateTextUI(intr);
|
||||||
|
foreach (var textMesh in __instance.points)
|
||||||
|
StringStore.TranslateTextUI(textMesh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||||
{
|
{
|
||||||
|
|
@ -12,18 +13,11 @@ namespace PvZ_Fusion_Translator__BepInEx_.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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Collections.Generic;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using Il2CppInterop.Runtime;
|
using Il2CppInterop.Runtime;
|
||||||
using PvZ_Fusion_Translator__BepInEx_;
|
using PvZ_Fusion_Translator__BepInEx_;
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.TextCore.Text;
|
using UnityEngine.TextCore.Text;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||||
{
|
{
|
||||||
[HarmonyPatch(typeof(ChessManager))]
|
[HarmonyPatch(typeof(ChessManager))]
|
||||||
public static class ChessManager_Patch
|
public static class ChessManager_Patch
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#if FIX
|
#if FIX
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
||||||
|
|
|
||||||
|
|
@ -1,45 +1,61 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using System.Collections.Generic;
|
using Il2CppSystem.Collections.Generic;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.TextCore.Text;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||||
{
|
{
|
||||||
[HarmonyPatch(typeof(DrawCardManager))]
|
[HarmonyPatch(typeof(DrawCardManager))]
|
||||||
public static class DrawCardManager_Patch
|
public static class DrawCardManager_Patch
|
||||||
{
|
{
|
||||||
// Dùng chung xử lý cập nhật text
|
[HarmonyPatch(nameof(DrawCardManager.UpdateText))]
|
||||||
private static void TranslateAndApplyFont(Il2CppSystem.Collections.Generic.List<TextMeshProUGUI> texts)
|
[HarmonyPostfix]
|
||||||
|
private static void Postfix_UpdateText(DrawCardManager __instance)
|
||||||
{
|
{
|
||||||
if (texts == null || texts.Count == 0) return;
|
Il2CppSystem.Collections.Generic.List<TextMeshProUGUI> texts = __instance.texts;
|
||||||
|
__instance.upName = StringStore.TranslateText(__instance.upName);
|
||||||
TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString());
|
if (texts != null && texts.Count > 0)
|
||||||
|
{
|
||||||
foreach (var textComponent in texts)
|
foreach (TextMeshProUGUI textComponent in texts)
|
||||||
|
{
|
||||||
|
if (textComponent != null)
|
||||||
{
|
{
|
||||||
if (textComponent == null) continue;
|
|
||||||
|
|
||||||
string translatedText = StringStore.TranslateText(textComponent.text);
|
string translatedText = StringStore.TranslateText(textComponent.text);
|
||||||
|
TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString());
|
||||||
textComponent.text = translatedText;
|
textComponent.text = translatedText;
|
||||||
textComponent.font = fontAsset;
|
textComponent.font = fontAsset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
[HarmonyPostfix]
|
|
||||||
[HarmonyPatch(nameof(DrawCardManager.UpdateText))]
|
|
||||||
private static void Postfix_UpdateText(DrawCardManager __instance)
|
|
||||||
{
|
|
||||||
__instance.upName = StringStore.TranslateText(__instance.upName);
|
|
||||||
TranslateAndApplyFont(__instance.texts);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPostfix]
|
|
||||||
|
|
||||||
[HarmonyPatch(nameof(DrawCardManager.Update))]
|
[HarmonyPatch(nameof(DrawCardManager.Update))]
|
||||||
|
[HarmonyPostfix]
|
||||||
private static void Postfix_Update(DrawCardManager __instance)
|
private static void Postfix_Update(DrawCardManager __instance)
|
||||||
{
|
{
|
||||||
|
Il2CppSystem.Collections.Generic.List<TextMeshProUGUI> texts = __instance.texts;
|
||||||
__instance.upName = StringStore.TranslateText(__instance.upName);
|
__instance.upName = StringStore.TranslateText(__instance.upName);
|
||||||
TranslateAndApplyFont(__instance.texts);
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
@ -7,7 +7,7 @@ using UnityEngine;
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
||||||
{
|
{
|
||||||
[HarmonyPatch(typeof(IZBottomMenu))]
|
[HarmonyPatch(typeof(IZBottomMenu))]
|
||||||
public static class IZEMgr_Patch
|
public static class IZBottomMenu_Patch
|
||||||
{
|
{
|
||||||
[HarmonyPatch(nameof(IZBottomMenu.ChangeString))]
|
[HarmonyPatch(nameof(IZBottomMenu.ChangeString))]
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
|
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
||||||
{
|
{
|
||||||
|
|
@ -19,12 +20,10 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
||||||
__instance.transform.GetChild(5).GetComponent<TextMeshProUGUI>(),
|
__instance.transform.GetChild(5).GetComponent<TextMeshProUGUI>(),
|
||||||
__instance.transform.GetChild(5).GetChild(0).GetComponent<TextMeshProUGUI>(),
|
__instance.transform.GetChild(5).GetChild(0).GetComponent<TextMeshProUGUI>(),
|
||||||
__instance.transform.GetChild(6).GetComponent<TextMeshProUGUI>(),
|
__instance.transform.GetChild(6).GetComponent<TextMeshProUGUI>(),
|
||||||
__instance.transform.GetChild(6).GetChild(0).GetComponent<TextMeshProUGUI>()
|
__instance.transform.GetChild(6).GetChild(0).GetComponent<TextMeshProUGUI>()};
|
||||||
};
|
|
||||||
TextMeshProUGUI[] array2 = array;
|
TextMeshProUGUI[] array2 = array;
|
||||||
for (int i = 0; i < array2.Length; i++)
|
for (int i = 0; i < array2.Length; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
array2[i] = StringStore.TranslateText(array2[i]);
|
array2[i] = StringStore.TranslateText(array2[i]);
|
||||||
array2[i].text = array2[i].text.Replace("\n", " ");
|
array2[i].text = array2[i].text.Replace("\n", " ");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
||||||
[HarmonyPatch(typeof(OppositeBuffManager))]
|
[HarmonyPatch(typeof(OppositeBuffManager))]
|
||||||
public static class OppositeBuffManager_Patch
|
public static class OppositeBuffManager_Patch
|
||||||
{
|
{
|
||||||
#if TESTING
|
#if TESTING
|
||||||
[HarmonyPatch(nameof(OppositeBuffManager.InitBuffPool))]
|
[HarmonyPatch(nameof(OppositeBuffManager.InitBuffPool))]
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
private static void InitBuffPool(OppositeBuffManager __instance)
|
private static void InitBuffPool(OppositeBuffManager __instance)
|
||||||
|
|
@ -44,7 +44,7 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
||||||
{
|
{
|
||||||
foreach(TextMeshProUGUI text in __instance.textA_bad)
|
foreach(TextMeshProUGUI text in __instance.textA_bad)
|
||||||
{
|
{
|
||||||
string stripText = text.text.Replace("但", "");
|
string stripText = text.text.Replace("?", "");
|
||||||
string translatedText = StringStore.TranslateText(stripText);
|
string translatedText = StringStore.TranslateText(stripText);
|
||||||
string replacementText = StringStore.translationString["但"] + translatedText;
|
string replacementText = StringStore.translationString["但"] + translatedText;
|
||||||
text.text = replacementText;
|
text.text = replacementText;
|
||||||
|
|
@ -66,7 +66,7 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
||||||
text.text = StringStore.TranslateText(text.text);
|
text.text = StringStore.TranslateText(text.text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
[HarmonyPatch(nameof(OppositeBuffManager.SetText), new Type[] { typeof(TextMeshProUGUI), typeof(BuffType), typeof(int)})]
|
[HarmonyPatch(nameof(OppositeBuffManager.SetText), new Type[] { typeof(TextMeshProUGUI), typeof(BuffType), typeof(int)})]
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
||||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using System.IO;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#if FIX
|
#if FIX
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -118,11 +118,21 @@
|
||||||
<Compile Include="Log.cs" />
|
<Compile Include="Log.cs" />
|
||||||
<Compile Include="ModFeatures.cs" />
|
<Compile Include="ModFeatures.cs" />
|
||||||
<Compile Include="AssetStore\AudioStore.cs" />
|
<Compile Include="AssetStore\AudioStore.cs" />
|
||||||
|
<Compile Include="Patches\GameObjects\Board_Patch.cs" />
|
||||||
|
<Compile Include="Patches\GameObjects\MinorObjects\Jigsaw_Patch.cs" />
|
||||||
|
<Compile Include="Patches\GameObjects\ShootingSelectWindow_Patch.cs" />
|
||||||
|
<Compile Include="Patches\GameObjects\FruitNinjaSelectWindow_Patch.cs" />
|
||||||
|
<Compile Include="Patches\GameObjects\RogueCardWindow_Patch.cs" />
|
||||||
|
<Compile Include="Patches\GameObjects\CrisisZombieWindow_Patch.cs" />
|
||||||
|
<Compile Include="Patches\GameObjects\RogueStartMenu_Patch.cs" />
|
||||||
<Compile Include="Patches\GameObjects\AbyssBagMenu_Patch.cs" />
|
<Compile Include="Patches\GameObjects\AbyssBagMenu_Patch.cs" />
|
||||||
<Compile Include="Patches\GameObjects\AbyssCheckInBag_Patch.cs" />
|
<Compile Include="Patches\GameObjects\AbyssCheckInBag_Patch.cs" />
|
||||||
<Compile Include="Patches\GameObjects\AbyssStoreMenu_Patch.cs" />
|
<Compile Include="Patches\GameObjects\AbyssStoreMenu_Patch.cs" />
|
||||||
<Compile Include="Patches\GameObjects\AbyssSettlementMenu_Patch.cs" />
|
<Compile Include="Patches\GameObjects\AbyssSettlementMenu_Patch.cs" />
|
||||||
<Compile Include="Patches\GameObjects\ButtonObjects\NormalBtn_Patch.cs" />
|
<Compile Include="Patches\GameObjects\ButtonObjects\NormalBtn_Patch.cs" />
|
||||||
|
<Compile Include="Patches\GameObjects\ButtonObjects\UIButton_Patch.cs" />
|
||||||
|
<Compile Include="Patches\GameObjects\MinorObjects\TrainingDummy_Patch.cs" />
|
||||||
|
<Compile Include="Patches\GameObjects\MinorObjects\UltimateChomper_Patch.cs" />
|
||||||
<Compile Include="Patches\GameObjects\OtherMenu_Patch.cs" />
|
<Compile Include="Patches\GameObjects\OtherMenu_Patch.cs" />
|
||||||
<Compile Include="Patches\GameObjects\ButtonObjects\AbyssCheckSellMenu_Patch.cs" />
|
<Compile Include="Patches\GameObjects\ButtonObjects\AbyssCheckSellMenu_Patch.cs" />
|
||||||
<Compile Include="Patches\GameObjects\ButtonObjects\AbyssBuffButton_Patch.cs" />
|
<Compile Include="Patches\GameObjects\ButtonObjects\AbyssBuffButton_Patch.cs" />
|
||||||
|
|
@ -140,7 +150,13 @@
|
||||||
<Compile Include="Patches\GameObjects\AbyssDevelopMenu_Patch.cs" />
|
<Compile Include="Patches\GameObjects\AbyssDevelopMenu_Patch.cs" />
|
||||||
<Compile Include="Patches\GameObjects\AbyssMenu2_Patch.cs" />
|
<Compile Include="Patches\GameObjects\AbyssMenu2_Patch.cs" />
|
||||||
<Compile Include="Patches\GameObjects\AbyssMenu_Patch.cs" />
|
<Compile Include="Patches\GameObjects\AbyssMenu_Patch.cs" />
|
||||||
|
<Compile Include="Patches\GameObjects\TowerOption_Patch.cs" />
|
||||||
|
<Compile Include="Patches\GameObjects\TravelLookBuff_Patch.cs" />
|
||||||
|
<Compile Include="Patches\GameObjects\ShootingMenu_Patch.cs" />
|
||||||
|
<Compile Include="Patches\GameObjects\TravelLookMenu_Patch.cs" />
|
||||||
|
<Compile Include="Patches\Managers\ChessManager_Patch.cs" />
|
||||||
<Compile Include="Patches\Managers\CustomLevelShower_Patch.cs" />
|
<Compile Include="Patches\Managers\CustomLevelShower_Patch.cs" />
|
||||||
|
<Compile Include="Patches\Managers\DrawCardManager_Patch.cs" />
|
||||||
<Compile Include="Patches\Managers\SaveMenu_Patch.cs" />
|
<Compile Include="Patches\Managers\SaveMenu_Patch.cs" />
|
||||||
<Compile Include="Patches\GameObjects\TravelBuffOptionButton_Patch.cs" />
|
<Compile Include="Patches\GameObjects\TravelBuffOptionButton_Patch.cs" />
|
||||||
<Compile Include="Patches\OtherManagers\AchievementClip_Patch.cs" />
|
<Compile Include="Patches\OtherManagers\AchievementClip_Patch.cs" />
|
||||||
|
|
@ -157,7 +173,7 @@
|
||||||
<Compile Include="Patches\GameObjects\NoticePauseMenu_Patch.cs" />
|
<Compile Include="Patches\GameObjects\NoticePauseMenu_Patch.cs" />
|
||||||
<Compile Include="Patches\GameObjects\ButtonObjects\InGameBtn_Patch.cs" />
|
<Compile Include="Patches\GameObjects\ButtonObjects\InGameBtn_Patch.cs" />
|
||||||
<Compile Include="Patches\BaseTextObjects\InGameText_Patch.cs" />
|
<Compile Include="Patches\BaseTextObjects\InGameText_Patch.cs" />
|
||||||
<Compile Include="Patches\Managers\InGameUIMgr_Patch.cs" />
|
<Compile Include="Patches\Managers\InGameUI_Patch.cs" />
|
||||||
<Compile Include="Patches\Managers\IZEMgr_Patch.cs" />
|
<Compile Include="Patches\Managers\IZEMgr_Patch.cs" />
|
||||||
<Compile Include="Patches\OtherManagers\MenuText_Patch.cs" />
|
<Compile Include="Patches\OtherManagers\MenuText_Patch.cs" />
|
||||||
<Compile Include="Patches\Managers\OppositeBuffManager_Patch.cs" />
|
<Compile Include="Patches\Managers\OppositeBuffManager_Patch.cs" />
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue