public AnimationBundleWrapper(DATA_Parser.FileEntry file, DATA_Parser dataParser,
                                      Dictionary <uint, DATA_Parser.FileEntry> animationFiles)
        {
            Label = file.Hash.ToString();
            Tag   = file.ChunkEntry.Data;

            File    = file;
            Version = dataParser.Version;

            using (var reader = new FileReader(file.ChunkEntry.Data, true))
            {
                uint numAnimations = reader.ReadUInt32();
                reader.ReadUInt32();
                for (int i = 0; i < numAnimations; i++)
                {
                    reader.ReadUInt32();
                    uint hash = reader.ReadUInt32();
                    if (animationFiles.ContainsKey(hash))
                    {
                        var fileNode = new AnimationWrapper(animationFiles[hash], dataParser);
                        AddChild(fileNode);
                    }
                }
            }
        }
Beispiel #2
0
        public ModelWrapper(DATA_Parser.FileEntry file, DATA_Parser dataParser)
        {
            Label    = file.Hash.ToString();
            ImageKey = "Model";

            File       = file;
            DataParser = dataParser;
        }
Beispiel #3
0
        public SkeletonWrapper(DATA_Parser.FileEntry file, DATA_Parser dataParser)
        {
            Label    = file.Hash.ToString();
            ImageKey = "Bone";

            File       = file;
            DataParser = dataParser;
        }
        public ScriptWrapper(DATA_Parser.FileEntry file, DATA_Parser dataParser)
        {
            Label = Hashing.CreateHashString(file.Hash);

            File    = file;
            Version = dataParser.Version;

            OnClick();
        }
        public AnimationWrapper(DATA_Parser.FileEntry file, DATA_Parser dataParser)
        {
            Label = file.Hash.ToString();

            File    = file;
            Version = dataParser.Version;

            AddChild(new ObjectTreeNode("RAW DATA")
            {
                Tag = file.ChunkEntry.Data
            });
        }
        public TextureWrapper(DATA_Parser.FileEntry file, DATA_Parser dataParser)
        {
            Label    = Hashing.CreateHashString(file.Hash);
            ImageKey = "Texture";

            File    = file;
            Version = dataParser.Version;

            try
            {
                OnClick();
            }
            catch { }
        }
Beispiel #7
0
        public void Load(Stream stream)
        {
            _stream = stream;
            using (var reader = new FileReader(stream, true)) {
                reader.SetByteOrder(true);
                reader.SeekBegin(12);
                if (reader.ReadUInt32() == 0x78340300)
                {
                    Version = GameVersion.LM3;
                }
            }

            Tag = this;

            //Parse dictionary
            if (Version == GameVersion.LM3)
            {
                DictFile = new LM3.DICT_Parser(stream);
            }
            else
            {
                DictFile = new LM2.DICT_Parser(stream);
            }
            this.Label = FileInfo.FileName;

            DictFile.FilePath = FileInfo.FilePath;

            //Parse seperate data file
            string dataPath = FileInfo.FilePath.Replace(".dict", ".data");

            if (File.Exists(dataPath))
            {
                _dataStream = File.OpenRead(dataPath);
                DataFile    = new DATA_Parser(_dataStream, Version, DictFile);

                var root = LoadChunkTabe();
                Children.AddRange(root.Children);

                int index = 0;

                var subNode = new ObjectTreeNode("Data Entries");
                AddChild(subNode);
                foreach (var child in DataFile.Table.DataEntries)
                {
                    subNode.AddChild(ReadChunk(child));
                }
            }
        }