mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-31 21:00:56 +00:00
Sort TEXTURES into their own category again, take subfolders into account for texture count
This commit is contained in:
parent
a832e73a4a
commit
d42f335948
2 changed files with 13 additions and 9 deletions
|
@ -70,8 +70,8 @@ namespace CodeImp.DoomBuilder.Data
|
|||
|
||||
//mxd
|
||||
SetName(name);
|
||||
this.virtualname = (!string.IsNullOrEmpty(virtualpath) ? virtualpath : "[TEXTURES]") + Path.AltDirectorySeparatorChar + this.name;
|
||||
|
||||
this.virtualname = "[TEXTURES]" + Path.AltDirectorySeparatorChar + (!string.IsNullOrEmpty(virtualpath) ? virtualpath + Path.AltDirectorySeparatorChar : "") + this.name;
|
||||
|
||||
// We have no destructor
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
|
|
@ -341,23 +341,27 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
}
|
||||
|
||||
//mxd
|
||||
private void SetItemsCount(TreeNode node)
|
||||
private int SetItemsCount(TreeNode node)
|
||||
{
|
||||
ResourceTextureSet ts = ((TreeNodeData)node.Tag).Set as ResourceTextureSet;
|
||||
if(ts == null) throw new Exception("Expected ResourceTextureSet, but got null...");
|
||||
|
||||
if(node.Parent != null && General.Map.Config.MixTexturesFlats)
|
||||
int texcount = 0;
|
||||
|
||||
foreach (TreeNode child in node.Nodes) texcount += SetItemsCount(child);
|
||||
|
||||
if (node.Parent != null && General.Map.Config.MixTexturesFlats)
|
||||
{
|
||||
ts.MixTexturesAndFlats();
|
||||
if(ts.Textures.Count > 0) node.Text += " [" + ts.Textures.Count + "]";
|
||||
texcount += ts.Textures.Count;
|
||||
if (texcount > 0) node.Text += " [" + texcount + "]";
|
||||
return texcount;
|
||||
}
|
||||
else
|
||||
{
|
||||
int texcount = (browseflats ? ts.Flats.Count : ts.Textures.Count);
|
||||
texcount = (browseflats ? ts.Flats.Count : ts.Textures.Count);
|
||||
if(texcount > 0) node.Text += " [" + texcount + "]";
|
||||
return texcount;
|
||||
}
|
||||
|
||||
foreach(TreeNode child in node.Nodes) SetItemsCount(child);
|
||||
}
|
||||
|
||||
// Selection changed
|
||||
|
|
Loading…
Reference in a new issue