public static void SetTextHook(ref string text, object __instance) { if (TranslationHooksEnabled) { text = DynamicTranslator.Translate(text, __instance); } }
public static void TextPropertyHook(ref string value, object __instance) { if (TranslationHooksEnabled) { value = DynamicTranslator.Translate(value, __instance); } }
public static void LoadSpriteHook(ref Image image) { var go = image.gameObject; var path = GameObjectUtils.AbsoluteTransform(go); var scene = go.scene.name; DynamicTranslator.TranslateImage(image, path, scene); }
public static bool SetCursorHook(ref Texture2D texture) { var scene = "Cursors"; DynamicTranslator.RegisterTexture(texture, string.Empty, scene); DynamicTranslator.ReplaceTexture(texture, string.Empty, scene); return(true); }
public static void DoSpriteSwapHook(ref Selectable __instance, ref Sprite newSprite) { if (newSprite == null) { newSprite = __instance.image.sprite; } var go = __instance.gameObject; var path = GameObjectUtils.AbsoluteTransform(go); var scene = go.scene.name; DynamicTranslator.RegisterTexture(newSprite, path, scene); DynamicTranslator.ReplaceTexture(ref newSprite, path, scene); }
public static bool RegisterGraphicForCanvasHook(ref Canvas c, ref Graphic graphic) { if (graphic) { var go = graphic.gameObject; if (go == null) { return(true); } DynamicTranslator.TranslateComponents(go); } return(true); }
public static void SetTextHook3(ref string text, object __instance) { if (TranslationHooksEnabled) { TranslationHooksEnabled = false; try { text = DynamicTranslator.Translate(text, __instance); } finally { TranslationHooksEnabled = true; } } }
public static void SetTextHook2(ref StringBuilder text, object __instance) { if (TranslationHooksEnabled) { TranslationHooksEnabled = false; try { text = new StringBuilder(DynamicTranslator.Translate(text.ToString(), __instance)); } finally { TranslationHooksEnabled = true; } } }
public static void TextPropertyHook2(ref string value, object __instance) { if (TranslationHooksEnabled) { TranslationHooksEnabled = false; try { value = DynamicTranslator.Translate(value, __instance); } finally { TranslationHooksEnabled = true; } } }
public static void OnEnableHook(Text __instance) { if (TranslationHooksEnabled) { TranslationHooksEnabled = false; try { var newText = DynamicTranslator.Translate(__instance.text, __instance); if (newText != null) { __instance.text = newText; } } finally { TranslationHooksEnabled = true; } } }
public static void SetTextHook(ref string text) { text = DynamicTranslator.Translate(text); }
public static void TextPropertyHook(ref string value) { value = DynamicTranslator.Translate(value); }