Esempio n. 1
0
        public HavokNode NewHavok()
        {
            HavokNode node = new HavokNode {
                Name = _resource.FindName("NewHavokData"), FileType = ARCFileType.MiscData
            };

            _resource.AddChild(node);

            BaseWrapper w = FindResource(node, false);

            w.EnsureVisible();
            w.TreeView.SelectedNode = w;
            return(node);
        }
        public void ExportPatched()
        {
            string outPath;
            int    index = Program.SaveFile(ExportFilter, Text, out outPath);

            if (index != 0)
            {
                if (Parent == null)
                {
                    _resource.Merge(Control.ModifierKeys == (Keys.Control | Keys.Shift));
                }
                //_resource.Rebuild();
                HavokNode p = _resource as HavokNode;
                using (FileStream stream = new FileStream(outPath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite, 8, FileOptions.SequentialScan))
                {
                    stream.SetLength(p._buffer.Length);
                    using (FileMap map = FileMap.FromStream(stream))
                        Memory.Move(map.Address, p._buffer.Address, (uint)p._buffer.Length);
                }
            }
        }