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)