public static void AddGroups(ResourceMaps.IntMap map, ResourceTreeNodeExt tn, bool type, bool inst) { List <ResourceTreeNodeExt> nodelist = new List <ResourceTreeNodeExt>(); foreach (uint group in map.Keys) { ResourceViewManager.ResourceNameList list = map[group]; ResourceTreeNodeExt node = new ResourceTreeNodeExt(group, list, "0x" + Helper.HexString(group)); if (type) { ResourceTreeNodeExt typenode = new ResourceTreeNodeExt(group, list, "Types"); AddSubNodesForTypes(typenode, list); node.Nodes.Add(typenode); } if (inst) { ResourceTreeNodeExt instnode = new ResourceTreeNodeExt(group, list, "Instances"); AddSubNodesForInstances(instnode, list); node.Nodes.Add(instnode); } nodelist.Add(node); } nodelist.Sort(); foreach (ResourceTreeNodeExt node in nodelist) { tn.Nodes.Add(node); } }
public static void AddType(ResourceMaps.IntMap map, ResourceTreeNodeExt tn) { List <ResourceTreeNodeExt> nodelist = new List <ResourceTreeNodeExt>(); foreach (uint type in map.Keys) { ResourceViewManager.ResourceNameList list = map[type]; ResourceTreeNodeExt node = new ResourceTreeTypeNodeExt(list, type); nodelist.Add(node); } nodelist.Sort(); foreach (ResourceTreeNodeExt node in nodelist) { tn.Nodes.Add(node); } }
static void AddSubNodesForGroups(ResourceTreeNodeExt node, ResourceViewManager.ResourceNameList resources) { ResourceMaps.IntMap map = new ResourceMaps.IntMap(); foreach (NamedPackedFileDescriptor pfd in resources) { ResourceViewManager.ResourceNameList list; if (!map.ContainsKey(pfd.Descriptor.Group)) { list = new ResourceViewManager.ResourceNameList(); map.Add(pfd.Descriptor.Group, list); } else { list = map[pfd.Descriptor.Group]; } list.Add(pfd); } ResourceTreeNodesByGroup.AddGroups(map, node, false, false); }
public static void AddSubNodesForTypes(ResourceTreeNodeExt node, ResourceViewManager.ResourceNameList resources) { ResourceMaps.IntMap map = new ResourceMaps.IntMap(); foreach (NamedPackedFileDescriptor pfd in resources) { ResourceViewManager.ResourceNameList list; if (!map.ContainsKey(pfd.Descriptor.Type)) { list = new ResourceViewManager.ResourceNameList(); map.Add(pfd.Descriptor.Type, list); } else { list = map[pfd.Descriptor.Type]; } list.Add(pfd); } ResourceTreeNodesByType.AddType(map, node); }