make a ValuesDifferFromData function

This commit is contained in:
Tim Young 2017-09-19 13:10:36 -05:00
parent 9f6412e916
commit 005c35761c
1 changed files with 45 additions and 0 deletions

View File

@ -291,6 +291,51 @@ namespace SpriteLibrary
}
}
/// <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;
}
/// <summary>
/// Given two locations that we have clicked on, find the area we have selected
/// </summary>