From abe2d8eadc95a19215770a015f20881fb3a4f18f Mon Sep 17 00:00:00 2001 From: SillyStar-Github <90102598+SillyStar-Github@users.noreply.github.com> Date: Tue, 10 Feb 2026 21:03:17 -0500 Subject: [PATCH] quick changes, removing old odyssey code temporarily, reordering certain files --- MelonLoader/AssetStore/StringStore.cs | 2 +- .../BaseTextObjects/InGameText_Patch.cs | 4 +- .../MinorObjects/UIProgress2_Patch.cs | 2 +- .../GameObjects/MinorObjects/Zombie_Patch.cs | 1 + .../GameObjects/TravelBuffMenu_Patch.cs | 24 ----- .../TravelBuffOptionButton_Patch.cs | 41 ------- .../Patches/GameObjects/TravelBuff_Patch.cs | 18 ---- .../GameObjects/TravelLookBuff_Patch.cs | 51 --------- .../GameObjects/TravelLookMenu_Patch.cs | 46 -------- .../GameObjects/TravelRefresh_Patch.cs | 28 ----- .../Patches/GameObjects/TravelStore_Patch.cs | 70 ------------ .../Patches/Managers/DifficultyMgr_Patch.cs | 14 +-- .../Managers/OppositeBuffManager_Patch.cs | 37 +++---- .../Patches/Managers/TravelBuffMgr_Patch.cs | 27 ----- .../Patches/Managers/TravelMgr_Patch.cs | 102 ------------------ .../Abyss}/AbyssBagMenu_Patch.cs | 0 .../Abyss}/AbyssBuffButton_Patch.cs | 0 .../Abyss}/AbyssBuffData_Patch.cs | 0 .../Abyss}/AbyssBuffMenu_Patch.cs | 4 +- .../Abyss}/AbyssCheckInBag_Patch.cs | 0 .../Abyss}/AbyssCheckSellMenu_Patch.cs | 0 .../Abyss}/AbyssDevelopMenu_Patch.cs | 0 .../Abyss}/AbyssGoods_Patch.cs | 2 +- .../Abyss}/AbyssInfo_Patch.cs | 0 .../Abyss}/AbyssLevelEnter_Patch.cs | 2 +- .../Abyss}/AbyssMenu2_Patch.cs | 0 .../Abyss}/AbyssMenu_Patch.cs | 2 +- .../Abyss}/AbyssSelectBuffWindow_Patch.cs | 4 +- .../Abyss}/AbyssSettlementMenu_Patch.cs | 0 .../Abyss}/AbyssStoreMenu_Patch.cs | 2 +- .../Harvest}/GardenBagMenu_Patch.cs | 40 +++---- .../Harvest}/GardenCard_Patch.cs | 0 .../Harvest}/TreasureConfirmMenu_Patch.cs | 2 +- .../Harvest}/TreasureEquipmentMenu_Patch.cs | 2 +- .../Harvest}/TreasureEvacuateMenu_Patch.cs | 2 +- .../Harvest}/TreasureMainMenu_Patch.cs | 2 +- .../Harvest}/TreasureManager_Patch.cs | 2 +- .../Harvest}/TreasureStoreMenu_Patch.cs | 2 +- .../Harvest}/TreasureUpgradeMenu_Patch.cs | 2 +- .../Harvest}/TreasureWarehouseMenu_Patch.cs | 2 +- .../Modes/Odyssey/TravelBuffMenu_Patch.cs | 24 +++++ .../Modes/Odyssey/TravelBuffMgr_Patch.cs | 27 +++++ .../Odyssey/TravelBuffOptionButton_Patch.cs | 41 +++++++ .../Patches/Modes/Odyssey/TravelBuff_Patch.cs | 18 ++++ .../Modes/Odyssey/TravelLookBuff_Patch.cs | 51 +++++++++ .../Modes/Odyssey/TravelLookMenu_Patch.cs | 46 ++++++++ .../Patches/Modes/Odyssey/TravelMgr_Patch.cs | 102 ++++++++++++++++++ .../Modes/Odyssey/TravelRefresh_Patch.cs | 28 +++++ .../Modes/Odyssey/TravelStore_Patch.cs | 70 ++++++++++++ .../AdvantureEvolutionMenu_Patch.cs | 2 +- .../Starbound}/AdvantureHelpMenu_Patch.cs | 2 +- .../Starbound}/AdvantureMenu2_Patch.cs | 2 +- .../Starbound}/AdvantureMenu_Patch.cs | 2 +- .../Starbound}/AdvantureMissionMenu_Patch.cs | 2 +- .../Starbound}/AdvantureStarMenu_Patch.cs | 2 +- ...PvZ Fusion Translator [MelonLoader].csproj | 20 ++-- 56 files changed, 490 insertions(+), 488 deletions(-) delete mode 100644 MelonLoader/Patches/GameObjects/TravelBuffMenu_Patch.cs delete mode 100644 MelonLoader/Patches/GameObjects/TravelBuffOptionButton_Patch.cs delete mode 100644 MelonLoader/Patches/GameObjects/TravelBuff_Patch.cs delete mode 100644 MelonLoader/Patches/GameObjects/TravelLookBuff_Patch.cs delete mode 100644 MelonLoader/Patches/GameObjects/TravelLookMenu_Patch.cs delete mode 100644 MelonLoader/Patches/GameObjects/TravelRefresh_Patch.cs delete mode 100644 MelonLoader/Patches/GameObjects/TravelStore_Patch.cs delete mode 100644 MelonLoader/Patches/Managers/TravelBuffMgr_Patch.cs delete mode 100644 MelonLoader/Patches/Managers/TravelMgr_Patch.cs rename MelonLoader/Patches/{GameObjects => Modes/Abyss}/AbyssBagMenu_Patch.cs (100%) rename MelonLoader/Patches/{GameObjects/ButtonObjects => Modes/Abyss}/AbyssBuffButton_Patch.cs (100%) rename MelonLoader/Patches/{Managers => Modes/Abyss}/AbyssBuffData_Patch.cs (100%) rename MelonLoader/Patches/{GameObjects => Modes/Abyss}/AbyssBuffMenu_Patch.cs (96%) rename MelonLoader/Patches/{GameObjects => Modes/Abyss}/AbyssCheckInBag_Patch.cs (100%) rename MelonLoader/Patches/{GameObjects/ButtonObjects => Modes/Abyss}/AbyssCheckSellMenu_Patch.cs (100%) rename MelonLoader/Patches/{GameObjects => Modes/Abyss}/AbyssDevelopMenu_Patch.cs (100%) rename MelonLoader/Patches/{GameObjects/MinorObjects => Modes/Abyss}/AbyssGoods_Patch.cs (92%) rename MelonLoader/Patches/{Managers => Modes/Abyss}/AbyssInfo_Patch.cs (100%) rename MelonLoader/Patches/{GameObjects/ButtonObjects => Modes/Abyss}/AbyssLevelEnter_Patch.cs (87%) rename MelonLoader/Patches/{GameObjects => Modes/Abyss}/AbyssMenu2_Patch.cs (100%) rename MelonLoader/Patches/{GameObjects => Modes/Abyss}/AbyssMenu_Patch.cs (97%) rename MelonLoader/Patches/{GameObjects => Modes/Abyss}/AbyssSelectBuffWindow_Patch.cs (85%) rename MelonLoader/Patches/{GameObjects => Modes/Abyss}/AbyssSettlementMenu_Patch.cs (100%) rename MelonLoader/Patches/{GameObjects => Modes/Abyss}/AbyssStoreMenu_Patch.cs (92%) rename MelonLoader/Patches/{GameObjects => Modes/Harvest}/GardenBagMenu_Patch.cs (55%) rename MelonLoader/Patches/{GameObjects => Modes/Harvest}/GardenCard_Patch.cs (100%) rename MelonLoader/Patches/{GameObjects => Modes/Harvest}/TreasureConfirmMenu_Patch.cs (93%) rename MelonLoader/Patches/{GameObjects => Modes/Harvest}/TreasureEquipmentMenu_Patch.cs (95%) rename MelonLoader/Patches/{GameObjects => Modes/Harvest}/TreasureEvacuateMenu_Patch.cs (94%) rename MelonLoader/Patches/{GameObjects => Modes/Harvest}/TreasureMainMenu_Patch.cs (92%) rename MelonLoader/Patches/{Managers => Modes/Harvest}/TreasureManager_Patch.cs (94%) rename MelonLoader/Patches/{GameObjects => Modes/Harvest}/TreasureStoreMenu_Patch.cs (92%) rename MelonLoader/Patches/{GameObjects => Modes/Harvest}/TreasureUpgradeMenu_Patch.cs (97%) rename MelonLoader/Patches/{GameObjects => Modes/Harvest}/TreasureWarehouseMenu_Patch.cs (97%) create mode 100644 MelonLoader/Patches/Modes/Odyssey/TravelBuffMenu_Patch.cs create mode 100644 MelonLoader/Patches/Modes/Odyssey/TravelBuffMgr_Patch.cs create mode 100644 MelonLoader/Patches/Modes/Odyssey/TravelBuffOptionButton_Patch.cs create mode 100644 MelonLoader/Patches/Modes/Odyssey/TravelBuff_Patch.cs create mode 100644 MelonLoader/Patches/Modes/Odyssey/TravelLookBuff_Patch.cs create mode 100644 MelonLoader/Patches/Modes/Odyssey/TravelLookMenu_Patch.cs create mode 100644 MelonLoader/Patches/Modes/Odyssey/TravelMgr_Patch.cs create mode 100644 MelonLoader/Patches/Modes/Odyssey/TravelRefresh_Patch.cs create mode 100644 MelonLoader/Patches/Modes/Odyssey/TravelStore_Patch.cs rename MelonLoader/Patches/{GameObjects => Modes/Starbound}/AdvantureEvolutionMenu_Patch.cs (98%) rename MelonLoader/Patches/{GameObjects => Modes/Starbound}/AdvantureHelpMenu_Patch.cs (91%) rename MelonLoader/Patches/{GameObjects => Modes/Starbound}/AdvantureMenu2_Patch.cs (93%) rename MelonLoader/Patches/{GameObjects => Modes/Starbound}/AdvantureMenu_Patch.cs (97%) rename MelonLoader/Patches/{GameObjects => Modes/Starbound}/AdvantureMissionMenu_Patch.cs (97%) rename MelonLoader/Patches/{GameObjects => Modes/Starbound}/AdvantureStarMenu_Patch.cs (97%) diff --git a/MelonLoader/AssetStore/StringStore.cs b/MelonLoader/AssetStore/StringStore.cs index b37d343..78b3727 100644 --- a/MelonLoader/AssetStore/StringStore.cs +++ b/MelonLoader/AssetStore/StringStore.cs @@ -278,7 +278,7 @@ namespace PvZ_Fusion_Translator.AssetStore { RegexOptions options = (singleLine) ? RegexOptions.None : RegexOptions.Singleline; return Regex.IsMatch(originalText, pattern, options); - } + } private static TextAlignmentOptions TextAnchorToTMPAlignment(TextAnchor anchor) { diff --git a/MelonLoader/Patches/BaseTextObjects/InGameText_Patch.cs b/MelonLoader/Patches/BaseTextObjects/InGameText_Patch.cs index 3e396ef..175eb58 100644 --- a/MelonLoader/Patches/BaseTextObjects/InGameText_Patch.cs +++ b/MelonLoader/Patches/BaseTextObjects/InGameText_Patch.cs @@ -2,7 +2,7 @@ using Il2Cpp; using Il2CppTMPro; using PvZ_Fusion_Translator.AssetStore; -using PvZ_Fusion_Translator.Patches.Managers; +//using PvZ_Fusion_Translator.Patches.Modes.Odyssey; using System.Text.RegularExpressions; using System.Xml.Linq; using UnityEngine; @@ -20,7 +20,7 @@ namespace PvZ_Fusion_Translator.Patches.BaseTextObjects foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) { - string travelMatch = TravelMgr_Patch.MatchTravelBuff(txt.text); + string travelMatch = ""; string originalText = txt.text; if (txt.gameObject.name.Contains("shadow")) diff --git a/MelonLoader/Patches/GameObjects/MinorObjects/UIProgress2_Patch.cs b/MelonLoader/Patches/GameObjects/MinorObjects/UIProgress2_Patch.cs index 4e66a7d..2ab8b59 100644 --- a/MelonLoader/Patches/GameObjects/MinorObjects/UIProgress2_Patch.cs +++ b/MelonLoader/Patches/GameObjects/MinorObjects/UIProgress2_Patch.cs @@ -12,6 +12,6 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects private static void Update(UIProgress2 __instance) { __instance.t.text = StringStore.TranslateText(__instance.t.text); - } + } } } \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/MinorObjects/Zombie_Patch.cs b/MelonLoader/Patches/GameObjects/MinorObjects/Zombie_Patch.cs index a243e6a..ea643de 100644 --- a/MelonLoader/Patches/GameObjects/MinorObjects/Zombie_Patch.cs +++ b/MelonLoader/Patches/GameObjects/MinorObjects/Zombie_Patch.cs @@ -57,6 +57,7 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects { string origText = textTMP.text; string translatedText = origText; + if (translatedText == null) return; string pattern = "(\\d+)阶\n([\\s\\S]+)"; if (StringStore.TestRegex(translatedText, pattern)) { diff --git a/MelonLoader/Patches/GameObjects/TravelBuffMenu_Patch.cs b/MelonLoader/Patches/GameObjects/TravelBuffMenu_Patch.cs deleted file mode 100644 index 095c160..0000000 --- a/MelonLoader/Patches/GameObjects/TravelBuffMenu_Patch.cs +++ /dev/null @@ -1,24 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using static PvZ_Fusion_Translator.Patches.Managers.TravelMgr_Patch; -using UnityEngine; -using MelonLoader; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(TravelBuffMenu))] - public static class TravelBuffMenu_Patch - { - [HarmonyPatch(nameof(TravelBuffMenu.RefeshOptions))] - [HarmonyPostfix] - public static void RefeshOptions(TravelBuffMenu __instance) - { - foreach(TravelBuffOptionButton button in __instance.options) - { - TravelBuffOptionButton_Patch.TranslateOptionButton(button); - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/TravelBuffOptionButton_Patch.cs b/MelonLoader/Patches/GameObjects/TravelBuffOptionButton_Patch.cs deleted file mode 100644 index 461de17..0000000 --- a/MelonLoader/Patches/GameObjects/TravelBuffOptionButton_Patch.cs +++ /dev/null @@ -1,41 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using MelonLoader; -using PvZ_Fusion_Translator.AssetStore; -using static MelonLoader.MelonLogger; -using static PvZ_Fusion_Translator.Patches.Managers.TravelMgr_Patch; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(TravelBuffOptionButton))] - public static class TravelBuffOptionButton_Patch - { - [HarmonyPatch(nameof(TravelBuffOptionButton.Awake))] - [HarmonyPostfix] - public static void Awake(TravelBuffOptionButton __instance) - { - TranslateOptionButton(__instance); - } - - [HarmonyPatch(nameof(TravelBuffOptionButton.OnAnimOver))] - [HarmonyPostfix] - public static void OnAnimOver(TravelBuffOptionButton __instance) - { - TranslateOptionButton(__instance); - } - - public static void TranslateOptionButton(TravelBuffOptionButton button) - { - List buffSet = translatedTravelBuffs[buffLinks[button.buffType]]; - - string buff = (button.show != null && button.introduce.text != "词条已选完") ? buffSet[button.buffIndex] : StringStore.TranslateText("词条已选完"); - - button.introduce.text = buff; - } - } - - //List buffSet = translatedTravelBuffs[buffLinks[__instance.buffType]]; - //string buff = (__instance.show != null) ? buffSet[__instance.buffIndex] : StringStore.TranslateText("无"); - //__instance.introduce.text = buff; -} diff --git a/MelonLoader/Patches/GameObjects/TravelBuff_Patch.cs b/MelonLoader/Patches/GameObjects/TravelBuff_Patch.cs deleted file mode 100644 index a21001f..0000000 --- a/MelonLoader/Patches/GameObjects/TravelBuff_Patch.cs +++ /dev/null @@ -1,18 +0,0 @@ -using HarmonyLib; -using Il2Cpp; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(TravelBuff))] - public static class TravelBuff_Patch - { - [HarmonyPatch(nameof(TravelBuff.OnMouseUpAsButton))] - [HarmonyPostfix] - private static void OnMouseUpAsButton() - { - if (TravelBuffMgr.Instance == null) return; - TravelBuffMgr.Instance.text = AssetStore.StringStore.TranslateText(TravelBuffMgr.Instance.text); - TravelBuffMgr.Instance.text2 = AssetStore.StringStore.TranslateText(TravelBuffMgr.Instance.text2); - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/TravelLookBuff_Patch.cs b/MelonLoader/Patches/GameObjects/TravelLookBuff_Patch.cs deleted file mode 100644 index 1004d00..0000000 --- a/MelonLoader/Patches/GameObjects/TravelLookBuff_Patch.cs +++ /dev/null @@ -1,51 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using static PvZ_Fusion_Translator.Patches.Managers.TravelMgr_Patch; -using UnityEngine; -using MelonLoader; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(TravelLookBuff))] - public static class TravelLookBuff_Patch - { - [HarmonyPatch(nameof(TravelLookBuff.Clear))] - [HarmonyPostfix] - public static void Post_Clear(TravelLookBuff __instance) - { - __instance.introduce.text = StringStore.TranslateText("无"); - __instance.set = false; - - foreach (TextMeshProUGUI text in __instance.transform.FindChild("Images").FindChild("Button").GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - - [HarmonyPatch(nameof(TravelLookBuff.OnMouseUpAsButton))] - [HarmonyPostfix] - public static void Post_OnMouseUpAsButton(TravelLookBuff __instance) - { - foreach (TextMeshProUGUI text in __instance.transform.FindChild("Images").FindChild("Button").GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - - [HarmonyPatch(nameof(TravelLookBuff.SetBuff))] - [HarmonyPostfix] - public static void Post_SetBuff(TravelLookBuff __instance) - { - List buffSet = translatedTravelBuffs[buffLinks[__instance.buffType]]; - string buffText = (__instance.buffIndex < buffSet.Count) ? buffSet[__instance.buffIndex] : StringStore.TranslateText(__instance.introduce.text); - __instance.introduce.text = buffText; - - foreach (TextMeshProUGUI text in __instance.transform.FindChild("Images").FindChild("Button").GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/TravelLookMenu_Patch.cs b/MelonLoader/Patches/GameObjects/TravelLookMenu_Patch.cs deleted file mode 100644 index b775a7a..0000000 --- a/MelonLoader/Patches/GameObjects/TravelLookMenu_Patch.cs +++ /dev/null @@ -1,46 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(TravelLookMenu))] - public static class TravelLookMenu_Patch - { - public static string savedAssetString = ""; - - [HarmonyPatch(nameof(TravelLookMenu.Start))] - [HarmonyPostfix] - private static void Postfix_Start(TravelLookMenu __instance) - { - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - - Transform quitButtonTransform = __instance.transform.Find("Quit"); - foreach (TextMeshProUGUI txt in quitButtonTransform.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText("合上"); - txt.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - - __instance.treasureText.text = StringStore.TranslateText(__instance.treasureText.text); - savedAssetString = __instance.treasureText.text; - } - - [HarmonyPatch(nameof(TravelLookMenu.Update))] - [HarmonyPostfix] - private static void Update(TravelLookMenu __instance) - { - if (savedAssetString != __instance.treasureText.text) - { - __instance.treasureText.text = StringStore.TranslateText(__instance.treasureText.text); - savedAssetString = __instance.treasureText.text; - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/TravelRefresh_Patch.cs b/MelonLoader/Patches/GameObjects/TravelRefresh_Patch.cs deleted file mode 100644 index 6206e7a..0000000 --- a/MelonLoader/Patches/GameObjects/TravelRefresh_Patch.cs +++ /dev/null @@ -1,28 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(TravelRefresh))] - public static class TravelRefresh_Patch - { - [HarmonyPatch(nameof(TravelRefresh.Start))] - [HarmonyPostfix] - private static void Start(TravelRefresh __instance) - { - __instance.text = StringStore.TranslateText(__instance.text); - __instance.text_shadow = StringStore.TranslateText(__instance.text_shadow); - } - - [HarmonyPatch(nameof(TravelRefresh.OnMouseUpAsButton))] - [HarmonyPostfix] - private static void OnMouseUpAsButton(TravelRefresh __instance) - { - __instance.text = StringStore.TranslateText(__instance.text); - __instance.text_shadow = StringStore.TranslateText(__instance.text_shadow); - } - } -} diff --git a/MelonLoader/Patches/GameObjects/TravelStore_Patch.cs b/MelonLoader/Patches/GameObjects/TravelStore_Patch.cs deleted file mode 100644 index 82b8c24..0000000 --- a/MelonLoader/Patches/GameObjects/TravelStore_Patch.cs +++ /dev/null @@ -1,70 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using static PvZ_Fusion_Translator.Patches.Managers.TravelMgr_Patch; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(TravelStore))] - public static class TravelStore_Patch - { - [HarmonyPatch(nameof(TravelStore.Update))] - [HarmonyPostfix] - private static void Update(TravelStore __instance) - { - foreach(TextMeshProUGUI text in __instance.introduces) - { - if(__instance.currentSelect != null) - { - var buffList = translatedTravelBuffs[buffLinks[(BuffType)__instance.currentSelect.theBuffType]]; - if(__instance.currentSelect.theBuffNumber < buffList.Count && __instance.currentSelect.theBuffNumber > -1) - { - text.text = buffList[__instance.currentSelect.theBuffNumber]; - } - else - { - text.text = StringStore.TranslateText(text.text); - } - } - } - foreach (var textMesh in __instance.points) - { - textMesh.text = StringStore.TranslateText(textMesh.text); - } - } - - [HarmonyPatch(nameof(TravelStore.RefreshBuff))] - [HarmonyPostfix] - private static void RefreshBuff(TravelStore __instance) - { - foreach (TravelBuff buff in __instance.travelBuffs) - { - TextMeshProUGUI cost = buff.transform.GetChild(1).GetComponent(); - cost.text = StringStore.TranslateText(cost.text); - cost.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - - foreach (TextMeshProUGUI text in __instance.introduces) - { - if (__instance.currentSelect != null) - { - var buffList = translatedTravelBuffs[buffLinks[(BuffType)__instance.currentSelect.theBuffType]]; - if (__instance.currentSelect.theBuffNumber < buffList.Count && __instance.currentSelect.theBuffNumber > -1) - { - text.text = buffList[__instance.currentSelect.theBuffNumber]; - } - else - { - text.text = StringStore.TranslateText(text.text); - } - } - } - foreach (var textMesh in __instance.points) - { - textMesh.text = StringStore.TranslateText(textMesh.text); - } - } - } -} diff --git a/MelonLoader/Patches/Managers/DifficultyMgr_Patch.cs b/MelonLoader/Patches/Managers/DifficultyMgr_Patch.cs index 3d05ff1..4b294d8 100644 --- a/MelonLoader/Patches/Managers/DifficultyMgr_Patch.cs +++ b/MelonLoader/Patches/Managers/DifficultyMgr_Patch.cs @@ -8,12 +8,12 @@ namespace PvZ_Fusion_Translator.Patches.Managers [HarmonyPatch(typeof(DifficultyMgr))] public static class DifficultyMgr_Patch { - [HarmonyPatch(nameof(DifficultyMgr.Update))] - [HarmonyPostfix] - private static void DifficultyMgr_Update(DifficultyMgr __instance) - { - __instance.t = StringStore.TranslateText(__instance.t); - __instance.t.autoSizeTextContainer = false; - } + //[HarmonyPatch(nameof(DifficultyMgr.Update))] + //[HarmonyPostfix] + //private static void DifficultyMgr_Update(DifficultyMgr __instance) + //{ + // __instance.t = StringStore.TranslateText(__instance.t); + // __instance.t.autoSizeTextContainer = false; + //} } } diff --git a/MelonLoader/Patches/Managers/OppositeBuffManager_Patch.cs b/MelonLoader/Patches/Managers/OppositeBuffManager_Patch.cs index 11a18af..4913c91 100644 --- a/MelonLoader/Patches/Managers/OppositeBuffManager_Patch.cs +++ b/MelonLoader/Patches/Managers/OppositeBuffManager_Patch.cs @@ -2,6 +2,7 @@ using Il2Cpp; using Il2CppTMPro; using PvZ_Fusion_Translator.AssetStore; +//using PvZ_Fusion_Translator.Patches.Modes.Odyssey; using System.Text.RegularExpressions; using UnityEngine; @@ -10,11 +11,11 @@ namespace PvZ_Fusion_Translator.Patches.Managers [HarmonyPatch(typeof(OppositeBuffManager))] public static class OppositeBuffManager_Patch { - public static Dictionary buffLinks = TravelMgr_Patch.buffLinks; - public static Dictionary> translatedTravelBuffs = TravelMgr_Patch.translatedTravelBuffs; - public static string badPattern = @"^但(.*)"; - public static string badFormat = StringStore.translationStringRegex.ContainsKey(badPattern) ? StringStore.translationStringRegex[badPattern] : "But, {0}"; - public static TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + //public static Dictionary buffLinks = TravelMgr_Patch.buffLinks; + //public static Dictionary> translatedTravelBuffs = TravelMgr_Patch.translatedTravelBuffs; + //public static string badPattern = @"^但(.*)"; + //public static string badFormat = StringStore.translationStringRegex.ContainsKey(badPattern) ? StringStore.translationStringRegex[badPattern] : "But, {0}"; + //public static TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); [HarmonyPatch(nameof(OppositeBuffManager.Awake))] [HarmonyPostfix] @@ -28,21 +29,21 @@ namespace PvZ_Fusion_Translator.Patches.Managers public static void TranslateOppositeText(Il2CppSystem.Collections.Generic.List textList, BuffType buffType, int buffIndex, bool isBad = false) { - string buff = translatedTravelBuffs[buffLinks[buffType]][buffIndex]; + //string buff = translatedTravelBuffs[buffLinks[buffType]][buffIndex]; - foreach(var text in textList) - { - if(isBad) - { - text.text = string.Format(badFormat, buff); - } - else - { - text.text = buff; - } + //foreach(var text in textList) + //{ + // if(isBad) + // { + // text.text = string.Format(badFormat, buff); + // } + // else + // { + // text.text = buff; + // } - text.font = fontAsset; - } + // text.font = fontAsset; + //} } } } diff --git a/MelonLoader/Patches/Managers/TravelBuffMgr_Patch.cs b/MelonLoader/Patches/Managers/TravelBuffMgr_Patch.cs deleted file mode 100644 index 86879e1..0000000 --- a/MelonLoader/Patches/Managers/TravelBuffMgr_Patch.cs +++ /dev/null @@ -1,27 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using System.Text.Encodings.Web; -using System.Text.Json; - -namespace PvZ_Fusion_Translator.Patches.Managers -{ - [HarmonyPatch(typeof(TravelBuffMgr))] - public static class TravelBuffMgr_Patch - { - [HarmonyPatch(nameof(TravelBuffMgr.Awake))] - [HarmonyPostfix] - private static void Awake(TravelBuffMgr __instance) - { - __instance.text = AssetStore.StringStore.TranslateText(__instance.text); - __instance.text2 = AssetStore.StringStore.TranslateText(__instance.text2); - } - - [HarmonyPatch(nameof(TravelBuffMgr.ShowText), new Type[] { typeof(int), typeof(int) })] - [HarmonyPostfix] - private static void ShowText(TravelBuffMgr __instance) - { - __instance.text = AssetStore.StringStore.TranslateText(__instance.text); - __instance.text2 = AssetStore.StringStore.TranslateText(__instance.text2); - } - } -} diff --git a/MelonLoader/Patches/Managers/TravelMgr_Patch.cs b/MelonLoader/Patches/Managers/TravelMgr_Patch.cs deleted file mode 100644 index 3c8c863..0000000 --- a/MelonLoader/Patches/Managers/TravelMgr_Patch.cs +++ /dev/null @@ -1,102 +0,0 @@ -using Il2Cpp; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Encodings.Web; -using System.Text.Json; -using System.Threading.Tasks; -using HarmonyLib; - -namespace PvZ_Fusion_Translator.Patches.Managers -{ - [HarmonyPatch(typeof(TravelMgr))] - public static class TravelMgr_Patch - { - public static Dictionary buffLinks = new Dictionary() - { - { BuffType.AdvancedBuff, "advancedUpgrades" }, - { BuffType.UltimateBuff, "ultimateUpgrades" }, - { BuffType.UnlockPlant, "strongUltimates" }, - { BuffType.Debuff, "debuffs" }, - }; - - public static Dictionary> dumpedTravelBuffs = new Dictionary>() - { - { "advancedUpgrades", [] }, - { "ultimateUpgrades", [] }, - { "strongUltimates", [] }, - { "debuffs", [] } - }; - - public static Dictionary> translatedTravelBuffs = new Dictionary>(); - - public static void DumpTravelBuffs(Il2CppSystem.Collections.Generic.Dictionary source, Dictionary> dest, string index) - { - foreach (var i in source) - { - if (!Utils.CheckForUntranslatedText(i.Value)) - { - break; - } - dest[index].Add(i.Value); - } - } - - public static string MatchTravelBuff(string originalText) - { - string res = ""; - - foreach(var i in dumpedTravelBuffs) - { - if(i.Value.Contains(originalText)) - { - res = translatedTravelBuffs[i.Key][i.Value.IndexOf(originalText)]; - break; - } - } - - return res; - } - - [HarmonyPatch(nameof(TravelMgr.Awake))] - [HarmonyPrefix] - private static void Pre_Awake(TravelMgr __instance) - { - // Dump buffs - - dumpedTravelBuffs = new Dictionary>() // reset dump - { - { "advancedUpgrades", [] }, - { "ultimateUpgrades", [] }, - { "strongUltimates", [] }, - { "debuffs", [] } - }; - - DumpTravelBuffs(TravelMgr.advancedBuffs, dumpedTravelBuffs, "advancedUpgrades"); - DumpTravelBuffs(TravelMgr.ultimateBuffs, dumpedTravelBuffs, "ultimateUpgrades"); - DumpTravelBuffs(TravelMgr.unlocks, dumpedTravelBuffs, "strongUltimates"); - DumpTravelBuffs(TravelMgr.debuffs, dumpedTravelBuffs, "debuffs"); - - string dumpDir = FileLoader.GetAssetDir(FileLoader.AssetType.Dumps); - var options = new JsonSerializerOptions - { - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, - WriteIndented = true - }; - File.WriteAllText(Path.Combine(dumpDir, "travel_buffs.json"), JsonSerializer.Serialize(dumpedTravelBuffs, options)); - - string stringDir = FileLoader.GetAssetDir(FileLoader.AssetType.Strings, Utils.Language); - string travelBuffDir = Path.Combine(stringDir, "travel_buffs.json"); - - if(!File.Exists(travelBuffDir)) - { - File.WriteAllText(travelBuffDir, JsonSerializer.Serialize(dumpedTravelBuffs, options)); - } - - string travelBuffs = File.ReadAllText(Path.Combine(stringDir, "travel_buffs.json")); - - translatedTravelBuffs = JsonSerializer.Deserialize>>(travelBuffs); - } - } -} diff --git a/MelonLoader/Patches/GameObjects/AbyssBagMenu_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssBagMenu_Patch.cs similarity index 100% rename from MelonLoader/Patches/GameObjects/AbyssBagMenu_Patch.cs rename to MelonLoader/Patches/Modes/Abyss/AbyssBagMenu_Patch.cs diff --git a/MelonLoader/Patches/GameObjects/ButtonObjects/AbyssBuffButton_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssBuffButton_Patch.cs similarity index 100% rename from MelonLoader/Patches/GameObjects/ButtonObjects/AbyssBuffButton_Patch.cs rename to MelonLoader/Patches/Modes/Abyss/AbyssBuffButton_Patch.cs diff --git a/MelonLoader/Patches/Managers/AbyssBuffData_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssBuffData_Patch.cs similarity index 100% rename from MelonLoader/Patches/Managers/AbyssBuffData_Patch.cs rename to MelonLoader/Patches/Modes/Abyss/AbyssBuffData_Patch.cs diff --git a/MelonLoader/Patches/GameObjects/AbyssBuffMenu_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssBuffMenu_Patch.cs similarity index 96% rename from MelonLoader/Patches/GameObjects/AbyssBuffMenu_Patch.cs rename to MelonLoader/Patches/Modes/Abyss/AbyssBuffMenu_Patch.cs index c9e53e7..a416bea 100644 --- a/MelonLoader/Patches/GameObjects/AbyssBuffMenu_Patch.cs +++ b/MelonLoader/Patches/Modes/Abyss/AbyssBuffMenu_Patch.cs @@ -12,7 +12,7 @@ using System.Text.Json; using System.Text.RegularExpressions; using UnityEngine.TextCore.Text; -namespace PvZ_Fusion_Translator.Patches.GameObjects +namespace PvZ_Fusion_Translator.Patches.Modes.Abyss { [HarmonyPatch(typeof(AbyssBuffMenu))] public static class AbyssBuffMenu_Patch @@ -98,7 +98,7 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects var regex = new Regex(pattern); var match = regex.Match(originalText); - return String.Format(x.Value.Replace("value", "0"), match.Groups[1].Value); + return string.Format(x.Value.Replace("value", "0"), match.Groups[1].Value); } } } diff --git a/MelonLoader/Patches/GameObjects/AbyssCheckInBag_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssCheckInBag_Patch.cs similarity index 100% rename from MelonLoader/Patches/GameObjects/AbyssCheckInBag_Patch.cs rename to MelonLoader/Patches/Modes/Abyss/AbyssCheckInBag_Patch.cs diff --git a/MelonLoader/Patches/GameObjects/ButtonObjects/AbyssCheckSellMenu_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssCheckSellMenu_Patch.cs similarity index 100% rename from MelonLoader/Patches/GameObjects/ButtonObjects/AbyssCheckSellMenu_Patch.cs rename to MelonLoader/Patches/Modes/Abyss/AbyssCheckSellMenu_Patch.cs diff --git a/MelonLoader/Patches/GameObjects/AbyssDevelopMenu_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssDevelopMenu_Patch.cs similarity index 100% rename from MelonLoader/Patches/GameObjects/AbyssDevelopMenu_Patch.cs rename to MelonLoader/Patches/Modes/Abyss/AbyssDevelopMenu_Patch.cs diff --git a/MelonLoader/Patches/GameObjects/MinorObjects/AbyssGoods_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssGoods_Patch.cs similarity index 92% rename from MelonLoader/Patches/GameObjects/MinorObjects/AbyssGoods_Patch.cs rename to MelonLoader/Patches/Modes/Abyss/AbyssGoods_Patch.cs index 5735459..a20ee73 100644 --- a/MelonLoader/Patches/GameObjects/MinorObjects/AbyssGoods_Patch.cs +++ b/MelonLoader/Patches/Modes/Abyss/AbyssGoods_Patch.cs @@ -4,7 +4,7 @@ using Il2CppTMPro; using PvZ_Fusion_Translator.AssetStore; using UnityEngine; -namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects +namespace PvZ_Fusion_Translator.Patches.Modes.Abyss { [HarmonyPatch(typeof(AbyssGoods))] public static class AbyssGoods_Patch diff --git a/MelonLoader/Patches/Managers/AbyssInfo_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssInfo_Patch.cs similarity index 100% rename from MelonLoader/Patches/Managers/AbyssInfo_Patch.cs rename to MelonLoader/Patches/Modes/Abyss/AbyssInfo_Patch.cs diff --git a/MelonLoader/Patches/GameObjects/ButtonObjects/AbyssLevelEnter_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssLevelEnter_Patch.cs similarity index 87% rename from MelonLoader/Patches/GameObjects/ButtonObjects/AbyssLevelEnter_Patch.cs rename to MelonLoader/Patches/Modes/Abyss/AbyssLevelEnter_Patch.cs index b754b8e..4dc73a3 100644 --- a/MelonLoader/Patches/GameObjects/ButtonObjects/AbyssLevelEnter_Patch.cs +++ b/MelonLoader/Patches/Modes/Abyss/AbyssLevelEnter_Patch.cs @@ -4,7 +4,7 @@ using Il2CppTMPro; using PvZ_Fusion_Translator.AssetStore; using UnityEngine; -namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects +namespace PvZ_Fusion_Translator.Patches.Modes.Abyss { [HarmonyPatch(typeof(AbyssLevelEnter))] public static class AbyssLevelEnter_Patch diff --git a/MelonLoader/Patches/GameObjects/AbyssMenu2_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssMenu2_Patch.cs similarity index 100% rename from MelonLoader/Patches/GameObjects/AbyssMenu2_Patch.cs rename to MelonLoader/Patches/Modes/Abyss/AbyssMenu2_Patch.cs diff --git a/MelonLoader/Patches/GameObjects/AbyssMenu_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssMenu_Patch.cs similarity index 97% rename from MelonLoader/Patches/GameObjects/AbyssMenu_Patch.cs rename to MelonLoader/Patches/Modes/Abyss/AbyssMenu_Patch.cs index abef5ee..b6ebf8f 100644 --- a/MelonLoader/Patches/GameObjects/AbyssMenu_Patch.cs +++ b/MelonLoader/Patches/Modes/Abyss/AbyssMenu_Patch.cs @@ -9,7 +9,7 @@ using System.Text.RegularExpressions; using UnityEngine.UI; using MelonLoader.Utils; -namespace PvZ_Fusion_Translator.Patches.GameObjects +namespace PvZ_Fusion_Translator.Patches.Modes.Abyss { [HarmonyPatch(typeof(AbyssMenu))] public static class AbyssMenu_Patch diff --git a/MelonLoader/Patches/GameObjects/AbyssSelectBuffWindow_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssSelectBuffWindow_Patch.cs similarity index 85% rename from MelonLoader/Patches/GameObjects/AbyssSelectBuffWindow_Patch.cs rename to MelonLoader/Patches/Modes/Abyss/AbyssSelectBuffWindow_Patch.cs index 8af7930..e4ac857 100644 --- a/MelonLoader/Patches/GameObjects/AbyssSelectBuffWindow_Patch.cs +++ b/MelonLoader/Patches/Modes/Abyss/AbyssSelectBuffWindow_Patch.cs @@ -5,7 +5,7 @@ using PvZ_Fusion_Translator.AssetStore; using UnityEngine; using System.Text.RegularExpressions; -namespace PvZ_Fusion_Translator.Patches.GameObjects +namespace PvZ_Fusion_Translator.Patches.Modes.Abyss { [HarmonyPatch(typeof(AbyssSelectBuffWindow))] public static class AbyssSelectBuffWindow_Patch @@ -45,7 +45,7 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects titleText.font = fontAsset; } - string translatedIntroduceText = (AbyssBuffMenu_Patch.abyssBuffData.ContainsKey(__instance.introduce.text)) ? AbyssBuffMenu_Patch.abyssBuffData[__instance.introduce.text] : AbyssBuffMenu_Patch.TranslateAbyssBuffRegex(__instance.introduce.text); + string translatedIntroduceText = AbyssBuffMenu_Patch.abyssBuffData.ContainsKey(__instance.introduce.text) ? AbyssBuffMenu_Patch.abyssBuffData[__instance.introduce.text] : AbyssBuffMenu_Patch.TranslateAbyssBuffRegex(__instance.introduce.text); if (translatedIntroduceText != null) { diff --git a/MelonLoader/Patches/GameObjects/AbyssSettlementMenu_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssSettlementMenu_Patch.cs similarity index 100% rename from MelonLoader/Patches/GameObjects/AbyssSettlementMenu_Patch.cs rename to MelonLoader/Patches/Modes/Abyss/AbyssSettlementMenu_Patch.cs diff --git a/MelonLoader/Patches/GameObjects/AbyssStoreMenu_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssStoreMenu_Patch.cs similarity index 92% rename from MelonLoader/Patches/GameObjects/AbyssStoreMenu_Patch.cs rename to MelonLoader/Patches/Modes/Abyss/AbyssStoreMenu_Patch.cs index ccbc895..971e7d5 100644 --- a/MelonLoader/Patches/GameObjects/AbyssStoreMenu_Patch.cs +++ b/MelonLoader/Patches/Modes/Abyss/AbyssStoreMenu_Patch.cs @@ -3,7 +3,7 @@ using Il2Cpp; using Il2CppTMPro; using PvZ_Fusion_Translator.AssetStore; -namespace PvZ_Fusion_Translator.Patches.GameObjects +namespace PvZ_Fusion_Translator.Patches.Modes.Abyss { [HarmonyPatch(typeof(AbyssStoreMenu))] public static class AbyssStoreMenu_Patch diff --git a/MelonLoader/Patches/GameObjects/GardenBagMenu_Patch.cs b/MelonLoader/Patches/Modes/Harvest/GardenBagMenu_Patch.cs similarity index 55% rename from MelonLoader/Patches/GameObjects/GardenBagMenu_Patch.cs rename to MelonLoader/Patches/Modes/Harvest/GardenBagMenu_Patch.cs index 093cacd..6a377e6 100644 --- a/MelonLoader/Patches/GameObjects/GardenBagMenu_Patch.cs +++ b/MelonLoader/Patches/Modes/Harvest/GardenBagMenu_Patch.cs @@ -15,26 +15,6 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects { TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - if(txt.transform.parent.name.Contains("Close")) - { - txt.text = StringStore.TranslateText("合上"); - } - else - { - txt.text = StringStore.TranslateText(txt.text); - } - txt.font = fontAsset; - } - } - - [HarmonyPatch(nameof(GardenBagMenu.SetTreasureCard))] - [HarmonyPostfix] - private static void SetTreasureCard(GardenBagMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) { if (txt.transform.parent.name.Contains("Close")) @@ -48,5 +28,25 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects txt.font = fontAsset; } } + + //[HarmonyPatch(nameof(GardenBagMenu.SetTreasureCard))] + //[HarmonyPostfix] + //private static void SetTreasureCard(GardenBagMenu __instance) + //{ + // //TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + // //foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) + // //{ + // // if (txt.transform.parent.name.Contains("Close")) + // // { + // // txt.text = StringStore.TranslateText("合上"); + // // } + // // else + // // { + // // txt.text = StringStore.TranslateText(txt.text); + // // } + // // txt.font = fontAsset; + // //} + //} } } \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/GardenCard_Patch.cs b/MelonLoader/Patches/Modes/Harvest/GardenCard_Patch.cs similarity index 100% rename from MelonLoader/Patches/GameObjects/GardenCard_Patch.cs rename to MelonLoader/Patches/Modes/Harvest/GardenCard_Patch.cs diff --git a/MelonLoader/Patches/GameObjects/TreasureConfirmMenu_Patch.cs b/MelonLoader/Patches/Modes/Harvest/TreasureConfirmMenu_Patch.cs similarity index 93% rename from MelonLoader/Patches/GameObjects/TreasureConfirmMenu_Patch.cs rename to MelonLoader/Patches/Modes/Harvest/TreasureConfirmMenu_Patch.cs index 9cbf1a0..2f5c947 100644 --- a/MelonLoader/Patches/GameObjects/TreasureConfirmMenu_Patch.cs +++ b/MelonLoader/Patches/Modes/Harvest/TreasureConfirmMenu_Patch.cs @@ -4,7 +4,7 @@ using Il2CppTMPro; using PvZ_Fusion_Translator.AssetStore; using UnityEngine; -namespace PvZ_Fusion_Translator.Patches.GameObjects +namespace PvZ_Fusion_Translator.Patches.Modes.Harvest { [HarmonyPatch(typeof(TreasureConfirmMenu))] public static class TreasureConfirmMenu_Patch diff --git a/MelonLoader/Patches/GameObjects/TreasureEquipmentMenu_Patch.cs b/MelonLoader/Patches/Modes/Harvest/TreasureEquipmentMenu_Patch.cs similarity index 95% rename from MelonLoader/Patches/GameObjects/TreasureEquipmentMenu_Patch.cs rename to MelonLoader/Patches/Modes/Harvest/TreasureEquipmentMenu_Patch.cs index f80e26d..1033f57 100644 --- a/MelonLoader/Patches/GameObjects/TreasureEquipmentMenu_Patch.cs +++ b/MelonLoader/Patches/Modes/Harvest/TreasureEquipmentMenu_Patch.cs @@ -4,7 +4,7 @@ using Il2CppTMPro; using PvZ_Fusion_Translator.AssetStore; using UnityEngine; -namespace PvZ_Fusion_Translator.Patches.GameObjects +namespace PvZ_Fusion_Translator.Patches.Modes.Harvest { [HarmonyPatch(typeof(TreasureEquipmentMenu))] public static class TreasureEquipmentMenu_Patch diff --git a/MelonLoader/Patches/GameObjects/TreasureEvacuateMenu_Patch.cs b/MelonLoader/Patches/Modes/Harvest/TreasureEvacuateMenu_Patch.cs similarity index 94% rename from MelonLoader/Patches/GameObjects/TreasureEvacuateMenu_Patch.cs rename to MelonLoader/Patches/Modes/Harvest/TreasureEvacuateMenu_Patch.cs index f32c011..e133b8f 100644 --- a/MelonLoader/Patches/GameObjects/TreasureEvacuateMenu_Patch.cs +++ b/MelonLoader/Patches/Modes/Harvest/TreasureEvacuateMenu_Patch.cs @@ -5,7 +5,7 @@ using PvZ_Fusion_Translator.AssetStore; using UnityEngine; using UnityEngine.UI; -namespace PvZ_Fusion_Translator.Patches.GameObjects +namespace PvZ_Fusion_Translator.Patches.Modes.Harvest { [HarmonyPatch(typeof(TreasureEvacuateMenu))] public static class TreasureEvacuateMenu_Patch diff --git a/MelonLoader/Patches/GameObjects/TreasureMainMenu_Patch.cs b/MelonLoader/Patches/Modes/Harvest/TreasureMainMenu_Patch.cs similarity index 92% rename from MelonLoader/Patches/GameObjects/TreasureMainMenu_Patch.cs rename to MelonLoader/Patches/Modes/Harvest/TreasureMainMenu_Patch.cs index ea0478e..df5b950 100644 --- a/MelonLoader/Patches/GameObjects/TreasureMainMenu_Patch.cs +++ b/MelonLoader/Patches/Modes/Harvest/TreasureMainMenu_Patch.cs @@ -4,7 +4,7 @@ using Il2CppTMPro; using PvZ_Fusion_Translator.AssetStore; using UnityEngine; -namespace PvZ_Fusion_Translator.Patches.GameObjects +namespace PvZ_Fusion_Translator.Patches.Modes.Harvest { [HarmonyPatch(typeof(TreasureMainMenu))] public static class TreasureMainMenu_Patch diff --git a/MelonLoader/Patches/Managers/TreasureManager_Patch.cs b/MelonLoader/Patches/Modes/Harvest/TreasureManager_Patch.cs similarity index 94% rename from MelonLoader/Patches/Managers/TreasureManager_Patch.cs rename to MelonLoader/Patches/Modes/Harvest/TreasureManager_Patch.cs index 9b20132..9e9f92f 100644 --- a/MelonLoader/Patches/Managers/TreasureManager_Patch.cs +++ b/MelonLoader/Patches/Modes/Harvest/TreasureManager_Patch.cs @@ -4,7 +4,7 @@ using Il2CppTMPro; using PvZ_Fusion_Translator.AssetStore; using UnityEngine; -namespace PvZ_Fusion_Translator.Patches.Managers +namespace PvZ_Fusion_Translator.Patches.Modes.Harvest { [HarmonyPatch(typeof(TreasureManager))] public static class TreasureManager_Patch diff --git a/MelonLoader/Patches/GameObjects/TreasureStoreMenu_Patch.cs b/MelonLoader/Patches/Modes/Harvest/TreasureStoreMenu_Patch.cs similarity index 92% rename from MelonLoader/Patches/GameObjects/TreasureStoreMenu_Patch.cs rename to MelonLoader/Patches/Modes/Harvest/TreasureStoreMenu_Patch.cs index 1b771c6..05c3d8c 100644 --- a/MelonLoader/Patches/GameObjects/TreasureStoreMenu_Patch.cs +++ b/MelonLoader/Patches/Modes/Harvest/TreasureStoreMenu_Patch.cs @@ -4,7 +4,7 @@ using Il2CppTMPro; using PvZ_Fusion_Translator.AssetStore; using UnityEngine; -namespace PvZ_Fusion_Translator.Patches.GameObjects +namespace PvZ_Fusion_Translator.Patches.Modes.Harvest { [HarmonyPatch(typeof(TreasureStoreMenu))] public static class TreasureStoreMenu_Patch diff --git a/MelonLoader/Patches/GameObjects/TreasureUpgradeMenu_Patch.cs b/MelonLoader/Patches/Modes/Harvest/TreasureUpgradeMenu_Patch.cs similarity index 97% rename from MelonLoader/Patches/GameObjects/TreasureUpgradeMenu_Patch.cs rename to MelonLoader/Patches/Modes/Harvest/TreasureUpgradeMenu_Patch.cs index a7d43bb..fc8c177 100644 --- a/MelonLoader/Patches/GameObjects/TreasureUpgradeMenu_Patch.cs +++ b/MelonLoader/Patches/Modes/Harvest/TreasureUpgradeMenu_Patch.cs @@ -7,7 +7,7 @@ using System.Text.RegularExpressions; using UnityEngine; using UnityEngine.UI; -namespace PvZ_Fusion_Translator.Patches.GameObjects +namespace PvZ_Fusion_Translator.Patches.Modes.Harvest { [HarmonyPatch(typeof(TreasureUpgradeMenu))] public static class TreasureUpgradeMenu_Patch diff --git a/MelonLoader/Patches/GameObjects/TreasureWarehouseMenu_Patch.cs b/MelonLoader/Patches/Modes/Harvest/TreasureWarehouseMenu_Patch.cs similarity index 97% rename from MelonLoader/Patches/GameObjects/TreasureWarehouseMenu_Patch.cs rename to MelonLoader/Patches/Modes/Harvest/TreasureWarehouseMenu_Patch.cs index fb7d1a9..edddd80 100644 --- a/MelonLoader/Patches/GameObjects/TreasureWarehouseMenu_Patch.cs +++ b/MelonLoader/Patches/Modes/Harvest/TreasureWarehouseMenu_Patch.cs @@ -4,7 +4,7 @@ using Il2CppTMPro; using PvZ_Fusion_Translator.AssetStore; using UnityEngine; -namespace PvZ_Fusion_Translator.Patches.GameObjects +namespace PvZ_Fusion_Translator.Patches.Modes.Harvest { [HarmonyPatch(typeof(TreasureWarehouseMenu))] public static class TreasureWarehouseMenu_Patch diff --git a/MelonLoader/Patches/Modes/Odyssey/TravelBuffMenu_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/TravelBuffMenu_Patch.cs new file mode 100644 index 0000000..c0d6da3 --- /dev/null +++ b/MelonLoader/Patches/Modes/Odyssey/TravelBuffMenu_Patch.cs @@ -0,0 +1,24 @@ +//using HarmonyLib; +//using Il2Cpp; +//using Il2CppTMPro; +//using PvZ_Fusion_Translator.AssetStore; +//using static PvZ_Fusion_Translator.Patches.Modes.Odyssey.TravelMgr_Patch; +//using UnityEngine; +//using MelonLoader; + +//namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey +//{ +// [HarmonyPatch(typeof(TravelBuffMenu))] +// public static class TravelBuffMenu_Patch +// { +// [HarmonyPatch(nameof(TravelBuffMenu.RefeshOptions))] +// [HarmonyPostfix] +// public static void RefeshOptions(TravelBuffMenu __instance) +// { +// foreach(TravelBuffOptionButton button in __instance.options) +// { +// TravelBuffOptionButton_Patch.TranslateOptionButton(button); +// } +// } +// } +//} \ No newline at end of file diff --git a/MelonLoader/Patches/Modes/Odyssey/TravelBuffMgr_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/TravelBuffMgr_Patch.cs new file mode 100644 index 0000000..7d583df --- /dev/null +++ b/MelonLoader/Patches/Modes/Odyssey/TravelBuffMgr_Patch.cs @@ -0,0 +1,27 @@ +//using HarmonyLib; +//using Il2Cpp; +//using System.Text.Encodings.Web; +//using System.Text.Json; + +//namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey +//{ +// [HarmonyPatch(typeof(TravelBuffMgr))] +// public static class TravelBuffMgr_Patch +// { +// [HarmonyPatch(nameof(TravelBuffMgr.Awake))] +// [HarmonyPostfix] +// private static void Awake(TravelBuffMgr __instance) +// { +// __instance.text = AssetStore.StringStore.TranslateText(__instance.text); +// __instance.text2 = AssetStore.StringStore.TranslateText(__instance.text2); +// } + +// [HarmonyPatch(nameof(TravelBuffMgr.ShowText), new Type[] { typeof(int), typeof(int) })] +// [HarmonyPostfix] +// private static void ShowText(TravelBuffMgr __instance) +// { +// __instance.text = AssetStore.StringStore.TranslateText(__instance.text); +// __instance.text2 = AssetStore.StringStore.TranslateText(__instance.text2); +// } +// } +//} diff --git a/MelonLoader/Patches/Modes/Odyssey/TravelBuffOptionButton_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/TravelBuffOptionButton_Patch.cs new file mode 100644 index 0000000..a98e95b --- /dev/null +++ b/MelonLoader/Patches/Modes/Odyssey/TravelBuffOptionButton_Patch.cs @@ -0,0 +1,41 @@ +//using HarmonyLib; +//using Il2Cpp; +//using Il2CppTMPro; +//using MelonLoader; +//using PvZ_Fusion_Translator.AssetStore; +//using static MelonLoader.MelonLogger; +//using static PvZ_Fusion_Translator.Patches.Modes.Odyssey.TravelMgr_Patch; + +//namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey +//{ +// [HarmonyPatch(typeof(TravelBuffOptionButton))] +// public static class TravelBuffOptionButton_Patch +// { +// [HarmonyPatch(nameof(TravelBuffOptionButton.Awake))] +// [HarmonyPostfix] +// public static void Awake(TravelBuffOptionButton __instance) +// { +// TranslateOptionButton(__instance); +// } + +// [HarmonyPatch(nameof(TravelBuffOptionButton.OnAnimOver))] +// [HarmonyPostfix] +// public static void OnAnimOver(TravelBuffOptionButton __instance) +// { +// TranslateOptionButton(__instance); +// } + +// public static void TranslateOptionButton(TravelBuffOptionButton button) +// { +// List buffSet = translatedTravelBuffs[buffLinks[button.buffType]]; + +// string buff = button.show != null && button.introduce.text != "词条已选完" ? buffSet[button.buffIndex] : StringStore.TranslateText("词条已选完"); + +// button.introduce.text = buff; +// } +// } + +// //List buffSet = translatedTravelBuffs[buffLinks[__instance.buffType]]; +// //string buff = (__instance.show != null) ? buffSet[__instance.buffIndex] : StringStore.TranslateText("无"); +// //__instance.introduce.text = buff; +//} diff --git a/MelonLoader/Patches/Modes/Odyssey/TravelBuff_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/TravelBuff_Patch.cs new file mode 100644 index 0000000..fbed59a --- /dev/null +++ b/MelonLoader/Patches/Modes/Odyssey/TravelBuff_Patch.cs @@ -0,0 +1,18 @@ +//using HarmonyLib; +//using Il2Cpp; + +//namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey +//{ +// [HarmonyPatch(typeof(TravelBuff))] +// public static class TravelBuff_Patch +// { +// [HarmonyPatch(nameof(TravelBuff.OnMouseUpAsButton))] +// [HarmonyPostfix] +// private static void OnMouseUpAsButton() +// { +// if (TravelBuffMgr.Instance == null) return; +// TravelBuffMgr.Instance.text = AssetStore.StringStore.TranslateText(TravelBuffMgr.Instance.text); +// TravelBuffMgr.Instance.text2 = AssetStore.StringStore.TranslateText(TravelBuffMgr.Instance.text2); +// } +// } +//} \ No newline at end of file diff --git a/MelonLoader/Patches/Modes/Odyssey/TravelLookBuff_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/TravelLookBuff_Patch.cs new file mode 100644 index 0000000..a7ac39f --- /dev/null +++ b/MelonLoader/Patches/Modes/Odyssey/TravelLookBuff_Patch.cs @@ -0,0 +1,51 @@ +//using HarmonyLib; +//using Il2Cpp; +//using Il2CppTMPro; +//using PvZ_Fusion_Translator.AssetStore; +//using static PvZ_Fusion_Translator.Patches.Modes.Odyssey.TravelMgr_Patch; +//using UnityEngine; +//using MelonLoader; + +//namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey +//{ +// [HarmonyPatch(typeof(TravelLookBuff))] +// public static class TravelLookBuff_Patch +// { +// [HarmonyPatch(nameof(TravelLookBuff.Clear))] +// [HarmonyPostfix] +// public static void Post_Clear(TravelLookBuff __instance) +// { +// __instance.introduce.text = StringStore.TranslateText("无"); +// __instance.set = false; + +// foreach (TextMeshProUGUI text in __instance.transform.FindChild("Images").FindChild("Button").GetComponentsInChildren()) +// { +// text.text = StringStore.TranslateText(text.text); +// } +// } + +// [HarmonyPatch(nameof(TravelLookBuff.OnMouseUpAsButton))] +// [HarmonyPostfix] +// public static void Post_OnMouseUpAsButton(TravelLookBuff __instance) +// { +// foreach (TextMeshProUGUI text in __instance.transform.FindChild("Images").FindChild("Button").GetComponentsInChildren()) +// { +// text.text = StringStore.TranslateText(text.text); +// } +// } + +// [HarmonyPatch(nameof(TravelLookBuff.SetBuff))] +// [HarmonyPostfix] +// public static void Post_SetBuff(TravelLookBuff __instance) +// { +// List buffSet = translatedTravelBuffs[buffLinks[__instance.buffType]]; +// string buffText = __instance.buffIndex < buffSet.Count ? buffSet[__instance.buffIndex] : StringStore.TranslateText(__instance.introduce.text); +// __instance.introduce.text = buffText; + +// foreach (TextMeshProUGUI text in __instance.transform.FindChild("Images").FindChild("Button").GetComponentsInChildren()) +// { +// text.text = StringStore.TranslateText(text.text); +// } +// } +// } +//} \ No newline at end of file diff --git a/MelonLoader/Patches/Modes/Odyssey/TravelLookMenu_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/TravelLookMenu_Patch.cs new file mode 100644 index 0000000..b00281a --- /dev/null +++ b/MelonLoader/Patches/Modes/Odyssey/TravelLookMenu_Patch.cs @@ -0,0 +1,46 @@ +//using HarmonyLib; +//using Il2Cpp; +//using Il2CppTMPro; +//using PvZ_Fusion_Translator.AssetStore; +//using UnityEngine; + +//namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey +//{ +// [HarmonyPatch(typeof(TravelLookMenu))] +// public static class TravelLookMenu_Patch +// { +// public static string savedAssetString = ""; + +// [HarmonyPatch(nameof(TravelLookMenu.Start))] +// [HarmonyPostfix] +// private static void Postfix_Start(TravelLookMenu __instance) +// { +// foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) +// { +// txt.text = StringStore.TranslateText(txt.text); +// txt.font = FontStore.LoadTMPFont(Utils.Language.ToString()); +// } + +// Transform quitButtonTransform = __instance.transform.Find("Quit"); +// foreach (TextMeshProUGUI txt in quitButtonTransform.GetComponentsInChildren()) +// { +// txt.text = StringStore.TranslateText("合上"); +// txt.font = FontStore.LoadTMPFont(Utils.Language.ToString()); +// } + +// __instance.treasureText.text = StringStore.TranslateText(__instance.treasureText.text); +// savedAssetString = __instance.treasureText.text; +// } + +// [HarmonyPatch(nameof(TravelLookMenu.Update))] +// [HarmonyPostfix] +// private static void Update(TravelLookMenu __instance) +// { +// if (savedAssetString != __instance.treasureText.text) +// { +// __instance.treasureText.text = StringStore.TranslateText(__instance.treasureText.text); +// savedAssetString = __instance.treasureText.text; +// } +// } +// } +//} \ No newline at end of file diff --git a/MelonLoader/Patches/Modes/Odyssey/TravelMgr_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/TravelMgr_Patch.cs new file mode 100644 index 0000000..7a53177 --- /dev/null +++ b/MelonLoader/Patches/Modes/Odyssey/TravelMgr_Patch.cs @@ -0,0 +1,102 @@ +//using Il2Cpp; +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using System.Text; +//using System.Text.Encodings.Web; +//using System.Text.Json; +//using System.Threading.Tasks; +//using HarmonyLib; + +//namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey +//{ +// [HarmonyPatch(typeof(TravelMgr))] +// public static class TravelMgr_Patch +// { +// public static Dictionary buffLinks = new Dictionary() +// { +// { BuffType.AdvancedBuff, "advancedUpgrades" }, +// { BuffType.UltimateBuff, "ultimateUpgrades" }, +// { BuffType.UnlockPlant, "strongUltimates" }, +// { BuffType.Debuff, "debuffs" }, +// }; + +// public static Dictionary> dumpedTravelBuffs = new Dictionary>() +// { +// { "advancedUpgrades", [] }, +// { "ultimateUpgrades", [] }, +// { "strongUltimates", [] }, +// { "debuffs", [] } +// }; + +// public static Dictionary> translatedTravelBuffs = new Dictionary>(); + +// public static void DumpTravelBuffs(Il2CppSystem.Collections.Generic.Dictionary source, Dictionary> dest, string index) +// { +// foreach (var i in source) +// { +// if (!Utils.CheckForUntranslatedText(i.Value)) +// { +// break; +// } +// dest[index].Add(i.Value); +// } +// } + +// public static string MatchTravelBuff(string originalText) +// { +// string res = ""; + +// foreach(var i in dumpedTravelBuffs) +// { +// if(i.Value.Contains(originalText)) +// { +// res = translatedTravelBuffs[i.Key][i.Value.IndexOf(originalText)]; +// break; +// } +// } + +// return res; +// } + +// [HarmonyPatch(nameof(TravelMgr.Awake))] +// [HarmonyPrefix] +// private static void Pre_Awake(TravelMgr __instance) +// { +// // Dump buffs + +// dumpedTravelBuffs = new Dictionary>() // reset dump +// { +// { "advancedUpgrades", [] }, +// { "ultimateUpgrades", [] }, +// { "strongUltimates", [] }, +// { "debuffs", [] } +// }; + +// DumpTravelBuffs(TravelMgr.advancedBuffs, dumpedTravelBuffs, "advancedUpgrades"); +// DumpTravelBuffs(TravelMgr.ultimateBuffs, dumpedTravelBuffs, "ultimateUpgrades"); +// DumpTravelBuffs(TravelMgr.unlocks, dumpedTravelBuffs, "strongUltimates"); +// DumpTravelBuffs(TravelMgr.debuffs, dumpedTravelBuffs, "debuffs"); + +// string dumpDir = FileLoader.GetAssetDir(FileLoader.AssetType.Dumps); +// var options = new JsonSerializerOptions +// { +// Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, +// WriteIndented = true +// }; +// File.WriteAllText(Path.Combine(dumpDir, "travel_buffs.json"), JsonSerializer.Serialize(dumpedTravelBuffs, options)); + +// string stringDir = FileLoader.GetAssetDir(FileLoader.AssetType.Strings, Utils.Language); +// string travelBuffDir = Path.Combine(stringDir, "travel_buffs.json"); + +// if(!File.Exists(travelBuffDir)) +// { +// File.WriteAllText(travelBuffDir, JsonSerializer.Serialize(dumpedTravelBuffs, options)); +// } + +// string travelBuffs = File.ReadAllText(Path.Combine(stringDir, "travel_buffs.json")); + +// translatedTravelBuffs = JsonSerializer.Deserialize>>(travelBuffs); +// } +// } +//} diff --git a/MelonLoader/Patches/Modes/Odyssey/TravelRefresh_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/TravelRefresh_Patch.cs new file mode 100644 index 0000000..e7263c2 --- /dev/null +++ b/MelonLoader/Patches/Modes/Odyssey/TravelRefresh_Patch.cs @@ -0,0 +1,28 @@ +//using HarmonyLib; +//using Il2Cpp; +//using Il2CppTMPro; +//using PvZ_Fusion_Translator.AssetStore; +//using UnityEngine; + +//namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey +//{ +// [HarmonyPatch(typeof(TravelRefresh))] +// public static class TravelRefresh_Patch +// { +// [HarmonyPatch(nameof(TravelRefresh.Start))] +// [HarmonyPostfix] +// private static void Start(TravelRefresh __instance) +// { +// __instance.text = StringStore.TranslateText(__instance.text); +// __instance.text_shadow = StringStore.TranslateText(__instance.text_shadow); +// } + +// [HarmonyPatch(nameof(TravelRefresh.OnMouseUpAsButton))] +// [HarmonyPostfix] +// private static void OnMouseUpAsButton(TravelRefresh __instance) +// { +// __instance.text = StringStore.TranslateText(__instance.text); +// __instance.text_shadow = StringStore.TranslateText(__instance.text_shadow); +// } +// } +//} diff --git a/MelonLoader/Patches/Modes/Odyssey/TravelStore_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/TravelStore_Patch.cs new file mode 100644 index 0000000..9de6677 --- /dev/null +++ b/MelonLoader/Patches/Modes/Odyssey/TravelStore_Patch.cs @@ -0,0 +1,70 @@ +//using HarmonyLib; +//using Il2Cpp; +//using Il2CppTMPro; +//using PvZ_Fusion_Translator.AssetStore; +//using static PvZ_Fusion_Translator.Patches.Modes.Odyssey.TravelMgr_Patch; +//using UnityEngine; + +//namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey +//{ +// [HarmonyPatch(typeof(TravelStore))] +// public static class TravelStore_Patch +// { +// [HarmonyPatch(nameof(TravelStore.Update))] +// [HarmonyPostfix] +// private static void Update(TravelStore __instance) +// { +// foreach(TextMeshProUGUI text in __instance.introduces) +// { +// if(__instance.currentSelect != null) +// { +// var buffList = translatedTravelBuffs[buffLinks[(BuffType)__instance.currentSelect.theBuffType]]; +// if(__instance.currentSelect.theBuffNumber < buffList.Count && __instance.currentSelect.theBuffNumber > -1) +// { +// text.text = buffList[__instance.currentSelect.theBuffNumber]; +// } +// else +// { +// text.text = StringStore.TranslateText(text.text); +// } +// } +// } +// foreach (var textMesh in __instance.points) +// { +// textMesh.text = StringStore.TranslateText(textMesh.text); +// } +// } + +// [HarmonyPatch(nameof(TravelStore.RefreshBuff))] +// [HarmonyPostfix] +// private static void RefreshBuff(TravelStore __instance) +// { +// foreach (TravelBuff buff in __instance.travelBuffs) +// { +// TextMeshProUGUI cost = buff.transform.GetChild(1).GetComponent(); +// cost.text = StringStore.TranslateText(cost.text); +// cost.font = FontStore.LoadTMPFont(Utils.Language.ToString()); +// } + +// foreach (TextMeshProUGUI text in __instance.introduces) +// { +// if (__instance.currentSelect != null) +// { +// var buffList = translatedTravelBuffs[buffLinks[(BuffType)__instance.currentSelect.theBuffType]]; +// if (__instance.currentSelect.theBuffNumber < buffList.Count && __instance.currentSelect.theBuffNumber > -1) +// { +// text.text = buffList[__instance.currentSelect.theBuffNumber]; +// } +// else +// { +// text.text = StringStore.TranslateText(text.text); +// } +// } +// } +// foreach (var textMesh in __instance.points) +// { +// textMesh.text = StringStore.TranslateText(textMesh.text); +// } +// } +// } +//} diff --git a/MelonLoader/Patches/GameObjects/AdvantureEvolutionMenu_Patch.cs b/MelonLoader/Patches/Modes/Starbound/AdvantureEvolutionMenu_Patch.cs similarity index 98% rename from MelonLoader/Patches/GameObjects/AdvantureEvolutionMenu_Patch.cs rename to MelonLoader/Patches/Modes/Starbound/AdvantureEvolutionMenu_Patch.cs index 30399e7..e2176fc 100644 --- a/MelonLoader/Patches/GameObjects/AdvantureEvolutionMenu_Patch.cs +++ b/MelonLoader/Patches/Modes/Starbound/AdvantureEvolutionMenu_Patch.cs @@ -4,7 +4,7 @@ using Il2CppTMPro; using PvZ_Fusion_Translator.AssetStore; using UnityEngine; -namespace PvZ_Fusion_Translator.Patches.GameObjects +namespace PvZ_Fusion_Translator.Patches.Modes.Starbound { [HarmonyPatch(typeof(AdvantureEvolutionMenu))] public static class AdvantureEvolutionMenu_Patch diff --git a/MelonLoader/Patches/GameObjects/AdvantureHelpMenu_Patch.cs b/MelonLoader/Patches/Modes/Starbound/AdvantureHelpMenu_Patch.cs similarity index 91% rename from MelonLoader/Patches/GameObjects/AdvantureHelpMenu_Patch.cs rename to MelonLoader/Patches/Modes/Starbound/AdvantureHelpMenu_Patch.cs index 80a540d..4f9751f 100644 --- a/MelonLoader/Patches/GameObjects/AdvantureHelpMenu_Patch.cs +++ b/MelonLoader/Patches/Modes/Starbound/AdvantureHelpMenu_Patch.cs @@ -3,7 +3,7 @@ using Il2Cpp; using Il2CppTMPro; using PvZ_Fusion_Translator.AssetStore; -namespace PvZ_Fusion_Translator.Patches.GameObjects +namespace PvZ_Fusion_Translator.Patches.Modes.Starbound { [HarmonyPatch(typeof(AdvantureHelpMenu))] public static class AdvantureHelpMenu_Patch diff --git a/MelonLoader/Patches/GameObjects/AdvantureMenu2_Patch.cs b/MelonLoader/Patches/Modes/Starbound/AdvantureMenu2_Patch.cs similarity index 93% rename from MelonLoader/Patches/GameObjects/AdvantureMenu2_Patch.cs rename to MelonLoader/Patches/Modes/Starbound/AdvantureMenu2_Patch.cs index 2c46df7..46814ba 100644 --- a/MelonLoader/Patches/GameObjects/AdvantureMenu2_Patch.cs +++ b/MelonLoader/Patches/Modes/Starbound/AdvantureMenu2_Patch.cs @@ -3,7 +3,7 @@ using Il2Cpp; using Il2CppTMPro; using PvZ_Fusion_Translator.AssetStore; -namespace PvZ_Fusion_Translator.Patches.GameObjects +namespace PvZ_Fusion_Translator.Patches.Modes.Starbound { [HarmonyPatch(typeof(AdvantureMenu2))] public static class AdvantureMenu2_Patch diff --git a/MelonLoader/Patches/GameObjects/AdvantureMenu_Patch.cs b/MelonLoader/Patches/Modes/Starbound/AdvantureMenu_Patch.cs similarity index 97% rename from MelonLoader/Patches/GameObjects/AdvantureMenu_Patch.cs rename to MelonLoader/Patches/Modes/Starbound/AdvantureMenu_Patch.cs index de0459d..91c593b 100644 --- a/MelonLoader/Patches/GameObjects/AdvantureMenu_Patch.cs +++ b/MelonLoader/Patches/Modes/Starbound/AdvantureMenu_Patch.cs @@ -3,7 +3,7 @@ using Il2Cpp; using Il2CppTMPro; using PvZ_Fusion_Translator.AssetStore; -namespace PvZ_Fusion_Translator.Patches.GameObjects +namespace PvZ_Fusion_Translator.Patches.Modes.Starbound { [HarmonyPatch(typeof(AdvantureMenu))] public static class AdvantureMenu_Patch diff --git a/MelonLoader/Patches/GameObjects/AdvantureMissionMenu_Patch.cs b/MelonLoader/Patches/Modes/Starbound/AdvantureMissionMenu_Patch.cs similarity index 97% rename from MelonLoader/Patches/GameObjects/AdvantureMissionMenu_Patch.cs rename to MelonLoader/Patches/Modes/Starbound/AdvantureMissionMenu_Patch.cs index bb23854..2aac117 100644 --- a/MelonLoader/Patches/GameObjects/AdvantureMissionMenu_Patch.cs +++ b/MelonLoader/Patches/Modes/Starbound/AdvantureMissionMenu_Patch.cs @@ -3,7 +3,7 @@ using Il2Cpp; using Il2CppTMPro; using PvZ_Fusion_Translator.AssetStore; -namespace PvZ_Fusion_Translator.Patches.GameObjects +namespace PvZ_Fusion_Translator.Patches.Modes.Starbound { [HarmonyPatch(typeof(AdvantureMissionMenu))] public static class AdvantureMissionMenu_Patch diff --git a/MelonLoader/Patches/GameObjects/AdvantureStarMenu_Patch.cs b/MelonLoader/Patches/Modes/Starbound/AdvantureStarMenu_Patch.cs similarity index 97% rename from MelonLoader/Patches/GameObjects/AdvantureStarMenu_Patch.cs rename to MelonLoader/Patches/Modes/Starbound/AdvantureStarMenu_Patch.cs index 9af61ce..2b8c4b1 100644 --- a/MelonLoader/Patches/GameObjects/AdvantureStarMenu_Patch.cs +++ b/MelonLoader/Patches/Modes/Starbound/AdvantureStarMenu_Patch.cs @@ -3,7 +3,7 @@ using Il2Cpp; using Il2CppTMPro; using PvZ_Fusion_Translator.AssetStore; -namespace PvZ_Fusion_Translator.Patches.GameObjects +namespace PvZ_Fusion_Translator.Patches.Modes.Starbound { [HarmonyPatch(typeof(AdvantureStarMenu))] public static class AdvantureStarMenu_Patch diff --git a/MelonLoader/PvZ Fusion Translator [MelonLoader].csproj b/MelonLoader/PvZ Fusion Translator [MelonLoader].csproj index 4d83fe5..c463798 100644 --- a/MelonLoader/PvZ Fusion Translator [MelonLoader].csproj +++ b/MelonLoader/PvZ Fusion Translator [MelonLoader].csproj @@ -13,7 +13,7 @@ latest enable Debug;DebugEnglish;ReleaseMulti;ReleaseEnglish;DebugTesting;ReleaseOther;DebugObfuscate;ReleaseObfuscate - C:\Users\rainb\Desktop\PC_PVZ-Fusion_3.3.1 + C:\Users\rainb\Desktop\PC_PVZ-Fusion_3.4.1 AnyCPU;ARM64;x64 @@ -475,12 +475,12 @@ - + - + - + @@ -488,11 +488,11 @@ - + - + @@ -518,10 +518,10 @@ - - - - + + + +