From e7c571771950bfef107f8e273380cc3088da6676 Mon Sep 17 00:00:00 2001 From: SillyStar-Github <90102598+SillyStar-Github@users.noreply.github.com> Date: Sun, 11 May 2025 07:23:11 -0400 Subject: [PATCH] default texture update ??? idk --- MelonLoader/FileLoader.cs | 51 +++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/MelonLoader/FileLoader.cs b/MelonLoader/FileLoader.cs index 84956b7..c2d42ae 100644 --- a/MelonLoader/FileLoader.cs +++ b/MelonLoader/FileLoader.cs @@ -167,34 +167,37 @@ namespace PvZ_Fusion_Translator internal static void LoadDefaultTextures() { - string textureDefaultDir = Path.Combine(Core.Instance.modsDirectory, AssetType.Dumps.ToString(), "Default Textures [Do Not Remove]"); - if (!Directory.Exists(textureDefaultDir)) + if(Utils.customTextures) { - Directory.CreateDirectory(textureDefaultDir); - } - try - { - foreach (string filepath in Directory.EnumerateFiles(textureDefaultDir, "*.png", SearchOption.AllDirectories)) - { + string textureDefaultDir = Path.Combine(Core.Instance.modsDirectory, AssetType.Dumps.ToString(), "Default Textures [Do Not Remove]"); + if (!Directory.Exists(textureDefaultDir)) + { + Directory.CreateDirectory(textureDefaultDir); + } + try + { + foreach (string filepath in Directory.EnumerateFiles(textureDefaultDir, "*.png", SearchOption.AllDirectories)) + { - #if OBFUSCATE - if (CheckSumStore.IsModified(filepath)) - { - Log.LogError("File {0} was modified!" , filepath); - continue; - } - #endif + #if OBFUSCATE + if (CheckSumStore.IsModified(filepath)) + { + Log.LogError("File {0} was modified!" , filepath); + continue; + } + #endif - Texture2D texture2D = Utils.LoadImage(filepath); - TextureStore.textureDict[Path.GetFileNameWithoutExtension(filepath)] = filepath; - } - } + Texture2D texture2D = Utils.LoadImage(filepath); + TextureStore.textureDict[Path.GetFileNameWithoutExtension(filepath)] = filepath; + } + } - catch (Exception e) - { - Log.LogError("Error loading Texture."); - Log.LogError(e.GetType() + " " + e.Message); - } + catch (Exception e) + { + Log.LogError("Error loading Texture."); + Log.LogError(e.GetType() + " " + e.Message); + } + } } internal static void LoadCustomTextures()