Пример #1
0
        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);
            }
        }
Пример #2
0
        /// <summary>
        /// Dumps a fighters script in it's entirety as text for use in version diffing.
        /// </summary>
        /// <returns></returns>
        public string Serialize()
        {
            StringBuilder sb = new StringBuilder();

            foreach (uint u in MotionTable)
            {
                string label = "";
                AnimationHashPairs.TryGetValue(u, out label);
                if (string.IsNullOrEmpty(label))
                {
                    label = $"{u:X8}";
                }

                sb.Append(String.Format($"\n\n{MotionTable.IndexOf(u):X}: [{label}]"));
                ACMDScript c1 = null, c2 = null,
                           c3 = null, c4 = null;

                if (Main.EventLists.ContainsKey(u))
                {
                    c1 = Main.EventLists[u];
                }
                if (GFX.EventLists.ContainsKey(u))
                {
                    c2 = GFX.EventLists[u];
                }
                if (SFX.EventLists.ContainsKey(u))
                {
                    c3 = SFX.EventLists[u];
                }
                if (Expression.EventLists.ContainsKey(u))
                {
                    c4 = Expression.EventLists[u];
                }

                sb.Append("\n\tGame:{");
                if (c1 != null)
                {
                    foreach (ACMDCommand cmd in c1)
                    {
                        sb.Append(String.Format("\n\t\t{0}", cmd.ToString()));
                    }
                }
                else
                {
                    sb.Append("\n\t\tEmpty");
                }
                sb.Append("\n\t}");

                sb.Append("\n\tGFX:{");
                if (c2 != null)
                {
                    foreach (ACMDCommand cmd in c2)
                    {
                        sb.Append(String.Format("\n\t\t{0}", cmd.ToString()));
                    }
                }
                else
                {
                    sb.Append("\n\t\tEmpty");
                }
                sb.Append("\n\t}");

                sb.Append("\n\tSFX:{");
                if (c3 != null)
                {
                    foreach (ACMDCommand cmd in c3)
                    {
                        sb.Append(String.Format("\n\t\t{0}", cmd.ToString()));
                    }
                }
                else
                {
                    sb.Append("\n\t\tEmpty");
                }
                sb.Append("\n\t}");

                sb.Append("\n\tExpression:{");
                if (c4 != null)
                {
                    foreach (ACMDCommand cmd in c4)
                    {
                        sb.Append(String.Format("\n\t\t{0}", cmd.ToString()));
                    }
                }
                else
                {
                    sb.Append("\n\t\tEmpty");
                }
                sb.Append("\n\t}");
            }
            return(sb.ToString());
        }