default texture update ??? idk
This commit is contained in:
parent
e3e1bdac94
commit
e7c5717719
1 changed files with 27 additions and 24 deletions
|
|
@ -167,34 +167,37 @@ namespace PvZ_Fusion_Translator
|
||||||
|
|
||||||
internal static void LoadDefaultTextures()
|
internal static void LoadDefaultTextures()
|
||||||
{
|
{
|
||||||
string textureDefaultDir = Path.Combine(Core.Instance.modsDirectory, AssetType.Dumps.ToString(), "Default Textures [Do Not Remove]");
|
if(Utils.customTextures)
|
||||||
if (!Directory.Exists(textureDefaultDir))
|
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(textureDefaultDir);
|
string textureDefaultDir = Path.Combine(Core.Instance.modsDirectory, AssetType.Dumps.ToString(), "Default Textures [Do Not Remove]");
|
||||||
}
|
if (!Directory.Exists(textureDefaultDir))
|
||||||
try
|
{
|
||||||
{
|
Directory.CreateDirectory(textureDefaultDir);
|
||||||
foreach (string filepath in Directory.EnumerateFiles(textureDefaultDir, "*.png", SearchOption.AllDirectories))
|
}
|
||||||
{
|
try
|
||||||
|
{
|
||||||
|
foreach (string filepath in Directory.EnumerateFiles(textureDefaultDir, "*.png", SearchOption.AllDirectories))
|
||||||
|
{
|
||||||
|
|
||||||
#if OBFUSCATE
|
#if OBFUSCATE
|
||||||
if (CheckSumStore.IsModified(filepath))
|
if (CheckSumStore.IsModified(filepath))
|
||||||
{
|
{
|
||||||
Log.LogError("File {0} was modified!" , filepath);
|
Log.LogError("File {0} was modified!" , filepath);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Texture2D texture2D = Utils.LoadImage(filepath);
|
Texture2D texture2D = Utils.LoadImage(filepath);
|
||||||
TextureStore.textureDict[Path.GetFileNameWithoutExtension(filepath)] = filepath;
|
TextureStore.textureDict[Path.GetFileNameWithoutExtension(filepath)] = filepath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.LogError("Error loading Texture.");
|
Log.LogError("Error loading Texture.");
|
||||||
Log.LogError(e.GetType() + " " + e.Message);
|
Log.LogError(e.GetType() + " " + e.Message);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void LoadCustomTextures()
|
internal static void LoadCustomTextures()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue