diff --git a/.gitignore b/.gitignore index 371124c..56890c6 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ /BepInEx/obj/Debug/net6.0 /BepInEx/obj /BepInEx/bin/ReleaseMulti/net6.0 +/AlmanacPlantBank_Patch.cs diff --git a/BepInEx/Patches/BaseTextObjects/InGameText_Patch.cs b/BepInEx/Patches/BaseTextObjects/InGameText_Patch.cs index 0efa9b2..320f990 100644 --- a/BepInEx/Patches/BaseTextObjects/InGameText_Patch.cs +++ b/BepInEx/Patches/BaseTextObjects/InGameText_Patch.cs @@ -1,4 +1,4 @@ -using HarmonyLib; +using HarmonyLib; using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; @@ -17,13 +17,13 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.BaseTextObjects private static void ShowText(InGameText __instance) { -#if MULTI_LANGUAGE - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); -#else + #if MULTI_LANGUAGE + TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + #else TMP_FontAsset fontAsset = FontStore.LoadTMPFont(); -#endif - - foreach (TextMeshProUGUI txt in __instance.textMeshes) + #endif + + foreach (TextMeshProUGUI txt in __instance.textMeshes) { txt.text = StringStore.TranslateText(txt.text, true); txt.font = fontAsset; diff --git a/BepInEx/Patches/BaseTextObjects/TMP_InputField_Patch.cs b/BepInEx/Patches/BaseTextObjects/TMP_InputField_Patch.cs index 0c066de..8928a4c 100644 --- a/BepInEx/Patches/BaseTextObjects/TMP_InputField_Patch.cs +++ b/BepInEx/Patches/BaseTextObjects/TMP_InputField_Patch.cs @@ -1,4 +1,5 @@ -using HarmonyLib; +using HarmonyLib; +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; diff --git a/BepInEx/Patches/BaseTextObjects/TextMeshProUGUI_Patch.cs b/BepInEx/Patches/BaseTextObjects/TextMeshProUGUI_Patch.cs index cec18bc..d03bb9c 100644 --- a/BepInEx/Patches/BaseTextObjects/TextMeshProUGUI_Patch.cs +++ b/BepInEx/Patches/BaseTextObjects/TextMeshProUGUI_Patch.cs @@ -1,4 +1,5 @@ -using HarmonyLib; +using HarmonyLib; +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine.UI; @@ -50,9 +51,9 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.BaseTextObjects __instance.fontSize = 12; } - if (__instance.text == "Полный Хаос" && __instance.transform.parent.parent.Find("Image").GetComponent().activeSprite.name == "Present") + if (__instance.text == "?????? ????" && __instance.transform.parent.parent.Find("Image").GetComponent().activeSprite.name == "Present") { - __instance.text += "\nБесконечно"; + __instance.text += "\n??????????"; } // __instance.ForceMeshUpdate(); diff --git a/BepInEx/Patches/BaseTextObjects/TextMeshPro_Patch.cs b/BepInEx/Patches/BaseTextObjects/TextMeshPro_Patch.cs index 588eb70..5012841 100644 --- a/BepInEx/Patches/BaseTextObjects/TextMeshPro_Patch.cs +++ b/BepInEx/Patches/BaseTextObjects/TextMeshPro_Patch.cs @@ -1,4 +1,5 @@ -using HarmonyLib; +using HarmonyLib; +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; @@ -26,4 +27,4 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.BaseTextObjects } } } -} +} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/AbyssBagMenu_Patch.cs b/BepInEx/Patches/GameObjects/AbyssBagMenu_Patch.cs index 59a5db2..2682ee0 100644 --- a/BepInEx/Patches/GameObjects/AbyssBagMenu_Patch.cs +++ b/BepInEx/Patches/GameObjects/AbyssBagMenu_Patch.cs @@ -1,7 +1,6 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using TMPro; - using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; using UnityEngine.TextCore.Text; diff --git a/BepInEx/Patches/GameObjects/AbyssCheckInBag_Patch.cs b/BepInEx/Patches/GameObjects/AbyssCheckInBag_Patch.cs index f468b2f..da5465c 100644 --- a/BepInEx/Patches/GameObjects/AbyssCheckInBag_Patch.cs +++ b/BepInEx/Patches/GameObjects/AbyssCheckInBag_Patch.cs @@ -1,7 +1,5 @@ -using HarmonyLib; - -using TMPro; - +using HarmonyLib; +using System; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; using UnityEngine.TextCore.Text; diff --git a/BepInEx/Patches/GameObjects/AbyssDevelopMenu_Patch.cs b/BepInEx/Patches/GameObjects/AbyssDevelopMenu_Patch.cs index 479c0bf..60d9445 100644 --- a/BepInEx/Patches/GameObjects/AbyssDevelopMenu_Patch.cs +++ b/BepInEx/Patches/GameObjects/AbyssDevelopMenu_Patch.cs @@ -1,6 +1,8 @@ -using System.Text.RegularExpressions; +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; @@ -21,7 +23,7 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects TextMeshProUGUI upgradeCostText = __instance.transform.FindChild("UpgradeCost").GetComponent(); TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - string regexStr = "([^\\s]+)\n当前等级:([^\\s]+)\n\n升级条件:\n([^\\s]+)\n\n升级消耗:([^\\s]+)"; + string regexStr = "([^\\s]+)\n????:([^\\s]+)\n\n????:\n([^\\s]+)\n\n????:([^\\s]+)"; Regex regex = new Regex(regexStr); diff --git a/BepInEx/Patches/GameObjects/AbyssMenu2_Patch.cs b/BepInEx/Patches/GameObjects/AbyssMenu2_Patch.cs index ac9fdad..47089f5 100644 --- a/BepInEx/Patches/GameObjects/AbyssMenu2_Patch.cs +++ b/BepInEx/Patches/GameObjects/AbyssMenu2_Patch.cs @@ -1,7 +1,6 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using TMPro; - using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; using UnityEngine.TextCore.Text; diff --git a/BepInEx/Patches/GameObjects/AbyssMenu_Patch.cs b/BepInEx/Patches/GameObjects/AbyssMenu_Patch.cs index d6654a6..0d563e4 100644 --- a/BepInEx/Patches/GameObjects/AbyssMenu_Patch.cs +++ b/BepInEx/Patches/GameObjects/AbyssMenu_Patch.cs @@ -1,14 +1,13 @@ -using HarmonyLib; - -using TMPro; +using HarmonyLib; 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 { @@ -38,7 +37,7 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects foreach (TextMeshProUGUI txt in __instance.levelInfo) { - string regexStr = "第(\\d+)关\n场景:([^\\s]+)\n总波数:(\\d+)波\n特殊环境:([^\\s:]+)\n减伤强度:(\\d+)"; + string regexStr = "?(\\d+)?\n??:([^\\s]+)\n???:(\\d+)?\n????:([^\\s:]+)\n????:(\\d+)"; Regex regex = new Regex(regexStr); diff --git a/BepInEx/Patches/GameObjects/AbyssSettlementMenu_Patch.cs b/BepInEx/Patches/GameObjects/AbyssSettlementMenu_Patch.cs index 1434127..9a26e09 100644 --- a/BepInEx/Patches/GameObjects/AbyssSettlementMenu_Patch.cs +++ b/BepInEx/Patches/GameObjects/AbyssSettlementMenu_Patch.cs @@ -1,6 +1,7 @@ -using HarmonyLib; -using TMPro; +using HarmonyLib; +using System; using System.Collections.Generic; +using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using Unity.VisualScripting; using UnityEngine; @@ -19,12 +20,12 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); string[] regexStrList = [ - "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n极限模式产出:(\\d+)\n非首胜无额外产出\n产出叶绿素总计:(\\d+)", - "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n极限模式产出:(\\d+)\n首胜产出:(\\d+)\n剩余小推车数量:(\\d+),获得叶绿素:(\\d+)\n产出叶绿素总计:(\\d+)", - "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n首胜产出:(\\d+)\n剩余小推车数量:(\\d+),获得叶绿素:(\\d+)\n产出叶绿素总计:(\\d+)", - "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n困难模式产出:(\\d+)\n首胜产出:(\\d+)\n剩余小推车数量:(\\d+),获得叶绿素:(\\d+)\n产出叶绿素总计:(\\d+)", - "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n非首胜无额外产出\n产出叶绿素总计:(\\d+)", - "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n困难模式产出:(\\d+)\n非首胜无额外产出\n产出叶绿素总计:(\\d+)" + "?(\\d+)?\n????:(\\d+)?(\\d+)?\n????:(\\d+)\n???????:(\\d+)\n??????:(\\d+)\n????????\n???????:(\\d+)", + "?(\\d+)?\n????:(\\d+)?(\\d+)?\n????:(\\d+)\n???????:(\\d+)\n??????:(\\d+)\n????:(\\d+)\n???????:(\\d+),?????:(\\d+)\n???????:(\\d+)", + "?(\\d+)?\n????:(\\d+)?(\\d+)?\n????:(\\d+)\n???????:(\\d+)\n????:(\\d+)\n???????:(\\d+),?????:(\\d+)\n???????:(\\d+)", + "?(\\d+)?\n????:(\\d+)?(\\d+)?\n????:(\\d+)\n???????:(\\d+)\n??????:(\\d+)\n????:(\\d+)\n???????:(\\d+),?????:(\\d+)\n???????:(\\d+)", + "?(\\d+)?\n????:(\\d+)?(\\d+)?\n????:(\\d+)\n???????:(\\d+)\n????????\n???????:(\\d+)", + "?(\\d+)?\n????:(\\d+)?(\\d+)?\n????:(\\d+)\n???????:(\\d+)\n??????:(\\d+)\n????????\n???????:(\\d+)" ]; foreach(string regexStr in regexStrList) diff --git a/BepInEx/Patches/GameObjects/AbyssStoreMenu_Patch.cs b/BepInEx/Patches/GameObjects/AbyssStoreMenu_Patch.cs index b6c445e..a1c5f65 100644 --- a/BepInEx/Patches/GameObjects/AbyssStoreMenu_Patch.cs +++ b/BepInEx/Patches/GameObjects/AbyssStoreMenu_Patch.cs @@ -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 diff --git a/BepInEx/Patches/GameObjects/BaseMenu_Patch.cs b/BepInEx/Patches/GameObjects/BaseMenu_Patch.cs index 229e80e..ca50e34 100644 --- a/BepInEx/Patches/GameObjects/BaseMenu_Patch.cs +++ b/BepInEx/Patches/GameObjects/BaseMenu_Patch.cs @@ -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()) { -#if DEBUG FileLoader.DumpUntranslatedStrings(txt.text); txt.text = StringStore.TranslateText(txt.text); -#else - txt.text = StringStore.TranslateText(txt.text, true); -#endif } } } diff --git a/BepInEx/Patches/GameObjects/Board_Patch.cs b/BepInEx/Patches/GameObjects/Board_Patch.cs index 12ee2c0..149d36c 100644 --- a/BepInEx/Patches/GameObjects/Board_Patch.cs +++ b/BepInEx/Patches/GameObjects/Board_Patch.cs @@ -1,5 +1,5 @@ using HarmonyLib; -using TMPro; +using System; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/AbyssBuffButton_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/AbyssBuffButton_Patch.cs index 3ab8bd5..7921fcc 100644 --- a/BepInEx/Patches/GameObjects/ButtonObjects/AbyssBuffButton_Patch.cs +++ b/BepInEx/Patches/GameObjects/ButtonObjects/AbyssBuffButton_Patch.cs @@ -1,12 +1,11 @@ -#if FIX +#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))] @@ -18,7 +17,7 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects { TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - Regex regex = new Regex("([^\\s]+)\n价格:(\\d+)"); + Regex regex = new Regex("([^\\s]+)\n??:(\\d+)"); if (regex.IsMatch(__instance.description.text)) { @@ -35,7 +34,7 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects MelonLogger.Msg(translatedValue); } - __instance.description.text = string.Format(StringStore.translationStringRegex["([^\\s]+)\n价格:(\\d+)"], [.. dynamicParts]); + __instance.description.text = string.Format(StringStore.translationStringRegex["([^\\s]+)\n??:(\\d+)"], [.. dynamicParts]); __instance.description.font = fontAsset; } } diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/AbyssCheckSellMenu_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/AbyssCheckSellMenu_Patch.cs index 359979a..4d27de8 100644 --- a/BepInEx/Patches/GameObjects/ButtonObjects/AbyssCheckSellMenu_Patch.cs +++ b/BepInEx/Patches/GameObjects/ButtonObjects/AbyssCheckSellMenu_Patch.cs @@ -1,6 +1,5 @@ -using HarmonyLib; - -using TMPro; +using HarmonyLib; +using System; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/AbyssLevelEnter_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/AbyssLevelEnter_Patch.cs index 0bafb08..5e85488 100644 --- a/BepInEx/Patches/GameObjects/ButtonObjects/AbyssLevelEnter_Patch.cs +++ b/BepInEx/Patches/GameObjects/ButtonObjects/AbyssLevelEnter_Patch.cs @@ -1,6 +1,5 @@ -using HarmonyLib; - -using TMPro; +using HarmonyLib; +using System; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/Advanture_Btn_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/Advanture_Btn_Patch.cs index 04ac110..cae0669 100644 --- a/BepInEx/Patches/GameObjects/ButtonObjects/Advanture_Btn_Patch.cs +++ b/BepInEx/Patches/GameObjects/ButtonObjects/Advanture_Btn_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/CustomLevelEnter_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/CustomLevelEnter_Patch.cs index 2f67bc2..ea9d7cc 100644 --- a/BepInEx/Patches/GameObjects/ButtonObjects/CustomLevelEnter_Patch.cs +++ b/BepInEx/Patches/GameObjects/ButtonObjects/CustomLevelEnter_Patch.cs @@ -1,7 +1,6 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using TMPro; - using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/InGameBtn_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/InGameBtn_Patch.cs index 102a731..52a196a 100644 --- a/BepInEx/Patches/GameObjects/ButtonObjects/InGameBtn_Patch.cs +++ b/BepInEx/Patches/GameObjects/ButtonObjects/InGameBtn_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/NormalBtn_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/NormalBtn_Patch.cs index 2e10909..674fbc7 100644 --- a/BepInEx/Patches/GameObjects/ButtonObjects/NormalBtn_Patch.cs +++ b/BepInEx/Patches/GameObjects/ButtonObjects/NormalBtn_Patch.cs @@ -1,25 +1,23 @@ -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 { - [HarmonyPatch(typeof(NormalBtn))] - public class NormalBtn_Patch + [HarmonyPatch(typeof(NormalBtn))] + public class NormalBtn_Patch { - [HarmonyPostfix] - [HarmonyPatch(nameof(NormalBtn.OnMouseUpAsButton))] - public static void OnMouseUpAsButton(NormalBtn __instance) - { - foreach (TextMeshPro textMeshPro in __instance.GetComponentsInChildren()) - { - textMeshPro.text = StringStore.TranslateText(textMeshPro.text); - } + [HarmonyPostfix] + [HarmonyPatch(nameof(NormalBtn.OnMouseUpAsButton))] + public static void OnMouseUpAsButton(NormalBtn __instance) + { + Transform banTransform = __instance.transform.GetChild(0); + if (banTransform != null) + { + banTransform.GetComponent().text = StringStore.TranslateText(banTransform.GetComponent().text); + } } - } -} + } +} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/OptLanguageBtn_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/OptLanguageBtn_Patch.cs index cd6f0cd..efb52c8 100644 --- a/BepInEx/Patches/GameObjects/ButtonObjects/OptLanguageBtn_Patch.cs +++ b/BepInEx/Patches/GameObjects/ButtonObjects/OptLanguageBtn_Patch.cs @@ -1,4 +1,4 @@ -#if MULTI_LANGUAGE +#if MULTI_LANGUAGE using HarmonyLib; using System.Collections.Generic; using System; @@ -242,31 +242,31 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects } } - private static void ToggleCustomAssets(string type) - { - if (type != "Textures" && type != "Audio") return; + private static void ToggleCustomAssets(string type) + { + if (type != "Textures" && type != "Audio") return; - if(type == "Textures") - { - Utils.customTextures = !Utils.customTextures; - ConfigEntry customTexturesEntry; - Core.Instance.Config.TryGetEntry(new ConfigDefinition("PvZ_Fusion_Translator", "DefaultTextures"), out customTexturesEntry); - customTexturesEntry.BoxedValue = !Utils.customTextures; + if (type == "Textures") + { + Utils.customTextures = !Utils.customTextures; + ConfigEntry customTexturesEntry; + Core.Instance.Config.TryGetEntry(new ConfigDefinition("PvZ_Fusion_Translator", "DefaultTextures"), out customTexturesEntry); + customTexturesEntry.BoxedValue = !Utils.customTextures; TextureStore.Reload(); Coroutine replaceTextureRoutine = Core.MonoInstance.StartCoroutine(TextureStore.ReplaceTexturesCoroutine()); - } - - if (type == "Audio") - { + } + + if (type == "Audio") + { Utils.customAudio = !Utils.customAudio; ConfigEntry customAudioEntry; Core.Instance.Config.TryGetEntry(new ConfigDefinition("PvZ_Fusion_Translator", "DefaultAudio"), out customAudioEntry); customAudioEntry.BoxedValue = !Utils.customAudio; } - Core.Instance.Config.Save(); + Core.Instance.Config.Save(); } - [HarmonyPatch(typeof(OptionBtn))] + [HarmonyPatch(typeof(OptionBtn))] public static class OptLangBtn_Patch { [HarmonyPatch(nameof(OptionBtn.Awake))] @@ -318,7 +318,7 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects ToggleCustomAssets(toggleType); if (toggleType == "Textures") { - FlashMessage(toggleData.Button, "Toggled custom textures!\nRestart your game for everything to apply.", 0.1f); + FlashMessage(toggleData.Button, "Toggled custom textures!", 0.1f); } else if (toggleType == "Audio") { diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/OptionBtn_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/OptionBtn_Patch.cs index 9b3064f..87f3e66 100644 --- a/BepInEx/Patches/GameObjects/ButtonObjects/OptionBtn_Patch.cs +++ b/BepInEx/Patches/GameObjects/ButtonObjects/OptionBtn_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/PVPPotBtn_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/PVPPotBtn_Patch.cs index 4cb1107..bb07b21 100644 --- a/BepInEx/Patches/GameObjects/ButtonObjects/PVPPotBtn_Patch.cs +++ b/BepInEx/Patches/GameObjects/ButtonObjects/PVPPotBtn_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/PauseMenu_Btn_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/PauseMenu_Btn_Patch.cs index 79d20c2..e110b2f 100644 --- a/BepInEx/Patches/GameObjects/ButtonObjects/PauseMenu_Btn_Patch.cs +++ b/BepInEx/Patches/GameObjects/ButtonObjects/PauseMenu_Btn_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using PvZ_Fusion_Translator__BepInEx_.AssetStore; namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/SaveMenuBtn_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/SaveMenuBtn_Patch.cs index 5233f02..b6b8df4 100644 --- a/BepInEx/Patches/GameObjects/ButtonObjects/SaveMenuBtn_Patch.cs +++ b/BepInEx/Patches/GameObjects/ButtonObjects/SaveMenuBtn_Patch.cs @@ -1,6 +1,6 @@ -#if FIX +#if FIX using HarmonyLib; - +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/UIButton_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/UIButton_Patch.cs index c79f69f..ef94655 100644 --- a/BepInEx/Patches/GameObjects/ButtonObjects/UIButton_Patch.cs +++ b/BepInEx/Patches/GameObjects/ButtonObjects/UIButton_Patch.cs @@ -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 @@ -32,7 +32,7 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects if (newTMP != null) { newTMP.text = translatedText; - } + } } } } diff --git a/BepInEx/Patches/GameObjects/Close_Patch.cs b/BepInEx/Patches/GameObjects/Close_Patch.cs index a2be68d..b0783e8 100644 --- a/BepInEx/Patches/GameObjects/Close_Patch.cs +++ b/BepInEx/Patches/GameObjects/Close_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; @@ -15,7 +15,7 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects { TextMeshPro closeText = __instance.transform.GetChild(0).GetComponent(); - closeText.text = "合上"; + closeText.text = "??"; closeText = StringStore.TranslateText(closeText); closeText.autoSizeTextContainer = true; diff --git a/BepInEx/Patches/GameObjects/CrisisZombieWindow_Patch.cs b/BepInEx/Patches/GameObjects/CrisisZombieWindow_Patch.cs index 1c37071..88b3411 100644 --- a/BepInEx/Patches/GameObjects/CrisisZombieWindow_Patch.cs +++ b/BepInEx/Patches/GameObjects/CrisisZombieWindow_Patch.cs @@ -1,5 +1,5 @@ using HarmonyLib; - +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; diff --git a/BepInEx/Patches/GameObjects/CustomSettings_Patch.cs b/BepInEx/Patches/GameObjects/CustomSettings_Patch.cs index 1b9c01e..a89481b 100644 --- a/BepInEx/Patches/GameObjects/CustomSettings_Patch.cs +++ b/BepInEx/Patches/GameObjects/CustomSettings_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using PvZ_Fusion_Translator__BepInEx_.AssetStore; namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects diff --git a/BepInEx/Patches/GameObjects/CustomSun_Patch.cs b/BepInEx/Patches/GameObjects/CustomSun_Patch.cs index d59734d..757ba73 100644 --- a/BepInEx/Patches/GameObjects/CustomSun_Patch.cs +++ b/BepInEx/Patches/GameObjects/CustomSun_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; diff --git a/BepInEx/Patches/GameObjects/FruitNinjaSelectWindow_Patch.cs b/BepInEx/Patches/GameObjects/FruitNinjaSelectWindow_Patch.cs index 26d193a..6f36532 100644 --- a/BepInEx/Patches/GameObjects/FruitNinjaSelectWindow_Patch.cs +++ b/BepInEx/Patches/GameObjects/FruitNinjaSelectWindow_Patch.cs @@ -1,5 +1,5 @@ using HarmonyLib; - +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; diff --git a/BepInEx/Patches/GameObjects/GardenPlant_Patch.cs b/BepInEx/Patches/GameObjects/GardenPlant_Patch.cs index f11d522..8942ca6 100644 --- a/BepInEx/Patches/GameObjects/GardenPlant_Patch.cs +++ b/BepInEx/Patches/GameObjects/GardenPlant_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using PvZ_Fusion_Translator__BepInEx_.AssetStore; namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects diff --git a/BepInEx/Patches/GameObjects/MainMenu_Patch.cs b/BepInEx/Patches/GameObjects/MainMenu_Patch.cs index ce3296d..8d00da2 100644 --- a/BepInEx/Patches/GameObjects/MainMenu_Patch.cs +++ b/BepInEx/Patches/GameObjects/MainMenu_Patch.cs @@ -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) - { - WarningStore.WarningReload(Utils.Language, NoticeMenu.Instance); - _warningShown = true; - } - } + { + if (_warningShown || NoticeMenu.Instance == null) + return; + + WarningStore.WarningReload(Utils.Language, NoticeMenu.Instance); + _warningShown = true; + } } } \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/MinorObjects/AbyssGoods_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/AbyssGoods_Patch.cs index da2a587..0c0e3b6 100644 --- a/BepInEx/Patches/GameObjects/MinorObjects/AbyssGoods_Patch.cs +++ b/BepInEx/Patches/GameObjects/MinorObjects/AbyssGoods_Patch.cs @@ -1,6 +1,5 @@ -using HarmonyLib; - -using TMPro; +using HarmonyLib; +using System; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; diff --git a/BepInEx/Patches/GameObjects/MinorObjects/DY_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/DY_Patch.cs index bcd1fcd..6659ddd 100644 --- a/BepInEx/Patches/GameObjects/MinorObjects/DY_Patch.cs +++ b/BepInEx/Patches/GameObjects/MinorObjects/DY_Patch.cs @@ -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 diff --git a/BepInEx/Patches/GameObjects/MinorObjects/Jigsaw_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/Jigsaw_Patch.cs index 23fc6a7..acc26c1 100644 --- a/BepInEx/Patches/GameObjects/MinorObjects/Jigsaw_Patch.cs +++ b/BepInEx/Patches/GameObjects/MinorObjects/Jigsaw_Patch.cs @@ -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 diff --git a/BepInEx/Patches/GameObjects/MinorObjects/LanternUmbrella_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/LanternUmbrella_Patch.cs index 226187b..e4c913c 100644 --- a/BepInEx/Patches/GameObjects/MinorObjects/LanternUmbrella_Patch.cs +++ b/BepInEx/Patches/GameObjects/MinorObjects/LanternUmbrella_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using PvZ_Fusion_Translator__BepInEx_.AssetStore; namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects diff --git a/BepInEx/Patches/GameObjects/MinorObjects/MagnetBox_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/MagnetBox_Patch.cs index 744d80f..3ff15e8 100644 --- a/BepInEx/Patches/GameObjects/MinorObjects/MagnetBox_Patch.cs +++ b/BepInEx/Patches/GameObjects/MinorObjects/MagnetBox_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using PvZ_Fusion_Translator__BepInEx_.AssetStore; namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects diff --git a/BepInEx/Patches/GameObjects/MinorObjects/MagnetInterface_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/MagnetInterface_Patch.cs index 907c18c..4263677 100644 --- a/BepInEx/Patches/GameObjects/MinorObjects/MagnetInterface_Patch.cs +++ b/BepInEx/Patches/GameObjects/MinorObjects/MagnetInterface_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using PvZ_Fusion_Translator__BepInEx_.AssetStore; namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects diff --git a/BepInEx/Patches/GameObjects/MinorObjects/Money_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/Money_Patch.cs index a453bb8..312d327 100644 --- a/BepInEx/Patches/GameObjects/MinorObjects/Money_Patch.cs +++ b/BepInEx/Patches/GameObjects/MinorObjects/Money_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using PvZ_Fusion_Translator__BepInEx_.AssetStore; namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects diff --git a/BepInEx/Patches/GameObjects/MinorObjects/Plant_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/Plant_Patch.cs index bf90a0b..cd60f9f 100644 --- a/BepInEx/Patches/GameObjects/MinorObjects/Plant_Patch.cs +++ b/BepInEx/Patches/GameObjects/MinorObjects/Plant_Patch.cs @@ -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 { @@ -46,5 +45,4 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects return originalText; } } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/MinorObjects/PlayerName_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/PlayerName_Patch.cs index feefb35..90b423f 100644 --- a/BepInEx/Patches/GameObjects/MinorObjects/PlayerName_Patch.cs +++ b/BepInEx/Patches/GameObjects/MinorObjects/PlayerName_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using PvZ_Fusion_Translator__BepInEx_.AssetStore; namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects diff --git a/BepInEx/Patches/GameObjects/MinorObjects/SelectYourPlants_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/SelectYourPlants_Patch.cs index bcaf3fb..c9ce753 100644 --- a/BepInEx/Patches/GameObjects/MinorObjects/SelectYourPlants_Patch.cs +++ b/BepInEx/Patches/GameObjects/MinorObjects/SelectYourPlants_Patch.cs @@ -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 diff --git a/BepInEx/Patches/GameObjects/MinorObjects/TrainingDummy_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/TrainingDummy_Patch.cs index 8aa1766..fd98134 100644 --- a/BepInEx/Patches/GameObjects/MinorObjects/TrainingDummy_Patch.cs +++ b/BepInEx/Patches/GameObjects/MinorObjects/TrainingDummy_Patch.cs @@ -1,5 +1,5 @@ using HarmonyLib; - +using System; namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects { diff --git a/BepInEx/Patches/GameObjects/MinorObjects/UltimateChomper_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/UltimateChomper_Patch.cs index 41ec1f9..5e8aac3 100644 --- a/BepInEx/Patches/GameObjects/MinorObjects/UltimateChomper_Patch.cs +++ b/BepInEx/Patches/GameObjects/MinorObjects/UltimateChomper_Patch.cs @@ -1,5 +1,5 @@ using HarmonyLib; - +using System; using PvZ_Fusion_Translator__BepInEx_.AssetStore; namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects diff --git a/BepInEx/Patches/GameObjects/MinorObjects/Zombie_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/Zombie_Patch.cs index 5b23409..499c6ab 100644 --- a/BepInEx/Patches/GameObjects/MinorObjects/Zombie_Patch.cs +++ b/BepInEx/Patches/GameObjects/MinorObjects/Zombie_Patch.cs @@ -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 System.Text.RegularExpressions; using UnityEngine; -using TMPro; -using System.Collections.Generic; namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects { @@ -13,10 +14,10 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects { private static Dictionary HPStrings = new Dictionary() { - { "最后一击:(\\d+)\nDPS:(.+)$", "Last damage: {0}\nDPS: {1}" }, - { "^HP:(\\d+)/(\\d+)\n\\D+(\\d+)/(\\d+)\n\\D+(\\d+)/(\\d+)$", "HP: {0}/{1}\nType 1 armor: {2}/{3}\nType 2 armor: {4}/{5}" }, - { "^HP:(\\d+)/(\\d+)\n\\D+(\\d+)/(\\d+)$", "HP: {0}/{1}\nType 1 armor: {2}/{3}" }, - { "^HP:(\\d+)/(\\d+)$", "HP: {0}/{1}" }, + { "????:(\\d+)\nDPS:(.+)$", "Last damage: {0}\nDPS: {1}" }, + { "^HP:(\\d+)/(\\d+)\n\\D+(\\d+)/(\\d+)\n\\D+(\\d+)/(\\d+)$", "HP: {0}/{1}\nType 1 armor: {2}/{3}\nType 2 armor: {4}/{5}" }, + { "^HP:(\\d+)/(\\d+)\n\\D+(\\d+)/(\\d+)$", "HP: {0}/{1}\nType 1 armor: {2}/{3}" }, + { "^HP:(\\d+)/(\\d+)$", "HP: {0}/{1}" }, }; public static void LoadHPStrings() diff --git a/BepInEx/Patches/GameObjects/NoticePauseMenu_Patch.cs b/BepInEx/Patches/GameObjects/NoticePauseMenu_Patch.cs index 25a39f7..1fd45c3 100644 --- a/BepInEx/Patches/GameObjects/NoticePauseMenu_Patch.cs +++ b/BepInEx/Patches/GameObjects/NoticePauseMenu_Patch.cs @@ -7,26 +7,26 @@ using UnityEngine; namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects { [HarmonyPatch(typeof(NoticeMenu))] - public class NoticePauseMenu_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(NoticeMenu.Start))] - private static void Start(NoticeMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - Transform warningTransform = __instance.transform.FindChild("窗口"); + public class NoticePauseMenu_Patch + { + [HarmonyPostfix] + [HarmonyPatch(nameof(NoticeMenu.Start))] + private static void Start(NoticeMenu __instance) + { + TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + Transform warningTransform = __instance.transform.FindChild("窗口"); Transform warningTextTransform = warningTransform.FindChild("文字"); - Transform warningTextShadowTransform = warningTransform.FindChild("文字2"); - Transform[] array = [warningTextTransform, warningTextShadowTransform]; + Transform warningTextShadowTransform = warningTransform.FindChild("文字2"); + Transform[] array = [warningTextTransform, warningTextShadowTransform]; - for (int i = 0; i < array.Length; i++) - { - if (array[i] != null) - { - array[i].GetComponent().text = StringStore.TranslateText(array[i].GetComponent().text); - array[i].GetComponent().font = fontAsset; - } - } - } - } + for (int i = 0; i < array.Length; i++) + { + if (array[i] != null) + { + array[i].GetComponent().text = StringStore.TranslateText(array[i].GetComponent().text); + array[i].GetComponent().font = fontAsset; + } + } + } + } } \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/OtherMenu_Patch.cs b/BepInEx/Patches/GameObjects/OtherMenu_Patch.cs index c055cbd..4ffed8c 100644 --- a/BepInEx/Patches/GameObjects/OtherMenu_Patch.cs +++ b/BepInEx/Patches/GameObjects/OtherMenu_Patch.cs @@ -1,6 +1,5 @@ -using HarmonyLib; - -using TMPro; +using HarmonyLib; +using System; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; diff --git a/BepInEx/Patches/GameObjects/RogueCardWindow_Patch.cs b/BepInEx/Patches/GameObjects/RogueCardWindow_Patch.cs index ef600fd..47797d5 100644 --- a/BepInEx/Patches/GameObjects/RogueCardWindow_Patch.cs +++ b/BepInEx/Patches/GameObjects/RogueCardWindow_Patch.cs @@ -1,5 +1,5 @@ using HarmonyLib; - +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; diff --git a/BepInEx/Patches/GameObjects/RogueStartMenu_Patch.cs b/BepInEx/Patches/GameObjects/RogueStartMenu_Patch.cs index 114180e..ce379ad 100644 --- a/BepInEx/Patches/GameObjects/RogueStartMenu_Patch.cs +++ b/BepInEx/Patches/GameObjects/RogueStartMenu_Patch.cs @@ -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 diff --git a/BepInEx/Patches/GameObjects/ShootingMenu_Patch.cs b/BepInEx/Patches/GameObjects/ShootingMenu_Patch.cs index dee2e81..4169bda 100644 --- a/BepInEx/Patches/GameObjects/ShootingMenu_Patch.cs +++ b/BepInEx/Patches/GameObjects/ShootingMenu_Patch.cs @@ -1,5 +1,5 @@ using HarmonyLib; - +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; diff --git a/BepInEx/Patches/GameObjects/ShootingSelectWindow_Patch.cs b/BepInEx/Patches/GameObjects/ShootingSelectWindow_Patch.cs index 0685b2e..f42f5a5 100644 --- a/BepInEx/Patches/GameObjects/ShootingSelectWindow_Patch.cs +++ b/BepInEx/Patches/GameObjects/ShootingSelectWindow_Patch.cs @@ -1,5 +1,5 @@ using HarmonyLib; -// using Il2Cpp; +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; diff --git a/BepInEx/Patches/GameObjects/TowerOption_Patch.cs b/BepInEx/Patches/GameObjects/TowerOption_Patch.cs index a985f83..2095824 100644 --- a/BepInEx/Patches/GameObjects/TowerOption_Patch.cs +++ b/BepInEx/Patches/GameObjects/TowerOption_Patch.cs @@ -1,5 +1,5 @@ using HarmonyLib; - +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; diff --git a/BepInEx/Patches/GameObjects/TravelBuffOptionButton_Patch.cs b/BepInEx/Patches/GameObjects/TravelBuffOptionButton_Patch.cs index 87269ea..4e17523 100644 --- a/BepInEx/Patches/GameObjects/TravelBuffOptionButton_Patch.cs +++ b/BepInEx/Patches/GameObjects/TravelBuffOptionButton_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; diff --git a/BepInEx/Patches/GameObjects/TravelBuff_Patch.cs b/BepInEx/Patches/GameObjects/TravelBuff_Patch.cs index 04e94c4..29ed00b 100644 --- a/BepInEx/Patches/GameObjects/TravelBuff_Patch.cs +++ b/BepInEx/Patches/GameObjects/TravelBuff_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects { diff --git a/BepInEx/Patches/GameObjects/TravelLookBuff_Patch.cs b/BepInEx/Patches/GameObjects/TravelLookBuff_Patch.cs index 4bd18bd..6fe49cb 100644 --- a/BepInEx/Patches/GameObjects/TravelLookBuff_Patch.cs +++ b/BepInEx/Patches/GameObjects/TravelLookBuff_Patch.cs @@ -1,6 +1,5 @@ -using System; using HarmonyLib; - +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; diff --git a/BepInEx/Patches/GameObjects/TravelLookMenu_Patch.cs b/BepInEx/Patches/GameObjects/TravelLookMenu_Patch.cs index 1d37f17..51d4139 100644 --- a/BepInEx/Patches/GameObjects/TravelLookMenu_Patch.cs +++ b/BepInEx/Patches/GameObjects/TravelLookMenu_Patch.cs @@ -1,5 +1,5 @@ using HarmonyLib; - +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; @@ -20,9 +20,9 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects foreach (var textComp in allTexts) { - if (textComp != null && textComp.text == StringStore.TranslateText("关闭")) + if (textComp != null && textComp.text == StringStore.TranslateText("??")) { - textComp.text = StringStore.TranslateText("关闭_close"); + textComp.text = StringStore.TranslateText("??_close"); TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); textComp.font = fontAsset; diff --git a/BepInEx/Patches/GameObjects/TravelRefresh_Patch.cs b/BepInEx/Patches/GameObjects/TravelRefresh_Patch.cs index c3388d3..4b64646 100644 --- a/BepInEx/Patches/GameObjects/TravelRefresh_Patch.cs +++ b/BepInEx/Patches/GameObjects/TravelRefresh_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; diff --git a/BepInEx/Patches/GameObjects/TravelStore_Patch.cs b/BepInEx/Patches/GameObjects/TravelStore_Patch.cs index 171d2d7..51a3b39 100644 --- a/BepInEx/Patches/GameObjects/TravelStore_Patch.cs +++ b/BepInEx/Patches/GameObjects/TravelStore_Patch.cs @@ -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); - } - - Transform moneyTransform = __instance.transform.Find("Money"); - if (moneyTransform != null) - { - StringStore.TranslateTextTransform(moneyTransform); - } - - foreach (TextMeshProUGUI text in __instance.points) - { - text.text = StringStore.TranslateText(text.text); - } + { + foreach (TextMeshProUGUI intr in __instance.introduces) + StringStore.TranslateTextUI(intr); + foreach (var textMesh in __instance.points) + StringStore.TranslateTextUI(textMesh); } - [HarmonyPatch(nameof(TravelStore.SetText), new Type[] { typeof(string)})] - [HarmonyPostfix] - private static void ShowText(TravelStore __instance) - { - foreach (TextMeshProUGUI text in __instance.introduces) - { - text.text = StringStore.TranslateText(text.text); - } - - foreach (TextMeshProUGUI text in __instance.points) + [HarmonyPatch(nameof(TravelStore.RefreshBuff))] + [HarmonyPostfix] + private static void RefreshBuff(TravelStore __instance) + { + foreach (TravelBuff buff in __instance.travelBuffs) { - text.text = StringStore.TranslateText(text.text); + TextMeshProUGUI cost = buff.transform.GetChild(1).GetComponent(); + if (!cost.text.Contains('0')) + StringStore.TranslateTextUI(cost); + cost.font = Resources.Load("fonts/Dynamic"); } + foreach (TextMeshProUGUI intr in __instance.introduces) + StringStore.TranslateTextUI(intr); + foreach (var textMesh in __instance.points) + StringStore.TranslateTextUI(textMesh); } } } diff --git a/BepInEx/Patches/GameObjects/UIDifficulty_Patch.cs b/BepInEx/Patches/GameObjects/UIDifficulty_Patch.cs index d1d1a5c..49159a5 100644 --- a/BepInEx/Patches/GameObjects/UIDifficulty_Patch.cs +++ b/BepInEx/Patches/GameObjects/UIDifficulty_Patch.cs @@ -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; + __instance.t.text = StringStore.TranslateText(__instance.t.text); + foreach(TextMeshProUGUI text in __instance.GetComponentsInChildren()) + { + text.text = StringStore.TranslateText(text.text); + } } } -} +} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/UIZombieNum_Patch.cs b/BepInEx/Patches/GameObjects/UIZombieNum_Patch.cs index d89a8cf..d547f91 100644 --- a/BepInEx/Patches/GameObjects/UIZombieNum_Patch.cs +++ b/BepInEx/Patches/GameObjects/UIZombieNum_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; diff --git a/BepInEx/Patches/Managers/AbyssDevelopMenu_Patch.cs b/BepInEx/Patches/Managers/AbyssDevelopMenu_Patch.cs index c5171e5..3459635 100644 --- a/BepInEx/Patches/Managers/AbyssDevelopMenu_Patch.cs +++ b/BepInEx/Patches/Managers/AbyssDevelopMenu_Patch.cs @@ -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 diff --git a/BepInEx/Patches/Managers/AbyssMenu2_Patch.cs b/BepInEx/Patches/Managers/AbyssMenu2_Patch.cs index d636c86..07374e5 100644 --- a/BepInEx/Patches/Managers/AbyssMenu2_Patch.cs +++ b/BepInEx/Patches/Managers/AbyssMenu2_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; diff --git a/BepInEx/Patches/Managers/AbyssMenu_Patch.cs b/BepInEx/Patches/Managers/AbyssMenu_Patch.cs index c1ca13d..0c60bcb 100644 --- a/BepInEx/Patches/Managers/AbyssMenu_Patch.cs +++ b/BepInEx/Patches/Managers/AbyssMenu_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; diff --git a/BepInEx/Patches/Managers/AlmanacMgrZombie_Patch.cs b/BepInEx/Patches/Managers/AlmanacMgrZombie_Patch.cs index 6c1658a..945f940 100644 --- a/BepInEx/Patches/Managers/AlmanacMgrZombie_Patch.cs +++ b/BepInEx/Patches/Managers/AlmanacMgrZombie_Patch.cs @@ -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; diff --git a/BepInEx/Patches/Managers/AlmanacPlantBank_Patch.cs b/BepInEx/Patches/Managers/AlmanacPlantBank_Patch.cs index 5fac5f6..c3927b9 100644 --- a/BepInEx/Patches/Managers/AlmanacPlantBank_Patch.cs +++ b/BepInEx/Patches/Managers/AlmanacPlantBank_Patch.cs @@ -1,4 +1,4 @@ -using System.IO; +using System.IO; using HarmonyLib; using Il2CppInterop.Runtime; using PvZ_Fusion_Translator__BepInEx_; diff --git a/BepInEx/Patches/Managers/ChessManager_Patch.cs b/BepInEx/Patches/Managers/ChessManager_Patch.cs index 34098ff..1c2f52f 100644 --- a/BepInEx/Patches/Managers/ChessManager_Patch.cs +++ b/BepInEx/Patches/Managers/ChessManager_Patch.cs @@ -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 diff --git a/BepInEx/Patches/Managers/CustomLevelShower_Patch.cs b/BepInEx/Patches/Managers/CustomLevelShower_Patch.cs index 0a0b8d2..81f4a72 100644 --- a/BepInEx/Patches/Managers/CustomLevelShower_Patch.cs +++ b/BepInEx/Patches/Managers/CustomLevelShower_Patch.cs @@ -1,6 +1,6 @@ -#if FIX +#if FIX using HarmonyLib; - +using System; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; diff --git a/BepInEx/Patches/Managers/DifficultyMgr_Patch.cs b/BepInEx/Patches/Managers/DifficultyMgr_Patch.cs index 4366569..84585b5 100644 --- a/BepInEx/Patches/Managers/DifficultyMgr_Patch.cs +++ b/BepInEx/Patches/Managers/DifficultyMgr_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using PvZ_Fusion_Translator__BepInEx_.AssetStore; namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers diff --git a/BepInEx/Patches/Managers/DrawCardManager_Patch.cs b/BepInEx/Patches/Managers/DrawCardManager_Patch.cs index 8331d4e..c85ca88 100644 --- a/BepInEx/Patches/Managers/DrawCardManager_Patch.cs +++ b/BepInEx/Patches/Managers/DrawCardManager_Patch.cs @@ -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 texts) + [HarmonyPatch(nameof(DrawCardManager.UpdateText))] + [HarmonyPostfix] + private static void Postfix_UpdateText(DrawCardManager __instance) + { + Il2CppSystem.Collections.Generic.List texts = __instance.texts; + __instance.upName = StringStore.TranslateText(__instance.upName); + if (texts != null && texts.Count > 0) { - if (texts == null || texts.Count == 0) return; - - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (var textComponent in texts) + foreach (TextMeshProUGUI textComponent in texts) { - if (textComponent == null) continue; + if (textComponent != null) + { + string translatedText = StringStore.TranslateText(textComponent.text); + TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + textComponent.text = translatedText; + textComponent.font = fontAsset; + } + } + } + } - string translatedText = StringStore.TranslateText(textComponent.text); - textComponent.text = translatedText; - textComponent.font = fontAsset; + + + [HarmonyPatch(nameof(DrawCardManager.Update))] + [HarmonyPostfix] + private static void Postfix_Update(DrawCardManager __instance) + { + Il2CppSystem.Collections.Generic.List texts = __instance.texts; + __instance.upName = StringStore.TranslateText(__instance.upName); + + 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; + } } } - [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))] - private static void Postfix_Update(DrawCardManager __instance) - { - __instance.upName = StringStore.TranslateText(__instance.upName); - TranslateAndApplyFont(__instance.texts); } } } + diff --git a/BepInEx/Patches/Managers/EndlessMgr_Patch.cs b/BepInEx/Patches/Managers/EndlessMgr_Patch.cs index 5b0a8cf..b137eff 100644 --- a/BepInEx/Patches/Managers/EndlessMgr_Patch.cs +++ b/BepInEx/Patches/Managers/EndlessMgr_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; diff --git a/BepInEx/Patches/Managers/IZEMgr_Patch.cs b/BepInEx/Patches/Managers/IZEMgr_Patch.cs index b78a9f7..876c4e2 100644 --- a/BepInEx/Patches/Managers/IZEMgr_Patch.cs +++ b/BepInEx/Patches/Managers/IZEMgr_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; @@ -7,8 +7,8 @@ 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] public static void Start(IZBottomMenu __instance) diff --git a/BepInEx/Patches/Managers/InGameUIMgr_Patch.cs b/BepInEx/Patches/Managers/InGameUIMgr_Patch.cs index f628ef6..8d698ec 100644 --- a/BepInEx/Patches/Managers/InGameUIMgr_Patch.cs +++ b/BepInEx/Patches/Managers/InGameUIMgr_Patch.cs @@ -1,4 +1,5 @@ -using HarmonyLib; +using HarmonyLib; +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; diff --git a/BepInEx/Patches/Managers/InGameUI_Patch.cs b/BepInEx/Patches/Managers/InGameUI_Patch.cs index be59ae8..2163be7 100644 --- a/BepInEx/Patches/Managers/InGameUI_Patch.cs +++ b/BepInEx/Patches/Managers/InGameUI_Patch.cs @@ -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.Managers { @@ -14,20 +15,18 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers { TextMeshProUGUI[] array = new TextMeshProUGUI[] { - __instance.transform.GetChild(4).GetComponent(), - __instance.transform.GetChild(4).GetChild(0).GetComponent(), - __instance.transform.GetChild(5).GetComponent(), - __instance.transform.GetChild(5).GetChild(0).GetComponent(), - __instance.transform.GetChild(6).GetComponent(), - __instance.transform.GetChild(6).GetChild(0).GetComponent() - }; + __instance.transform.GetChild(4).GetComponent(), + __instance.transform.GetChild(4).GetChild(0).GetComponent(), + __instance.transform.GetChild(5).GetComponent(), + __instance.transform.GetChild(5).GetChild(0).GetComponent(), + __instance.transform.GetChild(6).GetComponent(), + __instance.transform.GetChild(6).GetChild(0).GetComponent()}; 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", " "); } } - } + } } diff --git a/BepInEx/Patches/Managers/OppositeBuffManager_Patch.cs b/BepInEx/Patches/Managers/OppositeBuffManager_Patch.cs index 9a14a3e..142c975 100644 --- a/BepInEx/Patches/Managers/OppositeBuffManager_Patch.cs +++ b/BepInEx/Patches/Managers/OppositeBuffManager_Patch.cs @@ -1,4 +1,4 @@ -using HarmonyLib; +using HarmonyLib; using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; @@ -15,9 +15,9 @@ 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; + string replacementText = StringStore.translationString["?"] + translatedText; text.text = replacementText; } foreach(TextMeshProUGUI text in __instance.textA_good) @@ -27,9 +27,9 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers foreach(TextMeshProUGUI text in __instance.textB_bad) { - string stripText = text.text.Replace("但", ""); + string stripText = text.text.Replace("?", ""); string translatedText = StringStore.TranslateText(stripText); - string replacementText = StringStore.translationString["但"] + translatedText; + string replacementText = StringStore.translationString["?"] + translatedText; text.text = replacementText; } foreach(TextMeshProUGUI text in __instance.textB_good) @@ -44,9 +44,9 @@ 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; + string replacementText = StringStore.translationString["?"] + translatedText; text.text = replacementText; } foreach(TextMeshProUGUI text in __instance.textA_good) @@ -56,9 +56,9 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers foreach(TextMeshProUGUI text in __instance.textB_bad) { - string stripText = text.text.Replace("但", ""); + string stripText = text.text.Replace("?", ""); string translatedText = StringStore.TranslateText(stripText); - string replacementText = StringStore.translationString["但"] + translatedText; + string replacementText = StringStore.translationString["?"] + translatedText; text.text = replacementText; } foreach(TextMeshProUGUI text in __instance.textB_good) diff --git a/BepInEx/Patches/Managers/SaveMenu_Patch.cs b/BepInEx/Patches/Managers/SaveMenu_Patch.cs index be418a2..aa5d1f0 100644 --- a/BepInEx/Patches/Managers/SaveMenu_Patch.cs +++ b/BepInEx/Patches/Managers/SaveMenu_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; diff --git a/BepInEx/Patches/Managers/TravelBuffMgr_Patch.cs b/BepInEx/Patches/Managers/TravelBuffMgr_Patch.cs index b98b0aa..8f528fc 100644 --- a/BepInEx/Patches/Managers/TravelBuffMgr_Patch.cs +++ b/BepInEx/Patches/Managers/TravelBuffMgr_Patch.cs @@ -1,4 +1,4 @@ -using HarmonyLib; +using HarmonyLib; using System; namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers diff --git a/BepInEx/Patches/Managers/UIMgr_Patch.cs b/BepInEx/Patches/Managers/UIMgr_Patch.cs index 517deaa..12f5d50 100644 --- a/BepInEx/Patches/Managers/UIMgr_Patch.cs +++ b/BepInEx/Patches/Managers/UIMgr_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using PvZ_Fusion_Translator__BepInEx_.AssetStore; namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers diff --git a/BepInEx/Patches/OtherManagers/AchievementClip_Patch.cs b/BepInEx/Patches/OtherManagers/AchievementClip_Patch.cs index a9c1ca7..2c3de3d 100644 --- a/BepInEx/Patches/OtherManagers/AchievementClip_Patch.cs +++ b/BepInEx/Patches/OtherManagers/AchievementClip_Patch.cs @@ -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; diff --git a/BepInEx/Patches/OtherManagers/GardenUI_Patch.cs b/BepInEx/Patches/OtherManagers/GardenUI_Patch.cs index 29371cd..d313017 100644 --- a/BepInEx/Patches/OtherManagers/GardenUI_Patch.cs +++ b/BepInEx/Patches/OtherManagers/GardenUI_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using PvZ_Fusion_Translator__BepInEx_.AssetStore; using UnityEngine; diff --git a/BepInEx/Patches/OtherManagers/MenuText_Patch.cs b/BepInEx/Patches/OtherManagers/MenuText_Patch.cs index 7c435f9..8aaf4f2 100644 --- a/BepInEx/Patches/OtherManagers/MenuText_Patch.cs +++ b/BepInEx/Patches/OtherManagers/MenuText_Patch.cs @@ -1,6 +1,6 @@ -#if FIX +#if FIX using HarmonyLib; - +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; diff --git a/BepInEx/Patches/OtherManagers/ThanksMenu_Patch.cs b/BepInEx/Patches/OtherManagers/ThanksMenu_Patch.cs index e44add2..cf94e6c 100644 --- a/BepInEx/Patches/OtherManagers/ThanksMenu_Patch.cs +++ b/BepInEx/Patches/OtherManagers/ThanksMenu_Patch.cs @@ -1,5 +1,5 @@ -using HarmonyLib; - +using HarmonyLib; +using System; using TMPro; using PvZ_Fusion_Translator__BepInEx_.AssetStore; diff --git a/BepInEx/PvZ Fusion Translator [BepInEx].csproj b/BepInEx/PvZ Fusion Translator [BepInEx].csproj index 0971e34..4139e85 100644 --- a/BepInEx/PvZ Fusion Translator [BepInEx].csproj +++ b/BepInEx/PvZ Fusion Translator [BepInEx].csproj @@ -118,11 +118,21 @@ + + + + + + + + + + @@ -140,7 +150,13 @@ + + + + + + @@ -157,7 +173,7 @@ - +