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.");
     }
 }
예제 #2
0
 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.");
     }
 }
예제 #3
0
 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.");
     }
 }
예제 #4
0
        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.");
            }
        }
예제 #5
0
 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.");
             }
         }
     }
 }
예제 #6
0
        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.");
                    }
                }
            }
        }
예제 #7
0
        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.");
            }
        }
예제 #8
0
        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.");
            }
        }