public static void InstallTextAssetHooks() { try { HookingHelper.PatchAll(TextAssetHooks.All, Settings.ForceMonoModHooks); } catch (Exception e) { XuaLogger.AutoTranslator.Error(e, "An error occurred while setting up text asset hooks."); } }
public static void InstallTextGetterCompatHooks() { try { if (Settings.TextGetterCompatibilityMode) { HookingHelper.PatchAll(TextGetterCompatHooks.All, Settings.ForceMonoModHooks); } } catch (Exception e) { XuaLogger.AutoTranslator.Error(e, "An error occurred while setting up text getter compat hooks."); } }
public static void InstallSpriteRendererHooks() { try { if (Settings.EnableSpriteRendererHooking && (Settings.EnableTextureTranslation || Settings.EnableTextureDumping)) { HookingHelper.PatchAll(ImageHooks.SpriteRenderer, Settings.ForceMonoModHooks); } } catch (Exception e) { XuaLogger.AutoTranslator.Error(e, "An error occurred while setting up image hooks."); } }
public static void InstallTextGetterCompatHooks() { try { if (Settings.TextGetterCompatibilityMode) { #if MANAGED HookingHelper.PatchAll(TextGetterCompatHooks.All, Settings.ForceMonoModHooks); #else throw new NotImplementedException("TextGetterCompatibilityMode is not supported in IL2CPP."); #endif } } catch (Exception e) { XuaLogger.AutoTranslator.Error(e, "An error occurred while setting up text getter compat hooks."); } }
public static void InstallComponentBasedPluginTranslationHooks() { if (AutoTranslationPlugin.Current.PluginTextCaches.Count > 0) { if (!_installedPluginTranslationHooks) { _installedPluginTranslationHooks = true; try { HookingHelper.PatchAll(PluginTranslationHooks.All, Settings.ForceMonoModHooks); } catch (Exception e) { XuaLogger.AutoTranslator.Error(e, "An error occurred while setting up hooks for Plugin translations."); } } } }
public static void InstallComponentBasedPluginTranslationHooks() { if (AutoTranslationPlugin.Current.PluginTextCaches.Count > 0) { if (!_installedPluginTranslationHooks) { _installedPluginTranslationHooks = true; try { #if MANAGED HookingHelper.PatchAll(PluginTranslationHooks.All, Settings.ForceMonoModHooks); #else throw new NotImplementedException("Plugin specific hooks are not supported in IL2CPP."); #endif } catch (Exception e) { XuaLogger.AutoTranslator.Error(e, "An error occurred while setting up hooks for Plugin translations."); } } } }
public static void InstallTextHooks() { try { if (Settings.EnableUGUI) { HookingHelper.PatchAll(UGUIHooks.All, Settings.ForceMonoModHooks); } } catch (Exception e) { XuaLogger.AutoTranslator.Error(e, "An error occurred while setting up hooks for UGUI."); } try { if (Settings.EnableTextMeshPro) { HookingHelper.PatchAll(TextMeshProHooks.All, Settings.ForceMonoModHooks); } } catch (Exception e) { XuaLogger.AutoTranslator.Error(e, "An error occurred while setting up hooks for TextMeshPro."); } try { if (Settings.EnableNGUI) { HookingHelper.PatchAll(NGUIHooks.All, Settings.ForceMonoModHooks); } } catch (Exception e) { XuaLogger.AutoTranslator.Error(e, "An error occurred while setting up hooks for NGUI."); } try { if (Settings.EnableIMGUI) { HookingHelper.PatchAll(IMGUIHooks.All, Settings.ForceMonoModHooks); } } catch (Exception e) { XuaLogger.AutoTranslator.Error(e, "An error occurred while setting up hooks for IMGUI."); } try { HookingHelper.PatchAll(UtageHooks.All, Settings.ForceMonoModHooks); } catch (Exception e) { XuaLogger.AutoTranslator.Error(e, "An error occurred while setting up hooks for Utage."); } try { if (Settings.EnableTextMesh) { HookingHelper.PatchAll(TextMeshHooks.All, Settings.ForceMonoModHooks); } } catch (Exception e) { XuaLogger.AutoTranslator.Error(e, "An error occurred while setting up hooks for TextMesh."); } }
public static void InstallTextHooks() { try { if (Settings.EnableUGUI) { HookingHelper.PatchAll(UGUIHooks.All, Settings.ForceMonoModHooks); } } catch (Exception e) { XuaLogger.AutoTranslator.Error(e, "An error occurred while setting up hooks for UGUI."); } try { if (Settings.EnableTextMeshPro) { HookingHelper.PatchAll(TextMeshProHooks.All, Settings.ForceMonoModHooks); if (Settings.DisableTextMeshProScrollInEffects) { HookingHelper.PatchAll(TextMeshProHooks.DisableScrollInTmp, Settings.ForceMonoModHooks); } } } catch (Exception e) { XuaLogger.AutoTranslator.Error(e, "An error occurred while setting up hooks for TextMeshPro."); } try { if (Settings.EnableNGUI) { HookingHelper.PatchAll(NGUIHooks.All, Settings.ForceMonoModHooks); } } catch (Exception e) { XuaLogger.AutoTranslator.Error(e, "An error occurred while setting up hooks for NGUI."); } try { if (Settings.EnableIMGUI) { #if MANAGED HookingHelper.PatchAll(IMGUIHooks.All, Settings.ForceMonoModHooks); #else throw new NotImplementedException("EnableIMGUI is not supported in IL2CPP."); #endif } } catch (Exception e) { XuaLogger.AutoTranslator.Error(e, "An error occurred while setting up hooks for IMGUI."); } try { HookingHelper.PatchAll(UtageHooks.All, Settings.ForceMonoModHooks); } catch (Exception e) { XuaLogger.AutoTranslator.Error(e, "An error occurred while setting up hooks for Utage."); } try { if (Settings.EnableTextMesh) { HookingHelper.PatchAll(TextMeshHooks.All, Settings.ForceMonoModHooks); } } catch (Exception e) { XuaLogger.AutoTranslator.Error(e, "An error occurred while setting up hooks for TextMesh."); } try { if (Settings.EnableFairyGUI) { HookingHelper.PatchAll(FairyGUIHooks.All, Settings.ForceMonoModHooks); } } catch (Exception e) { XuaLogger.AutoTranslator.Error(e, "An error occurred while setting up hooks for FairyGUI."); } }