Merge pull request #7 from Teyliu/cassidy

shoot em up label fix + minor bug fixes
This commit is contained in:
Nanami-Houko 2025-08-11 14:19:43 +08:00 • committed by GitHub
commit 299b41f1ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 54 additions and 5 deletions

View file

@ -50,6 +50,12 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects
textMesh.text = StringStore.TranslateText(textMesh.text);
}
}
foreach(TextMeshProUGUI text in __instance.GetComponentsInChildren<TextMeshProUGUI>())
{
text.text = StringStore.TranslateText(text.text);
text.font = fontAsset;
}
}
[HarmonyPatch(nameof(AbyssMenu2.Start))]
@ -58,7 +64,6 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects
{
UpdateAbyss2Text(__instance);
Utils.ConvertButtonText(__instance.transform, "Goback");
Utils.ConvertButtonText(__instance.transform, "Help");
Utils.ConvertButtonText(__instance.transform, "Bag");
}

View file

@ -26,7 +26,11 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects
txt.font = fontAsset;
}
Utils.ConvertButtonText(__instance.transform, "Goback");
foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren<TextMeshProUGUI>())
{
text.text = StringStore.TranslateText(text.text);
text.font = fontAsset;
}
}
[HarmonyPatch(nameof(AbyssMenu.UpdateLevelInfo))]

View file

@ -116,7 +116,6 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects
foreach (TextMeshProUGUI txt in mainTransform.GetComponentsInChildren<TextMeshProUGUI>())
{
FileLoader.DumpUntranslatedStrings(txt.text);
txt.text = StringStore.TranslateText(txt.text);
}
}

View file

@ -0,0 +1,17 @@
using HarmonyLib;
using Il2Cpp;
using PvZ_Fusion_Translator.AssetStore;
namespace PvZ_Fusion_Translator.Patches.GameObjects
{
[HarmonyPatch(typeof(UIProgress2))]
public static class UIProgress2_Patch
{
[HarmonyPatch(nameof(UIProgress2.Update))]
[HarmonyPostfix]
private static void Update(UIProgress2 __instance)
{
__instance.t.text = StringStore.TranslateText(__instance.t.text);
}
}
}

View file

@ -0,0 +1,22 @@
using HarmonyLib;
using Il2Cpp;
using Il2CppTMPro;
using PvZ_Fusion_Translator.AssetStore;
using UnityEngine;
namespace PvZ_Fusion_Translator.Patches.GameObjects
{
[HarmonyPatch(typeof(TravelBuffMenu))]
public static class TravelBuffMenu_Patch
{
[HarmonyPatch(nameof(TravelBuffMenu.RefeshOptions))]
[HarmonyPostfix]
private static void RefeshOptions(TravelBuffMenu __instance)
{
foreach(TravelBuffOptionButton button in __instance.options)
{
button.introduce.text = StringStore.TranslateText(button.introduce.text);
}
}
}
}

View file

@ -10,7 +10,7 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects
{
[HarmonyPatch(nameof(TravelBuffOptionButton.SetBuff))]
[HarmonyPostfix]
private static void Start(TravelBuffOptionButton __instance)
private static void SetBuff(TravelBuffOptionButton __instance)
{
__instance.introduce.text = StringStore.TranslateText(__instance.introduce.text);
}

View file

@ -13,7 +13,7 @@
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Configurations>Debug;DebugEnglish;ReleaseMulti;ReleaseEnglish;DebugTesting;ReleaseOther;DebugObfuscate;ReleaseObfuscate</Configurations>
<GamePath>C:\Users\rainb\Desktop\PC_PVZ-Fusion-2.8</GamePath>
<GamePath>C:\Users\rainb\Desktop\PC_PVZ-Fusion-2.8.1</GamePath>
<Platforms>AnyCPU;ARM64;x64</Platforms>
</PropertyGroup>
@ -401,6 +401,7 @@
<Compile Include="ModFeatures.cs" />
<Compile Include="AssetStore\AudioStore.cs" />
<Compile Include="Patches\GameObjects\Board_Patch.cs" />
<Compile Include="Patches\GameObjects\MinorObjects\UIProgress2_Patch.cs" />
<Compile Include="Patches\GameObjects\MinorObjects\Jigsaw_Patch.cs" />
<Compile Include="Patches\GameObjects\PlayerShootingWindow_Patch.cs" />
<Compile Include="Patches\GameObjects\PlayerShootingMenu_Patch.cs" />
@ -434,6 +435,7 @@
<Compile Include="Patches\GameObjects\AbyssDevelopMenu_Patch.cs" />
<Compile Include="Patches\GameObjects\AbyssMenu2_Patch.cs" />
<Compile Include="Patches\GameObjects\AbyssMenu_Patch.cs" />
<Compile Include="Patches\GameObjects\TravelBuffMenu_Patch.cs" />
<Compile Include="Patches\GameObjects\TowerUpgradeMenu_Patch.cs" />
<Compile Include="Patches\GameObjects\TowerOption_Patch.cs" />
<Compile Include="Patches\GameObjects\TravelLookBuff_Patch.cs" />