diff --git a/Assets/Scripts/Common/EditorVersion.cs b/Assets/Scripts/Common/EditorVersion.cs index e7f8b55e..752fc892 100644 --- a/Assets/Scripts/Common/EditorVersion.cs +++ b/Assets/Scripts/Common/EditorVersion.cs @@ -17,8 +17,8 @@ public class EditorVersion : MonoBehaviour public const double VersionOffset = -0.001f; // Prerelease #else //Release - public const string EditorBuildTag = ""; - //public const string EditorBuildTag = "HF1"; // Hotfix + //public const string EditorBuildTag = ""; + public const string EditorBuildTag = "HF1"; // Hotfix public const float VersionOffset = 0f; // Release #endif diff --git a/Assets/Scripts/Ozone SCMAP Code/EnvPaths.cs b/Assets/Scripts/Ozone SCMAP Code/EnvPaths.cs index 8d6c11cd..b90171d7 100644 --- a/Assets/Scripts/Ozone SCMAP Code/EnvPaths.cs +++ b/Assets/Scripts/Ozone SCMAP Code/EnvPaths.cs @@ -57,7 +57,6 @@ public static bool GamedataExist { get { - Debug.Log(GamedataPath); return System.IO.Directory.Exists(GamedataPath); } } diff --git a/Assets/Scripts/Ozone SCMAP Code/GetGamedataFile/GetGamedataFile_Bytes.cs b/Assets/Scripts/Ozone SCMAP Code/GetGamedataFile/GetGamedataFile_Bytes.cs index 0488e3c2..f03d0b76 100644 --- a/Assets/Scripts/Ozone SCMAP Code/GetGamedataFile/GetGamedataFile_Bytes.cs +++ b/Assets/Scripts/Ozone SCMAP Code/GetGamedataFile/GetGamedataFile_Bytes.cs @@ -147,7 +147,6 @@ public static string[] GetFilesInPath(string path) return files.ToArray(); } - static bool Init = false; static void Initialize() diff --git a/Assets/Scripts/Ozone SCMAP Code/ScmapEditor.cs b/Assets/Scripts/Ozone SCMAP Code/ScmapEditor.cs index 2de2a23f..afe03f89 100644 --- a/Assets/Scripts/Ozone SCMAP Code/ScmapEditor.cs +++ b/Assets/Scripts/Ozone SCMAP Code/ScmapEditor.cs @@ -548,7 +548,8 @@ void GenerateArrays() { if(!Textures[i + 1].Albedo.isReadable) { - Debug.LogWarning("Assigned albedo texture is not readable! " + Textures[i + 1].AlbedoPath); + if(Textures[i + 1].Albedo != Texture2D.whiteTexture) + Debug.LogWarning("Assigned albedo texture is not readable! " + Textures[i + 1].AlbedoPath); continue; } diff --git a/Assets/Scripts/UI/ResourceBrowser/ResourceBrowser.cs b/Assets/Scripts/UI/ResourceBrowser/ResourceBrowser.cs index 8151b5a1..eff411b5 100644 --- a/Assets/Scripts/UI/ResourceBrowser/ResourceBrowser.cs +++ b/Assets/Scripts/UI/ResourceBrowser/ResourceBrowser.cs @@ -69,7 +69,7 @@ public static bool IsProp() public int LastLoadedType; //Local - List LoadedEnvPaths = new List(); + List LoadedEnvPaths = new List(24); const string LocalPath = "env/"; static string[] CategoryPaths = new string[] { "layers/", "splats/", "decals/", "Props/" }; string SelectedObject = ""; @@ -127,7 +127,7 @@ void ReadAllFolders() EnvType.ClearOptions(); - LoadedEnvPaths = new List(); + LoadedEnvPaths.Clear(); List NewOptions = new List(); if (!EnvPaths.GamedataExist) @@ -222,6 +222,7 @@ void ReadAllFolders() string[] files = GetGamedataFile.GetFilesInPath("env/"); + char Separator = '/'; for (int f = 0; f < files.Length; f++) { string LocalName = files[f].Replace("env/", ""); @@ -229,21 +230,10 @@ void ReadAllFolders() if (string.IsNullOrEmpty(LocalName)) continue; - int ContSeparators = 0; - char Separator = ("/")[0]; - for (int i = 0; i < LocalName.Length; i++) - { - if (LocalName[i] == Separator) - { - ContSeparators++; - if (ContSeparators > 1) - break; - } - } - if (ContSeparators > 1) - continue; + LocalName = LocalName.Split(Separator)[0]; - LocalName = LocalName.Replace("/", ""); + if (LoadedEnvPaths.Contains(LocalName)) + continue; LoadedEnvPaths.Add(LocalName); Dropdown.OptionData NewOptionInstance = new Dropdown.OptionData(LocalName); @@ -291,10 +281,7 @@ public void LoadStratumTexture(string path) int LastEnvType = EnvType.value; CustomLoading = true; - //Debug.Log ("Load browser for: " + path); string BeginPath = path; - //SRect.normalizedPosition = Vector2.zero; - path = path.Replace("env/", ""); @@ -506,19 +493,18 @@ IEnumerator GenerateList() SizeFitter.enabled = true; LastLoadedType = Category.value; - if (LoadedEnvPaths[EnvType.value] == CurrentMapFolderPath) { if (MapLuaParser.IsMapLoaded) { string LoadPath = MapLuaParser.LoadedMapFolderPath + "env/" + CategoryPaths[LastLoadedType]; - Debug.Log("Try load assets from: " + LoadPath); + //Debug.Log("Try load assets from: " + LoadPath); if (Directory.Exists(LoadPath)) { string[] AllFiles = Directory.GetFiles(LoadPath, "*", SearchOption.AllDirectories); - Debug.Log("Found " + AllFiles.Length + " files in map folder"); + //Debug.Log("Found " + AllFiles.Length + " files in map folder"); for (int i = 0; i < AllFiles.Length; i++) { @@ -564,7 +550,7 @@ IEnumerator GenerateList() if (LastLoadedType == 3) { int Count = EditMap.PropsInfo.AllPropsTypes.Count; - Debug.Log("Found props: " + Count); + //Debug.Log("Found props: " + Count); for (int i = 0; i < Count; i++) { @@ -688,17 +674,17 @@ IEnumerator GenerateList() SelectedDirectory = ("env/" + EnvType.options[EnvType.value].text + "/" + CategoryPaths[LastLoadedType]).ToLower(); - string[] files = GetGamedataFile.GetFilesInPath("SelectedDirectory"); + string[] files = GetGamedataFile.GetFilesInPath(SelectedDirectory); bool Breaked = false; for (int f = 0; f < files.Length; f++) { - string LocalName = files[f].Replace("env/", ""); + string LocalName = files[f]; if (!IsProperFile(LocalName)) continue; - if (LoadZipEntry(files[f], out Breaked)) + if (LoadZipEntry(LocalName, out Breaked)) { continue; } @@ -743,7 +729,6 @@ bool LoadZipEntry(string localPath, out bool Breaked) { string LocalName = localPath.Remove(0, LocalPath.Length); - LoadAtPath(localPath, LocalName); } return false; @@ -752,20 +737,19 @@ bool LoadZipEntry(string localPath, out bool Breaked) bool IsProperFile(string LocalName) { LocalName = LocalName.ToLower(); - if (!LocalName.StartsWith(SelectedDirectory)) return false; switch (Category.value) { case 0: - return LocalName.ToLower().EndsWith(".dds"); + return LocalName.EndsWith(".dds"); case 1: - return LocalName.ToLower().EndsWith(".dds"); + return LocalName.EndsWith(".dds"); case 2: - return LocalName.ToLower().EndsWith(".dds"); + return LocalName.EndsWith(".dds"); case 3: - return LocalName.ToLower().EndsWith(".bp"); + return LocalName.EndsWith(".bp"); } return false; }