public void PopulateMSC() { MSCNode.Nodes.Clear(); var file = MSC_FILES.ElementAt(0).Value; foreach (var scr in file.Scripts) { int index = file.Scripts.IndexOfValue(scr.Value); var snode = new ScriptNode((uint)index, $"Script_{index}"); snode.Scripts.Add("Script", scr.Value); MSCNode.Nodes.Add(snode); } }
private bool OpenFile(string Filepath) { bool handled = false; if (Filepath.EndsWith(".bin")) { DataSource source = new DataSource(FileMap.FromFile(Filepath)); if (*(buint *)source.Address == 0x41434D44) // ACMD { if (*(byte *)(source.Address + 0x04) == 0x02) { Runtime.WorkingEndian = Endianness.Little; } else if ((*(byte *)(source.Address + 0x04) == 0x00)) { Runtime.WorkingEndian = Endianness.Big; } else { handled = false; } ACMD_FILES.Add(Path.GetFileNameWithoutExtension(Filepath), new ACMDFile(source)); handled = true; } } else if (Filepath.EndsWith(".mscsb")) // MSC { MSC_FILES.Add(Path.GetFileNameWithoutExtension(Filepath), new MSCFile(Filepath)); handled = true; } else if (Filepath.EndsWith(".mtable")) { MotionTable = new MTable(Filepath, Runtime.WorkingEndian); } return(handled); }