protected override void OnAfterSelect(TreeViewEventArgs e) { QARETreeNode node = (QARETreeNode)e.Node; if ((node.Id > -1) || (node.NodeCode == NodeCode.NodeBasic)) // not base nodes { areViewer.LoadAreaElement(node.NodeCode, node.Id); } base.OnAfterSelect(e); }
private void PopulateTreeNode(QARETreeNode node) { NodeCode code = node.NodeCode; switch (code) { case NodeCode.NodeActor: ResourceClass.QAREFile.ActorStruct[] actors = areFile.actorList; for (int c = 0; c < actors.Length; c++) { node.Nodes.Add(new QARETreeNode(actors[c].fullName, code, c)); } break; case NodeCode.NodeAmbient: ResourceClass.QAREFile.AmbientStruct[] ambients = areFile.ambientList; for (int c = 0; c < ambients.Length; c++) { node.Nodes.Add(new QARETreeNode(ambients[c].fullName, code, c)); } break; case NodeCode.NodeAnim: ResourceClass.QAREFile.AnimStruct[] anims = areFile.animList; for (int c = 0; c < anims.Length; c++) { node.Nodes.Add(new QARETreeNode(anims[c].fullName, code, c)); } break; case NodeCode.NodeContainer: ResourceClass.QAREFile.ContainerStruct[] containers = areFile.containerList; for (int c = 0; c < containers.Length; c++) { node.Nodes.Add(new QARETreeNode(containers[c].fullName, code, c)); } break; case NodeCode.NodeDoor: ResourceClass.QAREFile.DoorStruct[] doors = areFile.doorList; for (int c = 0; c < doors.Length; c++) { node.Nodes.Add(new QARETreeNode(doors[c].fullName, code, c)); } break; case NodeCode.NodeEntrance: ResourceClass.QAREFile.EntranceStruct[] entrances = areFile.entranceList; for (int c = 0; c < entrances.Length; c++) { node.Nodes.Add(new QARETreeNode(entrances[c].fullName, code, c)); } break; case NodeCode.NodeInfoPt: ResourceClass.QAREFile.InfoptStruct[] infopts = areFile.infoptList; for (int c = 0; c < infopts.Length; c++) { node.Nodes.Add(new QARETreeNode(infopts[c].fullName, code, c)); } break; case NodeCode.NodeMapnote: ResourceClass.QAREFile.MapNoteStruct[] mapNotes = areFile.mapNoteList; for (int c = 0; c < mapNotes.Length; c++) { node.Nodes.Add(new QARETreeNode("Note", code, c)); } break; case NodeCode.NodeProjectile: ResourceClass.QAREFile.ProjectileStruct[] projectiles = areFile.projectileList; for (int c = 0; c < projectiles.Length; c++) { node.Nodes.Add(new QARETreeNode(projectiles[c].resProjectile, code, c)); } break; case NodeCode.NodeSpawn: ResourceClass.QAREFile.SpawnStruct[] spawns = areFile.spawnList; for (int c = 0; c < spawns.Length; c++) { node.Nodes.Add(new QARETreeNode(spawns[c].fullName, code, c)); } break; case NodeCode.NodeVariable: ResourceClass.QAREFile.VariableStruct[] variables = areFile.varList; for (int c = 0; c < variables.Length; c++) { node.Nodes.Add(new QARETreeNode(variables[c].varName, code, c)); } break; default: MessageBox.Show("Error: Unknown Area Element"); break; } }