Procházet zdrojové kódy

change error on SetText failure, disable IMGUI by default

Scrublord1336 před 6 roky
rodič
revize
92c089435f

+ 3 - 1
CHANGELOG.md

@@ -1,7 +1,9 @@
 ### 2.8.0
  * Fixed whitespace handling to honor configuration more appropriately
- * IMGUI enabled by default, now supports numbers in translated texts
+ * Support for IMGUI translation texts with numbers
  * Support for overwriting IMGUI hook events
+ * IMGUI is still disabled by default. Often other mods UI are implemented in IMGUI. Enabling it will allow those UIs to be translated as well. 
+  - Simply change the config, such that: EnableIMGUI=True
 
 ### 2.7.0
  * Additional installation instructions for standalone installation through ReiPatcher

+ 1 - 1
README.md

@@ -36,7 +36,7 @@ OutputFile=Translation\_AutoGeneratedTranslations.{lang}.txt   ;File to insert g
 EnableUGUI=True                  ;Enable or disable UGUI translation
 EnableNGUI=True                  ;Enable or disable NGUI translation
 EnableTextMeshPro=True           ;Enable or disable TextMeshProp translation
-EnableIMGUI=True                 ;Enable of disable IMGUI translation
+EnableIMGUI=False                ;Enable of disable IMGUI translation
 AllowPluginHookOverride=True     ;Allow other text translation plugins to override this plugin's hooks
 
 [Behaviour]

+ 3 - 3
src/XUnity.AutoTranslator.Plugin.Core/AutoTranslationPlugin.cs

@@ -402,7 +402,7 @@ namespace XUnity.AutoTranslator.Plugin.Core
             }
             catch( Exception e )
             {
-               Console.WriteLine( "[XUnity.AutoTranslator][ERROR]: An error occurred while setting text on a component." + Environment.NewLine + e );
+               Console.WriteLine( "[XUnity.AutoTranslator][WARN]: An error occurred while setting text on a component. This is likely happened due to a scene change." + Environment.NewLine + e );
             }
             finally
             {
@@ -530,8 +530,8 @@ namespace XUnity.AutoTranslator.Plugin.Core
                      StartCoroutine(
                         WaitForTextStablization(
                            ui: ui,
-                           delay: 0.5f,
-                           maxTries: 100, // 100 tries == 50 seconds
+                           delay: 1.2f,
+                           maxTries: 50, // 50 tries, about 1 minute
                            currentTries: 0,
                            onMaxTriesExceeded: () =>
                            {

+ 1 - 1
src/XUnity.AutoTranslator.Plugin.Core/Configuration/Settings.cs

@@ -77,7 +77,7 @@ namespace XUnity.AutoTranslator.Plugin.Core.Configuration
          TranslationDirectory = Config.Current.Preferences[ "Files" ][ "Directory" ].GetOrDefault( @"Translation" );
          OutputFile = Config.Current.Preferences[ "Files" ][ "OutputFile" ].GetOrDefault( @"Translation\_AutoGeneratedTranslations.{lang}.txt" );
 
-         EnableIMGUI = Config.Current.Preferences[ "TextFrameworks" ][ "EnableIMGUI" ].GetOrDefault( true );
+         EnableIMGUI = Config.Current.Preferences[ "TextFrameworks" ][ "EnableIMGUI" ].GetOrDefault( false );
          EnableUGUI = Config.Current.Preferences[ "TextFrameworks" ][ "EnableUGUI" ].GetOrDefault( true );
          EnableNGUI = Config.Current.Preferences[ "TextFrameworks" ][ "EnableNGUI" ].GetOrDefault( true );
          EnableTextMeshPro = Config.Current.Preferences[ "TextFrameworks" ][ "EnableTextMeshPro" ].GetOrDefault( true );