Пример #1
0
        static string GetDSIString(SkeletonBodyItem dsi)
        {
            var s = "_null_";
            if (dsi.Dest != null)
                s = dsi.Dest.Name;

            string textureName;
            if (dsi.Grh.GrhData == null)
                textureName = "*";
            else
                textureName = dsi.Grh.GrhData.Categorization.ToString();

            return textureName + ": " + dsi.Source.Name + " -> " + s;
        }
        static string GetDSIString(SkeletonBodyItem dsi)
        {
            var s = "_null_";
            if (dsi.Dest != null)
                s = dsi.Dest.Name;

            string textureName;
            if (dsi.Grh.GrhData == null)
                textureName = "*";
            else
                textureName = ((StationaryGrhData)dsi.Grh.GrhData).TextureName.Value.Replace("Character/", string.Empty);

            return textureName + ": " + dsi.Source.Name + " -> " + s;
        }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SkeletonBody"/> class.
        /// </summary>
        /// <param name="bodyInfo"><see cref="SkeletonBodyInfo"/> to create the <see cref="SkeletonBody"/> from.</param>
        /// <exception cref="ArgumentNullException"><paramref name="bodyInfo" /> is <c>null</c>.</exception>
        public SkeletonBody(SkeletonBodyInfo bodyInfo)
        {
            if (bodyInfo == null)
                throw new ArgumentNullException("bodyInfo");

            // Store the BodyInfo object reference
            _bodyInfo = bodyInfo;

            // Create the BodyItems array
            BodyItems = new SkeletonBodyItem[bodyInfo.Items.Length];

            // Create the individual BodyItems
            for (var i = 0; i < BodyItems.Length; i++)
            {
                BodyItems[i] = new SkeletonBodyItem(bodyInfo.Items[i]);
            }
        }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SkeletonBody"/> class.
        /// </summary>
        /// <param name="bodyInfo"><see cref="SkeletonBodyInfo"/> to create the <see cref="SkeletonBody"/> from.</param>
        /// <exception cref="ArgumentNullException"><paramref name="bodyInfo" /> is <c>null</c>.</exception>
        public SkeletonBody(SkeletonBodyInfo bodyInfo)
        {
            if (bodyInfo == null)
            {
                throw new ArgumentNullException("bodyInfo");
            }

            // Store the BodyInfo object reference
            _bodyInfo = bodyInfo;

            // Create the BodyItems array
            BodyItems = new SkeletonBodyItem[bodyInfo.Items.Length];

            // Create the individual BodyItems
            for (var i = 0; i < BodyItems.Length; i++)
            {
                BodyItems[i] = new SkeletonBodyItem(bodyInfo.Items[i]);
            }
        }
Пример #5
0
 /// <summary>
 /// Handles the Click event of the btnAdd control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         if (cmbSkeletonBodies.SelectedItem == null || cmbSkeletonBodyNodes.SelectedItem == null)
             return;
         var skelBodies = cmbSkeletonBodies.SelectedItem.ToString();
         var skelBodyNodes = cmbSkeletonBodyNodes.SelectedItem.ToString();
         Array.Resize(ref SkeletonBody.BodyItems, SkeletonBody.BodyItems.Length + 1);
         var spriteCategorization = new SpriteCategorization("Character.Skeletons." + skelBodies, skelBodyNodes);
         var grhData = GrhInfo.GetData(spriteCategorization);
         if (grhData == null)
             return;
         var bodyItemInfo = new SkeletonBodyItemInfo(grhData.GrhIndex, _skeleton.RootNode.Name, string.Empty,
             Vector2.Zero, Vector2.Zero);
         var bodyItem = new SkeletonBodyItem(bodyItemInfo);
         SkeletonBody.BodyItems[SkeletonBody.BodyItems.Length - 1] = bodyItem;
         UpdateBodyList();
     }
     catch
     {
     }
 }
Пример #6
0
 /// <summary>
 /// Handles the Click event of the btnAdd control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 void btnAdd_Click(object sender, EventArgs e)
 {
     Array.Resize(ref SkeletonBody.BodyItems, SkeletonBody.BodyItems.Length + 1);
     var spriteCategorization = new SpriteCategorization("Character.Naked", "Body");
     var grhData = GrhInfo.GetData(spriteCategorization);
     var bodyItemInfo = new SkeletonBodyItemInfo(grhData.GrhIndex, _skeleton.RootNode.Name, string.Empty, Vector2.Zero,
         Vector2.Zero);
     var bodyItem = new SkeletonBodyItem(bodyItemInfo);
     SkeletonBody.BodyItems[SkeletonBody.BodyItems.Length - 1] = bodyItem;
     UpdateBodyList();
 }