public void ExportAsARC(string path) { ARCNode node = new ARCNode(); node._children = _children; node.Name = _name; node.Export(path); }
public void ExportAsARC(string path) { ARCNode node = new ARCNode { _children = _children, Name = _name }; node.Export(path); }
private void LoadEtcFiles(ARCNode etc, ref Dictionary<int, Dictionary<ARCFileType, List<ARCEntryNode>>> files) { etc.Populate(); files = new Dictionary<int, Dictionary<ARCFileType, List<ARCEntryNode>>>(); foreach (ARCEntryNode e in etc.Children) { int grp = e.GroupID; if (!files.ContainsKey(grp)) files[grp] = new Dictionary<ARCFileType, List<ARCEntryNode>>(); ARCFileType type = e.FileType; if (!files[grp].ContainsKey(type)) files[grp].Add(type, new List<ARCEntryNode>()); files[grp][type].Add(e); } }
public ARCNode NewARC() { ARCNode node = new ARCNode() { Name = _resource.FindName("NewARChive"), FileType = ARCFileType.MiscData }; _resource.AddChild(node); BaseWrapper w = this.FindResource(node, false); w.EnsureVisible(); w.TreeView.SelectedNode = w; return node; }
private unsafe void Load(int index, int program) { if (TKContext.CurrentContext == null) { return; } bool isStage = false; Source = null; if (Texture != null) { Texture.Delete(); } Texture = new GLTexture(); Texture.Bind(index, program); Bitmap bmp = null; if (RootNode is ARCNode) { isStage = ((ARCNode)RootNode).IsStage; } if (_folderWatcher.EnableRaisingEvents && !String.IsNullOrEmpty(_folderWatcher.Path)) { bmp = SearchDirectory(_folderWatcher.Path + Name); } BRRESNode parentBRRES = null; ARCNode parentARC = null; // Safely search for whether this is part of a BRRES if (_parent != null) { if (_parent._parent != null) { if (_parent._parent._parent != null) { if (_parent._parent._parent._parent != null) { if (_parent._parent._parent._parent is BRRESNode) { parentBRRES = (BRRESNode)_parent._parent._parent._parent; if (parentBRRES._parent != null) { if (parentBRRES._parent is ARCNode) { parentARC = (ARCNode)parentBRRES._parent; } } } } } } } List <ResourceNode> nodes = TKContext.CurrentContext._states["_Node_Refs"] as List <ResourceNode>; TEX0Node tNode = null; if (bmp == null && TKContext.CurrentContext._states.ContainsKey("_Node_Refs") && parentBRRES != null) { ResourceNode node = parentBRRES; //Search node itself first if ((tNode = node.SearchForTextures("Textures(NW4R)/" + Name, true, false) as TEX0Node) != null) { Source = tNode; Texture.Attach(tNode, _palette); return; } } if (bmp == null && TKContext.CurrentContext._states.ContainsKey("_Node_Refs") && parentARC != null) { ResourceNode node = parentARC; //Search node itself first if ((tNode = node.SearchForTextures("Textures(NW4R)/" + Name, true, isStage) as TEX0Node) != null) { Source = tNode; Texture.Attach(tNode, _palette); return; } else //Then search the directory { bmp = SearchDirectory(node._origPath); } } if (bmp != null) { Texture.Attach(bmp); } else { Texture.Default(); } }