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
|
||||
/BepInEx/bin/ReleaseMulti/net6.0
|
||||
/AlmanacPlantBank_Patch.cs
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using HarmonyLib;
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using HarmonyLib;
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine.UI;
|
||||
|
|
@ -50,7 +51,7 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.BaseTextObjects
|
|||
__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Бесконечно";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using HarmonyLib;
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
using UnityEngine.TextCore.Text;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using TMPro;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
using UnityEngine.TextCore.Text;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
using System.Text.RegularExpressions;
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine.TextCore.Text;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
using UnityEngine.TextCore.Text;
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using TMPro;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using System.Text.RegularExpressions;
|
||||
using UnityEngine.UI;
|
||||
|
||||
using PvZ_Fusion_Translator__BepInEx_;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using HarmonyLib;
|
||||
using TMPro;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using TMPro;
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
|
@ -108,12 +108,8 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
|||
|
||||
foreach(TextMeshProUGUI txt in mainTransform.GetComponentsInChildren<TextMeshProUGUI>())
|
||||
{
|
||||
#if DEBUG
|
||||
FileLoader.DumpUntranslatedStrings(txt.text);
|
||||
txt.text = StringStore.TranslateText(txt.text);
|
||||
#else
|
||||
txt.text = StringStore.TranslateText(txt.text, true);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
using TMPro;
|
||||
using System;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
#if FIX
|
||||
using System.Text.RegularExpressions;
|
||||
using HarmonyLib;
|
||||
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects
|
||||
{
|
||||
[HarmonyPatch(typeof(AbyssBuffButton))]
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using TMPro;
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using TMPro;
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
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 PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects
|
||||
{
|
||||
|
|
@ -16,9 +13,10 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects
|
|||
[HarmonyPatch(nameof(NormalBtn.OnMouseUpAsButton))]
|
||||
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 System.Collections.Generic;
|
||||
using System;
|
||||
|
|
@ -318,7 +318,7 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects
|
|||
ToggleCustomAssets(toggleType);
|
||||
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")
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#if FIX
|
||||
#if FIX
|
||||
using HarmonyLib;
|
||||
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
|||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||
{
|
||||
[HarmonyPatch(typeof(UIButton))]
|
||||
public static class UIButton_Patch
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
||||
|
|
@ -11,15 +11,14 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
|||
private static bool _warningShown = false;
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch("AnimOver")]
|
||||
[HarmonyPatch(nameof(MainMenu.AnimOver))]
|
||||
private static void AnimOver(MainMenu __instance)
|
||||
{
|
||||
bool flag = _warningShown || NoticeMenu.Instance == null;
|
||||
if (!flag)
|
||||
{
|
||||
if (_warningShown || NoticeMenu.Instance == null)
|
||||
return;
|
||||
|
||||
WarningStore.WarningReload(Utils.Language, NoticeMenu.Instance);
|
||||
_warningShown = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using TMPro;
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
using HarmonyLib;
|
||||
// using Il2Cpp;
|
||||
using TMPro;
|
||||
using System;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||
{
|
||||
[HarmonyPatch(typeof(JigsawClip))]
|
||||
public static class JigsawClip_Patch
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
#if FIX
|
||||
using HarmonyLib;
|
||||
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
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;
|
||||
|
||||
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;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using System;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using System;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using System.Text.RegularExpressions;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using TMPro;
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
using HarmonyLib;
|
||||
// using Il2Cpp;
|
||||
using System;
|
||||
using TMPro;
|
||||
// using MelonLoader;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
using UnityEngine.TextCore.Text;
|
||||
using UnityEngine.UI;
|
||||
// using static MelonLoader.MelonLogger;
|
||||
// using static BepInEx.BepInEx;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
// using Il2Cpp;
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using HarmonyLib;
|
||||
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using HarmonyLib;
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
|
@ -7,42 +7,33 @@ using UnityEngine;
|
|||
namespace PvZ_Fusion_Translator__BepInEx_.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);
|
||||
foreach (TextMeshProUGUI intr in __instance.introduces)
|
||||
StringStore.TranslateTextUI(intr);
|
||||
foreach (var textMesh in __instance.points)
|
||||
StringStore.TranslateTextUI(textMesh);
|
||||
}
|
||||
|
||||
Transform moneyTransform = __instance.transform.Find("Money");
|
||||
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)})]
|
||||
[HarmonyPatch(nameof(TravelStore.RefreshBuff))]
|
||||
[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);
|
||||
}
|
||||
|
||||
foreach (TextMeshProUGUI text in __instance.points)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||
{
|
||||
|
|
@ -12,18 +13,11 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
|||
[HarmonyPostfix]
|
||||
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);
|
||||
#else
|
||||
TMP_FontAsset fontAsset = FontStore.LoadTMPFont();
|
||||
string difficultyText = StringStore.patchesStore["Difficulty"]["Spanish"];
|
||||
__instance.t.text = string.Format("Difficulty: {0}", GameAPP.difficulty);
|
||||
#endif
|
||||
|
||||
__instance.t.autoSizeTextContainer = false;
|
||||
__instance.t.font = fontAsset;
|
||||
foreach(TextMeshProUGUI text in __instance.GetComponentsInChildren<TextMeshProUGUI>())
|
||||
{
|
||||
text.text = StringStore.TranslateText(text.text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using TMPro;
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
using HarmonyLib;
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System.IO;
|
||||
using System.IO;
|
||||
using HarmonyLib;
|
||||
using Il2CppInterop.Runtime;
|
||||
using PvZ_Fusion_Translator__BepInEx_;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using TMPro;
|
||||
using System;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
using UnityEngine.TextCore.Text;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||
{
|
||||
[HarmonyPatch(typeof(ChessManager))]
|
||||
public static class ChessManager_Patch
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#if FIX
|
||||
#if FIX
|
||||
using HarmonyLib;
|
||||
|
||||
using System;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
||||
|
|
|
|||
|
|
@ -1,45 +1,61 @@
|
|||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
using System.Collections.Generic;
|
||||
using Il2CppSystem.Collections.Generic;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
using UnityEngine.TextCore.Text;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects
|
||||
{
|
||||
[HarmonyPatch(typeof(DrawCardManager))]
|
||||
public static class DrawCardManager_Patch
|
||||
{
|
||||
// Dùng chung xử lý cập nhật text
|
||||
private static void TranslateAndApplyFont(Il2CppSystem.Collections.Generic.List<TextMeshProUGUI> texts)
|
||||
[HarmonyPatch(nameof(DrawCardManager.UpdateText))]
|
||||
[HarmonyPostfix]
|
||||
private static void Postfix_UpdateText(DrawCardManager __instance)
|
||||
{
|
||||
if (texts == null || texts.Count == 0) return;
|
||||
|
||||
TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString());
|
||||
|
||||
foreach (var textComponent in texts)
|
||||
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)
|
||||
{
|
||||
if (textComponent == null) continue;
|
||||
|
||||
string translatedText = StringStore.TranslateText(textComponent.text);
|
||||
TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString());
|
||||
textComponent.text = translatedText;
|
||||
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))]
|
||||
[HarmonyPostfix]
|
||||
private static void Postfix_Update(DrawCardManager __instance)
|
||||
{
|
||||
Il2CppSystem.Collections.Generic.List<TextMeshProUGUI> texts = __instance.texts;
|
||||
__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 PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
|
@ -7,7 +7,7 @@ using UnityEngine;
|
|||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
||||
{
|
||||
[HarmonyPatch(typeof(IZBottomMenu))]
|
||||
public static class IZEMgr_Patch
|
||||
public static class IZBottomMenu_Patch
|
||||
{
|
||||
[HarmonyPatch(nameof(IZBottomMenu.ChangeString))]
|
||||
[HarmonyPostfix]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using HarmonyLib;
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
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).GetChild(0).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;
|
||||
for (int i = 0; i < array2.Length; i++)
|
||||
{
|
||||
|
||||
array2[i] = StringStore.TranslateText(array2[i]);
|
||||
array2[i].text = array2[i].text.Replace("\n", " ");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
|||
{
|
||||
foreach(TextMeshProUGUI text in __instance.textA_bad)
|
||||
{
|
||||
string stripText = text.text.Replace("但", "");
|
||||
string stripText = text.text.Replace("?", "");
|
||||
string translatedText = StringStore.TranslateText(stripText);
|
||||
string replacementText = StringStore.translationString["但"] + translatedText;
|
||||
text.text = replacementText;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using HarmonyLib;
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
using HarmonyLib;
|
||||
using System.IO;
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using TMPro;
|
||||
using Newtonsoft.Json;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#if FIX
|
||||
#if FIX
|
||||
using HarmonyLib;
|
||||
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using HarmonyLib;
|
||||
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using TMPro;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
|
||||
|
|
|
|||
|
|
@ -118,11 +118,21 @@
|
|||
<Compile Include="Log.cs" />
|
||||
<Compile Include="ModFeatures.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\AbyssCheckInBag_Patch.cs" />
|
||||
<Compile Include="Patches\GameObjects\AbyssStoreMenu_Patch.cs" />
|
||||
<Compile Include="Patches\GameObjects\AbyssSettlementMenu_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\ButtonObjects\AbyssCheckSellMenu_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\AbyssMenu2_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\DrawCardManager_Patch.cs" />
|
||||
<Compile Include="Patches\Managers\SaveMenu_Patch.cs" />
|
||||
<Compile Include="Patches\GameObjects\TravelBuffOptionButton_Patch.cs" />
|
||||
<Compile Include="Patches\OtherManagers\AchievementClip_Patch.cs" />
|
||||
|
|
@ -157,7 +173,7 @@
|
|||
<Compile Include="Patches\GameObjects\NoticePauseMenu_Patch.cs" />
|
||||
<Compile Include="Patches\GameObjects\ButtonObjects\InGameBtn_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\OtherManagers\MenuText_Patch.cs" />
|
||||
<Compile Include="Patches\Managers\OppositeBuffManager_Patch.cs" />
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue