예제 #1
0
        private void btnDeleteAnim_Click(object sender, EventArgs e)
        {
            //delete the current entry.  Deal with zero entries.
            DialogResult Answer = MessageBox.Show("Delete The current Animation?", "Delete", MessageBoxButtons.YesNo);

            if (Answer == DialogResult.Yes)
            {
                TempInformation.Animations.RemoveAt(CurrentSIAnimation);
                CurrentSIAnimation--;
                if (CurrentSIAnimation < 0 && TempInformation.Animations.Count > 0)
                {
                    CurrentSIAnimation = 0;
                }
                if (TempInformation.Animations.Count == 0)
                {
                    AnimationInfo AI = new AnimationInfo();
                    TempInformation.Animations.Add(AI);
                    CurrentSIAnimation = 0;
                }
                WeHaveNewItem();
            }
        }
예제 #2
0
        /// <summary>
        /// Take the values stored in TempInformation and push it out to our form
        /// </summary>
        private bool ValuesDifferFromData()
        {
            if (TempInformation == null)
            {
                return(true);
            }
            //For the main sprite information
            int tValue;

            if (TempInformation.SpriteName != tbSpriteName.Text)
            {
                return(true);
            }
            int.TryParse(tbDefaultSize.Text, out tValue);
            if (tValue != TempInformation.ViewPercent)
            {
                return(true);
            }

            //From the current animation
            AnimationInfo AI = null;

            if (CurrentSIAnimation < 0)
            {
                CurrentSIAnimation = 0;
            }
            if (CurrentSIAnimation >= TempInformation.Animations.Count)
            {
                CurrentSIAnimation = TempInformation.Animations.Count - 1;
            }
            if (CurrentSIAnimation < TempInformation.Animations.Count)
            {
                AI = TempInformation.Animations[CurrentSIAnimation];

                int.TryParse(tbAmimationSpeed.Text, out tValue);
                if (tValue != AI.AnimSpeed)
                {
                    return(true);
                }
                if (AI.ImageName != cbStartingImage.Text)
                {
                    return(true);
                }

                if (AI.MirrorHorizontally != cbMirrorH.Checked)
                {
                    return(true);
                }
                if (AI.MirrorVertically != cbMirrorV.Checked)
                {
                    return(true);
                }

                int.TryParse(cbAnimation.Text, out tValue);
                if (tValue != AI.AnimationToUse)
                {
                    return(true);
                }

                int.TryParse(tbNumFrames.Text, out tValue);
                if (tValue != AI.NumFrames)
                {
                    return(true);
                }

                if (AI.StartPoint != ChosenArea.Location)
                {
                    return(true);
                }
                if (AI.Width != ChosenArea.Width)
                {
                    return(true);
                }
                if (AI.Height != ChosenArea.Height)
                {
                    return(true);
                }

                if (rbFromImage.Checked && AI.FieldsToUse != AnimationType.SpriteDefinition)
                {
                    return(true);
                }
                if (rbMirror.Checked && AI.FieldsToUse != AnimationType.Mirror)
                {
                    return(true);
                }
                if (rbRotation.Checked && AI.FieldsToUse != AnimationType.Rotation)
                {
                    return(true);
                }
            }
            return(false);
        }