//private static AfterImageDesc after_desc = new AfterImageDesc()
        //{
        //    Bone = 57,//27,
        //    Bottom = 0,
        //    Top = 4,
        //    Color1 = new Vector3(1, 1, 1),
        //    Color2 = new Vector3(0, 1, 1)
        //};
        //private static AfterImageDesc after_desc = new AfterImageDesc()
        //{
        //    Bone = 75,
        //    Bottom = 1.75f,
        //    Top = 9.63f,
        //    Color1 = new Vector3(1, 1, 1),
        //    Color2 = new Vector3(0, 1, 1)
        //};

        /// <summary>
        ///
        /// </summary>
        /// <param name="offset"></param>
        /// <param name="size"></param>
        private void LoadAnimation(string symbol)
        {
            // reset display sheild size
            DisplayShieldSize = 0;

            // check if animations are loaded
            if (AJManager == null)
            {
                return;
            }

            // check if animation exists
            var animData = AJManager.GetAnimationData(symbol);

            if (animData == null)
            {
                return;
            }

            // load animation
            var anim = new HSDRawFile(animData);

            if (anim.Roots[0].Data is HSD_FigaTree tree)
            {
                LoadFigaTree(anim.Roots[0].Name, tree);
            }


            if (FrameSpeedModifiers.Count > 0)
            {
                UpdateAnimationWithFSMs();
            }
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ftdat"></param>
        /// <param name="ajdat"></param>
        /// <param name="editAnim"></param>
        public static void EditFighterAnimations(string ftdat, string ajdat, EditAnimation editAnim)
        {
            FighterAJManager manager = new FighterAJManager(File.ReadAllBytes(ajdat));

            foreach (var symbol in manager.GetAnimationSymbols())
            {
                if (symbol.Contains("Taro"))
                {
                    continue;
                }

                var ftFile = new HSDRawFile(manager.GetAnimationData(symbol));

                if (ftFile[symbol] != null)
                {
                    var ft = ftFile[symbol].Data as HSD_FigaTree;
                    editAnim(ft, symbol);
                    ftFile[symbol].Data = ft;

                    using (MemoryStream stream = new MemoryStream())
                    {
                        ftFile.Save(stream);
                        manager.SetAnimation(symbol, stream.ToArray());
                    }
                }
            }

            var newAJFile = manager.RebuildAJFile(manager.GetAnimationSymbols().ToArray(), true);

            HSDRawFile ftfile = new HSDRawFile(ftdat);

            if (ftfile.Roots[0].Data is SBM_FighterData data)
            {
                var sa = data.FighterActionTable.Commands;

                foreach (var action in sa)
                {
                    if (action.SymbolName != null && !string.IsNullOrEmpty(action.SymbolName.Value))
                    {
                        var sizeOffset = manager.GetOffsetSize(action.SymbolName.Value);
                        action.AnimationOffset = sizeOffset.Item1;
                        action.AnimationSize   = sizeOffset.Item2;
                    }
                }

                data.FighterActionTable.Commands = sa;

                ftfile.TrimData();
                ftfile.Save(ftdat);
                File.WriteAllBytes(ajdat, newAJFile);
            }
        }