fixes idk

This commit is contained in:
SillyStar-Github 2025-07-15 00:51:48 -04:00
parent 32e319af0f
commit 790fc4c66c
4 changed files with 28 additions and 1 deletions

View file

@ -3,7 +3,7 @@ using MelonLoader.Utils;
using PvZ_Fusion_Translator.AssetStore;
using UnityEngine;
[assembly: MelonInfo(typeof(PvZ_Fusion_Translator.Core), "PvZ Fusion Translator", "231.0.0", "dynaslash / arifrios1st / lancerx0 / JustNull / Dakosha / Mamoru-kun \ cassidy", null)]
[assembly: MelonInfo(typeof(PvZ_Fusion_Translator.Core), "PvZ Fusion Translator", "231.0.0", "dynaslash / arifrios1st / lancerx0 / JustNull / Dakosha / Mamoru-kun / cassidy", null)]
[assembly: MelonGame("LanPiaoPiao", "PlantsVsZombiesRH")]
namespace PvZ_Fusion_Translator

View file

@ -18,6 +18,7 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects
{
// Convert and translate legacy Text components
Text[] textComponents = __instance.GetComponentsInChildren<Text>(true);
TextMeshProUGUI[] textMeshComponents = __instance.GetComponentsInChildren<TextMeshProUGUI>(true);
foreach (Text textComponent in textComponents)
{
if (textComponent != null && !string.IsNullOrEmpty(textComponent.text))

View file

@ -0,0 +1,25 @@
using HarmonyLib;
using Il2Cpp;
using Il2CppTMPro;
using PvZ_Fusion_Translator.AssetStore;
using UnityEngine;
namespace PvZ_Fusion_Translator.Patches.GameObjects
{
[HarmonyPatch(typeof(ShootingMenu))]
public static class ShootingMenu_Patch
{
[HarmonyPatch(nameof(ShootingMenu.Update))]
[HarmonyPostfix]
private static void Update(ShootingMenu __instance)
{
TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString());
foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren<TextMeshProUGUI>())
{
txt.text = StringStore.TranslateText(txt.text);
txt.font = fontAsset;
}
}
}
}

View file

@ -432,6 +432,7 @@
<Compile Include="Patches\GameObjects\AbyssMenu_Patch.cs" />
<Compile Include="Patches\GameObjects\TowerOption_Patch.cs" />
<Compile Include="Patches\GameObjects\TravelLookBuff_Patch.cs" />
<Compile Include="Patches\GameObjects\ShootingMenu_Patch.cs" />
<Compile Include="Patches\GameObjects\TravelLookMenu_Patch.cs" />
<Compile Include="Patches\Managers\ChessManager_Patch.cs" />
<Compile Include="Patches\Managers\CustomLevelShower_Patch.cs" />