Преглед на файлове

removed DeleteUnmodifiedTextures config

randoman преди 6 години
родител
ревизия
f5c3ca2d35
променени са 3 файла, в които са добавени 15 реда и са изтрити 19 реда
  1. 1 5
      README.md
  2. 12 12
      src/XUnity.AutoTranslator.Plugin.Core/AutoTranslationPlugin.cs
  3. 2 2
      src/XUnity.AutoTranslator.Plugin.Core/Configuration/Settings.cs

+ 1 - 5
README.md

@@ -83,7 +83,6 @@ EnableTextureDumping=False       ;Indicates whether the plugin will dump texture
 EnableTextureToggling=False      ;Indicates whether or not toggle the translation with the ALT+T hotkey will also affect textures. Not guaranteed to work for all textures. Has significant performance impact
 EnableTextureScanOnSceneLoad=True ;Indicates whether or not the plugin should scan for textures on scene load. This enables the plugin to find and (possibly) replace more texture
 LoadUnmodifiedTextures=False     ;Indicates whether or not unmodified textures should be loaded. Modifications are determined based on the hash in the file name. Only enable this for debugging purposes as it is likely to cause oddities
-DeleteUnmodifiedTextures=False   ;Indicates whether or not unmodified texture files should be deleted. Useful for cleaninig up the TextureDirectory
 TextureHashGenerationStrategy=FromImageName ;Indicates how the mod identifies pictures through hashes. Can be ["FromImageName", "FromImageData", "FromImageNameThenData"]
 
 [Http]
@@ -211,7 +210,6 @@ EnableTextureDumping=False
 EnableTextureToggling=False
 EnableTextureScanOnSceneLoad=True
 LoadUnmodifiedTextures=False
-DeleteUnmodifiedTextures=False
 TextureHashGenerationStrategy=FromImageName
 ```
 
@@ -225,8 +223,6 @@ TextureHashGenerationStrategy=FromImageName
 
 `LoadUnmodifiedTextures` enables whether or not the plugin should load textures that has not been modified. This is only useful for debugging, and likely to cause various visual glitches, especially if `EnableTextureScanOnSceneLoad` is also enabled. **NEVER REDISTRIBUTE THIS MOD WITH THIS ENABLED.**
 
-`DeleteUnmodifiedTextures` enables whether or not the plugin should delete texture files that has not been modified. This is useful for cleaning up the `TextureDirectory` after image translation, such that no unmodified images are distributed. **NEVER REDISTRIBUTE THIS MOD WITH THIS ENABLED.**
-
 `EnableTextureToggling` enables whether the ALT+T hotkey will also toggle textures. This is by no means guaranteed to work, especially if `EnableTextureScanOnSceneLoad` is also enabled. **NEVER REDISTRIBUTE THIS MOD WITH THIS ENABLED.**
 
 `TextureHashGenerationStrategy` specifies how images are identified. When images are stored, the game will need some way of associating them with the image that it has to replace.
@@ -244,7 +240,7 @@ If you redistribute this mod with translated images, it is recommended you delet
 You can also change the file name to whatever you desire, as long as you keep the hash appended to the end of the file name.
 
 If you take anything away from this section, it should be these two points:
- * **NEVER REDISTRIBUTE THIS MOD WITH `EnableTextureDumping=True`, `EnableTextureToggling=True`, `LoadUnmodifiedTextures=True` OR `DeleteUnmodifiedTextures=True`**
+ * **NEVER REDISTRIBUTE THIS MOD WITH `EnableTextureDumping=True`, `EnableTextureToggling=True` OR `LoadUnmodifiedTextures=True`**
  * **ONLY REDISTRIBUTE THIS MOD WITH `TextureHashGenerationStrategy=FromImageData|FromImageNameThenData` ENABLED IF ABSOLUTELY REQUIRED BY THE GAME.**
 
 ### Technical details about Hash Generation in file names

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

@@ -378,18 +378,18 @@ namespace XUnity.AutoTranslator.Plugin.Core
                Logger.Current.Warn( $"Image not loaded (unmodified): {fullFileName}." );
             }
 
-            if( Settings.DeleteUnmodifiedTextures && !isModified )
-            {
-               try
-               {
-                  File.Delete( fullFileName );
-                  Logger.Current.Warn( $"Image deleted (unmodified): {fullFileName}." );
-               }
-               catch( Exception e )
-               {
-                  Logger.Current.Warn( e, $"An error occurred while trying to delete unmodified image: {fullFileName}." );
-               }
-            }
+            //if( Settings.DeleteUnmodifiedTextures && !isModified )
+            //{
+            //   try
+            //   {
+            //      File.Delete( fullFileName );
+            //      Logger.Current.Warn( $"Image deleted (unmodified): {fullFileName}." );
+            //   }
+            //   catch( Exception e )
+            //   {
+            //      Logger.Current.Warn( e, $"An error occurred while trying to delete unmodified image: {fullFileName}." );
+            //   }
+            //}
          }
          else
          {

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

@@ -85,7 +85,7 @@ namespace XUnity.AutoTranslator.Plugin.Core.Configuration
       public static bool EnableTextureToggling;
       public static bool EnableTextureScanOnSceneLoad;
       public static bool LoadUnmodifiedTextures;
-      public static bool DeleteUnmodifiedTextures;
+      //public static bool DeleteUnmodifiedTextures;
       public static TextureHashGenerationStrategy TextureHashGenerationStrategy;
 
       public static bool CopyToClipboard;
@@ -147,7 +147,7 @@ namespace XUnity.AutoTranslator.Plugin.Core.Configuration
          EnableTextureToggling = Config.Current.Preferences[ "Texture" ][ "EnableTextureToggling" ].GetOrDefault( false );
          EnableTextureScanOnSceneLoad = Config.Current.Preferences[ "Texture" ][ "EnableTextureScanOnSceneLoad" ].GetOrDefault( false );
          LoadUnmodifiedTextures = Config.Current.Preferences[ "Texture" ][ "LoadUnmodifiedTextures" ].GetOrDefault( false );
-         DeleteUnmodifiedTextures = Config.Current.Preferences[ "Texture" ][ "DeleteUnmodifiedTextures" ].GetOrDefault( false );
+         //DeleteUnmodifiedTextures = Config.Current.Preferences[ "Texture" ][ "DeleteUnmodifiedTextures" ].GetOrDefault( false );
          TextureHashGenerationStrategy = Config.Current.Preferences[ "Texture" ][ "TextureHashGenerationStrategy" ].GetOrDefault( TextureHashGenerationStrategy.FromImageName );
 
          // special handling because of enum parsing