public void PopulateACMD() { ACMDNode.Nodes.Clear(); foreach (uint u in MotionTable) { ScriptNode snode = new ScriptNode(u, $"{MotionTable.IndexOf(u)} - {u.ToString("X8")}"); if (AnimationHashes.ContainsKey(u)) { snode.Text = $"{MotionTable.IndexOf(u)} - {AnimationHashes[u]}"; } if (ACMD_FILES.ContainsKey("game")) { if (ACMD_FILES["game"].Scripts.ContainsKey(u)) { snode.Scripts.Add("Game", ACMD_FILES["game"].Scripts[u]); } } if (ACMD_FILES.ContainsKey("effect")) { if (ACMD_FILES["effect"].Scripts.ContainsKey(u)) { snode.Scripts.Add("Effect", ACMD_FILES["effect"].Scripts[u]); } } if (ACMD_FILES.ContainsKey("sound")) { if (ACMD_FILES["sound"].Scripts.ContainsKey(u)) { snode.Scripts.Add("Sound", ACMD_FILES["sound"].Scripts[u]); } } if (ACMD_FILES.ContainsKey("expression")) { if (ACMD_FILES["expression"].Scripts.ContainsKey(u)) { snode.Scripts.Add("Expression", ACMD_FILES["expression"].Scripts[u]); } } ACMDNode.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); }