From 100b89125cf83bd054c30d50cbd7df059bb431d7 Mon Sep 17 00:00:00 2001 From: Chipseq <108542751+xChipseq@users.noreply.github.com> Date: Thu, 20 Aug 2026 00:34:33 +0200 Subject: [PATCH] fix string ids --- Reactor/Localization/Patches/GetStringPatch.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Reactor/Localization/Patches/GetStringPatch.cs b/Reactor/Localization/Patches/GetStringPatch.cs index aa765c5..4c38913 100644 --- a/Reactor/Localization/Patches/GetStringPatch.cs +++ b/Reactor/Localization/Patches/GetStringPatch.cs @@ -19,6 +19,23 @@ internal static class GetStringPatch return true; } + [HarmonyPatch(typeof(TranslationController), nameof(TranslationController.GetString), typeof(string), typeof(string), typeof(Il2CppReferenceArray))] + [HarmonyPrefix] + public static bool SystemTypesStringPatch( + TranslationController __instance, + string id, + Il2CppReferenceArray parts, + ref string __result) + { + if (!int.TryParse(id, out var intId)) + { + return true; + } + + var stringName = (StringNames) intId; + return !LocalizationManager.TryGetTextFormatted(stringName, parts, out __result); + } + [HarmonyPatch(typeof(TranslationController), nameof(TranslationController.GetString), typeof(SystemTypes))] [HarmonyPrefix] public static bool SystemTypesStringPatch(TranslationController __instance, SystemTypes room, ref string __result)