mirror of
https://github.com/NuclearPowered/Reactor.git
synced 2026-10-19 15:51:54 +00:00
fix string ids
This commit is contained in:
1 parent
04100970b6
commit
100b89125c
1 file changed
+17
@@ -19,6 +19,23 @@ internal static class GetStringPatch
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HarmonyPatch(typeof(TranslationController), nameof(TranslationController.GetString), typeof(string), typeof(string), typeof(Il2CppReferenceArray<Il2CppSystem.Object>))]
|
||||||
|
[HarmonyPrefix]
|
||||||
|
public static bool SystemTypesStringPatch(
|
||||||
|
TranslationController __instance,
|
||||||
|
string id,
|
||||||
|
Il2CppReferenceArray<Il2CppSystem.Object> 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))]
|
[HarmonyPatch(typeof(TranslationController), nameof(TranslationController.GetString), typeof(SystemTypes))]
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
public static bool SystemTypesStringPatch(TranslationController __instance, SystemTypes room, ref string __result)
|
public static bool SystemTypesStringPatch(TranslationController __instance, SystemTypes room, ref string __result)
|
||||||
|
|||||||
Reference in new issue
Block a user