patching stuff up

This commit is contained in:
SillyStar-Github 2025-05-10 16:31:10 -04:00
parent 07b49647d3
commit 1fbf09289a
3 changed files with 15 additions and 5 deletions

View file

@ -19,7 +19,7 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects
{
TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString());
string regexStr1 = "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n极限模式产出:(\\d+)\n非首胜无额外产出\n产出叶绿素总计:(\\d+)\n";
string regexStr1 = "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n极限模式产出:(\\d+)\n非首胜无额外产出\n产出叶绿素总计:(\\d+)";
string regexStr2 = "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n极限模式产出:(\\d+)\n首胜产出:(\\d+)\n剩余小推车数量:(\\d+),获得叶绿素:(\\d+)\n产出叶绿素总计:(\\d+)";
Regex regex1 = new Regex(regexStr1);

View file

@ -23,6 +23,11 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects
{
StringStore.TranslateTextTransform(moneyTransform);
}
foreach (TextMeshProUGUI text in __instance.points)
{
text.text = StringStore.TranslateText(text.text);
}
}
[HarmonyPatch(nameof(TravelStore.SetText), new Type[] { typeof(string)})]
@ -33,6 +38,11 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects
{
text.text = StringStore.TranslateText(text.text);
}
foreach (TextMeshProUGUI text in __instance.points)
{
text.text = StringStore.TranslateText(text.text);
}
}
}
}

View file

@ -15,8 +15,8 @@ namespace PvZ_Fusion_Translator.Patches.GameObjects
#if MULTI_LANGUAGE
TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString());
string zombieText = StringStore.patchesStore["Zombies"][Utils.Language.ToString()];
__instance.t.text = string.Format(zombieText + " {0}", Board.Instance.enermyCount);
string zombieText = StringStore.TranslateText(__instance.t.text);
__instance.t.text = zombieText;
#else
TMP_FontAsset fontAsset = FontStore.LoadTMPFont();
string zombieText = StringStore.patchesStore["Zombies"]["Spanish"];