diff --git a/SpriteLibrary/SpriteEntryForm.cs b/SpriteLibrary/SpriteEntryForm.cs index 3b14c2d..8f306fe 100644 --- a/SpriteLibrary/SpriteEntryForm.cs +++ b/SpriteLibrary/SpriteEntryForm.cs @@ -291,6 +291,51 @@ namespace SpriteLibrary } } + /// + /// Take the values stored in TempInformation and push it out to our form + /// + 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; + } + /// /// Given two locations that we have clicked on, find the area we have selected ///