Explorar el Código

changed logic to determine whether or not to templatize by numbers

Scrublord1336 hace 6 años
padre
commit
3434f2c5c2

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

@@ -578,7 +578,7 @@ namespace XUnity.AutoTranslator.Plugin.Core
          if( !string.IsNullOrEmpty( text ) && IsTranslatable( text ) && ShouldTranslate( ui ) && !IsCurrentlySetting( info ) )
          {
             info?.Reset( text );
-            var textKey = new TranslationKey( text, context == null && !supportsStabilization, context != null );
+            var textKey = new TranslationKey( text, ui.IsSpammingComponent(), context != null );
 
 
             // if we already have translation loaded in our _translatios dictionary, simply load it and set text

+ 7 - 0
src/XUnity.AutoTranslator.Plugin.Core/Extensions/ObjectExtensions.cs

@@ -36,6 +36,13 @@ namespace XUnity.AutoTranslator.Plugin.Core.Extensions
             || ( Types.AdvCommand != null && Types.AdvCommand.IsAssignableFrom( type ) );
       }
 
+      public static bool IsSpammingComponent( this object ui )
+      {
+         if( ui == null ) return false;
+
+         return ui is UnityEngine.GUIContent;
+      }
+
       public static TranslationInfo GetTranslationInfo( this object obj, bool isAwakening )
       {
          if( !Settings.EnableObjectTracking ) return null;