Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public static void LoadIconDataFromSymbol(MEX_mexMapData data, MEXStageIconEntry[] icons)
        {
            var tobjs    = data.IconMatAnimJoint.Child.MaterialAnimation.Next.TextureAnimation.ToTOBJs();
            var tobjanim = data.IconMatAnimJoint.Child.MaterialAnimation.Next.TextureAnimation.AnimationObject.FObjDesc.GetDecodedKeys();

            var nametobjs    = data.StageNameMaterialAnimation.Child.Child.MaterialAnimation.TextureAnimation.ToTOBJs();
            var nametobjanim = data.StageNameMaterialAnimation.Child.Child.MaterialAnimation.TextureAnimation.AnimationObject.FObjDesc.GetDecodedKeys();

            for (int i = 0; i < data.PositionModel.Children.Length; i++)
            {
                icons[i].Joint     = data.PositionModel.Children[i];
                icons[i].Animation = MexMenuAnimationGenerator.FromAnimJoint(data.PositionAnimJoint.Children[i], icons[i].Joint);
                icons[i].IconTOBJ  = tobjs[(int)tobjanim[i + 2].Value];
                icons[i].NameTOBJ  = nametobjs[(int)nametobjanim[i].Value];
            }
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        public static void LoadFromMEXNode(MEX_mexSelectChr mex, MEX_CSSIconEntry[] icons)
        {
            var csps    = mex.CSPMatAnim.TextureAnimation.ToTOBJs();
            var cspKeys = mex.CSPMatAnim.TextureAnimation.AnimationObject.FObjDesc.GetDecodedKeys();

            var stride = mex.CSPStride;

            var index = 0;

            foreach (var ico in icons)
            {
                // load joints
                if (index < mex.IconModel.Children.Length)
                {
                    ico.Joint        = mex.IconModel.Children[index];
                    ico.Animation    = MexMenuAnimationGenerator.FromAnimJoint(mex.IconAnimJoint.Children[index], ico.Joint);
                    ico.MatAnimJoint = mex.IconMatAnimJoint.Children[index];
                }

                // load csps
                var icocsps  = new List <HSD_TOBJ>();
                int cspIndex = 0;
                while (true)
                {
                    var key = ico.FighterExternalID + (cspIndex * stride);

                    var k = cspKeys.Find(e => e.Frame == key);

                    if (k == null)
                    {
                        break;
                    }

                    icocsps.Add(csps[(int)k.Value]);

                    cspIndex++;
                }
                ico.CSPs = icocsps.Select(e => new TOBJProxy(e)).ToArray();

                index++;
            }
        }
Exemple #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="stage"></param>
        /// <returns></returns>
        public static void LoadIconDataFromVanilla(SBM_MnSelectStageDataTable stage, MEXStageIconEntry[] icons)
        {
            var tex0       = stage.IconDoubleMatAnimJoint.Child.Next.MaterialAnimation.Next.TextureAnimation.ToTOBJs();
            var tex0_extra = stage.IconDoubleMatAnimJoint.Child.MaterialAnimation.Next.TextureAnimation.ToTOBJs();
            var tex1       = stage.IconLargeMatAnimJoint.Child.MaterialAnimation.Next.TextureAnimation.ToTOBJs();
            var tex2       = stage.IconSpecialMatAnimJoint.Child.MaterialAnimation.Next.TextureAnimation.ToTOBJs();

            var nameTOBJs     = stage.StageNameMatAnimJoint.Child.Child.MaterialAnimation.TextureAnimation.ToTOBJs();
            var nameTOBJsAnim = stage.StageNameMatAnimJoint.Child.Child.MaterialAnimation.TextureAnimation.AnimationObject.FObjDesc.GetDecodedKeys();

            var g1 = tex0.Length - 2;
            var g2 = tex0.Length - 2 + tex1.Length - 2;
            var g3 = tex0.Length - 2 + tex1.Length - 2 + tex2.Length - 2;

            int icoIndex = 0;

            for (int i = 0; i < stage.PositionModel.Children.Length; i++)
            {
                var childIndex = i;
                if (unswizzle.ContainsKey(i))
                {
                    childIndex = unswizzle[i];
                }

                HSD_TOBJ icon    = null;
                HSD_TOBJ name    = null;
                var      anim    = stage.PositionAnimation.Children[childIndex].AOBJ.FObjDesc;
                var      keys    = anim.GetDecodedKeys();
                var      Y       = stage.PositionModel.Children[childIndex].TY;
                var      Z       = stage.PositionModel.Children[childIndex].TZ;
                var      SX      = 1f;
                var      SY      = 1f;
                int      nameTex = i;

                if (i >= g3)
                {
                    //RandomIcon
                    name = nameTOBJs[(int)nameTOBJsAnim[nameTOBJsAnim.Count - 1].Value];
                }
                else
                if (i >= g2)
                {
                    name = nameTOBJs[(int)nameTOBJsAnim[24 + (i - g2)].Value];
                    icon = tex2[i - g2 + 2];
                    SX   = 0.8f;
                    SY   = 0.8f;
                }
                else
                if (i >= g1)
                {
                    name = nameTOBJs[(int)nameTOBJsAnim[22 + texunswizzle[i - g1]].Value];
                    icon = tex1[i - g1 + 2];
                    SY   = 1.1f;
                }
                else
                {
                    icon = tex0[texunswizzle[i] + 2];
                    name = nameTOBJs[(int)nameTOBJsAnim[texunswizzle[i]].Value * 2];

                    icons[icoIndex].X         = keys[keys.Count - 1].Value;
                    icons[icoIndex].Y         = Y;
                    icons[icoIndex].Z         = Z;
                    icons[icoIndex].Joint.SX  = SX;
                    icons[icoIndex].Joint.SY  = SY;
                    icons[icoIndex].IconTOBJ  = icon;
                    icons[icoIndex].NameTOBJ  = name;
                    icons[icoIndex].Animation = MexMenuAnimationGenerator.FromAnimJoint(stage.PositionAnimation.Children[childIndex], icons[icoIndex].Joint);
                    icoIndex++;

                    Y   -= 5.6f;
                    Z    = 0;
                    icon = tex0_extra[texunswizzle[i] + 2];
                    name = nameTOBJs[(int)nameTOBJsAnim[texunswizzle[i]].Value * 2 + 1];
                }

                icons[icoIndex].X         = keys[keys.Count - 1].Value;
                icons[icoIndex].Y         = Y;
                icons[icoIndex].Z         = Z;
                icons[icoIndex].Joint.SX  = SX;
                icons[icoIndex].Joint.SY  = SY;
                icons[icoIndex].IconTOBJ  = icon;
                icons[icoIndex].NameTOBJ  = name;
                icons[icoIndex].Animation = MexMenuAnimationGenerator.FromAnimJoint(stage.PositionAnimation.Children[childIndex], icons[icoIndex].Joint);
                icoIndex++;
            }
        }