Skip to content

Commit

Permalink
v0.702 Hotfix1
Browse files Browse the repository at this point in the history
  • Loading branch information
ozonexo3 committed Mar 20, 2021
1 parent 10fe3fa commit 481bc8d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 37 deletions.
4 changes: 2 additions & 2 deletions Assets/Scripts/Common/EditorVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion Assets/Scripts/Ozone SCMAP Code/EnvPaths.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public static bool GamedataExist
{
get
{
Debug.Log(GamedataPath);
return System.IO.Directory.Exists(GamedataPath);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ public static string[] GetFilesInPath(string path)
return files.ToArray();
}


static bool Init = false;

static void Initialize()
Expand Down
3 changes: 2 additions & 1 deletion Assets/Scripts/Ozone SCMAP Code/ScmapEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
48 changes: 16 additions & 32 deletions Assets/Scripts/UI/ResourceBrowser/ResourceBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static bool IsProp()
public int LastLoadedType;

//Local
List<string> LoadedEnvPaths = new List<string>();
List<string> LoadedEnvPaths = new List<string>(24);
const string LocalPath = "env/";
static string[] CategoryPaths = new string[] { "layers/", "splats/", "decals/", "Props/" };
string SelectedObject = "";
Expand Down Expand Up @@ -127,7 +127,7 @@ void ReadAllFolders()

EnvType.ClearOptions();

LoadedEnvPaths = new List<string>();
LoadedEnvPaths.Clear();
List<Dropdown.OptionData> NewOptions = new List<Dropdown.OptionData>();

if (!EnvPaths.GamedataExist)
Expand Down Expand Up @@ -222,28 +222,18 @@ void ReadAllFolders()

string[] files = GetGamedataFile.GetFilesInPath("env/");

char Separator = '/';
for (int f = 0; f < files.Length; f++)
{
string LocalName = files[f].Replace("env/", "");

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);
Expand Down Expand Up @@ -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/", "");

Expand Down Expand Up @@ -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++)
{
Expand Down Expand Up @@ -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++)
{
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -743,7 +729,6 @@ bool LoadZipEntry(string localPath, out bool Breaked)
{
string LocalName = localPath.Remove(0, LocalPath.Length);


LoadAtPath(localPath, LocalName);
}
return false;
Expand All @@ -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;
}
Expand Down

0 comments on commit 481bc8d

Please sign in to comment.