mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-23 04:12:12 +00:00
Merge remote-tracking branch 'udb/master'
This commit is contained in:
commit
a1658c66b3
4 changed files with 64 additions and 16 deletions
|
@ -77,7 +77,7 @@ let newtag = UDB.Map.getNewTag();
|
||||||
|
|
||||||
// Set the action, arg, and tag of both lines
|
// Set the action, arg, and tag of both lines
|
||||||
lines[0].action = lines[1].action = 301; // Line_QuickPortal
|
lines[0].action = lines[1].action = 301; // Line_QuickPortal
|
||||||
lines[0].args[0] = lines[1].args[0] = 0;
|
for(let i=0; i <= 4; i++) lines[0].args[i] = lines[1].args[i] = 0;
|
||||||
lines[0].tag = lines[1].tag = newtag;
|
lines[0].tag = lines[1].tag = newtag;
|
||||||
|
|
||||||
// Draw the sectors behind the portal
|
// Draw the sectors behind the portal
|
||||||
|
|
|
@ -358,8 +358,27 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Find in voxels directory
|
// Find in voxels directory
|
||||||
string path = Path.Combine(VOXELS_DIR, Path.GetDirectoryName(name));
|
string filename = null;
|
||||||
string filename = FindFirstFile(path, Path.GetFileName(name), true);
|
|
||||||
|
// There are different places we have to look for the file, depending on how it was defined. Right now
|
||||||
|
// there's no way to know if the definition comes from VOXELDEF or spreite replacement, so we're assuming
|
||||||
|
// it's from VOXELDEF if there's an extension given.
|
||||||
|
// - Auto-detect for sprite name: must be in the "voxels" directory
|
||||||
|
// - Just given as file name without path in VOXELDEF: must be in the root directory
|
||||||
|
// - Given as full path and file name in VOXELDEF: must be in exactly that spot
|
||||||
|
string path = Path.GetDirectoryName(name);
|
||||||
|
if (string.IsNullOrWhiteSpace(path))
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(Path.GetExtension(name)))
|
||||||
|
filename = FindFirstFile(VOXELS_DIR, Path.GetFileName(name), true);
|
||||||
|
else
|
||||||
|
filename = FindFirstFileWithExt("", Path.GetFileName(name), true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
filename = FindFirstFileWithExt(path, Path.GetFileName(name), false);
|
||||||
|
}
|
||||||
|
|
||||||
if ((filename != null) && FileExists(filename))
|
if ((filename != null) && FileExists(filename))
|
||||||
{
|
{
|
||||||
voxellocation = location.GetDisplayName();
|
voxellocation = location.GetDisplayName();
|
||||||
|
|
|
@ -454,15 +454,42 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
if(voxel != null) return voxel;
|
if(voxel != null) return voxel;
|
||||||
}
|
}
|
||||||
|
|
||||||
string pfilename = name.Replace('\\', '^');
|
name = name.Replace('\\', '^');
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Find in voxels directory
|
||||||
|
string filename = null;
|
||||||
|
|
||||||
|
// There are different places we have to look for the file, depending on how it was defined. Right now
|
||||||
|
// there's no way to know if the definition comes from VOXELDEF or spreite replacement, so we're assuming
|
||||||
|
// it's from VOXELDEF if there's an extension given.
|
||||||
|
// - Auto-detect for sprite name: must be in the "voxels" directory
|
||||||
|
// - Just given as file name without path in VOXELDEF: must be in the root directory
|
||||||
|
// - Given as full path and file name in VOXELDEF: must be in exactly that spot
|
||||||
|
string path = Path.GetDirectoryName(name);
|
||||||
|
if (string.IsNullOrWhiteSpace(path))
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(Path.GetExtension(name)))
|
||||||
|
filename = FindFirstFile(VOXELS_DIR, Path.GetFileName(name), true);
|
||||||
|
else
|
||||||
|
filename = FindFirstFileWithExt("", Path.GetFileName(name), true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
filename = FindFirstFileWithExt(path, Path.GetFileName(name), false);
|
||||||
|
}
|
||||||
|
|
||||||
// Find in sprites directory
|
|
||||||
string filename = FindFirstFile(VOXELS_DIR, pfilename, true);
|
|
||||||
if ((filename != null) && FileExists(filename))
|
if ((filename != null) && FileExists(filename))
|
||||||
{
|
{
|
||||||
voxellocation = location.GetDisplayName();
|
voxellocation = location.GetDisplayName();
|
||||||
return LoadFile(filename);
|
return LoadFile(filename);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
if (!Silent) General.ErrorLogger.Add(ErrorType.Error, e.GetType().Name + " while loading voxel \"" + name + "\" from PK3: " + e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
// Nothing found
|
// Nothing found
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -39,14 +39,16 @@ namespace CodeImp.DoomBuilder.GZBuilder.Models
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//clear unneeded data
|
|
||||||
mde.SkinNames = null;
|
|
||||||
mde.ModelNames = null;
|
|
||||||
|
|
||||||
if (mde.Model.Meshes == null || mde.Model.Meshes.Count == 0)
|
if (mde.Model.Meshes == null || mde.Model.Meshes.Count == 0)
|
||||||
{
|
{
|
||||||
mde.Model = null;
|
mde.Model = null;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//clear unneeded data
|
||||||
|
mde.SkinNames = null;
|
||||||
|
mde.ModelNames = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void LoadModel(ModelData mde, List<DataReader> containers)
|
private static void LoadModel(ModelData mde, List<DataReader> containers)
|
||||||
|
|
Loading…
Reference in a new issue